/* Generated by Cython 3.3.0 */

/* BEGIN: Cython Metadata
{
    "distutils": {
        "depends": [
            "/build/opendht/src/opendht/include/opendht/callbacks.h",
            "/build/opendht/src/opendht/include/opendht/crypto.h",
            "/build/opendht/src/opendht/include/opendht/dhtrunner.h",
            "/build/opendht/src/opendht/include/opendht/indexation/pht.h",
            "/build/opendht/src/opendht/include/opendht/infohash.h",
            "/build/opendht/src/opendht/include/opendht/log.h",
            "/build/opendht/src/opendht/include/opendht/node.h",
            "/build/opendht/src/opendht/include/opendht/sockaddr.h",
            "/build/opendht/src/opendht/include/opendht/utils.h",
            "/build/opendht/src/opendht/include/opendht/value.h",
            "/usr/include/gnutls/gnutls.h"
        ],
        "extra_compile_args": [
            "-std=c++17",
            "-DMSGPACK_NO_BOOST",
            "-DMSGPACK_DISABLE_LEGACY_NIL",
            "-DMSGPACK_DISABLE_LEGACY_CONVERT",
            "-DOPENDHT_INDEXATION",
            "-Dopendht_EXPORTS"
        ],
        "extra_link_args": [
            "-std=c++17"
        ],
        "include_dirs": [
            "../../include",
            "/build/opendht/src/opendht/include",
            "/usr/include"
        ],
        "language": "c++",
        "libraries": [
            "opendht",
            "gnutls"
        ],
        "library_dirs": [
            "../../src",
            "/build/opendht/src/opendht/python",
            "/build/opendht/src/opendht",
            "/usr/lib"
        ],
        "name": "opendht._core",
        "sources": [
            "/build/opendht/src/opendht/python/opendht.pyx"
        ]
    },
    "module_name": "opendht._core"
}
END: Cython Metadata */

#ifndef PY_SSIZE_T_CLEAN
#define PY_SSIZE_T_CLEAN
#endif /* PY_SSIZE_T_CLEAN */
/* InitLimitedAPI */
#if defined(Py_LIMITED_API)
  #if !defined(CYTHON_LIMITED_API)
  #define CYTHON_LIMITED_API 1
  #endif
#elif defined(CYTHON_LIMITED_API)
  #ifdef _MSC_VER
  #pragma message ("Limited API usage is enabled with 'CYTHON_LIMITED_API' but 'Py_LIMITED_API' does not define a Python target version. Consider setting 'Py_LIMITED_API' instead.")
  #else
  #warning Limited API usage is enabled with 'CYTHON_LIMITED_API' but 'Py_LIMITED_API' does not define a Python target version. Consider setting 'Py_LIMITED_API' instead.
  #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 < 0x03090000
    #error Cython requires Python 3.9+.
#elif defined(Py_LIMITED_API) && (Py_LIMITED_API & 0xFFFF0000) > (PY_VERSION_HEX & 0xFFFF0000)
    #error 'Py_LIMITED_API' can only select past Python X.Y versions, not future ones.
#else
#define __PYX_ABI_VERSION "3_3_0"
#define CYTHON_HEX_VERSION 0x030300F0
#define CYTHON_FUTURE_DIVISION 1
/* CModulePreamble */
#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
#ifdef __has_builtin
  #define __Pyx_has_cbuiltin(name) __has_builtin(name)
#else
  #define __Pyx_has_cbuiltin(name) (0)
#endif
#ifndef DL_IMPORT
  #define DL_IMPORT(t) t
#endif
#ifndef DL_EXPORT
  #define DL_EXPORT(t) t
#endif
#define __PYX_COMMA ,
#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(CYTHON_LIMITED_API)
  #ifdef Py_LIMITED_API
    #undef __PYX_LIMITED_VERSION_HEX
    #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API
    #if Py_LIMITED_API < 0x03090000
      #error "Cython 3.3 requires the Python Limited API version to be 3.9 or greater."
    #endif
  #endif
  #if defined(GRAALVM_PYTHON) || defined(PYPY_VERSION)
    #ifdef _MSC_VER
      #pragma message ("Py_LIMITED_API is defined on PyPy or GraalPy. This takes precedence over Cython's specialized\
        code for PyPy and GraalPy and is unlikely to work.")
    #else
      #warning "Py_LIMITED_API is defined on PyPy or GraalPy. This takes precedence over Cython's specialized\
        code for PyPy and GraalPy and is unlikely to work."
    #endif
  #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_CPYTHON_FREETHREADING 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_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
  #ifndef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
    #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
  #endif
  #undef CYTHON_ASSUME_SAFE_MACROS
  #define CYTHON_ASSUME_SAFE_MACROS 0
  #undef CYTHON_ASSUME_SAFE_SIZE
  #define CYTHON_ASSUME_SAFE_SIZE 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_VECTORCALL
  #define CYTHON_VECTORCALL (__PYX_LIMITED_VERSION_HEX >= 0x030C0000)
  #ifndef CYTHON_VECTORCALL_TPNEW
    #define CYTHON_VECTORCALL_TPNEW (CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
  #endif
  #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
  #undef CYTHON_USE_SYS_MONITORING
  #define CYTHON_USE_SYS_MONITORING 0
  #ifndef CYTHON_USE_TP_FINALIZE
    #define CYTHON_USE_TP_FINALIZE (__PYX_LIMITED_VERSION_HEX >= 0x030F0000 && PY_VERSION_HEX > 0x030F00A8)
  #endif
  #ifndef CYTHON_USE_AM_SEND
    #define CYTHON_USE_AM_SEND (__PYX_LIMITED_VERSION_HEX >= 0x030A0000)
  #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
  #ifndef CYTHON_USE_OWN_PREP_RERAISE_STAR
    #define CYTHON_USE_OWN_PREP_RERAISE_STAR 1
  #endif
  #ifndef CYTHON_USE_FREELISTS
  #define CYTHON_USE_FREELISTS 1
  #endif
  #undef CYTHON_IMMORTAL_CONSTANTS
  #define CYTHON_IMMORTAL_CONSTANTS 0
  #if __PYX_LIMITED_VERSION_HEX < 0x030E0000
  #undef CYTHON_OPAQUE_OBJECTS
  #define CYTHON_OPAQUE_OBJECTS 0
  #elif !defined(CYTHON_OPAQUE_OBJECTS)
  #define CYTHON_OPAQUE_OBJECTS (__PYX_LIMITED_VERSION_HEX >= 0x030F0000)
  #endif
#elif 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_CPYTHON_FREETHREADING 0
  #ifndef CYTHON_USE_TYPE_SLOTS
    #define CYTHON_USE_TYPE_SLOTS 0
  #endif
  #undef CYTHON_USE_TYPE_SPECS
  #define CYTHON_USE_TYPE_SPECS 0
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #undef CYTHON_USE_PYLIST_INTERNALS
  #define CYTHON_USE_PYLIST_INTERNALS 0
  #undef CYTHON_USE_UNICODE_INTERNALS
  #define CYTHON_USE_UNICODE_INTERNALS 0
  #undef CYTHON_USE_UNICODE_WRITER
  #define CYTHON_USE_UNICODE_WRITER 0
  #undef CYTHON_USE_PYLONG_INTERNALS
  #define CYTHON_USE_PYLONG_INTERNALS 0
  #undef CYTHON_AVOID_BORROWED_REFS
  #define CYTHON_AVOID_BORROWED_REFS 1
  #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
  #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
  #undef CYTHON_ASSUME_SAFE_MACROS
  #define CYTHON_ASSUME_SAFE_MACROS 0
  #undef CYTHON_ASSUME_SAFE_SIZE
  #define CYTHON_ASSUME_SAFE_SIZE 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
  #ifndef CYTHON_VECTORCALL
    #define CYTHON_VECTORCALL 1
  #endif
  #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX < 0x030E0000
    #undef CYTHON_VECTORCALL_TPNEW
    #define CYTHON_VECTORCALL_TPNEW 0
  #elif !defined(CYTHON_VECTORCALL_TPNEW)
    #define CYTHON_VECTORCALL_TPNEW CYTHON_VECTORCALL
  #endif
  #ifndef CYTHON_PEP487_INIT_SUBCLASS
    #define CYTHON_PEP487_INIT_SUBCLASS 1
  #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_SYS_MONITORING
  #define CYTHON_USE_SYS_MONITORING 0
  #undef CYTHON_USE_TP_FINALIZE
  #define CYTHON_USE_TP_FINALIZE 0
  #undef CYTHON_USE_AM_SEND
  #define CYTHON_USE_AM_SEND 0
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 1
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
  #endif
  #ifndef CYTHON_USE_OWN_PREP_RERAISE_STAR
    #define CYTHON_USE_OWN_PREP_RERAISE_STAR 1
  #endif
  #undef CYTHON_USE_FREELISTS
  #define CYTHON_USE_FREELISTS 0
  #undef CYTHON_IMMORTAL_CONSTANTS
  #define CYTHON_IMMORTAL_CONSTANTS 0
  #undef CYTHON_OPAQUE_OBJECTS
  #define CYTHON_OPAQUE_OBJECTS 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_CPYTHON_FREETHREADING 0
  #undef CYTHON_USE_TYPE_SLOTS
  #define CYTHON_USE_TYPE_SLOTS 1
  #ifndef CYTHON_USE_TYPE_SPECS
    #define CYTHON_USE_TYPE_SPECS 0
  #endif
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #undef CYTHON_USE_PYLIST_INTERNALS
  #define CYTHON_USE_PYLIST_INTERNALS 0
  #undef CYTHON_USE_UNICODE_INTERNALS
  #define CYTHON_USE_UNICODE_INTERNALS 0
  #undef CYTHON_USE_UNICODE_WRITER
  #define CYTHON_USE_UNICODE_WRITER 0
  #undef CYTHON_USE_PYLONG_INTERNALS
  #define CYTHON_USE_PYLONG_INTERNALS 0
  #undef CYTHON_AVOID_BORROWED_REFS
  #define CYTHON_AVOID_BORROWED_REFS 1
  #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
  #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1
  #undef CYTHON_ASSUME_SAFE_MACROS
  #define CYTHON_ASSUME_SAFE_MACROS 0
  #ifndef CYTHON_ASSUME_SAFE_SIZE
    #define CYTHON_ASSUME_SAFE_SIZE 1
  #endif
  #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
  #ifndef CYTHON_VECTORCALL
    #define CYTHON_VECTORCALL 1
  #endif
  #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX < 0x030E0000
    #undef CYTHON_VECTORCALL_TPNEW
    #define CYTHON_VECTORCALL_TPNEW 0
  #elif !defined(CYTHON_VECTORCALL_TPNEW)
    #define CYTHON_VECTORCALL_TPNEW (PYPY_VERSION_NUM >= 0x07030800 && CYTHON_VECTORCALL)
  #endif
  #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
  #undef CYTHON_USE_MODULE_STATE
  #define CYTHON_USE_MODULE_STATE 0
  #undef CYTHON_USE_SYS_MONITORING
  #define CYTHON_USE_SYS_MONITORING 0
  #ifndef CYTHON_USE_TP_FINALIZE
    #define CYTHON_USE_TP_FINALIZE (PYPY_VERSION_NUM >= 0x07030C00)
  #endif
  #undef CYTHON_USE_AM_SEND
  #define CYTHON_USE_AM_SEND 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 (PYPY_VERSION_NUM >= 0x07031100)
  #endif
  #ifndef CYTHON_USE_OWN_PREP_RERAISE_STAR
    #define CYTHON_USE_OWN_PREP_RERAISE_STAR 1
  #endif
  #undef CYTHON_USE_FREELISTS
  #define CYTHON_USE_FREELISTS 0
  #undef CYTHON_IMMORTAL_CONSTANTS
  #define CYTHON_IMMORTAL_CONSTANTS 0
  #undef CYTHON_OPAQUE_OBJECTS
  #define CYTHON_OPAQUE_OBJECTS 0
#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
  #ifdef Py_GIL_DISABLED
    #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 1
  #else
    #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
  #endif
  #if PY_VERSION_HEX < 0x030A0000
    #undef CYTHON_USE_TYPE_SLOTS
    #define CYTHON_USE_TYPE_SLOTS 1
  #elif !defined(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
  #ifndef CYTHON_USE_PYLONG_INTERNALS
    #define CYTHON_USE_PYLONG_INTERNALS 1
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    #undef CYTHON_USE_PYLIST_INTERNALS
    #define CYTHON_USE_PYLIST_INTERNALS 0
  #elif !defined(CYTHON_USE_PYLIST_INTERNALS)
    #define CYTHON_USE_PYLIST_INTERNALS 1
  #endif
  #ifndef CYTHON_USE_UNICODE_INTERNALS
    #define CYTHON_USE_UNICODE_INTERNALS 1
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING || 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
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
    #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1
  #elif !defined(CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS)
    #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
  #endif
  #ifndef CYTHON_ASSUME_SAFE_MACROS
    #define CYTHON_ASSUME_SAFE_MACROS 1
  #endif
  #ifndef CYTHON_ASSUME_SAFE_SIZE
    #define CYTHON_ASSUME_SAFE_SIZE 1
  #endif
  #ifndef CYTHON_UNPACK_METHODS
    #define CYTHON_UNPACK_METHODS 1
  #endif
  #ifndef CYTHON_FAST_THREAD_STATE
    #define CYTHON_FAST_THREAD_STATE 1
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    #undef CYTHON_FAST_GIL
    #define CYTHON_FAST_GIL 0
  #elif !defined(CYTHON_FAST_GIL)
    #define CYTHON_FAST_GIL (PY_VERSION_HEX < 0x030C00A6)
  #endif
  #ifndef CYTHON_VECTORCALL
    #define CYTHON_VECTORCALL 1
  #endif
  #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX < 0x030E0000
    #undef CYTHON_VECTORCALL_TPNEW
    #define CYTHON_VECTORCALL_TPNEW 0
  #elif !defined(CYTHON_VECTORCALL_TPNEW)
    #define CYTHON_VECTORCALL_TPNEW CYTHON_VECTORCALL
  #endif
  #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_SYS_MONITORING
    #define CYTHON_USE_SYS_MONITORING (PY_VERSION_HEX >= 0x030d00B1)
  #endif
  #ifndef CYTHON_USE_TP_FINALIZE
    #define CYTHON_USE_TP_FINALIZE 1
  #endif
  #ifndef CYTHON_USE_AM_SEND
    #define CYTHON_USE_AM_SEND 1
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    #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 && !CYTHON_USE_MODULE_STATE)
  #endif
  #ifndef 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_OWN_PREP_RERAISE_STAR
    #define CYTHON_USE_OWN_PREP_RERAISE_STAR (PY_VERSION_HEX < 0x030C00B2)
  #endif
  #ifndef CYTHON_USE_FREELISTS
    #define CYTHON_USE_FREELISTS (!CYTHON_COMPILING_IN_CPYTHON_FREETHREADING)
  #endif
  #if defined(CYTHON_IMMORTAL_CONSTANTS) && PY_VERSION_HEX < 0x030C0000
    #undef CYTHON_IMMORTAL_CONSTANTS
    #define CYTHON_IMMORTAL_CONSTANTS 0  // definitely won't work
  #elif !defined(CYTHON_IMMORTAL_CONSTANTS)
    #define CYTHON_IMMORTAL_CONSTANTS (PY_VERSION_HEX >= 0x030C0000 && !CYTHON_USE_MODULE_STATE && CYTHON_COMPILING_IN_CPYTHON_FREETHREADING)
  #endif
  #ifndef CYTHON_OPAQUE_OBJECTS
    #define CYTHON_OPAQUE_OBJECTS 0
  #endif
#endif
#if CYTHON_USE_PYLONG_INTERNALS
  #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
  #elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L
    #define CYTHON_UNUSED [[maybe_unused]]
  #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 && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
#  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)
#include <stdint.h>
typedef uintptr_t  __pyx_uintptr_t;
#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 Py_UNREACHABLE
  #define __Pyx_UNREACHABLE() Py_UNREACHABLE()
#elif __Pyx_has_cbuiltin(__builtin_unreachable)
  #define __Pyx_UNREACHABLE() __builtin_unreachable()
#elif defined(__clang__) || defined(__INTEL_COMPILER) || (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)))
  #define __Pyx_UNREACHABLE() __builtin_unreachable()
#elif defined(_MSC_VER)
  #define __Pyx_UNREACHABLE() __assume(0)
#else
  #define __Pyx_UNREACHABLE() Py_FatalError("Unreachable C code path reached")
#endif
#ifndef Py_UNREACHABLE
  #define Py_UNREACHABLE() __Pyx_UNREACHABLE()
#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 < 0x030A0000)
#else
  #define __PYX_NEED_TP_PRINT_SLOT  0
#endif
#define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer))
#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
#define __Pyx_PyErr_FetchException(petype, peval, petb) PyErr_Fetch(petype, peval, petb)
#define __Pyx_PyErr_RestoreException(etype, eval, etb) PyErr_Restore(etype, eval, etb)
#else
#define __Pyx_PyErr_FetchException(petype, peval, petb) *(petype)=NULL; *(peval)=PyErr_GetRaisedException(); *(petb)=NULL
#define __Pyx_PyErr_RestoreException(etype, eval, etb) PyErr_SetRaisedException(eval)
#endif

/* CppInitCode */
#ifndef __cplusplus
  #error "Cython files generated with the C++ option must be compiled with a C++ compiler."
#endif
#ifndef CYTHON_INLINE
  #if defined(__clang__)
    #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
  #else
    #define CYTHON_INLINE inline
  #endif
#endif
template<typename T>
void __Pyx_call_destructor(T& x) {
    x.~T();
}
template<typename T>
class __Pyx_FakeReference {
  public:
    __Pyx_FakeReference() : ptr(NULL) { }
    __Pyx_FakeReference(const T& ref) : ptr(const_cast<T*>(&ref)) { }
    T *operator->() { return ptr; }
    T *operator&() { return ptr; }
    operator T&() { return *ptr; }
    template<typename U> bool operator ==(const U& other) const { return *ptr == other; }
    template<typename U> bool operator !=(const U& other) const { return *ptr != other; }
    template<typename U> bool operator==(const __Pyx_FakeReference<U>& other) const { return *ptr == *other.ptr; }
    template<typename U> bool operator!=(const __Pyx_FakeReference<U>& other) const { return *ptr != *other.ptr; }
  private:
    T *ptr;
};

/* PythonCompatibility */
#define __PYX_BUILD_PY_SSIZE_T "n"
#define CYTHON_FORMAT_SSIZE_T "z"
#define __Pyx_BUILTIN_MODULE_NAME "builtins"
#define __Pyx_DefaultClassType PyType_Type
#if CYTHON_COMPILING_IN_LIMITED_API
    #ifndef CO_OPTIMIZED
    static int CO_OPTIMIZED;
    #endif
    #ifndef CO_NEWLOCALS
    static int CO_NEWLOCALS;
    #endif
    #ifndef CO_VARARGS
    static int CO_VARARGS;
    #endif
    #ifndef CO_VARKEYWORDS
    static int CO_VARKEYWORDS;
    #endif
    #ifndef CO_ASYNC_GENERATOR
    static int CO_ASYNC_GENERATOR;
    #endif
    #ifndef CO_GENERATOR
    static int CO_GENERATOR;
    #endif
    #ifndef CO_COROUTINE
    static int CO_COROUTINE;
    #endif
#else
    #ifndef CO_COROUTINE
      #define CO_COROUTINE 0x80
    #endif
    #ifndef CO_ASYNC_GENERATOR
      #define CO_ASYNC_GENERATOR 0x200
    #endif
#endif
static int __Pyx_init_co_variables(void);
#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 CYTHON_COMPILING_IN_PYPY
  #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o)
#else
  #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o)
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
static unsigned long __Pyx_Runtime_TPFLAGS_SEQUENCE;
static unsigned long __Pyx_Runtime_TPFLAGS_MAPPING;
#else
#define __Pyx_Runtime_TPFLAGS_SEQUENCE Py_TPFLAGS_SEQUENCE
#define __Pyx_Runtime_TPFLAGS_MAPPING Py_TPFLAGS_MAPPING
#endif
static int __Pyx_init_tpflags_variables(void);
#ifndef Py_TPFLAGS_HAVE_FINALIZE
  #define Py_TPFLAGS_HAVE_FINALIZE 0
#endif
#ifndef Py_TPFLAGS_SEQUENCE
  #define Py_TPFLAGS_SEQUENCE (CYTHON_COMPILING_IN_LIMITED_API ? 0 : 1 << 5)
#endif
#ifndef Py_TPFLAGS_MAPPING
  #define Py_TPFLAGS_MAPPING (CYTHON_COMPILING_IN_LIMITED_API ? 0 : 1 << 6)
#endif
#ifndef Py_TPFLAGS_IMMUTABLETYPE
  #define Py_TPFLAGS_IMMUTABLETYPE (1UL << 8)
#endif
#ifndef Py_TPFLAGS_DISALLOW_INSTANTIATION
  #define Py_TPFLAGS_DISALLOW_INSTANTIATION (1UL << 7)
#endif
#ifndef METH_STACKLESS
  #define METH_STACKLESS 0
#endif
#if !defined(METH_FASTCALL) || CYTHON_COMPILING_IN_PYPY
  #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_VECTORCALL
  #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))
#else
  #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET  0
  #define __Pyx_PyVectorcall_NARGS(n)  ((Py_ssize_t)(n))
#endif
#define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func)
#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)(void)) {
#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 CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
  #define __Pyx_PyType_FromModuleAndSpec(m, s, b)  ((void)m, PyType_FromSpecWithBases(s, b))
#else
  #define __Pyx_PyType_FromModuleAndSpec(m, s, b)  PyType_FromModuleAndSpec(m, s, b)
#endif
#if CYTHON_COMPILING_IN_PYPY
  typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *);
#else
  #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_PyFrame_SetLineNumber(frame, lineno)
#elif CYTHON_COMPILING_IN_GRAAL && defined(GRAALPY_VERSION_NUM) && GRAALPY_VERSION_NUM > 0x19000000
  #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) GraalPyFrame_SetLineNumber((frame), (lineno))
#elif CYTHON_COMPILING_IN_GRAAL
  #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) _PyFrame_SetLineNumber((frame), (lineno))
#else
  #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno)  (frame)->f_lineno = (lineno)
#endif
#if CYTHON_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()
#else
  #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
#endif
#if CYTHON_OPAQUE_OBJECTS && CYTHON_COMPILING_IN_LIMITED_API
    #define __PYX_SHARED_SIZEOF(T) -((int)sizeof(T))
    #define __PYX_SHARED_RELATIVE_OFFSET Py_RELATIVE_OFFSET
    #define CYTHON_OPAQUE_SHARED_TYPES 1
#else
    #define __PYX_SHARED_SIZEOF(T) sizeof(T)
    #define __PYX_SHARED_RELATIVE_OFFSET 0
    #define CYTHON_OPAQUE_SHARED_TYPES 0
#endif
#if CYTHON_USE_MODULE_STATE
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;
}
#define __Pyx_PyModule_GetState(o) (__pyx_mstatetype *)__Pyx__PyModule_GetState(o)
#else
#define __Pyx_PyModule_GetState(op) ((void)op,__pyx_mstate_global)
#endif
#define __Pyx_PyObject_GetSlot(obj, name, func_ctype)  __Pyx_PyType_GetSlot(Py_TYPE((PyObject *) obj), name, func_ctype)
#define __Pyx_PyObject_TryGetSlot(obj, name, func_ctype) __Pyx_PyType_TryGetSlot(Py_TYPE(obj), name, func_ctype)
#define __Pyx_PyObject_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(Py_TYPE(obj), sub, name, func_ctype)
#define __Pyx_PyObject_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSubSlot(Py_TYPE(obj), sub, name, func_ctype)
#if CYTHON_USE_TYPE_SLOTS
  #define __Pyx_PyType_GetSlot(type, name, func_ctype)  ((type)->name)
  #define __Pyx_PyType_TryGetSlot(type, name, func_ctype) __Pyx_PyType_GetSlot(type, name, func_ctype)
  #define __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype) (((type)->sub) ? ((type)->sub->name) : NULL)
  #define __Pyx_PyType_TryGetSubSlot(type, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype)
#else
  #define __Pyx_PyType_GetSlot(type, name, func_ctype)  ((func_ctype) PyType_GetSlot((type), Py_##name))
  #define __Pyx_PyType_TryGetSlot(type, name, func_ctype)\
    ((__PYX_LIMITED_VERSION_HEX >= 0x030A0000 ||\
     (PyType_GetFlags(type) & Py_TPFLAGS_HEAPTYPE) || __Pyx_get_runtime_version() >= 0x030A0000) ?\
     __Pyx_PyType_GetSlot(type, name, func_ctype) : NULL)
  #define __Pyx_PyType_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSlot(obj, name, func_ctype)
  #define __Pyx_PyType_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSlot(obj, name, func_ctype)
#endif
#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
#define __Pyx_PyDict_NewPresized(n)  ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
#else
#define __Pyx_PyDict_NewPresized(n)  PyDict_New()
#endif
#define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
#define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
#if CYTHON_COMPILING_IN_CPYTHON && 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_Occurred()) {
        PyErr_WriteUnraisable(NULL);
    }
    return res;
}
#elif !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)
#else
  #define __Pyx_PyType_GetFlags(tp)   (PyType_GetFlags((PyTypeObject *)tp))
  #define __Pyx_PyType_HasFeature(type, feature)  PyType_HasFeature(type, feature)
#endif
#define __Pyx_PyObject_GetIterNextFunc(iterator)  __Pyx_PyObject_GetSlot(iterator, tp_iternext, iternextfunc)
#if CYTHON_USE_TYPE_SPECS
#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 __Pyx_PyUnicode_READY(op)       (0)
  #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_KIND_04(u)      __Pyx_PyUnicode_KIND(u)
  #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))
#else
  #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_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
    #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
  static CYTHON_INLINE int __Pyx_PyUnicode_KIND_04(PyObject *o) {
      return __Pyx_PyUnicode_KIND(o) - (int) !!PyUnicode_IS_ASCII(o);
  }
#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)
    #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_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  #define __Pyx_PySequence_ListKeepNew(obj)\
    (likely(PyList_CheckExact(obj) && PyUnstable_Object_IsUniquelyReferenced(obj)) ? __Pyx_NewRef(obj) : PySequence_List(obj))
#elif 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)        Py_IS_TYPE(obj, &PySet_Type)
#endif
enum __Pyx_ReferenceSharing {
  __Pyx_ReferenceSharing_DefinitelyUnique, // We created it so we know it's unshared - no need to check
  __Pyx_ReferenceSharing_OwnStrongReference,
  __Pyx_ReferenceSharing_FunctionArgument,
  __Pyx_ReferenceSharing_SharedReference, // Never trust it to be unshared because it's a global or similar
};
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && PY_VERSION_HEX >= 0x030E0000
#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing)\
    (sharing == __Pyx_ReferenceSharing_DefinitelyUnique ? 1 :\
      (sharing == __Pyx_ReferenceSharing_FunctionArgument ? PyUnstable_Object_IsUniqueReferencedTemporary(o) :\
      (sharing == __Pyx_ReferenceSharing_OwnStrongReference ? PyUnstable_Object_IsUniquelyReferenced(o) : 0)))
#elif (CYTHON_COMPILING_IN_CPYTHON && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING) || CYTHON_COMPILING_IN_LIMITED_API
#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing) (((void)sharing), Py_REFCNT(o) == 1)
#else
#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing) (((void)o), ((void)sharing), 0)
#endif
#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
  #define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i)
#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
  #if CYTHON_COMPILING_IN_LIMITED_API || !CYTHON_ASSUME_SAFE_MACROS
    #define __Pyx_PyList_GetItemRef(o, i) (likely((i) >= 0) ? PySequence_GetItem(o, i) : (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
  #else
    #define __Pyx_PyList_GetItemRef(o, i) PySequence_ITEM(o, i)
  #endif
#elif CYTHON_COMPILING_IN_LIMITED_API || !(CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE)
  #define __Pyx_PyList_GetItemRef(o, i) __Pyx_XNewRef(PyList_GetItem(o, i))
#else
  #define __Pyx_PyList_GetItemRef(o, i) (likely(__Pyx_is_valid_index(i, PyList_GET_SIZE(o))) ?\
    __Pyx_NewRef(PyList_GET_ITEM(o, i)) : (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
#endif
#if CYTHON_AVOID_BORROWED_REFS || CYTHON_COMPILING_IN_LIMITED_API
  #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared)  ((void)(unsafe_shared),\
      __Pyx_PyList_GetItemRef(o, i))
#elif CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
  #if CYTHON_ASSUME_SAFE_MACROS
  #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) (\
      __Pyx_IS_UNIQUELY_REFERENCED(o, unsafe_shared) ?\
      __Pyx_NewRef(PyList_GET_ITEM(o, i)) : __Pyx_PyList_GetItemRef(o, i))
  #else
  #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) (\
      __Pyx_IS_UNIQUELY_REFERENCED(o, unsafe_shared) ?\
      __Pyx_XNewRef(PyList_GetItem(o, i)) : __Pyx_PyList_GetItemRef(o, i))
  #endif
#elif CYTHON_ASSUME_SAFE_MACROS
  #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared)  ((void)(unsafe_shared),\
      __Pyx_NewRef(PyList_GET_ITEM(o, i)))
#else
  #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared)  ((void)(unsafe_shared),\
      __Pyx_XNewRef(PyList_GetItem(o, i)))
#endif
#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
#define __Pyx_PyDict_GetItemRef(dict, key, result) PyDict_GetItemRef(dict, key, result)
#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) {
  *result = PyObject_GetItem(dict, key);
  if (*result == NULL) {
    if (PyErr_ExceptionMatches(PyExc_KeyError)) {
      PyErr_Clear();
      return 0;
    }
    return -1;
  }
  return 1;
}
#else
static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) {
  *result = PyDict_GetItemWithError(dict, key);
  if (*result == NULL) {
    return PyErr_Occurred() ? -1 : 0;
  }
  Py_INCREF(*result);
  return 1;
}
#endif
#if defined(CYTHON_DEBUG_VISIT_CONST) && CYTHON_DEBUG_VISIT_CONST
  #define __Pyx_VISIT_CONST(obj)  Py_VISIT(obj)
#else
  #define __Pyx_VISIT_CONST(obj)
#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_PyTuple_GET_ITEM(o, i) PyTuple_GET_ITEM(o, i)
  #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0))
  #define __Pyx_PyList_GET_ITEM(o, i) PyList_GET_ITEM(o, i)
#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_PyTuple_GET_ITEM(o, i) PyTuple_GetItem(o, i)
  #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v)
  #define __Pyx_PyList_GET_ITEM(o, i) PyList_GetItem(o, i)
#endif
#if CYTHON_ASSUME_SAFE_SIZE
  #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_PyDict_GET_SIZE(o) PyDict_GET_SIZE(o)
  #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o)
  #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o)
  #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GET_LENGTH(o)
#else
  #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_PyDict_GET_SIZE(o) PyDict_Size(o)
  #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o)
  #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o)
  #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GetLength(o)
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_InternFromString)
  #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
#endif
#define __Pyx_PyLong_FromHash_t PyLong_FromSsize_t
#define __Pyx_PyLong_AsHash_t   __Pyx_PyIndex_AsSsize_t
#if __PYX_LIMITED_VERSION_HEX >= 0x030A0000
    #define __Pyx_PySendResult PySendResult
#else
    typedef enum {
        PYGEN_RETURN = 0,
        PYGEN_ERROR = -1,
        PYGEN_NEXT = 1,
    } __Pyx_PySendResult;
#endif
#if CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX < 0x030A00A3
  typedef __Pyx_PySendResult (*__Pyx_pyiter_sendfunc)(PyObject *iter, PyObject *value, PyObject **result);
#else
  #define __Pyx_pyiter_sendfunc sendfunc
#endif
#if !CYTHON_USE_AM_SEND
#define __PYX_HAS_PY_AM_SEND 0
#elif __PYX_LIMITED_VERSION_HEX >= 0x030A0000
#define __PYX_HAS_PY_AM_SEND 1
#else
#define __PYX_HAS_PY_AM_SEND 2  // our own backported implementation
#endif
#if __PYX_HAS_PY_AM_SEND < 2
    #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
#else
    typedef struct {
        unaryfunc am_await;
        unaryfunc am_aiter;
        unaryfunc am_anext;
        __Pyx_pyiter_sendfunc am_send;
    } __Pyx_PyAsyncMethodsStruct;
    #define __Pyx_SlotTpAsAsync(s) ((PyAsyncMethods*)(s))
#endif
#if CYTHON_USE_AM_SEND && PY_VERSION_HEX < 0x030A00F0
    #define __Pyx_TPFLAGS_HAVE_AM_SEND (1UL << 21)
#else
    #define __Pyx_TPFLAGS_HAVE_AM_SEND (0)
#endif
#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030A0000
#ifdef __cplusplus
extern "C"
#endif
PyAPI_FUNC(void *) PyMem_Calloc(size_t nelem, size_t elsize);
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
static int __Pyx_init_co_variable(PyObject *inspect, const char* name, int *write_to) {
    int value;
    PyObject *py_value = PyObject_GetAttrString(inspect, name);
    if (!py_value) return 0;
    value = (int) PyLong_AsLong(py_value);
    Py_DECREF(py_value);
    *write_to = value;
    return value != -1 || !PyErr_Occurred();
}
static int __Pyx_init_co_variables(void) {
    PyObject *inspect;
    int result;
    inspect = PyImport_ImportModule("inspect");
    result =
#if !defined(CO_OPTIMIZED)
        __Pyx_init_co_variable(inspect, "CO_OPTIMIZED", &CO_OPTIMIZED) &&
#endif
#if !defined(CO_NEWLOCALS)
        __Pyx_init_co_variable(inspect, "CO_NEWLOCALS", &CO_NEWLOCALS) &&
#endif
#if !defined(CO_VARARGS)
        __Pyx_init_co_variable(inspect, "CO_VARARGS", &CO_VARARGS) &&
#endif
#if !defined(CO_VARKEYWORDS)
        __Pyx_init_co_variable(inspect, "CO_VARKEYWORDS", &CO_VARKEYWORDS) &&
#endif
#if !defined(CO_ASYNC_GENERATOR)
        __Pyx_init_co_variable(inspect, "CO_ASYNC_GENERATOR", &CO_ASYNC_GENERATOR) &&
#endif
#if !defined(CO_GENERATOR)
        __Pyx_init_co_variable(inspect, "CO_GENERATOR", &CO_GENERATOR) &&
#endif
#if !defined(CO_COROUTINE)
        __Pyx_init_co_variable(inspect, "CO_COROUTINE", &CO_COROUTINE) &&
#endif
        1;
    Py_DECREF(inspect);
    return result ? 0 : -1;
}
static int __Pyx_init_tpflags_bitcount(unsigned long flag) {
    int count = 0;
    while (flag) {
        count += (int) (flag & 1);
        flag >>= 1;
    }
    return count;
}
static int __Pyx_init_tpflags_variables(void) {
    if (__Pyx_Runtime_TPFLAGS_SEQUENCE != 0 && __Pyx_Runtime_TPFLAGS_MAPPING != 0) {
        return 0;
    }
    PyObject *collections_abc = PyImport_ImportModule("collections.abc");
    if (!collections_abc) return -1;
    int result = 0;
    PyObject *sequence = NULL, *mapping = NULL;
#if __PYX_LIMITED_VERSION_HEX >= 0x030D0000
    if (PyObject_GetOptionalAttrString(collections_abc, "Sequence", &sequence) != 1) goto fail;
    if (PyObject_GetOptionalAttrString(collections_abc, "Mapping", &mapping) != 1) goto fail;
#else
    sequence = PyObject_GetAttrString(collections_abc, "Sequence");
    if (!sequence) goto fail_attr_lookup;
    mapping = PyObject_GetAttrString(collections_abc, "Mapping");
    if (!mapping) goto fail_attr_lookup;
#endif
    if (!PyType_Check(sequence) || !PyType_Check(mapping)) goto fail;
    {
        unsigned long sequence_flags = PyType_GetFlags((PyTypeObject*)sequence);
        unsigned long mapping_flags = PyType_GetFlags((PyTypeObject*)mapping);
        unsigned long mutual_flags = sequence_flags & mapping_flags;
        sequence_flags = sequence_flags ^ mutual_flags;
        mapping_flags = mapping_flags ^ mutual_flags;
        if (__Pyx_Runtime_TPFLAGS_SEQUENCE == 0 && __Pyx_init_tpflags_bitcount(sequence_flags) == 1) {
            __Pyx_Runtime_TPFLAGS_SEQUENCE = sequence_flags;
        }
        if (__Pyx_Runtime_TPFLAGS_MAPPING == 0 && __Pyx_init_tpflags_bitcount(mapping_flags) == 1) {
            __Pyx_Runtime_TPFLAGS_MAPPING = mapping_flags;
        }
    }
    cleanup:
    Py_XDECREF(mapping);
    Py_XDECREF(sequence);
    Py_DECREF(collections_abc);
    return result;
#if __PYX_LIMITED_VERSION_HEX < 0x030D0000
    fail_attr_lookup:
    if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
        PyErr_Clear();
    }
#endif
    fail:
    result = PyErr_Occurred() ? -1 : 0;
    goto cleanup;
}
#else
static int __Pyx_init_co_variables(void) {
    return 0;  // It's a limited API-only feature
}
static int __Pyx_init_tpflags_variables(void) {
    return 0;  // It's a limited API-only feature
}
#endif

/* MathInitCode */
#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
  #ifndef _USE_MATH_DEFINES
    #define _USE_MATH_DEFINES
  #endif
#endif
#include <math.h>
#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
#define __Pyx_truncl trunc
#else
#define __Pyx_truncl truncl
#endif

#ifndef CYTHON_CLINE_IN_TRACEBACK_RUNTIME
#define CYTHON_CLINE_IN_TRACEBACK_RUNTIME 0
#endif
#ifndef CYTHON_CLINE_IN_TRACEBACK
#define CYTHON_CLINE_IN_TRACEBACK CYTHON_CLINE_IN_TRACEBACK_RUNTIME
#endif
#if CYTHON_CLINE_IN_TRACEBACK
#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; }
#else
#define __PYX_MARK_ERR_POS(f_index, lineno)  { __pyx_filename = __pyx_f[f_index]; (void) __pyx_filename; __pyx_lineno = lineno; (void) __pyx_lineno; (void) __pyx_clineno; }
#endif
#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
    #define __PYX_EXTERN_C extern "C++"
#endif

#define __PYX_HAVE__opendht___core
#define __PYX_HAVE_API__opendht___core
/* Early includes */
#include "ios"
#include "new"
#include "stdexcept"
#include "typeinfo"
#include <utility>

    #if __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)
    // move should be defined for these versions of MSVC, but __cplusplus isn't set usefully
    #include <type_traits>

    namespace cython_std {
    template <typename T> typename std::remove_reference<T>::type&& move(T& t) noexcept { return std::move(t); }
    template <typename T> typename std::remove_reference<T>::type&& move(T&& t) noexcept { return std::move(t); }
    }

    #endif
    
#include <map>
#include <string.h>
#include <string_view>
#include <string>
#include <memory>
#include <stdio.h>

    #if __PYX_LIMITED_VERSION_HEX < 0x030d0000
    static CYTHON_INLINE PyObject *
    __Pyx_CAPI_PyList_GetItemRef(PyObject *list, Py_ssize_t index)
    {
        PyObject *item = PyList_GetItem(list, index);
        Py_XINCREF(item);
        return item;
    }
    #else
    #define __Pyx_CAPI_PyList_GetItemRef PyList_GetItemRef
    #endif

    #if CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX < 0x030d0000
    static CYTHON_INLINE int
    __Pyx_CAPI_PyList_Extend(PyObject *list, PyObject *iterable)
    {
        return PyList_SetSlice(list, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, iterable);
    }

    static CYTHON_INLINE int
    __Pyx_CAPI_PyList_Clear(PyObject *list)
    {
        return PyList_SetSlice(list, 0, PY_SSIZE_T_MAX, NULL);
    }
    #else
    #define __Pyx_CAPI_PyList_Extend PyList_Extend
    #define __Pyx_CAPI_PyList_Clear PyList_Clear
    #endif
    
#include <stdint.h>
#include <stddef.h>

    #if __PYX_LIMITED_VERSION_HEX < 0x030d0000
    static CYTHON_INLINE int
    __Pyx_CAPI_PyDict_GetItemStringRef(PyObject *mp, const char *key, PyObject **result)
    {
        int res;
        PyObject *key_obj = PyUnicode_FromString(key);
        if (key_obj == NULL) {
            *result = NULL;
            return -1;
        }
        res = __Pyx_PyDict_GetItemRef(mp, key_obj, result);
        Py_DECREF(key_obj);
        return res;
    }
    #else
    #define __Pyx_CAPI_PyDict_GetItemStringRef PyDict_GetItemStringRef
    #endif
    #if PY_VERSION_HEX < 0x030d0000 || (CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030F0000)
    static CYTHON_INLINE int
    __Pyx_CAPI_PyDict_SetDefaultRef(PyObject *d, PyObject *key, PyObject *default_value,
                        PyObject **result)
    {
        PyObject *value;
        if (__Pyx_PyDict_GetItemRef(d, key, &value) < 0) {
            // get error
            if (result) {
                *result = NULL;
            }
            return -1;
        }
        if (value != NULL) {
            // present
            if (result) {
                *result = value;
            }
            else {
                Py_DECREF(value);
            }
            return 1;
        }

        // missing: set the item
        if (PyDict_SetItem(d, key, default_value) < 0) {
            // set error
            if (result) {
                *result = NULL;
            }
            return -1;
        }
        if (result) {
            Py_INCREF(default_value);
            *result = default_value;
        }
        return 0;
    }
    #else
    #define __Pyx_CAPI_PyDict_SetDefaultRef PyDict_SetDefaultRef
    #endif
    

    #if PY_VERSION_HEX < 0x030d0000
    static CYTHON_INLINE int __Pyx_PyWeakref_GetRef(PyObject *ref, PyObject **pobj)
    {
        PyObject *obj = PyWeakref_GetObject(ref);
        if (obj == NULL) {
            // SystemError if ref is NULL
            *pobj = NULL;
            return -1;
        }
        if (obj == Py_None) {
            *pobj = NULL;
            return 0;
        }
        Py_INCREF(obj);
        *pobj = obj;
        return 1;
    }
    #else
    #define __Pyx_PyWeakref_GetRef PyWeakref_GetRef
    #endif
    
#include "pythread.h"

    #if (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030600) && !defined(PyContextVar_Get)
    #define PyContextVar_Get(var, d, v)         ((d) ?             ((void)(var), Py_INCREF(d), (v)[0] = (d), 0) :             ((v)[0] = NULL, 0)         )
    #endif
    
#include <vector>
#include <chrono>
#include <functional>
#include <future>
#include "opendht/utils.h"
#include "opendht/infohash.h"
#include "opendht/sockaddr.h"
#include "opendht/crypto.h"
#include "opendht/value.h"
#include "opendht/node.h"
#include "opendht/callbacks.h"
#include "opendht/dhtrunner.h"
#include "opendht/log.h"
#include "opendht/indexation/pht.h"
#include "gnutls/gnutls.h"
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */

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

#ifdef CYTHON_FREETHREADING_COMPATIBLE
#if CYTHON_FREETHREADING_COMPATIBLE
#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_NOT_USED
#else
#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_USED
#endif
#else
#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_USED
#endif
#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
#define __PYX_DEFAULT_STRING_ENCODING ""
#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#define __Pyx_uchar_cast(c) ((unsigned char)c)
#define __Pyx_long_cast(x) ((long)x)
#define __Pyx_fits_Py_ssize_t(v, type, is_signed)  (\
    (sizeof(type) < sizeof(Py_ssize_t))  ||\
    (sizeof(type) > sizeof(Py_ssize_t) &&\
          likely(v < (type)PY_SSIZE_T_MAX ||\
                 v == (type)PY_SSIZE_T_MAX)  &&\
          (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
                                v == (type)PY_SSIZE_T_MIN)))  ||\
    (sizeof(type) == sizeof(Py_ssize_t) &&\
          (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
                               v == (type)PY_SSIZE_T_MAX)))  )
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 CYTHON_ASSUME_SAFE_MACROS
    #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_PyByteArray_AsString(s) PyByteArray_AS_STRING(s)
#else
    #define __Pyx_PyBytes_AsWritableString(s)     ((char*) PyBytes_AsString(s))
    #define __Pyx_PyBytes_AsWritableSString(s)    ((signed char*) PyBytes_AsString(s))
    #define __Pyx_PyBytes_AsWritableUString(s)    ((unsigned char*) PyBytes_AsString(s))
    #define __Pyx_PyBytes_AsString(s)     ((const char*) PyBytes_AsString(s))
    #define __Pyx_PyBytes_AsSString(s)    ((const signed char*) PyBytes_AsString(s))
    #define __Pyx_PyBytes_AsUString(s)    ((const unsigned char*) PyBytes_AsString(s))
    #define __Pyx_PyByteArray_AsString(s) PyByteArray_AsString(s)
#endif
#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_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
#define __Pyx_PyUnicode_FromOrdinal(o)       PyUnicode_FromOrdinal((int)o)
#define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
static CYTHON_INLINE PyObject *__Pyx_NewRef(PyObject *obj) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_NewRef)
    return Py_NewRef(obj);
#else
    Py_INCREF(obj);
    return obj;
#endif
}
static CYTHON_INLINE PyObject *__Pyx_XNewRef(PyObject *obj) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_XNewRef)
    return Py_XNewRef(obj);
#else
    Py_XINCREF(obj);
    return obj;
#endif
}
static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(int b);
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_Long(PyObject* x);
#define __Pyx_PyObject_RichCompareBool(a,b,cmp)  __Pyx_PyObject_IsTrueAndDecref(PyObject_RichCompare((a),(b),(cmp)))
#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_PyLong_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))
#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AS_DOUBLE(x)
#define __Pyx_PyFloat_IsNonZero(x) (PyFloat_AS_DOUBLE(x) != 0.0)
#else
#define __Pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AsDouble(x)
#define __Pyx_PyFloat_IsNonZero(x) PyObject_IsTrue(x)
#endif
#define __Pyx_PyFloat_AsFloat(x) ((float) __Pyx_PyFloat_AsDouble(x))
#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
#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_SignBits(x)  ((int) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK))
  #define __Pyx_PyLong_Sign(x)  (1 - __Pyx_PyLong_SignBits(x))
  #define __Pyx_PyLong_IsNeg(x)  ((__Pyx_PyLong_SignBits(x) & 2) != 0)
  #define __Pyx_PyLong_IsNonNeg(x)  (!__Pyx_PyLong_IsNeg(x))
  #define __Pyx_PyLong_IsZero(x)  (__Pyx_PyLong_SignBits(x) & 1)
  #define __Pyx_PyLong_IsPos(x)  (__Pyx_PyLong_SignBits(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)\
        (((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)  (((Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0])
  #endif
  static CYTHON_INLINE Py_ssize_t __Pyx_PyLong_CompareSignAndSize(PyObject *a, PyObject *b) {
      uintptr_t tag_a = ((PyLongObject*)a)->long_value.lv_tag;
      uintptr_t tag_b = ((PyLongObject*)b)->long_value.lv_tag;
      if (tag_a == tag_b) return 0;
      int sign_a = (int) (tag_a & _PyLong_SIGN_MASK);
      int sign_b = (int) (tag_b & _PyLong_SIGN_MASK);
      if (sign_a > sign_b) return -1;
      if (sign_a < sign_b) return 1;
      Py_ssize_t size_a = (Py_ssize_t) (tag_a >> _PyLong_NON_SIZE_BITS);
      Py_ssize_t size_b = (Py_ssize_t) (tag_b >> _PyLong_NON_SIZE_BITS);
      return (1 - sign_a) * (size_a - size_b);
  }
  typedef Py_ssize_t  __Pyx_compact_pylong;
  typedef size_t  __Pyx_compact_upylong;
  #else
  #define __Pyx_PyLong_Sign(x)  ((int) ((Py_SIZE(x) == 0) ? 0 : (Py_SIZE(x) < 0) ? -1 : 1))
  #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]))
  #define __Pyx_PyLong_CompareSignAndSize(a, b)  (Py_SIZE(a) - Py_SIZE(b))
  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
  #define __Pyx_PyLong_IsNonZero(x)  (!__Pyx_PyLong_IsZero(x))
#else
  #define __Pyx_PyLong_IsNonZero(x)  PyObject_IsTrue(x)
#endif
#if __PYX_DEFAULT_STRING_ENCODING_IS_UTF8
  #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
#elif __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
  #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeASCII(c_str, size, NULL)
#else
  #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
#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__ */
/* PretendToInitialize */
#ifdef __cplusplus
#if __cplusplus > 201103L
#include <type_traits>
#endif
template <typename T>
static void __Pyx_pretend_to_initialize(T* ptr) {
#if __cplusplus > 201103L
    if ((std::is_trivially_default_constructible<T>::value))
#endif
        *ptr = T();
    (void)ptr;
}
#else
static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
#endif


#if !CYTHON_USE_MODULE_STATE
static PyObject *__pyx_m = NULL;
#endif
static const char * const __pyx_cfilenm = __FILE__;

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

static const char* const __pyx_f[] = {
  "opendht.pyx",
  "cfunc.to_py",
  "cpython/contextvars.pxd",
  "cpython/type.pxd",
  "cpython/bool.pxd",
  "cpython/complex.pxd",
};
/* #### Code section: utility_code_proto_before_types ### */
/* IncludeStructmemberH.proto (used by CythonFunctionShared) */
#include <structmember.h>

/* Atomics.proto (used by UnpackUnboundCMethod) */
#include <pythread.h>
#ifndef CYTHON_ATOMICS
    #define CYTHON_ATOMICS 1
#endif
#define __PYX_CYTHON_ATOMICS_ENABLED() CYTHON_ATOMICS
#define __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
#define __pyx_atomic_int_type int
#define __pyx_nonatomic_int_type int
#if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\
                        (__STDC_VERSION__ >= 201112L) &&\
                        !defined(__STDC_NO_ATOMICS__))
    #include <stdatomic.h>
#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
                    (__cplusplus >= 201103L) ||\
                    (defined(_MSC_VER) && _MSC_VER >= 1700)))
    #include <atomic>
#endif
#if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\
                        (__STDC_VERSION__ >= 201112L) &&\
                        !defined(__STDC_NO_ATOMICS__) &&\
                       ATOMIC_INT_LOCK_FREE == 2)
    #undef __pyx_atomic_int_type
    #define __pyx_atomic_int_type atomic_int
    #define __pyx_atomic_ptr_type atomic_uintptr_t
    #define __pyx_nonatomic_ptr_type uintptr_t
    #define __pyx_atomic_incr_relaxed(value) atomic_fetch_add_explicit(value, 1, memory_order_relaxed)
    #define __pyx_atomic_incr_acq_rel(value) atomic_fetch_add_explicit(value, 1, memory_order_acq_rel)
    #define __pyx_atomic_decr_acq_rel(value) atomic_fetch_sub_explicit(value, 1, memory_order_acq_rel)
    #define __pyx_atomic_sub(value, arg) atomic_fetch_sub(value, arg)
    #define __pyx_atomic_int_cmp_exchange(value, expected, desired) atomic_compare_exchange_strong(value, expected, desired)
    #define __pyx_atomic_load(value) atomic_load(value)
    #define __pyx_atomic_store(value, new_value) atomic_store(value, new_value)
    #define __pyx_atomic_pointer_load_relaxed(value) atomic_load_explicit(value, memory_order_relaxed)
    #define __pyx_atomic_pointer_load_acquire(value) atomic_load_explicit(value, memory_order_acquire)
    #define __pyx_atomic_pointer_exchange(value, new_value) atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value)
    #define __pyx_atomic_pointer_cmp_exchange(value, expected, desired) atomic_compare_exchange_strong(value, expected, desired)
    #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER)
        #pragma message ("Using standard C atomics")
    #elif defined(__PYX_DEBUG_ATOMICS)
        #warning "Using standard C atomics"
    #endif
#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
                    (__cplusplus >= 201103L) ||\
\
                    (defined(_MSC_VER) && _MSC_VER >= 1700)) &&\
                    ATOMIC_INT_LOCK_FREE == 2)
    #undef __pyx_atomic_int_type
    #define __pyx_atomic_int_type std::atomic_int
    #define __pyx_atomic_ptr_type std::atomic_uintptr_t
    #define __pyx_nonatomic_ptr_type uintptr_t
    #define __pyx_atomic_incr_relaxed(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_relaxed)
    #define __pyx_atomic_incr_acq_rel(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_acq_rel)
    #define __pyx_atomic_decr_acq_rel(value) std::atomic_fetch_sub_explicit(value, 1, std::memory_order_acq_rel)
    #define __pyx_atomic_sub(value, arg) std::atomic_fetch_sub(value, arg)
    #define __pyx_atomic_int_cmp_exchange(value, expected, desired) std::atomic_compare_exchange_strong(value, expected, desired)
    #define __pyx_atomic_load(value) std::atomic_load(value)
    #define __pyx_atomic_store(value, new_value) std::atomic_store(value, new_value)
    #define __pyx_atomic_pointer_load_relaxed(value) std::atomic_load_explicit(value, std::memory_order_relaxed)
    #define __pyx_atomic_pointer_load_acquire(value) std::atomic_load_explicit(value, std::memory_order_acquire)
    #define __pyx_atomic_pointer_exchange(value, new_value) std::atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value)
    #define __pyx_atomic_pointer_cmp_exchange(value, expected, desired) std::atomic_compare_exchange_strong(value, expected, desired)
    #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER)
        #pragma message ("Using standard C++ atomics")
    #elif defined(__PYX_DEBUG_ATOMICS)
        #warning "Using standard C++ atomics"
    #endif
#elif CYTHON_ATOMICS && (__GNUC__ >= 5 || (__GNUC__ == 4 &&\
                    (__GNUC_MINOR__ > 1 ||\
                    (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ >= 2))))
    #define __pyx_atomic_ptr_type void*
    #define __pyx_nonatomic_ptr_type void*
    #define __pyx_atomic_incr_relaxed(value) __sync_fetch_and_add(value, 1)
    #define __pyx_atomic_incr_acq_rel(value) __sync_fetch_and_add(value, 1)
    #define __pyx_atomic_decr_acq_rel(value) __sync_fetch_and_sub(value, 1)
    #define __pyx_atomic_sub(value, arg) __sync_fetch_and_sub(value, arg)
    static CYTHON_INLINE int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) {
        __pyx_nonatomic_int_type old = __sync_val_compare_and_swap(value, *expected, desired);
        int result = old == *expected;
        *expected = old;
        return result;
    }
    #define __pyx_atomic_load(value) __sync_fetch_and_add(value, 0)
    #define __pyx_atomic_store(value, new_value) __sync_lock_test_and_set(value, new_value)
    #define __pyx_atomic_pointer_load_relaxed(value) __sync_fetch_and_add(value, 0)
    #define __pyx_atomic_pointer_load_acquire(value) __sync_fetch_and_add(value, 0)
    #define __pyx_atomic_pointer_exchange(value, new_value) __sync_lock_test_and_set(value, (__pyx_atomic_ptr_type)new_value)
    static CYTHON_INLINE int __pyx_atomic_pointer_cmp_exchange(__pyx_atomic_ptr_type* value, __pyx_nonatomic_ptr_type* expected, __pyx_nonatomic_ptr_type desired) {
        __pyx_nonatomic_ptr_type old = __sync_val_compare_and_swap(value, *expected, desired);
        int result = old == *expected;
        *expected = old;
        return result;
    }
    #ifdef __PYX_DEBUG_ATOMICS
        #warning "Using GNU atomics"
    #endif
#elif CYTHON_ATOMICS && defined(_MSC_VER)
    #include <intrin.h>
    #undef __pyx_atomic_int_type
    #define __pyx_atomic_int_type long
    #define __pyx_atomic_ptr_type void*
    #undef __pyx_nonatomic_int_type
    #define __pyx_nonatomic_int_type long
    #define __pyx_nonatomic_ptr_type void*
    #pragma intrinsic (_InterlockedExchangeAdd, _InterlockedExchange, _InterlockedCompareExchange, _InterlockedCompareExchangePointer, _InterlockedExchangePointer)
    #define __pyx_atomic_incr_relaxed(value) _InterlockedExchangeAdd(value, 1)
    #define __pyx_atomic_incr_acq_rel(value) _InterlockedExchangeAdd(value, 1)
    #define __pyx_atomic_decr_acq_rel(value) _InterlockedExchangeAdd(value, -1)
    #define __pyx_atomic_sub(value, arg) _InterlockedExchangeAdd(value, -arg)
    static CYTHON_INLINE int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) {
        __pyx_nonatomic_int_type old = _InterlockedCompareExchange(value, desired, *expected);
        int result = old == *expected;
        *expected = old;
        return result;
    }
    #define __pyx_atomic_load(value) _InterlockedExchangeAdd(value, 0)
    #define __pyx_atomic_store(value, new_value) _InterlockedExchange(value, new_value)
    #define __pyx_atomic_pointer_load_relaxed(value) *(void * volatile *)value
    #define __pyx_atomic_pointer_load_acquire(value) _InterlockedCompareExchangePointer(value, 0, 0)
    #define __pyx_atomic_pointer_exchange(value, new_value) _InterlockedExchangePointer(value, (__pyx_atomic_ptr_type)new_value)
    static CYTHON_INLINE int __pyx_atomic_pointer_cmp_exchange(__pyx_atomic_ptr_type* value, __pyx_nonatomic_ptr_type* expected, __pyx_nonatomic_ptr_type desired) {
        __pyx_atomic_ptr_type old = _InterlockedCompareExchangePointer(value, desired, *expected);
        int result = old == *expected;
        *expected = old;
        return result;
    }
    #ifdef __PYX_DEBUG_ATOMICS
        #pragma message ("Using MSVC atomics")
    #endif
#else
    #undef CYTHON_ATOMICS
    #define CYTHON_ATOMICS 0
    #ifdef __PYX_DEBUG_ATOMICS
        #warning "Not using atomics"
    #endif
#endif

/* CriticalSectionsDefinition.proto (used by CriticalSections) */
#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
#define __Pyx_PyCriticalSection void*
#define __Pyx_PyCriticalSection2 void*
#define __Pyx_PyCriticalSection_End(cs)
#define __Pyx_PyCriticalSection2_End(cs)
#else
#define __Pyx_PyCriticalSection PyCriticalSection
#define __Pyx_PyCriticalSection2 PyCriticalSection2
#define __Pyx_PyCriticalSection_End PyCriticalSection_End
#define __Pyx_PyCriticalSection2_End PyCriticalSection2_End
#endif

/* CriticalSections.proto (used by CythonFunctionShared) */
#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
#define __Pyx_PyCriticalSection_Begin(cs, arg) (void)(cs)
#define __Pyx_PyCriticalSection2_Begin(cs, arg1, arg2) (void)(cs)
#else
#define __Pyx_PyCriticalSection_Begin PyCriticalSection_Begin
#define __Pyx_PyCriticalSection2_Begin PyCriticalSection2_Begin
#endif
#if PY_VERSION_HEX < 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API
#define __Pyx_BEGIN_CRITICAL_SECTION(o) {
#define __Pyx_END_CRITICAL_SECTION() }
#else
#define __Pyx_BEGIN_CRITICAL_SECTION Py_BEGIN_CRITICAL_SECTION
#define __Pyx_END_CRITICAL_SECTION Py_END_CRITICAL_SECTION
#endif

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

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

/* #### Code section: numeric_typedefs ### */

/* "opendht_cpp.pxd":13
 * from libc.string cimport const_char
 * 
 * ctypedef uint16_t in_port_t             # <<<<<<<<<<<<<<
 * ctypedef unsigned short int sa_family_t
 * 
*/
typedef uint16_t __pyx_t_11opendht_cpp_in_port_t;

/* "opendht_cpp.pxd":14
 * 
 * ctypedef uint16_t in_port_t
 * ctypedef unsigned short int sa_family_t             # <<<<<<<<<<<<<<
 * 
 * cdef extern from "<chrono>" namespace "std::chrono" nogil:
*/
typedef unsigned short __pyx_t_11opendht_cpp_sa_family_t;
/* #### Code section: complex_type_declarations ### */
/* #### Code section: type_declarations ### */

/*--- Type declarations ---*/
struct __pyx_obj_7opendht_5_core__WithID;
struct __pyx_obj_7opendht_5_core__WithPk;
struct __pyx_obj_7opendht_5_core_InfoHash;
struct __pyx_obj_7opendht_5_core_PkId;
struct __pyx_obj_7opendht_5_core_SockAddr;
struct __pyx_obj_7opendht_5_core_Node;
struct __pyx_obj_7opendht_5_core_NodeEntry;
struct __pyx_obj_7opendht_5_core_Query;
struct __pyx_obj_7opendht_5_core_Select;
struct __pyx_obj_7opendht_5_core_Where;
struct __pyx_obj_7opendht_5_core_Value;
struct __pyx_obj_7opendht_5_core_ValueType;
struct __pyx_obj_7opendht_5_core_NodeSetIter;
struct __pyx_obj_7opendht_5_core_NodeSet;
struct __pyx_obj_7opendht_5_core_PrivateKey;
struct __pyx_obj_7opendht_5_core_PublicKey;
struct __pyx_obj_7opendht_5_core_Certificate;
struct __pyx_obj_7opendht_5_core_VerifyResult;
struct __pyx_obj_7opendht_5_core_TrustList;
struct __pyx_obj_7opendht_5_core_ListenToken;
struct __pyx_obj_7opendht_5_core_Identity;
struct __pyx_obj_7opendht_5_core_DhtConfig;
struct __pyx_obj_7opendht_5_core_DhtRunner;
struct __pyx_obj_7opendht_5_core_IndexValue;
struct __pyx_obj_7opendht_5_core_Pht;
struct __pyx_obj_7opendht_5_core___pyx_scope_struct__ping;
struct __pyx_obj_7opendht_5_core___pyx_scope_struct_1_get;
struct __pyx_obj_7opendht_5_core___pyx_scope_struct_2_put;
struct __pyx_obj_7opendht_5_core___pyx_scope_struct_3_putSigned;
struct __pyx_obj_7opendht_5_core___pyx_scope_struct_4_putEncrypted;
struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_;
struct __pyx_opt_args_7cpython_11contextvars_get_value;
struct __pyx_opt_args_7cpython_11contextvars_get_value_no_default;

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

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

/* "opendht_cpp.pxd":97
 *         vector[SockAddr] resolve(string host, string service) except +
 * 
 * ctypedef vector[uint8_t] Blob             # <<<<<<<<<<<<<<
 * 
 * cdef extern from "opendht/crypto.h" namespace "dht::crypto":
*/
typedef std::vector<uint8_t>  __pyx_t_11opendht_cpp_Blob;

/* "opendht_cpp.pxd":145
 *         VerifyResult verify(Certificate);
 * 
 * ctypedef TrustList.VerifyResult TrustListVerifyResult             # <<<<<<<<<<<<<<
 * 
 * cdef extern from "opendht/value.h" namespace "dht::Value":
*/
typedef dht::crypto::TrustList::VerifyResult __pyx_t_11opendht_cpp_TrustListVerifyResult;

/* "opendht_cpp.pxd":292
 *         vector[unsigned] getNodeMessageStats(bool i)
 * 
 * ctypedef DhtRunner.Config DhtRunnerConfig             # <<<<<<<<<<<<<<
 * 
 * cdef extern from "opendht/log.h" namespace "dht::log":
*/
typedef dht::DhtRunner::Config __pyx_t_11opendht_cpp_DhtRunnerConfig;

/* "opendht.pyx":92
 *     ref.Py_DECREF(cbs)
 * 
 * cdef class _WithID(object):             # <<<<<<<<<<<<<<
 *     def __repr__(self):
 *         return "<%s '%s'>" % (self.__class__.__name__, str(self))
*/
struct __pyx_obj_7opendht_5_core__WithID {
  PyObject_HEAD
};


/* "opendht.pyx":98
 *         return self.getId().toString().decode()
 * 
 * cdef class _WithPk(object):             # <<<<<<<<<<<<<<
 *     def __repr__(self):
 *         return "<%s '%s'>" % (self.__class__.__name__, str(self))
*/
struct __pyx_obj_7opendht_5_core__WithPk {
  PyObject_HEAD
};


/* "opendht.pyx":104
 *         return self.getLongId().toString().decode()
 * 
 * cdef class InfoHash(_WithID):             # <<<<<<<<<<<<<<
 *     cdef cpp.InfoHash _infohash
 *     def __cinit__(self, bytes str=b''):
*/
struct __pyx_obj_7opendht_5_core_InfoHash {
  struct __pyx_obj_7opendht_5_core__WithID __pyx_base;
  dht::InfoHash _infohash;
};


/* "opendht.pyx":142
 *         return h
 * 
 * cdef class PkId(_WithPk):             # <<<<<<<<<<<<<<
 *     cdef cpp.PkId _pkid
 *     def __cinit__(self, bytes str=b''):
*/
struct __pyx_obj_7opendht_5_core_PkId {
  struct __pyx_obj_7opendht_5_core__WithPk __pyx_base;
  dht::PkId _pkid;
};


/* "opendht.pyx":180
 *         return h
 * 
 * cdef class SockAddr(object):             # <<<<<<<<<<<<<<
 *     cdef cpp.SockAddr _addr
 *     def toString(SockAddr self):
*/
struct __pyx_obj_7opendht_5_core_SockAddr {
  PyObject_HEAD
  dht::SockAddr _addr;
};


/* "opendht.pyx":212
 *         return vals
 * 
 * cdef class Node(_WithID):             # <<<<<<<<<<<<<<
 *     cdef shared_ptr[cpp.Node] _node
 *     def getId(self):
*/
struct __pyx_obj_7opendht_5_core_Node {
  struct __pyx_obj_7opendht_5_core__WithID __pyx_base;
  std::shared_ptr<dht::Node>  _node;
};


/* "opendht.pyx":223
 *         return self._node.get().isExpired()
 * 
 * cdef class NodeEntry(_WithID):             # <<<<<<<<<<<<<<
 *     cdef cpp.pair[cpp.InfoHash, shared_ptr[cpp.Node]] _v
 *     def getId(self):
*/
struct __pyx_obj_7opendht_5_core_NodeEntry {
  struct __pyx_obj_7opendht_5_core__WithID __pyx_base;
  std::pair<dht::InfoHash,std::shared_ptr<dht::Node> >  _v;
};


/* "opendht.pyx":234
 *         return n
 * 
 * cdef class Query(object):             # <<<<<<<<<<<<<<
 *     cdef cpp.Query _query
 *     def __cinit__(self, str q_str=''):
*/
struct __pyx_obj_7opendht_5_core_Query {
  PyObject_HEAD
  dht::Query _query;
};


/* "opendht.pyx":245
 *         return self._query.isSatisfiedBy(q._query)
 * 
 * cdef class Select(object):             # <<<<<<<<<<<<<<
 *     cdef cpp.Select _select
 *     def __cinit__(self, str q_str=None):
*/
struct __pyx_obj_7opendht_5_core_Select {
  PyObject_HEAD
  dht::Select _select;
};


/* "opendht.pyx":260
 *         return self
 * 
 * cdef class Where(object):             # <<<<<<<<<<<<<<
 *     cdef cpp.Where _where
 *     def __cinit__(self, str q_str=None):
*/
struct __pyx_obj_7opendht_5_core_Where {
  PyObject_HEAD
  dht::Where _where;
};


/* "opendht.pyx":287
 *         return self
 * 
 * cdef class Value(object):             # <<<<<<<<<<<<<<
 *     cdef shared_ptr[cpp.Value] _value
 *     def __init__(self, bytes val=b'', cpp.uint16_t id=0):
*/
struct __pyx_obj_7opendht_5_core_Value {
  PyObject_HEAD
  std::shared_ptr<dht::Value>  _value;
};


/* "opendht.pyx":330
 *         return self._value.get().size()
 * 
 * cdef class ValueType(object):             # <<<<<<<<<<<<<<
 *     cdef cpp.ValueType * _value
 *     def __init__(self, cpp.uint16_t id, str name, expiration: timedelta):
*/
struct __pyx_obj_7opendht_5_core_ValueType {
  PyObject_HEAD
  dht::ValueType *_value;
};


/* "opendht.pyx":338
 *         self._value =  new cpp.ValueType(id, name.encode(), duration)
 * 
 * cdef class NodeSetIter(object):             # <<<<<<<<<<<<<<
 *     cdef map[cpp.InfoHash, shared_ptr[cpp.Node]]* _nodes
 *     cdef map[cpp.InfoHash, shared_ptr[cpp.Node]].iterator _curIter
*/
struct __pyx_obj_7opendht_5_core_NodeSetIter {
  PyObject_HEAD
  std::map<dht::InfoHash,std::shared_ptr<dht::Node> >  *_nodes;
  std::map<dht::InfoHash,std::shared_ptr<dht::Node> > ::iterator _curIter;
};


/* "opendht.pyx":352
 *         return h
 * 
 * cdef class NodeSet(object):             # <<<<<<<<<<<<<<
 *     cdef map[cpp.InfoHash, shared_ptr[cpp.Node]] _nodes
 *     def size(self):
*/
struct __pyx_obj_7opendht_5_core_NodeSet {
  PyObject_HEAD
  std::map<dht::InfoHash,std::shared_ptr<dht::Node> >  _nodes;
};


/* "opendht.pyx":383
 *         return NodeSetIter(self)
 * 
 * cdef class PrivateKey(_WithPk):             # <<<<<<<<<<<<<<
 *     cdef shared_ptr[cpp.PrivateKey] _key
 * 
*/
struct __pyx_obj_7opendht_5_core_PrivateKey {
  struct __pyx_obj_7opendht_5_core__WithPk __pyx_base;
  std::shared_ptr<dht::crypto::PrivateKey>  _key;
};


/* "opendht.pyx":440
 *         return k
 * 
 * cdef class PublicKey(_WithPk):             # <<<<<<<<<<<<<<
 *     cdef cpp.shared_ptr[cpp.PublicKey] _key
 *     def getId(self) -> InfoHash:
*/
struct __pyx_obj_7opendht_5_core_PublicKey {
  struct __pyx_obj_7opendht_5_core__WithPk __pyx_base;
  std::shared_ptr<dht::crypto::PublicKey>  _key;
};


/* "opendht.pyx":481
 *         return self._key.get().checkSignature(indat, sig)
 * 
 * cdef class Certificate(_WithPk):             # <<<<<<<<<<<<<<
 *     cdef shared_ptr[cpp.Certificate] _cert
 *     def __init__(self, bytes dat = None):
*/
struct __pyx_obj_7opendht_5_core_Certificate {
  struct __pyx_obj_7opendht_5_core__WithPk __pyx_base;
  std::shared_ptr<dht::crypto::Certificate>  _cert;
};


/* "opendht.pyx":521
 *         return c
 * 
 * cdef class VerifyResult(object):             # <<<<<<<<<<<<<<
 *     cdef cpp.TrustListVerifyResult _result
 *     def __bool__(self):
*/
struct __pyx_obj_7opendht_5_core_VerifyResult {
  PyObject_HEAD
  __pyx_t_11opendht_cpp_TrustListVerifyResult _result;
};


/* "opendht.pyx":528
 *         return self._result.toString()
 * 
 * cdef class TrustList(object):             # <<<<<<<<<<<<<<
 *     cdef cpp.TrustList _trust
 *     def add(self, Certificate cert):
*/
struct __pyx_obj_7opendht_5_core_TrustList {
  PyObject_HEAD
  dht::crypto::TrustList _trust;
};


/* "opendht.pyx":539
 *         return r
 * 
 * cdef class ListenToken(object):             # <<<<<<<<<<<<<<
 *     cdef cpp.InfoHash _h
 *     cdef cpp.shared_future[size_t] _t
*/
struct __pyx_obj_7opendht_5_core_ListenToken {
  PyObject_HEAD
  dht::InfoHash _h;
  std::shared_future<size_t>  _t;
};


/* "opendht.pyx":544
 *     _cb = dict()
 * 
 * cdef class Identity(object):             # <<<<<<<<<<<<<<
 *     cdef cpp.Identity _id
 *     def __init__(self, PrivateKey k = None, Certificate c = None):
*/
struct __pyx_obj_7opendht_5_core_Identity {
  PyObject_HEAD
  dht::crypto::Identity _id;
};


/* "opendht.pyx":598
 *     return decrypted_c_str[:length]
 * 
 * cdef class DhtConfig(object):             # <<<<<<<<<<<<<<
 *     cdef cpp.DhtRunnerConfig _config
 *     def __init__(self):
*/
struct __pyx_obj_7opendht_5_core_DhtConfig {
  PyObject_HEAD
  __pyx_t_11opendht_cpp_DhtRunnerConfig _config;
};


/* "opendht.pyx":631
 *         self._config.bind6 = bind6._addr
 * 
 * cdef class DhtRunner(_WithID):             # <<<<<<<<<<<<<<
 *     cdef cpp.shared_ptr[cpp.DhtRunner] thisptr
 *     def __cinit__(self):
*/
struct __pyx_obj_7opendht_5_core_DhtRunner {
  struct __pyx_obj_7opendht_5_core__WithID __pyx_base;
  std::shared_ptr<dht::DhtRunner>  thisptr;
};


/* "opendht.pyx":862
 *         # fixme: not thread safe
 * 
 * cdef class IndexValue(object):             # <<<<<<<<<<<<<<
 *     cdef cpp.shared_ptr[cpp.IndexValue] _value
 *     def __init__(self, InfoHash h=None, cpp.uint64_t vid=0):
*/
struct __pyx_obj_7opendht_5_core_IndexValue {
  PyObject_HEAD
  std::shared_ptr<dht::indexation::Value>  _value;
};


/* "opendht.pyx":876
 *         return self._value.get().second
 * 
 * cdef class Pht(object):             # <<<<<<<<<<<<<<
 *     cdef cpp.Pht* thisptr
 *     def __cinit__(self, bytes name, key_spec, DhtRunner dht):
*/
struct __pyx_obj_7opendht_5_core_Pht {
  PyObject_HEAD
  dht::indexation::Pht *thisptr;
};


/* "opendht.pyx":651
 *             h._infohash = self.thisptr.get().getNodeId()
 *         return h
 *     def ping(self, SockAddr addr, done_cb=None):             # <<<<<<<<<<<<<<
 *         if done_cb:
 *             cb_obj = {'done':done_cb}
*/
struct __pyx_obj_7opendht_5_core___pyx_scope_struct__ping {
  PyObject_HEAD
  PyObject *__pyx_v_lock;
  PyObject *__pyx_v_ok;
  PyObject *__pyx_v_pending;
};


/* "opendht.pyx":718
 *         return stats
 * 
 *     def get(self, InfoHash key, get_cb=None, done_cb=None, filter=None, Where where=None):             # <<<<<<<<<<<<<<
 *         """Retreive values associated with a key on the DHT.
 * 
*/
struct __pyx_obj_7opendht_5_core___pyx_scope_struct_1_get {
  PyObject_HEAD
  PyObject *__pyx_v_lock;
  PyObject *__pyx_v_pending;
  PyObject *__pyx_v_res;
};


/* "opendht.pyx":756
 *             return res
 * 
 *     def put(self, InfoHash key, Value val, done_cb=None, permanent=False):             # <<<<<<<<<<<<<<
 *         """Publish a new value on the DHT at key.
 * 
*/
struct __pyx_obj_7opendht_5_core___pyx_scope_struct_2_put {
  PyObject_HEAD
  PyObject *__pyx_v_lock;
  PyObject *__pyx_v_ok;
  PyObject *__pyx_v_pending;
};


/* "opendht.pyx":784
 *             return ok
 * 
 *     def putSigned(self, InfoHash key, Value val, done_cb=None, permanent=False):             # <<<<<<<<<<<<<<
 *         if done_cb:
 *             cb_obj = {'done':done_cb}
*/
struct __pyx_obj_7opendht_5_core___pyx_scope_struct_3_putSigned {
  PyObject_HEAD
  PyObject *__pyx_v_lock;
  PyObject *__pyx_v_ok;
  PyObject *__pyx_v_pending;
};


/* "opendht.pyx":806
 *             return ok
 * 
 *     def putEncrypted(self, InfoHash key, Value val, to, done_cb=None, bool permanent=False):             # <<<<<<<<<<<<<<
 *         if to is None:
 *             raise ValueError("'to' must be provided")
*/
struct __pyx_obj_7opendht_5_core___pyx_scope_struct_4_putEncrypted {
  PyObject_HEAD
  PyObject *__pyx_v_lock;
  PyObject *__pyx_v_ok;
  PyObject *__pyx_v_pending;
};


/* "cfunc.to_py":84
 * 
 * 
 * @cname("__Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_")             # <<<<<<<<<<<<<<
 * cdef object __Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_(object (*f)() ):
 *     def wrap():
*/
struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_ {
  PyObject_HEAD
  PyObject *(*__pyx_v_f)(void);
};

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

/* FastTypeChecks.proto (used by GivenExceptionMatches) */
#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);
#define __Pyx_PyAnySet_Check(obj)  __Pyx_TypeCheck2(obj, &PySet_Type, &PyFrozenSet_Type)
#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_PyAnySet_Check(obj)  PyAnySet_Check(obj)
#endif

/* PyThreadStateGet.proto (used by PyErrFetchRestore) */
#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 (used by GivenExceptionMatches) */
#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

/* GivenExceptionMatches.proto (used by PyErrExceptionMatches) */
#if CYTHON_COMPILING_IN_CPYTHON
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_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2) {
    return PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2);
}
#endif
#define __Pyx_PyErr_ExceptionMatches2(err1, err2)  __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2)

/* PyErrExceptionMatches.proto (used by PyObjectGetAttrStrNoError) */
#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

/* PyObjectGetAttrStr.proto (used by PyObjectGetAttrStrNoError) */
#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 (used by GetBuiltinName) */
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);

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

/* CopyObjectArray.proto (used by TupleOrListFromArrayImpl) */
#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);
#endif

/* TupleOrListFromArrayImpl.proto (used by TupleFromArray) */
#if PY_VERSION_HEX >= 0x030F0000 && !CYTHON_COMPILING_IN_LIMITED_API
#define __Pyx_PyTuple_FromArray(src, n) PyTuple_FromArray(src, ((n)<0) ? 0 : (n))
#else
CYTHON_UNUSED static PyObject *
__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n);
#endif

/* TupleFromArray.proto (used by fastcall) */


/* IncludeStringH.proto (used by PyObjectCompare) */
#include <string.h>

/* PyObjectCompare.proto (used by UnicodeEquals) */
static CYTHON_INLINE int __Pyx_PyObject_CompareBoolEq_str_str(PyObject *op1, PyObject *op2, int pyop);

/* UnicodeEquals.proto (used by fastcall) */
#define __Pyx_PyUnicode_Equals(s1, s2)  __Pyx_PyObject_CompareBoolEq_str_str(s1, s2, Py_EQ)

/* fastcall.proto */
#if CYTHON_AVOID_BORROWED_REFS
    #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_PySequence_ITEM(args, i)
#elif CYTHON_ASSUME_SAFE_MACROS
    #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_NewRef(__Pyx_PyTuple_GET_ITEM(args, i))
#else
    #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_XNewRef(PyTuple_GetItem(args, i))
#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_VECTORCALL
    #define __Pyx_ArgRef_FASTCALL(args, i) __Pyx_NewRef(args[i])
    #define __Pyx_NumKwargs_FASTCALL(kwds) __Pyx_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_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL
    CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues);
  #else
    #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw)
  #endif
#else
    #define __Pyx_ArgRef_FASTCALL __Pyx_ArgRef_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
#endif
#if CYTHON_VECTORCALL_TPNEW
    #if !CYTHON_VECTORCALL
        #error Enabling CYTHON_VECTORCALL_TPNEW without CYTHON_VECTORCALL is not supported
    #endif
    #define __Pyx_ArgRef_FASTCALL_TPNEW __Pyx_ArgRef_FASTCALL
    #define __Pyx_NumKwargs_FASTCALL_TPNEW __Pyx_NumKwargs_FASTCALL
    #define __Pyx_KwValues_FASTCALL_TPNEW __Pyx_KwValues_FASTCALL
    #define __Pyx_GetKwValue_FASTCALL_TPNEW __Pyx_GetKwValue_FASTCALL
    #define __Pyx_KwargsAsDict_FASTCALL_TPNEW __Pyx_KwargsAsDict_FASTCALL
#else
    #define __Pyx_ArgRef_FASTCALL_TPNEW __Pyx_ArgRef_VARARGS
    #define __Pyx_NumKwargs_FASTCALL_TPNEW __Pyx_NumKwargs_VARARGS
    #define __Pyx_KwValues_FASTCALL_TPNEW __Pyx_KwValues_VARARGS
    #define __Pyx_GetKwValue_FASTCALL_TPNEW __Pyx_GetKwValue_VARARGS
    #define __Pyx_KwargsAsDict_FASTCALL_TPNEW __Pyx_KwargsAsDict_VARARGS
#endif
#define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop)
#if CYTHON_VECTORCALL
#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(args + start, stop - start)
#else
#define __Pyx_ArgsSlice_FASTCALL __Pyx_ArgsSlice_VARARGS
#endif

/* dict_setdefault.proto (used by FetchCommonType) */
static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value);

/* AddModuleRef.proto (used by FetchSharedCythonModule) */
#if ((CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && PY_VERSION_HEX < 0x030F00a3) ||\
     __PYX_LIMITED_VERSION_HEX < 0x030d0000)
  static PyObject *__Pyx_PyImport_AddModuleRef(const char *name);
#else
  #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name)
#endif

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

/* VerifyCachedType.proto (used by FetchCommonType) */
static int __Pyx_VerifyCachedType(PyObject *cached_type,
                               const char *name,
                               Py_ssize_t expected_basicsize);

/* FetchCommonType.proto (used by CommonTypesMetaclass) */
static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases);

/* CommonTypesMetaclass.proto (used by CythonFunctionShared) */
static int __pyx_CommonTypesMetaclass_init(PyObject *module);
#define __Pyx_CommonTypesMetaclass_USED

/* CythonFunctionPerModule.proto (used by CythonFunctionShared) */
#define __Pyx_CyFunction_USED
#if CYTHON_OPAQUE_SHARED_TYPES
#define __Pyx_as_CyFunctionObject(o) ((__pyx_CyFunctionObject *)PyObject_GetTypeData((o), __pyx_mstate_global->__pyx_CyFunctionType))
#else
#define __Pyx_as_CyFunctionObject(o) ((__pyx_CyFunctionObject *)o)
#endif
#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_as_CyFunctionObject(f))->func_closure)
#if CYTHON_COMPILING_IN_LIMITED_API
  #define __Pyx__CyFunction_GetClassObj(f)\
      ((f)->func_classobj)
#else
  #define __Pyx__CyFunction_GetClassObj(f)\
      ((PyObject*) ((PyCMethodObject *) (f))->mm_class)
#endif
#define __Pyx_CyFunction_GetClassObj(f)\
    __Pyx__CyFunction_GetClassObj(__Pyx_as_CyFunctionObject(f))
#define __Pyx_CyFunction_SetClassObj(f, classobj)\
    __Pyx__CyFunction_SetClassObj(__Pyx_as_CyFunctionObject(f), (classobj))
#define __Pyx_CyFunction_Defaults(type, f)\
    ((type *)((__Pyx_as_CyFunctionObject(f))->defaults))
#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
    (__Pyx_as_CyFunctionObject(f))->defaults_getter = (g)
typedef struct {
#if CYTHON_COMPILING_IN_LIMITED_API
#if !CYTHON_OPAQUE_OBJECTS
    PyObject_HEAD
#endif
    PyMethodDef *func_methoddef;
    PyObject *func_module;
#else
    PyCMethodObject func;
#endif
#if (CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY) && CYTHON_VECTORCALL
    __pyx_vectorcallfunc func_vectorcall;
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *func_weakreflist;
#endif
#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
    PyObject *func_dict;
#endif
    PyObject *func_name;
    PyObject *func_qualname;
    PyObject *func_doc;
    PyObject *func_globals;
    PyObject *func_code;
    PyObject *func_closure;
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *func_classobj;
#endif
    PyObject *defaults;
    int flags;
    PyObject *defaults_tuple;
    PyObject *defaults_kwdict;
    PyObject *(*defaults_getter)(PyObject *);
    PyObject *func_annotations;
#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
    PyObject *func_is_coroutine;
#endif
} __pyx_CyFunctionObject;
#undef __Pyx_CyOrPyCFunction_Check
#define __Pyx_CyFunction_Check(obj)  __Pyx_TypeCheck(obj, __pyx_mstate_global->__pyx_CyFunctionType)
#define __Pyx_CyOrPyCFunction_Check(obj)  __Pyx_TypeCheck2(obj, __pyx_mstate_global->__pyx_CyFunctionType, &PyCFunction_Type)
#define __Pyx_CyFunction_CheckExact(obj)  Py_IS_TYPE(obj, __pyx_mstate_global->__pyx_CyFunctionType)
static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void));
#undef __Pyx_IsSameCFunction
#define __Pyx_IsSameCFunction(func, cfunc)   __Pyx__IsSameCyOrCFunction(func, cfunc)
static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj);
static CYTHON_INLINE PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func,
                                                         PyTypeObject *defaults_type);
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_VECTORCALL
#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
#define __Pyx_CyFunction_func_vectorcall(f) ((f)->func_vectorcall)
#else
#define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall)
#endif
#endif

/* IgnoreException.proto (used by CythonFunctionShared) */
static CYTHON_INLINE int __Pyx_IgnoreGivenException(PyObject *given_exception, PyObject *ignorable_exception);
#define __Pyx_IgnoreException(ignorable_exception) __Pyx_IgnoreGivenException(NULL, ignorable_exception)

/* CallTypeTraverse.proto (used by CythonFunctionShared) */
#if !CYTHON_USE_TYPE_SPECS
#define __Pyx_call_type_traverse(o, always_call, visit, arg) 0
#else
static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visit, void *arg);
#endif

/* PyMethodNew.proto (used by CythonFunctionShared) */
static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ);

/* PyObjectCall.proto (used by PyObjectFastCall) */
#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 (used by PyObjectFastCall) */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
#endif

/* PyObjectFastCall.proto (used by PyObjectCallOneArg) */
#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 * const*args, size_t nargsf, PyObject *kwargs);

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

/* py_dict_items.proto (used by OwnedDictNext) */
#define __Pyx_PyDict_items_TypePtr  (&PyDictKeys_Type)
#define __Pyx_PyDict_items_Check(obj)  PyObject_TypeCheck((obj), __Pyx_PyDictItems_TypePtr)
#define __Pyx_PyDict_items_CheckExact(obj)  Py_IS_TYPE((obj), __Pyx_PyDictItems_TypePtr)
static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d);

/* CallCFunction.proto (used by CallUnboundCMethod0) */
#define __Pyx_CallCFunction(cfunc, self, args)\
    ((PyCFunction)(void(*)(void))(cfunc)->func)(self, args)
#define __Pyx_CallCFunctionWithKeywords(cfunc, self, args, kwargs)\
    ((PyCFunctionWithKeywords)(void(*)(void))(cfunc)->func)(self, args, kwargs)
#define __Pyx_CallCFunctionFast(cfunc, self, args, nargs)\
    ((__Pyx_PyCFunctionFast)(void(*)(void))(PyCFunction)(cfunc)->func)(self, args, nargs)
#define __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, nargs, kwnames)\
    ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))(PyCFunction)(cfunc)->func)(self, args, nargs, kwnames)

/* UnpackUnboundCMethod_decl.proto (used by UnpackUnboundCMethod) */
typedef struct {
    PyObject *type;
    PyObject **method_name;
    PyCFunction func;
    PyObject *method;
    int flag;
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && CYTHON_ATOMICS
    __pyx_atomic_int_type initialized;
#endif
} __Pyx_CachedCFunction;

/* UnpackUnboundCMethod_impl.export */
static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target);

/* UnpackUnboundCMethod.proto (used by CallUnboundCMethod0) */
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
static CYTHON_INLINE int __Pyx_CachedCFunction_GetAndSetInitializing(__Pyx_CachedCFunction *cfunc) {
#if !CYTHON_ATOMICS
    return 1;
#else
    __pyx_nonatomic_int_type expected = 0;
    if (__pyx_atomic_int_cmp_exchange(&cfunc->initialized, &expected, 1)) {
        return 0;
    }
    return expected;
#endif
}
static CYTHON_INLINE void __Pyx_CachedCFunction_SetFinishedInitializing(__Pyx_CachedCFunction *cfunc) {
#if CYTHON_ATOMICS
    __pyx_atomic_store(&cfunc->initialized, 2);
#endif
}
#else
#define __Pyx_CachedCFunction_GetAndSetInitializing(cfunc) 2
#define __Pyx_CachedCFunction_SetFinishedInitializing(cfunc)
#endif

/* CallUnboundCMethod0.proto */
CYTHON_UNUSED
static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self);
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self);
#else
#define __Pyx_CallUnboundCMethod0(cfunc, self)  __Pyx__CallUnboundCMethod0(cfunc, self)
#endif

/* py_dict_values.proto (used by OwnedDictNext) */
#define __Pyx_PyDict_values_TypePtr  (&PyDictKeys_Type)
#define __Pyx_PyDict_values_Check(obj)  PyObject_TypeCheck((obj), __Pyx_PyDictValues_TypePtr)
#define __Pyx_PyDict_values_CheckExact(obj)  Py_IS_TYPE((obj), __Pyx_PyDictValues_TypePtr)
static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d);

/* OwnedDictNext.proto (used by PyVectorcallFastCallDict) */
#if CYTHON_AVOID_BORROWED_REFS
static int __Pyx_PyDict_NextRef(PyObject *p, PyObject **ppos, PyObject **pkey, PyObject **pvalue);
#else
CYTHON_INLINE
static int __Pyx_PyDict_NextRef(PyObject *p, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue);
#endif

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

/* CythonFunctionShared.proto (used by CythonFunction) */
static PyObject *__Pyx_CyFunction_Init(PyObject *op_in, PyMethodDef *ml,
                                      int flags, PyObject* qualname,
                                      PyObject *closure,
                                      PyObject *module, PyObject *globals,
                                      PyObject* code);
#if CYTHON_VECTORCALL
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);
#endif

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

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

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

/* FormatTypeName.proto (used by RaiseErrorWithObjectType1) */
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX >= 0x030d0000
typedef PyObject *__Pyx_TypeName;
#define __Pyx_FMT_TYPENAME "%N"
#define __Pyx_PyType_GetFullyQualifiedName(tp) Py_NewRef((PyObject*)tp)
#define __Pyx_DECREF_TypeName(obj) Py_DECREF(obj)
#elif CYTHON_COMPILING_IN_LIMITED_API
typedef PyObject *__Pyx_TypeName;
#define __Pyx_FMT_TYPENAME "%U"
#define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj)
static __Pyx_TypeName __Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp);
#else  // !LIMITED_API
typedef const char *__Pyx_TypeName;
#define __Pyx_FMT_TYPENAME "%.200s"
#define __Pyx_PyType_GetFullyQualifiedName(tp) ((tp)->tp_name)
#define __Pyx_DECREF_TypeName(obj)
#endif

/* RaiseErrorWithObjectType1.proto (used by RaiseUnexpectedTypeError) */
#define __Pyx_RaiseTypeErrorWithObjectType1(message, arg, obj) __Pyx_RaiseErrorWithObjectType1(PyExc_TypeError, message, arg, obj)
#define __Pyx_RaiseErrorWithObjectType1(exc_type, message, arg, obj) __Pyx_RaiseErrorWithType1(exc_type, message, arg, Py_TYPE(obj))
CYTHON_UNUSED
static void __Pyx_RaiseErrorWithType1(PyObject* exc_type, const char* message, const char *arg, PyTypeObject *type_obj);

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

/* HasAttr.proto (used by ImportImpl) */
#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
#define __Pyx_HasAttr(o, n)  PyObject_HasAttrWithError(o, n)
#else
static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
#endif

/* TupleOrListFromArrayImpl.proto (used by ListFromArray) */
CYTHON_UNUSED static PyObject *
__Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n);

/* ListFromArray.proto (used by ImportImpl) */


/* ImportImpl.export */
static PyObject *__Pyx__Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, PyObject *moddict, int level);

/* Import.proto */
static CYTHON_INLINE PyObject *__Pyx_Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, int level);

/* PyObjectFastCallMethod.proto */
#if CYTHON_VECTORCALL
#define __Pyx_PyObject_FastCallMethod(name, args, nargsf) PyObject_VectorcallMethod(name, args, nargsf, NULL)
#else
static PyObject *__Pyx_PyObject_FastCallMethod(PyObject *name, PyObject *const *args, size_t nargsf);
#endif

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

/* PyFrozenDict.proto (used by DictGetItem) */
#if CYTHON_COMPILING_IN_LIMITED_API
#define __Pyx_PyFrozenDict_TypePtr  ((PyTypeObject*) __pyx_mstate_global->__Pyx_PyFrozenDictType)
#define __Pyx_PyFrozenDict_New(it)  __Pyx__PyFrozenDict_New(__pyx_mstate_global->__Pyx_PyFrozenDictType, it)
static CYTHON_INLINE PyObject* __Pyx__PyFrozenDict_New(PyObject* frozendict_type, PyObject* it);
#define __Pyx_PyFrozenDict_NewEmpty()  __Pyx_PyFrozenDict_New(NULL)
#define __Pyx_PyFrozenDict_Check(obj)  PyObject_TypeCheck((obj), __Pyx_PyFrozenDict_TypePtr)
#define __Pyx_PyFrozenDict_CheckExact(obj)  Py_IS_TYPE((obj), __Pyx_PyFrozenDict_TypePtr)
#define __Pyx_PyAnyDict_Check(obj)   __Pyx__PyAnyDict_Check(obj, __Pyx_PyFrozenDict_TypePtr)
static CYTHON_INLINE int __Pyx__PyAnyDict_Check(PyObject *obj, PyTypeObject* frozendict_type) {
    return PyObject_TypeCheck(obj, &PyDict_Type) || PyObject_TypeCheck(obj, frozendict_type);
}
#define __Pyx_PyAnyDict_CheckExact(obj)  __Pyx__PyAnyDict_CheckExact(obj, __Pyx_PyFrozenDict_TypePtr)
static CYTHON_INLINE int __Pyx__PyAnyDict_CheckExact(PyObject *obj, PyTypeObject* frozendict_type) {
    return Py_IS_TYPE(obj, &PyDict_Type) || Py_IS_TYPE(obj, frozendict_type);
}
#elif PY_VERSION_HEX >= 0x030f00a6 ||\
    (defined(PyFrozenDict_Check) && defined(PyAnyDict_Check) && defined(PyFrozenDict_New))
#define __Pyx_PyFrozenDict_TypePtr  (&PyFrozenDict_Type)
#define __Pyx_PyFrozenDict_New(it)  PyFrozenDict_New(it)
#define __Pyx_PyFrozenDict_NewEmpty()  PyFrozenDict_New(NULL)
#define __Pyx_PyFrozenDict_Check(obj)  PyFrozenDict_Check(obj)
#define __Pyx_PyFrozenDict_CheckExact(obj)  PyFrozenDict_CheckExact(obj)
#define __Pyx_PyAnyDict_Check(obj)  PyAnyDict_Check(obj)
#define __Pyx_PyAnyDict_CheckExact(obj)  PyAnyDict_CheckExact(obj)
#else
#define __Pyx_PyFrozenDict_TypePtr  (&PyDict_Type)
static CYTHON_INLINE PyObject* __Pyx_PyFrozenDict_New(PyObject* it) {
    if (!it) {
        return PyDict_New();
    } else if (PyDict_Check(it)) {
        return PyDict_Copy(it);
    } else {
        PyObject *dict = PyDict_New();
        if (!dict) return NULL;
        PyObject *result = PyNumber_InPlaceOr(dict, it);
        Py_DECREF(dict);
        return result;
    }
}
#define __Pyx_PyFrozenDict_NewEmpty()  PyDict_New()
#define __Pyx_PyFrozenDict_Check(obj)  PyDict_Check(obj)
#define __Pyx_PyFrozenDict_CheckExact(obj)  PyDict_CheckExact(obj)
#define __Pyx_PyAnyDict_Check(obj)  PyDict_Check(obj)
#define __Pyx_PyAnyDict_CheckExact(obj)  PyDict_CheckExact(obj)
#endif

/* DictGetItem.proto */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
#define __Pyx_PyObject_Dict_GetItem(obj, name)\
    (likely(__Pyx_PyAnyDict_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

/* MoveIfSupported.proto */
#if CYTHON_USE_CPP_STD_MOVE
  #include <utility>
  #define __PYX_STD_MOVE_IF_SUPPORTED(x) std::move(x)
#else
  #define __PYX_STD_MOVE_IF_SUPPORTED(x) x
#endif

/* ListAppend.proto */
#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x);
#else
#define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
#endif

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

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

/* PyObject_Unicode.proto */
#define __Pyx_PyObject_Unicode(obj)\
    (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Str(obj))

/* JoinPyUnicode.proto */
#define __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH\
    (!CYTHON_COMPILING_IN_GRAAL && !CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API)

/* JoinPyUnicode.export */
static PyObject* __Pyx_PyUnicode_Join(PyObject** values, Py_ssize_t value_count, Py_ssize_t result_ulength, int kind);

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

/* RejectKeywords.export */
static void __Pyx_RejectKeywords(const char* function_name, PyObject *kwds);

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

/* PyDictVersioning.proto (used by GetModuleGlobalName) */
#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_XNewRef(__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_mstate_global->__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

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

/* ParseKeywordsImpl.export */
static int __Pyx_ParseKeywordsTuple(
    PyObject *kwds,
    PyObject * const *kwvalues,
    PyObject ** const argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    Py_ssize_t num_kwargs,
    const char* function_name,
    int ignore_unknown_kwargs
);
static int __Pyx_ParseKeywordDictToDict(
    PyObject *kwds,
    PyObject ** const argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    const char* function_name
);
static int __Pyx_ParseKeywordDict(
    PyObject *kwds,
    PyObject ** const argnames[],
    PyObject *values[],
    Py_ssize_t num_pos_args,
    Py_ssize_t num_kwargs,
    const char* function_name,
    int ignore_unknown_kwargs
);

/* CallUnboundCMethod2.proto */
CYTHON_UNUSED
static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2);
#if CYTHON_COMPILING_IN_CPYTHON
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

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

/* ArgTypeTestError.export */
static void __Pyx_ArgTypeError(PyObject *obj, PyTypeObject *type, const char *name, int exact);

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

/* pybuiltin_invalid.export */
static void __Pyx_PyBuiltin_Invalid(PyObject *obj, const char *builtin_type_name, const char *argname);

/* pyint_simplify.proto */
static CYTHON_INLINE int __Pyx_PyInt_FromNumber(PyObject **number_var, const char *argname, int accept_none);

/* PyTypeError_Check.proto */
#define __Pyx_PyExc_TypeError_Check(obj)  __Pyx_TypeCheck(obj, PyExc_TypeError)

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

/* IncludeCppStringH.proto (used by decode_cpp_string) */
#include <string>

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

/* decode_cpp_string.proto */
static CYTHON_INLINE PyObject* __Pyx_decode_cpp_string(
         std::string cppstring, Py_ssize_t start, Py_ssize_t stop,
         const char* encoding, const char* errors,
         PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
    return __Pyx_decode_c_bytes(
        cppstring.data(), (Py_ssize_t) cppstring.size(), start, stop, encoding, errors, decode_func);
}

/* PyIndexError_Check.proto */
#define __Pyx_PyExc_IndexError_Check(obj)  __Pyx_TypeCheck(obj, PyExc_IndexError)

/* UnicodeConcatInPlace.proto */
# if CYTHON_COMPILING_IN_CPYTHON
    #if CYTHON_REFNANNY
        #define __Pyx_PyUnicode_ConcatInPlace(left, right, unsafe_shared) __Pyx_PyUnicode_ConcatInPlaceImpl(&left, right, unsafe_shared, __pyx_refnanny)
    #else
        #define __Pyx_PyUnicode_ConcatInPlace(left, right, unsafe_shared) __Pyx_PyUnicode_ConcatInPlaceImpl(&left, right, unsafe_shared)
    #endif
    #define __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_DefinitelyUniqueInPlace(left, right) __Pyx_PyUnicode_ConcatInPlace(left, right, __Pyx_ReferenceSharing_DefinitelyUnique)
    #define __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlace(left, right) __Pyx_PyUnicode_ConcatInPlace(left, right, __Pyx_ReferenceSharing_OwnStrongReference)
    #define __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_FunctionArgumentInPlace(left, right) __Pyx_PyUnicode_ConcatInPlace(left, right, __Pyx_ReferenceSharing_FunctionArgument)
    #define __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_SharedReferenceInPlace(left, right) __Pyx_PyUnicode_ConcatInPlace(left, right, __Pyx_ReferenceSharing_SharedReference)
    static CYTHON_INLINE PyObject *__Pyx_PyUnicode_ConcatInPlaceImpl(PyObject **p_left, PyObject *right, int unsafe_shared
        #if CYTHON_REFNANNY
        , void* __pyx_refnanny
        #endif
    );
#else
#define __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_DefinitelyUniqueInPlace __Pyx_PyUnicode_Concat
#define __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlace __Pyx_PyUnicode_Concat
#define __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_FunctionArgumentInPlace __Pyx_PyUnicode_Concat
#define __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_SharedReferenceInPlace __Pyx_PyUnicode_Concat
#endif
#define __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_DefinitelyUniqueInPlaceSafe(left, right)\
    ((unlikely((left) == Py_None) || unlikely((right) == Py_None)) ?\
    PyNumber_InPlaceAdd(left, right) : __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_DefinitelyUniqueInPlace(left, right))
#define __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlaceSafe(left, right)\
    ((unlikely((left) == Py_None) || unlikely((right) == Py_None)) ?\
    PyNumber_InPlaceAdd(left, right) : __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlace(left, right))
#define __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_FunctionArgumentInPlaceSafe(left, right)\
    ((unlikely((left) == Py_None) || unlikely((right) == Py_None)) ?\
    PyNumber_InPlaceAdd(left, right) : __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_FunctionArgumentInPlace(left, right))
#define __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_SharedReferenceInPlaceSafe(left, right)\
    ((unlikely((left) == Py_None) || unlikely((right) == Py_None)) ?\
    PyNumber_InPlaceAdd(left, right) : __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_SharedReferenceInPlace(left, right))

/* PyValueError_Check.proto */
#define __Pyx_PyExc_ValueError_Check(obj)  __Pyx_TypeCheck(obj, PyExc_ValueError)

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

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

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

/* GetTopmostException.proto (used by SaveResetException) */
#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

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

/* PyObjectVectorcallKwds.proto (used by PyObjectVectorcallMethodKwds) */
#if CYTHON_VECTORCALL
#define __Pyx_Object_VectorcallKwds PyObject_Vectorcall
CYTHON_UNUSED static int __Pyx_CheckVectorcallKwarg(PyObject *kwnames, Py_ssize_t i);
#else
#define __Pyx_Object_VectorcallKwds __Pyx_PyObject_FastCallDict
CYTHON_UNUSED static PyObject *__Pyx_MakeKwargDict(PyObject **keys, PyObject **values, Py_ssize_t n);
CYTHON_UNUSED static int __Pyx_CheckVectorcallKwarg(PyObject **kwnames, Py_ssize_t i);
#endif

/* PyObjectVectorcallMethodKwds.proto */
#if CYTHON_VECTORCALL
#define __Pyx_Object_VectorcallMethodKwds PyObject_VectorcallMethod
#else
static PyObject *__Pyx_Object_VectorcallMethodKwds(PyObject *name, PyObject *const *args, size_t nargsf, PyObject *kwnames);
#endif

/* PyObjectCompare.proto */
static CYTHON_INLINE int __Pyx_PyObject_CompareBoolGt_object_int(PyObject *op1, PyObject *op2, int pyop);

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

/* PyObjectCallMethod0.proto (used by dict_iter_common) */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name);

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

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

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

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

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

/* UnpackTuple2.proto (used by dict_iter_common) */
static CYTHON_INLINE int __Pyx_unpack_tuple2(
    PyObject* tuple, PyObject** value1, PyObject** value2, int is_tuple, int has_known_size, int 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_common.proto (used by dict_iter) */
static PyObject *__Pyx_dict_call_to_get_iterable(PyObject* iterable, PyObject* method_name);
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);

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

/* AllocateExtensionType.proto */
static PyObject *__Pyx_AllocateExtensionType(PyTypeObject *t, int is_final);

/* CallSlotAsVectorcall.proto */
#if CYTHON_VECTORCALL_TPNEW
typedef PyObject * (*__Pyx_tpnewvectorcallfunc)(PyTypeObject* o, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames);
static PyObject * __Pyx_CallTpnewAsVectorcall(__Pyx_tpnewvectorcallfunc f, PyTypeObject* o, PyObject *a, PyObject *k);
#endif

/* RaiseErrorWithObjectType.proto (used by CallNewInitFromVectorcall) */
#define __Pyx_RaiseTypeErrorWithObjectType(message, obj)  __Pyx_RaiseErrorWithObjectType(PyExc_TypeError, message, obj)
#define __Pyx_RaiseErrorWithObjectType(exc_type, message, obj)  __Pyx_RaiseErrorWithType(exc_type, message, Py_TYPE(obj))
CYTHON_UNUSED
static void __Pyx_RaiseErrorWithType(PyObject* exc_type, const char* message, PyTypeObject *type_obj);

/* CallNewInitFromVectorcall.proto */
#if CYTHON_VECTORCALL_TPNEW
static PyObject *__Pyx_CallNewInitFromVectorcall(PyTypeObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames);
#endif

/* DefaultPlacementNew.proto */
#include <new>
template<typename T>
void __Pyx_default_placement_construct(T* x) {
    new (static_cast<void*>(x)) T();
}

/* CallSlotAsVectorcall.proto */
#if CYTHON_VECTORCALL_TPNEW
typedef int (*__Pyx_tpinitvectorcallfunc)(PyObject* o, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames);
static int __Pyx_CallTpinitAsVectorcall(__Pyx_tpinitvectorcallfunc f, PyObject* o, PyObject *a, PyObject *k);
#endif

/* CheckTypeForFreelists.proto */
#if CYTHON_USE_FREELISTS
#if CYTHON_USE_TYPE_SPECS
#define __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, expected_tp, expected_size) ((int) ((t) == (expected_tp)))
#define __PYX_CHECK_TYPE_FOR_FREELIST_FLAGS  Py_TPFLAGS_IS_ABSTRACT
#else
#define __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, expected_tp, expected_size) ((int) ((t)->tp_basicsize == (expected_size)))
#define __PYX_CHECK_TYPE_FOR_FREELIST_FLAGS  (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)
#endif
#define __PYX_CHECK_TYPE_FOR_FREELISTS(t, expected_tp, expected_size)\
    (__PYX_CHECK_FINAL_TYPE_FOR_FREELISTS((t), (expected_tp), (expected_size)) &\
     (int) (!__Pyx_PyType_HasFeature((t), __PYX_CHECK_TYPE_FOR_FREELIST_FLAGS)))
#endif

/* GetTypeDictOffset.proto (used by ValidateBasesTuple) */
#if !CYTHON_USE_TYPE_SLOTS
CYTHON_UNUSED static Py_ssize_t __Pyx_GetTypeDictOffset(PyObject *tp, int require_cython_valid_result);
#endif

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

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

/* LimitedApiGetTypeTypeDict.proto (used by DelItemOnTypeDict) */
#if CYTHON_COMPILING_IN_LIMITED_API
static PyObject *__Pyx_GetTypeTypeDict(PyTypeObject *tp);
#endif

/* DelItemOnTypeDict.proto (used by SetupReduce) */
#define __Pyx_DelItemOnTypeDict(tp, k) __Pyx__DelItemOnTypeDict((PyTypeObject*)tp, k)

/* DelItemOnTypeDict.export */
static int __Pyx__DelItemOnTypeDict(PyTypeObject *tp, PyObject *k);

/* SetItemOnTypeDict.proto (used by SetupReduce) */
#define __Pyx_SetItemOnTypeDict(tp, k, v) __Pyx__SetItemOnTypeDict((PyTypeObject*)tp, k, v)

/* SetItemOnTypeDict.export */
static int __Pyx__SetItemOnTypeDict(PyTypeObject *tp, PyObject *k, PyObject *v);

/* SetupReduce.export */
static int __Pyx_setup_reduce(PyObject* type_obj);

/* TypeImport.proto */
#ifndef __PYX_HAVE_RT_ImportType_proto_3_3_0
#define __PYX_HAVE_RT_ImportType_proto_3_3_0
#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
#include <stdalign.h>
#endif
#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L
#define __PYX_GET_STRUCT_ALIGNMENT_3_3_0(s) alignof(s)
#else
#define __PYX_GET_STRUCT_ALIGNMENT_3_3_0(s) sizeof(void*)
#endif
enum __Pyx_ImportType_CheckSize_3_3_0 {
   __Pyx_ImportType_CheckSize_Error_3_3_0 = 0,
   __Pyx_ImportType_CheckSize_Warn_3_3_0 = 1,
   __Pyx_ImportType_CheckSize_Ignore_3_3_0 = 2
};
static PyTypeObject *__Pyx_ImportType_3_3_0(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_3_0 check_size);
#endif

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

/* GetNameInClass.proto */
#define __Pyx_GetNameInClass(var, nmspace, name)  (var) = __Pyx__GetNameInClass(nmspace, name)
static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name);

/* CLineInTraceback.proto (used by AddTraceback) */
#if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME
static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
#else
#define __Pyx_CLineForTraceback(tstate, c_line)  (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
#endif

/* CodeObjectCache.proto (used by AddTraceback) */
#if CYTHON_COMPILING_IN_LIMITED_API
typedef PyObject __Pyx_CachedCodeObjectType;
#else
typedef PyCodeObject __Pyx_CachedCodeObjectType;
#endif
typedef struct {
    __Pyx_CachedCodeObjectType* code_object;
    int code_line;
} __Pyx_CodeObjectCacheEntry;
struct __Pyx_CodeObjectCache {
    int count;
    int max_count;
    __Pyx_CodeObjectCacheEntry* entries;
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    __pyx_atomic_int_type accessor_count;
  #endif
};
static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
static __Pyx_CachedCodeObjectType *__pyx_find_code_object(int code_line);
static void __pyx_insert_code_object(int code_line, __Pyx_CachedCodeObjectType* code_object);

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

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

/* CheckUnpickleChecksumError.export */
static void __Pyx_RaiseUnpickleChecksumError(long checksum, long checksum1, long checksum2, long checksum3, const char *members);

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

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

/* LengthHint.proto */
#if CYTHON_COMPILING_IN_LIMITED_API
#define __Pyx_PyObject_LengthHint(o, defaultval)  (defaultval)
#else
#define __Pyx_PyObject_LengthHint(o, defaultval)  PyObject_LengthHint(o, defaultval)
#endif

/* UpdateUnpickledDict.export */
static int __Pyx_UpdateUnpickledDict(PyObject *obj, PyObject *state, Py_ssize_t index);

/* CheckUnpickleChecksum.proto */
static CYTHON_INLINE int __Pyx_CheckUnpickleChecksum(long checksum, long checksum1, long checksum2, long checksum3, const char *members);

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

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

/* CIntFromPy.proto */
static CYTHON_INLINE unsigned short __Pyx_PyLong_As_unsigned_short(PyObject *);

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

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

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

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

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

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_unsigned_short(unsigned short value);

/* CIntFromPy.proto */
static CYTHON_INLINE uint8_t __Pyx_PyLong_As_uint8_t(PyObject *);

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

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

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

/* GetRuntimeVersion.proto */
#if __PYX_LIMITED_VERSION_HEX < 0x030b0000
static unsigned long __Pyx_cached_runtime_version = 0;
static void __Pyx_init_runtime_version(void);
#else
#define __Pyx_init_runtime_version()
#endif
static unsigned long __Pyx_get_runtime_version(void);

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

/* DecompressString.proto */
static PyObject *__Pyx_DecompressString(const char *s, Py_ssize_t length, int algo);

/* DecompressString_LZSS.proto */
static PyObject *__Pyx_DecompressString_LZSS(const char *s, size_t compressed_length, size_t uncompressed_length);

/* MultiPhaseInitModuleState.proto */
#if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE
#include <stdlib.h>
static PyObject *__Pyx_State_FindModule(void*);
static int __Pyx_State_AddModule(PyObject* module, void*);
static int __Pyx_State_RemoveModule(void*);
#elif CYTHON_USE_MODULE_STATE
#define __Pyx_State_FindModule PyState_FindModule
#define __Pyx_State_AddModule PyState_AddModule
#define __Pyx_State_RemoveModule PyState_RemoveModule
#endif

/* #### Code section: module_declarations ### */
/* CythonABIVersion.proto */
#if CYTHON_COMPILING_IN_LIMITED_API
    #if CYTHON_VECTORCALL
        #define __PYX_VECTORCALL_ABI_SUFFIX  "_vectorcall"
    #else
        #define __PYX_VECTORCALL_ABI_SUFFIX
    #endif
    #define __PYX_LIMITED_ABI_SUFFIX "limited" __PYX_VECTORCALL_ABI_SUFFIX __PYX_AM_SEND_ABI_SUFFIX
#else
    #define __PYX_LIMITED_ABI_SUFFIX
#endif
#if __PYX_HAS_PY_AM_SEND == 1
    #define __PYX_AM_SEND_ABI_SUFFIX
#elif __PYX_HAS_PY_AM_SEND == 2
    #define __PYX_AM_SEND_ABI_SUFFIX "amsendbackport"
#else
    #define __PYX_AM_SEND_ABI_SUFFIX "noamsend"
#endif
#ifndef __PYX_MONITORING_ABI_SUFFIX
    #define __PYX_MONITORING_ABI_SUFFIX
#endif
#if CYTHON_USE_TP_FINALIZE
    #define __PYX_TP_FINALIZE_ABI_SUFFIX
#else
    #define __PYX_TP_FINALIZE_ABI_SUFFIX "nofinalize"
#endif
#if CYTHON_USE_FREELISTS || !defined(__Pyx_AsyncGen_USED)
    #define __PYX_FREELISTS_ABI_SUFFIX
#else
    #define __PYX_FREELISTS_ABI_SUFFIX "nofreelists"
#endif
#if CYTHON_OPAQUE_OBJECTS && CYTHON_COMPILING_IN_LIMITED_API
    #define __PYX_OPAQUE_OBJECTS_ABI_SUFFIX "opaque"
#else
    #define __PYX_OPAQUE_OBJECTS_ABI_SUFFIX
#endif
#define CYTHON_ABI  __PYX_ABI_VERSION __PYX_LIMITED_ABI_SUFFIX __PYX_MONITORING_ABI_SUFFIX __PYX_TP_FINALIZE_ABI_SUFFIX __PYX_FREELISTS_ABI_SUFFIX __PYX_AM_SEND_ABI_SUFFIX __PYX_OPAQUE_OBJECTS_ABI_SUFFIX
#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI
#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "."

#if !CYTHON_COMPILING_IN_LIMITED_API
static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4real___get__(PyComplexObject *__pyx_v_self); /* proto*/
#endif
#if !CYTHON_COMPILING_IN_LIMITED_API
static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4imag___get__(PyComplexObject *__pyx_v_self); /* proto*/
#endif

/* Module declarations from "libcpp.utility" */

/* Module declarations from "libcpp.map" */

/* Module declarations from "libcpp" */

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

/* Module declarations from "libcpp.string_view" */

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

/* Module declarations from "libcpp.memory" */

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

/* Module declarations from "__builtin__" */

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

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

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

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

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

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

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

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

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

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

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

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

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

/* Module declarations from "__builtin__" */

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

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

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

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

/* Module declarations from "cython" */

/* Module declarations from "__builtin__" */

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/* Module declarations from "cpython" */

/* Module declarations from "libcpp.vector" */

/* Module declarations from "opendht_cpp" */

/* Module declarations from "opendht._core" */
static CYTHON_INLINE void __pyx_f_7opendht_5_core__initialize_gnutls(void); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_7opendht_5_core__deinitialize_gnutls(void); /*proto*/
static CYTHON_INLINE void __pyx_f_7opendht_5_core_lookup_callback(std::vector<std::shared_ptr<dht::indexation::Value> >  *, dht::indexation::Prefix *, void *); /*proto*/
static CYTHON_INLINE void __pyx_f_7opendht_5_core_shutdown_callback(void *); /*proto*/
static CYTHON_INLINE bool __pyx_f_7opendht_5_core_get_callback(std::shared_ptr<dht::Value> , void *); /*proto*/
static CYTHON_INLINE bool __pyx_f_7opendht_5_core_value_callback(std::shared_ptr<dht::Value> , bool, void *); /*proto*/
static CYTHON_INLINE void __pyx_f_7opendht_5_core_done_callback(bool, std::vector<std::shared_ptr<dht::Node> >  *, void *); /*proto*/
static CYTHON_INLINE void __pyx_f_7opendht_5_core_done_callback_simple(bool, void *); /*proto*/
static PyObject *__pyx_f_7opendht_5_core___pyx_unpickle__WithID__set_state(struct __pyx_obj_7opendht_5_core__WithID *, PyObject *); /*proto*/
static PyObject *__pyx_f_7opendht_5_core___pyx_unpickle__WithPk__set_state(struct __pyx_obj_7opendht_5_core__WithPk *, PyObject *); /*proto*/
static PyObject *__Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_(PyObject *(*)(void)); /*proto*/
static CYTHON_INLINE PyObject *__pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string(std::string const &); /*proto*/
static CYTHON_INLINE PyObject *__pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(std::string const &); /*proto*/
static CYTHON_INLINE PyObject *__pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(std::string const &); /*proto*/
static CYTHON_INLINE PyObject *__pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string(std::string const &); /*proto*/
static std::string __pyx_convert_string_from_py_6libcpp_6string_std__in_string(PyObject *); /*proto*/
static std::vector<uint8_t>  __pyx_convert_vector_from_py_uint8_t(PyObject *); /*proto*/
/* #### Code section: typeinfo ### */
/* #### Code section: before_global_var ### */
#define __Pyx_MODULE_NAME "opendht._core"
extern int __pyx_module_is_main_opendht___core;
int __pyx_module_is_main_opendht___core = 0;

/* Implementation of "opendht._core" */
/* #### Code section: global_var ### */
static PyObject *__pyx_builtin_staticmethod;
static PyObject *__pyx_builtin_print;
static PyObject *__pyx_builtin_NotImplemented;
/* #### Code section: string_decls ### */
static const char __pyx_k__5[] = "";
/* #### Code section: decls ### */
static PyObject *__pyx_pf_11cfunc_dot_to_py_57__Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py__wrap(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_version(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_7_WithID___repr__(struct __pyx_obj_7opendht_5_core__WithID *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_7_WithID_2__str__(struct __pyx_obj_7opendht_5_core__WithID *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_7_WithID_4__reduce_cython__(struct __pyx_obj_7opendht_5_core__WithID *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_7_WithID_6__setstate_cython__(struct __pyx_obj_7opendht_5_core__WithID *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_7_WithPk___repr__(struct __pyx_obj_7opendht_5_core__WithPk *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_7_WithPk_2__str__(struct __pyx_obj_7opendht_5_core__WithPk *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_7_WithPk_4__reduce_cython__(struct __pyx_obj_7opendht_5_core__WithPk *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_7_WithPk_6__setstate_cython__(struct __pyx_obj_7opendht_5_core__WithPk *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7opendht_5_core_8InfoHash___cinit__(struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_v_self, PyObject *__pyx_v_str); /* proto */
static int __pyx_pf_7opendht_5_core_8InfoHash_2__bool__(struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_8InfoHash_4__richcmp__(struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_v_self, struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_v_other, int __pyx_v_op); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_8InfoHash_6getBit(struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_v_self, PyObject *__pyx_v_bit); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_8InfoHash_8setBit(struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_v_self, PyObject *__pyx_v_bit, PyObject *__pyx_v_b); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_8InfoHash_10getId(struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_8InfoHash_12toString(struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_8InfoHash_14toFloat(struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_8InfoHash_16commonBits(struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_v_a, struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_v_b); /* proto */
static struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_pf_7opendht_5_core_8InfoHash_18get(PyObject *__pyx_v_key); /* proto */
static struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_pf_7opendht_5_core_8InfoHash_20getRandom(void); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_8InfoHash_22__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_8InfoHash_24__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7opendht_5_core_4PkId___cinit__(struct __pyx_obj_7opendht_5_core_PkId *__pyx_v_self, PyObject *__pyx_v_str); /* proto */
static int __pyx_pf_7opendht_5_core_4PkId_2__bool__(struct __pyx_obj_7opendht_5_core_PkId *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_4PkId_4__richcmp__(struct __pyx_obj_7opendht_5_core_PkId *__pyx_v_self, struct __pyx_obj_7opendht_5_core_PkId *__pyx_v_other, int __pyx_v_op); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_4PkId_6getBit(struct __pyx_obj_7opendht_5_core_PkId *__pyx_v_self, PyObject *__pyx_v_bit); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_4PkId_8setBit(struct __pyx_obj_7opendht_5_core_PkId *__pyx_v_self, PyObject *__pyx_v_bit, PyObject *__pyx_v_b); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_4PkId_10getLongId(struct __pyx_obj_7opendht_5_core_PkId *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_4PkId_12toString(struct __pyx_obj_7opendht_5_core_PkId *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_4PkId_14toFloat(struct __pyx_obj_7opendht_5_core_PkId *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_4PkId_16commonBits(struct __pyx_obj_7opendht_5_core_PkId *__pyx_v_a, struct __pyx_obj_7opendht_5_core_PkId *__pyx_v_b); /* proto */
static struct __pyx_obj_7opendht_5_core_PkId *__pyx_pf_7opendht_5_core_4PkId_18get(PyObject *__pyx_v_key); /* proto */
static struct __pyx_obj_7opendht_5_core_PkId *__pyx_pf_7opendht_5_core_4PkId_20getRandom(void); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_4PkId_22__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7opendht_5_core_PkId *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_4PkId_24__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7opendht_5_core_PkId *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_8SockAddr_toString(struct __pyx_obj_7opendht_5_core_SockAddr *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_8SockAddr_2getPort(struct __pyx_obj_7opendht_5_core_SockAddr *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_8SockAddr_4getFamily(struct __pyx_obj_7opendht_5_core_SockAddr *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_8SockAddr_6setPort(struct __pyx_obj_7opendht_5_core_SockAddr *__pyx_v_self, __pyx_t_11opendht_cpp_in_port_t __pyx_v_port); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_8SockAddr_8setFamily(struct __pyx_obj_7opendht_5_core_SockAddr *__pyx_v_self, __pyx_t_11opendht_cpp_sa_family_t __pyx_v_af); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_8SockAddr_10isLoopback(struct __pyx_obj_7opendht_5_core_SockAddr *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_8SockAddr_12isPrivate(struct __pyx_obj_7opendht_5_core_SockAddr *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_8SockAddr_14isUnspecified(struct __pyx_obj_7opendht_5_core_SockAddr *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_8SockAddr_16__str__(struct __pyx_obj_7opendht_5_core_SockAddr *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_8SockAddr_18__repr__(struct __pyx_obj_7opendht_5_core_SockAddr *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_8SockAddr_20resolve(PyObject *__pyx_v_host, PyObject *__pyx_v_service); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_8SockAddr_22__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7opendht_5_core_SockAddr *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_8SockAddr_24__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7opendht_5_core_SockAddr *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_4Node_getId(struct __pyx_obj_7opendht_5_core_Node *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_4Node_2getAddr(struct __pyx_obj_7opendht_5_core_Node *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_4Node_4isExpired(struct __pyx_obj_7opendht_5_core_Node *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_4Node_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7opendht_5_core_Node *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_4Node_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7opendht_5_core_Node *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_9NodeEntry_getId(struct __pyx_obj_7opendht_5_core_NodeEntry *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_9NodeEntry_2getNode(struct __pyx_obj_7opendht_5_core_NodeEntry *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_9NodeEntry_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7opendht_5_core_NodeEntry *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_9NodeEntry_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7opendht_5_core_NodeEntry *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7opendht_5_core_5Query___cinit__(struct __pyx_obj_7opendht_5_core_Query *__pyx_v_self, PyObject *__pyx_v_q_str); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_5Query_2__str__(struct __pyx_obj_7opendht_5_core_Query *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_5Query_4buildFrom(struct __pyx_obj_7opendht_5_core_Query *__pyx_v_self, struct __pyx_obj_7opendht_5_core_Select *__pyx_v_s, struct __pyx_obj_7opendht_5_core_Where *__pyx_v_w); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_5Query_6isSatisfiedBy(struct __pyx_obj_7opendht_5_core_Query *__pyx_v_self, struct __pyx_obj_7opendht_5_core_Query *__pyx_v_q); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_5Query_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7opendht_5_core_Query *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_5Query_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7opendht_5_core_Query *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7opendht_5_core_6Select___cinit__(struct __pyx_obj_7opendht_5_core_Select *__pyx_v_self, PyObject *__pyx_v_q_str); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_6Select_2__str__(struct __pyx_obj_7opendht_5_core_Select *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_6Select_4isSatisfiedBy(struct __pyx_obj_7opendht_5_core_Select *__pyx_v_self, struct __pyx_obj_7opendht_5_core_Select *__pyx_v_os); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_6Select_6field(struct __pyx_obj_7opendht_5_core_Select *__pyx_v_self, int __pyx_v_field); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_6Select_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7opendht_5_core_Select *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_6Select_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7opendht_5_core_Select *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7opendht_5_core_5Where___cinit__(struct __pyx_obj_7opendht_5_core_Where *__pyx_v_self, PyObject *__pyx_v_q_str); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_5Where_2__str__(struct __pyx_obj_7opendht_5_core_Where *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_5Where_4isSatisfiedBy(struct __pyx_obj_7opendht_5_core_Where *__pyx_v_self, struct __pyx_obj_7opendht_5_core_Where *__pyx_v_where); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_5Where_6id(struct __pyx_obj_7opendht_5_core_Where *__pyx_v_self, uint64_t __pyx_v_id); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_5Where_8valueType(struct __pyx_obj_7opendht_5_core_Where *__pyx_v_self, uint16_t __pyx_v_type); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_5Where_10owner(struct __pyx_obj_7opendht_5_core_Where *__pyx_v_self, struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_v_owner_pk_hash); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_5Where_12seq(struct __pyx_obj_7opendht_5_core_Where *__pyx_v_self, uint16_t __pyx_v_seq_no); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_5Where_14userType(struct __pyx_obj_7opendht_5_core_Where *__pyx_v_self, PyObject *__pyx_v_user_type); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_5Where_16__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7opendht_5_core_Where *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_5Where_18__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7opendht_5_core_Where *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7opendht_5_core_5Value___init__(struct __pyx_obj_7opendht_5_core_Value *__pyx_v_self, PyObject *__pyx_v_val, uint16_t __pyx_v_id); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_5Value_2__str__(struct __pyx_obj_7opendht_5_core_Value *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_5Value_5owner___get__(struct __pyx_obj_7opendht_5_core_Value *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_5Value_9recipient___get__(struct __pyx_obj_7opendht_5_core_Value *__pyx_v_self); /* proto */
static int __pyx_pf_7opendht_5_core_5Value_9recipient_2__set__(struct __pyx_obj_7opendht_5_core_Value *__pyx_v_self, struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_v_h); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_5Value_4data___get__(struct __pyx_obj_7opendht_5_core_Value *__pyx_v_self); /* proto */
static int __pyx_pf_7opendht_5_core_5Value_4data_2__set__(struct __pyx_obj_7opendht_5_core_Value *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_5Value_9user_type___get__(struct __pyx_obj_7opendht_5_core_Value *__pyx_v_self); /* proto */
static int __pyx_pf_7opendht_5_core_5Value_9user_type_2__set__(struct __pyx_obj_7opendht_5_core_Value *__pyx_v_self, PyObject *__pyx_v_t); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_5Value_2id___get__(struct __pyx_obj_7opendht_5_core_Value *__pyx_v_self); /* proto */
static int __pyx_pf_7opendht_5_core_5Value_2id_2__set__(struct __pyx_obj_7opendht_5_core_Value *__pyx_v_self, uint64_t __pyx_v_value); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_5Value_4size___get__(struct __pyx_obj_7opendht_5_core_Value *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_5Value_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7opendht_5_core_Value *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_5Value_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7opendht_5_core_Value *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7opendht_5_core_9ValueType___init__(struct __pyx_obj_7opendht_5_core_ValueType *__pyx_v_self, uint16_t __pyx_v_id, PyObject *__pyx_v_name, PyObject *__pyx_v_expiration); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_9ValueType_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7opendht_5_core_ValueType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_9ValueType_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7opendht_5_core_ValueType *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7opendht_5_core_11NodeSetIter___init__(struct __pyx_obj_7opendht_5_core_NodeSetIter *__pyx_v_self, struct __pyx_obj_7opendht_5_core_NodeSet *__pyx_v_s); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_11NodeSetIter_2__next__(struct __pyx_obj_7opendht_5_core_NodeSetIter *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_11NodeSetIter_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7opendht_5_core_NodeSetIter *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_11NodeSetIter_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7opendht_5_core_NodeSetIter *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_7NodeSet_size(struct __pyx_obj_7opendht_5_core_NodeSet *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_7NodeSet_2insert(struct __pyx_obj_7opendht_5_core_NodeSet *__pyx_v_self, struct __pyx_obj_7opendht_5_core_NodeEntry *__pyx_v_l); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_7NodeSet_4extend(struct __pyx_obj_7opendht_5_core_NodeSet *__pyx_v_self, PyObject *__pyx_v_li); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_7NodeSet_6first(struct __pyx_obj_7opendht_5_core_NodeSet *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_7NodeSet_8last(struct __pyx_obj_7opendht_5_core_NodeSet *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_7NodeSet_10__str__(struct __pyx_obj_7opendht_5_core_NodeSet *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_7NodeSet_12__iter__(struct __pyx_obj_7opendht_5_core_NodeSet *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_7NodeSet_14__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7opendht_5_core_NodeSet *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_7NodeSet_16__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7opendht_5_core_NodeSet *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_pf_7opendht_5_core_10PrivateKey_getId(struct __pyx_obj_7opendht_5_core_PrivateKey *__pyx_v_self); /* proto */
static struct __pyx_obj_7opendht_5_core_PkId *__pyx_pf_7opendht_5_core_10PrivateKey_2getLongId(struct __pyx_obj_7opendht_5_core_PrivateKey *__pyx_v_self); /* proto */
static struct __pyx_obj_7opendht_5_core_PublicKey *__pyx_pf_7opendht_5_core_10PrivateKey_4getPublicKey(struct __pyx_obj_7opendht_5_core_PrivateKey *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_10PrivateKey_6decrypt(struct __pyx_obj_7opendht_5_core_PrivateKey *__pyx_v_self, PyObject *__pyx_v_dat); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_10PrivateKey_8sign(struct __pyx_obj_7opendht_5_core_PrivateKey *__pyx_v_self, PyObject *__pyx_v_dat); /* proto */
static struct __pyx_obj_7opendht_5_core_PrivateKey *__pyx_pf_7opendht_5_core_10PrivateKey_10generate(void); /* proto */
static struct __pyx_obj_7opendht_5_core_PrivateKey *__pyx_pf_7opendht_5_core_10PrivateKey_12generateEC(void); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_10PrivateKey_14__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7opendht_5_core_PrivateKey *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_10PrivateKey_16__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7opendht_5_core_PrivateKey *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_pf_7opendht_5_core_9PublicKey_getId(struct __pyx_obj_7opendht_5_core_PublicKey *__pyx_v_self); /* proto */
static struct __pyx_obj_7opendht_5_core_PkId *__pyx_pf_7opendht_5_core_9PublicKey_2getLongId(struct __pyx_obj_7opendht_5_core_PublicKey *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_9PublicKey_4encrypt(struct __pyx_obj_7opendht_5_core_PublicKey *__pyx_v_self, PyObject *__pyx_v_dat); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_9PublicKey_6checkSignature(struct __pyx_obj_7opendht_5_core_PublicKey *__pyx_v_self, PyObject *__pyx_v_dat, PyObject *__pyx_v_signature); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_9PublicKey_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7opendht_5_core_PublicKey *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_9PublicKey_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7opendht_5_core_PublicKey *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7opendht_5_core_11Certificate___init__(struct __pyx_obj_7opendht_5_core_Certificate *__pyx_v_self, PyObject *__pyx_v_dat); /* proto */
static struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_pf_7opendht_5_core_11Certificate_2getId(struct __pyx_obj_7opendht_5_core_Certificate *__pyx_v_self); /* proto */
static struct __pyx_obj_7opendht_5_core_PkId *__pyx_pf_7opendht_5_core_11Certificate_4getLongId(struct __pyx_obj_7opendht_5_core_Certificate *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_11Certificate_6toString(struct __pyx_obj_7opendht_5_core_Certificate *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_11Certificate_8getName(struct __pyx_obj_7opendht_5_core_Certificate *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_11Certificate_10revoke(struct __pyx_obj_7opendht_5_core_Certificate *__pyx_v_self, struct __pyx_obj_7opendht_5_core_PrivateKey *__pyx_v_k, struct __pyx_obj_7opendht_5_core_Certificate *__pyx_v_c); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_11Certificate_12__bytes__(struct __pyx_obj_7opendht_5_core_Certificate *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_11Certificate_6issuer___get__(struct __pyx_obj_7opendht_5_core_Certificate *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_11Certificate_14generate(struct __pyx_obj_7opendht_5_core_PrivateKey *__pyx_v_k, PyObject *__pyx_v_name, struct __pyx_obj_7opendht_5_core_Identity *__pyx_v_i, bool __pyx_v_is_ca); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_11Certificate_16__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7opendht_5_core_Certificate *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_11Certificate_18__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7opendht_5_core_Certificate *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7opendht_5_core_12VerifyResult___bool__(struct __pyx_obj_7opendht_5_core_VerifyResult *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_12VerifyResult_2__str(struct __pyx_obj_7opendht_5_core_VerifyResult *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_12VerifyResult_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7opendht_5_core_VerifyResult *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_12VerifyResult_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7opendht_5_core_VerifyResult *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_9TrustList_add(struct __pyx_obj_7opendht_5_core_TrustList *__pyx_v_self, struct __pyx_obj_7opendht_5_core_Certificate *__pyx_v_cert); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_9TrustList_2remove(struct __pyx_obj_7opendht_5_core_TrustList *__pyx_v_self, struct __pyx_obj_7opendht_5_core_Certificate *__pyx_v_cert); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_9TrustList_4verify(struct __pyx_obj_7opendht_5_core_TrustList *__pyx_v_self, struct __pyx_obj_7opendht_5_core_Certificate *__pyx_v_cert); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_9TrustList_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7opendht_5_core_TrustList *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_9TrustList_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7opendht_5_core_TrustList *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_11ListenToken___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7opendht_5_core_ListenToken *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_11ListenToken_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7opendht_5_core_ListenToken *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7opendht_5_core_8Identity___init__(struct __pyx_obj_7opendht_5_core_Identity *__pyx_v_self, struct __pyx_obj_7opendht_5_core_PrivateKey *__pyx_v_k, struct __pyx_obj_7opendht_5_core_Certificate *__pyx_v_c); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_8Identity_2generate(PyObject *__pyx_v_name, struct __pyx_obj_7opendht_5_core_Identity *__pyx_v_ca, unsigned int __pyx_v_bits); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_8Identity_9publickey___get__(struct __pyx_obj_7opendht_5_core_Identity *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_8Identity_11certificate___get__(struct __pyx_obj_7opendht_5_core_Identity *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_8Identity_3key___get__(struct __pyx_obj_7opendht_5_core_Identity *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_8Identity_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7opendht_5_core_Identity *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_8Identity_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7opendht_5_core_Identity *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_2aesEncrypt(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_password); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_4aesDecrypt(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_password); /* proto */
static int __pyx_pf_7opendht_5_core_9DhtConfig___init__(struct __pyx_obj_7opendht_5_core_DhtConfig *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_9DhtConfig_2setIdentity(struct __pyx_obj_7opendht_5_core_DhtConfig *__pyx_v_self, struct __pyx_obj_7opendht_5_core_Identity *__pyx_v_id); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_9DhtConfig_4setBootstrapMode(struct __pyx_obj_7opendht_5_core_DhtConfig *__pyx_v_self, bool __pyx_v_bootstrap); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_9DhtConfig_6setNodeId(struct __pyx_obj_7opendht_5_core_DhtConfig *__pyx_v_self, struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_v_id); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_9DhtConfig_8setNetwork(struct __pyx_obj_7opendht_5_core_DhtConfig *__pyx_v_self, unsigned int __pyx_v_netid); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_9DhtConfig_10setMaintainStorage(struct __pyx_obj_7opendht_5_core_DhtConfig *__pyx_v_self, bool __pyx_v_maintain_storage); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_9DhtConfig_12setRateLimit(struct __pyx_obj_7opendht_5_core_DhtConfig *__pyx_v_self, Py_ssize_t __pyx_v_max_req_per_sec, Py_ssize_t __pyx_v_max_peer_req_per_sec); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_9DhtConfig_14setProxyInfo(struct __pyx_obj_7opendht_5_core_DhtConfig *__pyx_v_self, PyObject *__pyx_v_proxy_server, PyObject *__pyx_v_push_node_id, PyObject *__pyx_v_push_token, PyObject *__pyx_v_push_topic, PyObject *__pyx_v_push_platform, PyObject *__pyx_v_user_agent, struct __pyx_obj_7opendht_5_core_Certificate *__pyx_v_server_ca); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_9DhtConfig_16setPeerDiscovery(struct __pyx_obj_7opendht_5_core_DhtConfig *__pyx_v_self, bool __pyx_v_peer_discovery, bool __pyx_v_peer_publish); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_9DhtConfig_18setBound(struct __pyx_obj_7opendht_5_core_DhtConfig *__pyx_v_self, struct __pyx_obj_7opendht_5_core_SockAddr *__pyx_v_bind4, struct __pyx_obj_7opendht_5_core_SockAddr *__pyx_v_bind6); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_9DhtConfig_20__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7opendht_5_core_DhtConfig *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_9DhtConfig_22__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7opendht_5_core_DhtConfig *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7opendht_5_core_9DhtRunner___cinit__(struct __pyx_obj_7opendht_5_core_DhtRunner *__pyx_v_self); /* proto */
static struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_pf_7opendht_5_core_9DhtRunner_2getId(struct __pyx_obj_7opendht_5_core_DhtRunner *__pyx_v_self); /* proto */
static struct __pyx_obj_7opendht_5_core_PublicKey *__pyx_pf_7opendht_5_core_9DhtRunner_4getPublicKey(struct __pyx_obj_7opendht_5_core_DhtRunner *__pyx_v_self); /* proto */
static struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_pf_7opendht_5_core_9DhtRunner_6getNodeId(struct __pyx_obj_7opendht_5_core_DhtRunner *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_9DhtRunner_4ping_tmp_done(PyObject *__pyx_self, PyObject *__pyx_v_ok_ret); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_9DhtRunner_8ping(struct __pyx_obj_7opendht_5_core_DhtRunner *__pyx_v_self, struct __pyx_obj_7opendht_5_core_SockAddr *__pyx_v_addr, PyObject *__pyx_v_done_cb); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_9DhtRunner_10bootstrap(struct __pyx_obj_7opendht_5_core_DhtRunner *__pyx_v_self, PyObject *__pyx_v_host, PyObject *__pyx_v_port); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_9DhtRunner_12run(struct __pyx_obj_7opendht_5_core_DhtRunner *__pyx_v_self, struct __pyx_obj_7opendht_5_core_Identity *__pyx_v_id, CYTHON_UNUSED PyObject *__pyx_v_is_bootstrap, __pyx_t_11opendht_cpp_in_port_t __pyx_v_port, PyObject *__pyx_v_ipv4, PyObject *__pyx_v_ipv6, struct __pyx_obj_7opendht_5_core_DhtConfig *__pyx_v_config); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_9DhtRunner_14join(struct __pyx_obj_7opendht_5_core_DhtRunner *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_9DhtRunner_16shutdown(struct __pyx_obj_7opendht_5_core_DhtRunner *__pyx_v_self, PyObject *__pyx_v_shutdown_cb); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_9DhtRunner_18registerType(struct __pyx_obj_7opendht_5_core_DhtRunner *__pyx_v_self, struct __pyx_obj_7opendht_5_core_ValueType *__pyx_v_type); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_9DhtRunner_20enableLogging(struct __pyx_obj_7opendht_5_core_DhtRunner *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_9DhtRunner_22disableLogging(struct __pyx_obj_7opendht_5_core_DhtRunner *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_9DhtRunner_24enableFileLogging(struct __pyx_obj_7opendht_5_core_DhtRunner *__pyx_v_self, PyObject *__pyx_v_path); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_9DhtRunner_26isRunning(struct __pyx_obj_7opendht_5_core_DhtRunner *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_9DhtRunner_28getBound(struct __pyx_obj_7opendht_5_core_DhtRunner *__pyx_v_self, __pyx_t_11opendht_cpp_sa_family_t __pyx_v_af); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_9DhtRunner_30getStorageLog(struct __pyx_obj_7opendht_5_core_DhtRunner *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_9DhtRunner_32getRoutingTablesLog(struct __pyx_obj_7opendht_5_core_DhtRunner *__pyx_v_self, __pyx_t_11opendht_cpp_sa_family_t __pyx_v_af); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_9DhtRunner_34getSearchesLog(struct __pyx_obj_7opendht_5_core_DhtRunner *__pyx_v_self, __pyx_t_11opendht_cpp_sa_family_t __pyx_v_af); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_9DhtRunner_36getNodeMessageStats(struct __pyx_obj_7opendht_5_core_DhtRunner *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_9DhtRunner_3get_tmp_get(PyObject *__pyx_self, PyObject *__pyx_v_v); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_9DhtRunner_3get_2tmp_done(PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_ok, CYTHON_UNUSED PyObject *__pyx_v_nodes); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_9DhtRunner_38get(struct __pyx_obj_7opendht_5_core_DhtRunner *__pyx_v_self, struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_v_key, PyObject *__pyx_v_get_cb, PyObject *__pyx_v_done_cb, PyObject *__pyx_v_filter, struct __pyx_obj_7opendht_5_core_Where *__pyx_v_where); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_9DhtRunner_3put_tmp_done(PyObject *__pyx_self, PyObject *__pyx_v_ok_ret, CYTHON_UNUSED PyObject *__pyx_v_nodes); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_9DhtRunner_40put(struct __pyx_obj_7opendht_5_core_DhtRunner *__pyx_v_self, struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_v_key, struct __pyx_obj_7opendht_5_core_Value *__pyx_v_val, PyObject *__pyx_v_done_cb, PyObject *__pyx_v_permanent); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_9DhtRunner_9putSigned_tmp_done(PyObject *__pyx_self, PyObject *__pyx_v_ok_ret, CYTHON_UNUSED PyObject *__pyx_v_nodes); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_9DhtRunner_42putSigned(struct __pyx_obj_7opendht_5_core_DhtRunner *__pyx_v_self, struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_v_key, struct __pyx_obj_7opendht_5_core_Value *__pyx_v_val, PyObject *__pyx_v_done_cb, PyObject *__pyx_v_permanent); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_9DhtRunner_12putEncrypted_tmp_done(PyObject *__pyx_self, PyObject *__pyx_v_ok_ret, CYTHON_UNUSED PyObject *__pyx_v_nodes); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_9DhtRunner_44putEncrypted(struct __pyx_obj_7opendht_5_core_DhtRunner *__pyx_v_self, struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_v_key, struct __pyx_obj_7opendht_5_core_Value *__pyx_v_val, PyObject *__pyx_v_to, PyObject *__pyx_v_done_cb, bool __pyx_v_permanent); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_9DhtRunner_46cancelPut(struct __pyx_obj_7opendht_5_core_DhtRunner *__pyx_v_self, struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_v_key, struct __pyx_obj_7opendht_5_core_Value *__pyx_v_val); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_9DhtRunner_48listen(struct __pyx_obj_7opendht_5_core_DhtRunner *__pyx_v_self, struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_v_key, PyObject *__pyx_v_value_cb); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_9DhtRunner_50cancelListen(struct __pyx_obj_7opendht_5_core_DhtRunner *__pyx_v_self, struct __pyx_obj_7opendht_5_core_ListenToken *__pyx_v_token); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_9DhtRunner_52__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7opendht_5_core_DhtRunner *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_9DhtRunner_54__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7opendht_5_core_DhtRunner *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7opendht_5_core_10IndexValue___init__(struct __pyx_obj_7opendht_5_core_IndexValue *__pyx_v_self, struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_v_h, uint64_t __pyx_v_vid); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_10IndexValue_2__str__(struct __pyx_obj_7opendht_5_core_IndexValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_10IndexValue_4getKey(struct __pyx_obj_7opendht_5_core_IndexValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_10IndexValue_6getValueId(struct __pyx_obj_7opendht_5_core_IndexValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_10IndexValue_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7opendht_5_core_IndexValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_10IndexValue_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7opendht_5_core_IndexValue *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7opendht_5_core_3Pht___cinit__(struct __pyx_obj_7opendht_5_core_Pht *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_key_spec, struct __pyx_obj_7opendht_5_core_DhtRunner *__pyx_v_dht); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_3Pht_20MAX_NODE_ENTRY_COUNT___get__(CYTHON_UNUSED struct __pyx_obj_7opendht_5_core_Pht *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_3Pht_2lookup(struct __pyx_obj_7opendht_5_core_Pht *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_lookup_cb, PyObject *__pyx_v_done_cb); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_3Pht_4insert(struct __pyx_obj_7opendht_5_core_Pht *__pyx_v_self, PyObject *__pyx_v_key, struct __pyx_obj_7opendht_5_core_IndexValue *__pyx_v_value, PyObject *__pyx_v_done_cb); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_3Pht_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7opendht_5_core_Pht *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_3Pht_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7opendht_5_core_Pht *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_6__pyx_unpickle__WithID(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7opendht_5_core_8__pyx_unpickle__WithPk(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_tp_new__initialisation_7opendht_5_core__WithID(PyObject *o, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
); /*proto*/
static PyObject *__pyx_tp_new_vectorcall_7opendht_5_core__WithID(PyTypeObject *t, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
); /*proto*/
#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_new_7opendht_5_core__WithID(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
#endif
#if !CYTHON_VECTORCALL_TPNEW
#define __pyx_tp_new_7opendht_5_core__WithID __pyx_tp_new_vectorcall_7opendht_5_core__WithID
#endif
#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_vectorcall_7opendht_5_core__WithID(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames); /*proto*/
#endif
static PyObject *__pyx_tp_new__initialisation_7opendht_5_core__WithPk(PyObject *o, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
); /*proto*/
static PyObject *__pyx_tp_new_vectorcall_7opendht_5_core__WithPk(PyTypeObject *t, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
); /*proto*/
#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_new_7opendht_5_core__WithPk(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
#endif
#if !CYTHON_VECTORCALL_TPNEW
#define __pyx_tp_new_7opendht_5_core__WithPk __pyx_tp_new_vectorcall_7opendht_5_core__WithPk
#endif
#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_vectorcall_7opendht_5_core__WithPk(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames); /*proto*/
#endif
static PyObject *__pyx_tp_new__initialisation_7opendht_5_core_InfoHash(PyObject *o, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
); /*proto*/
static PyObject *__pyx_tp_new_vectorcall_7opendht_5_core_InfoHash(PyTypeObject *t, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
); /*proto*/
#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_new_7opendht_5_core_InfoHash(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
#endif
#if !CYTHON_VECTORCALL_TPNEW
#define __pyx_tp_new_7opendht_5_core_InfoHash __pyx_tp_new_vectorcall_7opendht_5_core_InfoHash
#endif
#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_vectorcall_7opendht_5_core_InfoHash(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames); /*proto*/
#endif
static PyObject *__pyx_tp_new__initialisation_7opendht_5_core_PkId(PyObject *o, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
); /*proto*/
static PyObject *__pyx_tp_new_vectorcall_7opendht_5_core_PkId(PyTypeObject *t, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
); /*proto*/
#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_new_7opendht_5_core_PkId(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
#endif
#if !CYTHON_VECTORCALL_TPNEW
#define __pyx_tp_new_7opendht_5_core_PkId __pyx_tp_new_vectorcall_7opendht_5_core_PkId
#endif
#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_vectorcall_7opendht_5_core_PkId(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames); /*proto*/
#endif
static PyObject *__pyx_tp_new__initialisation_7opendht_5_core_SockAddr(PyObject *o, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
); /*proto*/
static PyObject *__pyx_tp_new_vectorcall_7opendht_5_core_SockAddr(PyTypeObject *t, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
); /*proto*/
#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_new_7opendht_5_core_SockAddr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
#endif
#if !CYTHON_VECTORCALL_TPNEW
#define __pyx_tp_new_7opendht_5_core_SockAddr __pyx_tp_new_vectorcall_7opendht_5_core_SockAddr
#endif
#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_vectorcall_7opendht_5_core_SockAddr(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames); /*proto*/
#endif
static PyObject *__pyx_tp_new__initialisation_7opendht_5_core_Node(PyObject *o, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
); /*proto*/
static PyObject *__pyx_tp_new_vectorcall_7opendht_5_core_Node(PyTypeObject *t, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
); /*proto*/
#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_new_7opendht_5_core_Node(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
#endif
#if !CYTHON_VECTORCALL_TPNEW
#define __pyx_tp_new_7opendht_5_core_Node __pyx_tp_new_vectorcall_7opendht_5_core_Node
#endif
#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_vectorcall_7opendht_5_core_Node(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames); /*proto*/
#endif
static PyObject *__pyx_tp_new__initialisation_7opendht_5_core_NodeEntry(PyObject *o, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
); /*proto*/
static PyObject *__pyx_tp_new_vectorcall_7opendht_5_core_NodeEntry(PyTypeObject *t, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
); /*proto*/
#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_new_7opendht_5_core_NodeEntry(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
#endif
#if !CYTHON_VECTORCALL_TPNEW
#define __pyx_tp_new_7opendht_5_core_NodeEntry __pyx_tp_new_vectorcall_7opendht_5_core_NodeEntry
#endif
#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_vectorcall_7opendht_5_core_NodeEntry(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames); /*proto*/
#endif
static PyObject *__pyx_tp_new__initialisation_7opendht_5_core_Query(PyObject *o, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
); /*proto*/
static PyObject *__pyx_tp_new_vectorcall_7opendht_5_core_Query(PyTypeObject *t, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
); /*proto*/
#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_new_7opendht_5_core_Query(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
#endif
#if !CYTHON_VECTORCALL_TPNEW
#define __pyx_tp_new_7opendht_5_core_Query __pyx_tp_new_vectorcall_7opendht_5_core_Query
#endif
#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_vectorcall_7opendht_5_core_Query(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames); /*proto*/
#endif
static PyObject *__pyx_tp_new__initialisation_7opendht_5_core_Select(PyObject *o, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
); /*proto*/
static PyObject *__pyx_tp_new_vectorcall_7opendht_5_core_Select(PyTypeObject *t, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
); /*proto*/
#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_new_7opendht_5_core_Select(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
#endif
#if !CYTHON_VECTORCALL_TPNEW
#define __pyx_tp_new_7opendht_5_core_Select __pyx_tp_new_vectorcall_7opendht_5_core_Select
#endif
#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_vectorcall_7opendht_5_core_Select(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames); /*proto*/
#endif
static PyObject *__pyx_tp_new__initialisation_7opendht_5_core_Where(PyObject *o, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
); /*proto*/
static PyObject *__pyx_tp_new_vectorcall_7opendht_5_core_Where(PyTypeObject *t, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
); /*proto*/
#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_new_7opendht_5_core_Where(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
#endif
#if !CYTHON_VECTORCALL_TPNEW
#define __pyx_tp_new_7opendht_5_core_Where __pyx_tp_new_vectorcall_7opendht_5_core_Where
#endif
#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_vectorcall_7opendht_5_core_Where(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames); /*proto*/
#endif
static PyObject *__pyx_tp_new__initialisation_7opendht_5_core_Value(PyObject *o, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
); /*proto*/
static PyObject *__pyx_tp_new_vectorcall_7opendht_5_core_Value(PyTypeObject *t, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
); /*proto*/
#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_new_7opendht_5_core_Value(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
#endif
#if !CYTHON_VECTORCALL_TPNEW
#define __pyx_tp_new_7opendht_5_core_Value __pyx_tp_new_vectorcall_7opendht_5_core_Value
#endif
#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_vectorcall_7opendht_5_core_Value(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames); /*proto*/
#endif
#if CYTHON_VECTORCALL_TPNEW
static int __pyx_tp_init_7opendht_5_core_Value(PyObject *o, PyObject *args, PyObject *kwds); /*proto*/
#endif
#if !CYTHON_VECTORCALL_TPNEW
#define __pyx_tp_init_7opendht_5_core_Value __pyx_pw_7opendht_5_core_5Value_1__init__
#endif
static PyObject *__pyx_tp_new__initialisation_7opendht_5_core_ValueType(PyObject *o, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
); /*proto*/
static PyObject *__pyx_tp_new_vectorcall_7opendht_5_core_ValueType(PyTypeObject *t, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
); /*proto*/
#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_new_7opendht_5_core_ValueType(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
#endif
#if !CYTHON_VECTORCALL_TPNEW
#define __pyx_tp_new_7opendht_5_core_ValueType __pyx_tp_new_vectorcall_7opendht_5_core_ValueType
#endif
#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_vectorcall_7opendht_5_core_ValueType(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames); /*proto*/
#endif
#if CYTHON_VECTORCALL_TPNEW
static int __pyx_tp_init_7opendht_5_core_ValueType(PyObject *o, PyObject *args, PyObject *kwds); /*proto*/
#endif
#if !CYTHON_VECTORCALL_TPNEW
#define __pyx_tp_init_7opendht_5_core_ValueType __pyx_pw_7opendht_5_core_9ValueType_1__init__
#endif
static PyObject *__pyx_tp_new__initialisation_7opendht_5_core_NodeSetIter(PyObject *o, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
); /*proto*/
static PyObject *__pyx_tp_new_vectorcall_7opendht_5_core_NodeSetIter(PyTypeObject *t, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
); /*proto*/
#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_new_7opendht_5_core_NodeSetIter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
#endif
#if !CYTHON_VECTORCALL_TPNEW
#define __pyx_tp_new_7opendht_5_core_NodeSetIter __pyx_tp_new_vectorcall_7opendht_5_core_NodeSetIter
#endif
#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_vectorcall_7opendht_5_core_NodeSetIter(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames); /*proto*/
#endif
#if CYTHON_VECTORCALL_TPNEW
static int __pyx_tp_init_7opendht_5_core_NodeSetIter(PyObject *o, PyObject *args, PyObject *kwds); /*proto*/
#endif
#if !CYTHON_VECTORCALL_TPNEW
#define __pyx_tp_init_7opendht_5_core_NodeSetIter __pyx_pw_7opendht_5_core_11NodeSetIter_1__init__
#endif
static PyObject *__pyx_tp_new__initialisation_7opendht_5_core_NodeSet(PyObject *o, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
); /*proto*/
static PyObject *__pyx_tp_new_vectorcall_7opendht_5_core_NodeSet(PyTypeObject *t, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
); /*proto*/
#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_new_7opendht_5_core_NodeSet(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
#endif
#if !CYTHON_VECTORCALL_TPNEW
#define __pyx_tp_new_7opendht_5_core_NodeSet __pyx_tp_new_vectorcall_7opendht_5_core_NodeSet
#endif
#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_vectorcall_7opendht_5_core_NodeSet(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames); /*proto*/
#endif
static PyObject *__pyx_tp_new__initialisation_7opendht_5_core_PrivateKey(PyObject *o, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
); /*proto*/
static PyObject *__pyx_tp_new_vectorcall_7opendht_5_core_PrivateKey(PyTypeObject *t, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
); /*proto*/
#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_new_7opendht_5_core_PrivateKey(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
#endif
#if !CYTHON_VECTORCALL_TPNEW
#define __pyx_tp_new_7opendht_5_core_PrivateKey __pyx_tp_new_vectorcall_7opendht_5_core_PrivateKey
#endif
#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_vectorcall_7opendht_5_core_PrivateKey(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames); /*proto*/
#endif
static PyObject *__pyx_tp_new__initialisation_7opendht_5_core_PublicKey(PyObject *o, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
); /*proto*/
static PyObject *__pyx_tp_new_vectorcall_7opendht_5_core_PublicKey(PyTypeObject *t, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
); /*proto*/
#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_new_7opendht_5_core_PublicKey(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
#endif
#if !CYTHON_VECTORCALL_TPNEW
#define __pyx_tp_new_7opendht_5_core_PublicKey __pyx_tp_new_vectorcall_7opendht_5_core_PublicKey
#endif
#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_vectorcall_7opendht_5_core_PublicKey(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames); /*proto*/
#endif
static PyObject *__pyx_tp_new__initialisation_7opendht_5_core_Certificate(PyObject *o, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
); /*proto*/
static PyObject *__pyx_tp_new_vectorcall_7opendht_5_core_Certificate(PyTypeObject *t, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
); /*proto*/
#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_new_7opendht_5_core_Certificate(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
#endif
#if !CYTHON_VECTORCALL_TPNEW
#define __pyx_tp_new_7opendht_5_core_Certificate __pyx_tp_new_vectorcall_7opendht_5_core_Certificate
#endif
#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_vectorcall_7opendht_5_core_Certificate(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames); /*proto*/
#endif
#if CYTHON_VECTORCALL_TPNEW
static int __pyx_tp_init_7opendht_5_core_Certificate(PyObject *o, PyObject *args, PyObject *kwds); /*proto*/
#endif
#if !CYTHON_VECTORCALL_TPNEW
#define __pyx_tp_init_7opendht_5_core_Certificate __pyx_pw_7opendht_5_core_11Certificate_1__init__
#endif
static PyObject *__pyx_tp_new__initialisation_7opendht_5_core_VerifyResult(PyObject *o, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
); /*proto*/
static PyObject *__pyx_tp_new_vectorcall_7opendht_5_core_VerifyResult(PyTypeObject *t, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
); /*proto*/
#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_new_7opendht_5_core_VerifyResult(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
#endif
#if !CYTHON_VECTORCALL_TPNEW
#define __pyx_tp_new_7opendht_5_core_VerifyResult __pyx_tp_new_vectorcall_7opendht_5_core_VerifyResult
#endif
#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_vectorcall_7opendht_5_core_VerifyResult(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames); /*proto*/
#endif
static PyObject *__pyx_tp_new__initialisation_7opendht_5_core_TrustList(PyObject *o, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
); /*proto*/
static PyObject *__pyx_tp_new_vectorcall_7opendht_5_core_TrustList(PyTypeObject *t, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
); /*proto*/
#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_new_7opendht_5_core_TrustList(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
#endif
#if !CYTHON_VECTORCALL_TPNEW
#define __pyx_tp_new_7opendht_5_core_TrustList __pyx_tp_new_vectorcall_7opendht_5_core_TrustList
#endif
#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_vectorcall_7opendht_5_core_TrustList(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames); /*proto*/
#endif
static PyObject *__pyx_tp_new__initialisation_7opendht_5_core_ListenToken(PyObject *o, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
); /*proto*/
static PyObject *__pyx_tp_new_vectorcall_7opendht_5_core_ListenToken(PyTypeObject *t, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
); /*proto*/
#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_new_7opendht_5_core_ListenToken(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
#endif
#if !CYTHON_VECTORCALL_TPNEW
#define __pyx_tp_new_7opendht_5_core_ListenToken __pyx_tp_new_vectorcall_7opendht_5_core_ListenToken
#endif
#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_vectorcall_7opendht_5_core_ListenToken(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames); /*proto*/
#endif
static PyObject *__pyx_tp_new__initialisation_7opendht_5_core_Identity(PyObject *o, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
); /*proto*/
static PyObject *__pyx_tp_new_vectorcall_7opendht_5_core_Identity(PyTypeObject *t, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
); /*proto*/
#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_new_7opendht_5_core_Identity(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
#endif
#if !CYTHON_VECTORCALL_TPNEW
#define __pyx_tp_new_7opendht_5_core_Identity __pyx_tp_new_vectorcall_7opendht_5_core_Identity
#endif
#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_vectorcall_7opendht_5_core_Identity(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames); /*proto*/
#endif
#if CYTHON_VECTORCALL_TPNEW
static int __pyx_tp_init_7opendht_5_core_Identity(PyObject *o, PyObject *args, PyObject *kwds); /*proto*/
#endif
#if !CYTHON_VECTORCALL_TPNEW
#define __pyx_tp_init_7opendht_5_core_Identity __pyx_pw_7opendht_5_core_8Identity_1__init__
#endif
static PyObject *__pyx_tp_new__initialisation_7opendht_5_core_DhtConfig(PyObject *o, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
); /*proto*/
static PyObject *__pyx_tp_new_vectorcall_7opendht_5_core_DhtConfig(PyTypeObject *t, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
); /*proto*/
#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_new_7opendht_5_core_DhtConfig(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
#endif
#if !CYTHON_VECTORCALL_TPNEW
#define __pyx_tp_new_7opendht_5_core_DhtConfig __pyx_tp_new_vectorcall_7opendht_5_core_DhtConfig
#endif
#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_vectorcall_7opendht_5_core_DhtConfig(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames); /*proto*/
#endif
#if CYTHON_VECTORCALL_TPNEW
static int __pyx_tp_init_7opendht_5_core_DhtConfig(PyObject *o, PyObject *args, PyObject *kwds); /*proto*/
#endif
#if !CYTHON_VECTORCALL_TPNEW
#define __pyx_tp_init_7opendht_5_core_DhtConfig __pyx_pw_7opendht_5_core_9DhtConfig_1__init__
#endif
static PyObject *__pyx_tp_new__initialisation_7opendht_5_core_DhtRunner(PyObject *o, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
); /*proto*/
static PyObject *__pyx_tp_new_vectorcall_7opendht_5_core_DhtRunner(PyTypeObject *t, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
); /*proto*/
#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_new_7opendht_5_core_DhtRunner(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
#endif
#if !CYTHON_VECTORCALL_TPNEW
#define __pyx_tp_new_7opendht_5_core_DhtRunner __pyx_tp_new_vectorcall_7opendht_5_core_DhtRunner
#endif
#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_vectorcall_7opendht_5_core_DhtRunner(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames); /*proto*/
#endif
static PyObject *__pyx_tp_new__initialisation_7opendht_5_core_IndexValue(PyObject *o, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
); /*proto*/
static PyObject *__pyx_tp_new_vectorcall_7opendht_5_core_IndexValue(PyTypeObject *t, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
); /*proto*/
#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_new_7opendht_5_core_IndexValue(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
#endif
#if !CYTHON_VECTORCALL_TPNEW
#define __pyx_tp_new_7opendht_5_core_IndexValue __pyx_tp_new_vectorcall_7opendht_5_core_IndexValue
#endif
#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_vectorcall_7opendht_5_core_IndexValue(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames); /*proto*/
#endif
#if CYTHON_VECTORCALL_TPNEW
static int __pyx_tp_init_7opendht_5_core_IndexValue(PyObject *o, PyObject *args, PyObject *kwds); /*proto*/
#endif
#if !CYTHON_VECTORCALL_TPNEW
#define __pyx_tp_init_7opendht_5_core_IndexValue __pyx_pw_7opendht_5_core_10IndexValue_1__init__
#endif
static PyObject *__pyx_tp_new__initialisation_7opendht_5_core_Pht(PyObject *o, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
); /*proto*/
static PyObject *__pyx_tp_new_vectorcall_7opendht_5_core_Pht(PyTypeObject *t, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
); /*proto*/
#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_new_7opendht_5_core_Pht(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
#endif
#if !CYTHON_VECTORCALL_TPNEW
#define __pyx_tp_new_7opendht_5_core_Pht __pyx_tp_new_vectorcall_7opendht_5_core_Pht
#endif
#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_vectorcall_7opendht_5_core_Pht(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames); /*proto*/
#endif
static PyObject *__pyx_tp_new__initialisation_7opendht_5_core___pyx_scope_struct__ping(PyObject *o, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
); /*proto*/
static PyObject *__pyx_tp_new_vectorcall_7opendht_5_core___pyx_scope_struct__ping(PyTypeObject *t, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
); /*proto*/
#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_new_7opendht_5_core___pyx_scope_struct__ping(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
#endif
#if !CYTHON_VECTORCALL_TPNEW
#define __pyx_tp_new_7opendht_5_core___pyx_scope_struct__ping __pyx_tp_new_vectorcall_7opendht_5_core___pyx_scope_struct__ping
#endif
#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_vectorcall_7opendht_5_core___pyx_scope_struct__ping(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames); /*proto*/
#endif
static PyObject *__pyx_tp_new__initialisation_7opendht_5_core___pyx_scope_struct_1_get(PyObject *o, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
); /*proto*/
static PyObject *__pyx_tp_new_vectorcall_7opendht_5_core___pyx_scope_struct_1_get(PyTypeObject *t, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
); /*proto*/
#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_new_7opendht_5_core___pyx_scope_struct_1_get(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
#endif
#if !CYTHON_VECTORCALL_TPNEW
#define __pyx_tp_new_7opendht_5_core___pyx_scope_struct_1_get __pyx_tp_new_vectorcall_7opendht_5_core___pyx_scope_struct_1_get
#endif
#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_vectorcall_7opendht_5_core___pyx_scope_struct_1_get(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames); /*proto*/
#endif
static PyObject *__pyx_tp_new__initialisation_7opendht_5_core___pyx_scope_struct_2_put(PyObject *o, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
); /*proto*/
static PyObject *__pyx_tp_new_vectorcall_7opendht_5_core___pyx_scope_struct_2_put(PyTypeObject *t, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
); /*proto*/
#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_new_7opendht_5_core___pyx_scope_struct_2_put(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
#endif
#if !CYTHON_VECTORCALL_TPNEW
#define __pyx_tp_new_7opendht_5_core___pyx_scope_struct_2_put __pyx_tp_new_vectorcall_7opendht_5_core___pyx_scope_struct_2_put
#endif
#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_vectorcall_7opendht_5_core___pyx_scope_struct_2_put(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames); /*proto*/
#endif
static PyObject *__pyx_tp_new__initialisation_7opendht_5_core___pyx_scope_struct_3_putSigned(PyObject *o, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
); /*proto*/
static PyObject *__pyx_tp_new_vectorcall_7opendht_5_core___pyx_scope_struct_3_putSigned(PyTypeObject *t, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
); /*proto*/
#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_new_7opendht_5_core___pyx_scope_struct_3_putSigned(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
#endif
#if !CYTHON_VECTORCALL_TPNEW
#define __pyx_tp_new_7opendht_5_core___pyx_scope_struct_3_putSigned __pyx_tp_new_vectorcall_7opendht_5_core___pyx_scope_struct_3_putSigned
#endif
#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_vectorcall_7opendht_5_core___pyx_scope_struct_3_putSigned(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames); /*proto*/
#endif
static PyObject *__pyx_tp_new__initialisation_7opendht_5_core___pyx_scope_struct_4_putEncrypted(PyObject *o, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
); /*proto*/
static PyObject *__pyx_tp_new_vectorcall_7opendht_5_core___pyx_scope_struct_4_putEncrypted(PyTypeObject *t, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
); /*proto*/
#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_new_7opendht_5_core___pyx_scope_struct_4_putEncrypted(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
#endif
#if !CYTHON_VECTORCALL_TPNEW
#define __pyx_tp_new_7opendht_5_core___pyx_scope_struct_4_putEncrypted __pyx_tp_new_vectorcall_7opendht_5_core___pyx_scope_struct_4_putEncrypted
#endif
#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_vectorcall_7opendht_5_core___pyx_scope_struct_4_putEncrypted(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames); /*proto*/
#endif
static PyObject *__pyx_tp_new__initialisation___pyx_scope_struct____Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_(PyObject *o, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
); /*proto*/
static PyObject *__pyx_tp_new_vectorcall___pyx_scope_struct____Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_(PyTypeObject *t, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
); /*proto*/
#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_new___pyx_scope_struct____Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
#endif
#if !CYTHON_VECTORCALL_TPNEW
#define __pyx_tp_new___pyx_scope_struct____Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_ __pyx_tp_new_vectorcall___pyx_scope_struct____Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_
#endif
#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_vectorcall___pyx_scope_struct____Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames); /*proto*/
#endif
/* #### Code section: late_includes ### */
/* #### Code section: module_state ### */
/* SmallCodeConfig */
#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

#ifdef __cplusplus
namespace {
  #endif
  typedef struct {
    PyObject *__pyx_d;
    PyObject *__pyx_b;
    PyObject *__pyx_cython_runtime;
    PyObject *__pyx_empty_tuple;
    PyObject *__pyx_empty_bytes;
    PyObject *__pyx_empty_unicode;
    PyTypeObject *__pyx_ptype_7cpython_4type_type;
    PyTypeObject *__pyx_ptype_7cpython_4bool_bool;
    PyTypeObject *__pyx_ptype_7cpython_7complex_complex;
    PyObject *__pyx_type_7opendht_5_core__WithID;
    PyObject *__pyx_type_7opendht_5_core__WithPk;
    PyObject *__pyx_type_7opendht_5_core_InfoHash;
    PyObject *__pyx_type_7opendht_5_core_PkId;
    PyObject *__pyx_type_7opendht_5_core_SockAddr;
    PyObject *__pyx_type_7opendht_5_core_Node;
    PyObject *__pyx_type_7opendht_5_core_NodeEntry;
    PyObject *__pyx_type_7opendht_5_core_Query;
    PyObject *__pyx_type_7opendht_5_core_Select;
    PyObject *__pyx_type_7opendht_5_core_Where;
    PyObject *__pyx_type_7opendht_5_core_Value;
    PyObject *__pyx_type_7opendht_5_core_ValueType;
    PyObject *__pyx_type_7opendht_5_core_NodeSetIter;
    PyObject *__pyx_type_7opendht_5_core_NodeSet;
    PyObject *__pyx_type_7opendht_5_core_PrivateKey;
    PyObject *__pyx_type_7opendht_5_core_PublicKey;
    PyObject *__pyx_type_7opendht_5_core_Certificate;
    PyObject *__pyx_type_7opendht_5_core_VerifyResult;
    PyObject *__pyx_type_7opendht_5_core_TrustList;
    PyObject *__pyx_type_7opendht_5_core_ListenToken;
    PyObject *__pyx_type_7opendht_5_core_Identity;
    PyObject *__pyx_type_7opendht_5_core_DhtConfig;
    PyObject *__pyx_type_7opendht_5_core_DhtRunner;
    PyObject *__pyx_type_7opendht_5_core_IndexValue;
    PyObject *__pyx_type_7opendht_5_core_Pht;
    PyObject *__pyx_type_7opendht_5_core___pyx_scope_struct__ping;
    PyObject *__pyx_type_7opendht_5_core___pyx_scope_struct_1_get;
    PyObject *__pyx_type_7opendht_5_core___pyx_scope_struct_2_put;
    PyObject *__pyx_type_7opendht_5_core___pyx_scope_struct_3_putSigned;
    PyObject *__pyx_type_7opendht_5_core___pyx_scope_struct_4_putEncrypted;
    PyObject *__pyx_scope_struct____Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_;
    PyTypeObject *__pyx_ptype_7opendht_5_core__WithID;
    PyTypeObject *__pyx_ptype_7opendht_5_core__WithPk;
    PyTypeObject *__pyx_ptype_7opendht_5_core_InfoHash;
    PyTypeObject *__pyx_ptype_7opendht_5_core_PkId;
    PyTypeObject *__pyx_ptype_7opendht_5_core_SockAddr;
    PyTypeObject *__pyx_ptype_7opendht_5_core_Node;
    PyTypeObject *__pyx_ptype_7opendht_5_core_NodeEntry;
    PyTypeObject *__pyx_ptype_7opendht_5_core_Query;
    PyTypeObject *__pyx_ptype_7opendht_5_core_Select;
    PyTypeObject *__pyx_ptype_7opendht_5_core_Where;
    PyTypeObject *__pyx_ptype_7opendht_5_core_Value;
    PyTypeObject *__pyx_ptype_7opendht_5_core_ValueType;
    PyTypeObject *__pyx_ptype_7opendht_5_core_NodeSetIter;
    PyTypeObject *__pyx_ptype_7opendht_5_core_NodeSet;
    PyTypeObject *__pyx_ptype_7opendht_5_core_PrivateKey;
    PyTypeObject *__pyx_ptype_7opendht_5_core_PublicKey;
    PyTypeObject *__pyx_ptype_7opendht_5_core_Certificate;
    PyTypeObject *__pyx_ptype_7opendht_5_core_VerifyResult;
    PyTypeObject *__pyx_ptype_7opendht_5_core_TrustList;
    PyTypeObject *__pyx_ptype_7opendht_5_core_ListenToken;
    PyTypeObject *__pyx_ptype_7opendht_5_core_Identity;
    PyTypeObject *__pyx_ptype_7opendht_5_core_DhtConfig;
    PyTypeObject *__pyx_ptype_7opendht_5_core_DhtRunner;
    PyTypeObject *__pyx_ptype_7opendht_5_core_IndexValue;
    PyTypeObject *__pyx_ptype_7opendht_5_core_Pht;
    PyTypeObject *__pyx_ptype_7opendht_5_core___pyx_scope_struct__ping;
    PyTypeObject *__pyx_ptype_7opendht_5_core___pyx_scope_struct_1_get;
    PyTypeObject *__pyx_ptype_7opendht_5_core___pyx_scope_struct_2_put;
    PyTypeObject *__pyx_ptype_7opendht_5_core___pyx_scope_struct_3_putSigned;
    PyTypeObject *__pyx_ptype_7opendht_5_core___pyx_scope_struct_4_putEncrypted;
    PyTypeObject *__pyx_ptype___pyx_scope_struct____Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_;
    __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_items;
    __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop;
    __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_values;
    struct __pyx_obj_7opendht_5_core_Identity *__pyx_k__8;
    struct __pyx_obj_7opendht_5_core_Identity *__pyx_k__9;
    struct __pyx_obj_7opendht_5_core_Certificate *__pyx_k__10;
    struct __pyx_obj_7opendht_5_core_DhtConfig *__pyx_k__11;
    PyObject *__pyx_tuple[9];
    PyObject *__pyx_codeobj_tab[168];
    PyObject *__pyx_string_tab[599];
    PyObject *__pyx_number_tab[4];
/* #### Code section: module_state_contents ### */
/* CommonTypesMetaclass.module_state_decls */
PyTypeObject *__pyx_CommonTypesMetaclassType;

/* CachedMethodType.module_state_decls */
#if CYTHON_COMPILING_IN_LIMITED_API
PyObject *__Pyx_CachedMethodType;
#endif

/* CythonFunctionPerModule.module_state_decls */
PyTypeObject *__pyx_CyFunctionType;

/* PyFrozenDict.module_state_decls */
#if CYTHON_COMPILING_IN_LIMITED_API
PyObject *__Pyx_PyFrozenDictType;
#endif


#if CYTHON_USE_FREELISTS
struct __pyx_obj_7opendht_5_core___pyx_scope_struct__ping *__pyx_freelist_7opendht_5_core___pyx_scope_struct__ping[8];
int __pyx_freecount_7opendht_5_core___pyx_scope_struct__ping;
#endif

#if CYTHON_USE_FREELISTS
struct __pyx_obj_7opendht_5_core___pyx_scope_struct_1_get *__pyx_freelist_7opendht_5_core___pyx_scope_struct_1_get[8];
int __pyx_freecount_7opendht_5_core___pyx_scope_struct_1_get;
#endif

#if CYTHON_USE_FREELISTS
struct __pyx_obj_7opendht_5_core___pyx_scope_struct_2_put *__pyx_freelist_7opendht_5_core___pyx_scope_struct_2_put[8];
int __pyx_freecount_7opendht_5_core___pyx_scope_struct_2_put;
#endif

#if CYTHON_USE_FREELISTS
struct __pyx_obj_7opendht_5_core___pyx_scope_struct_3_putSigned *__pyx_freelist_7opendht_5_core___pyx_scope_struct_3_putSigned[8];
int __pyx_freecount_7opendht_5_core___pyx_scope_struct_3_putSigned;
#endif

#if CYTHON_USE_FREELISTS
struct __pyx_obj_7opendht_5_core___pyx_scope_struct_4_putEncrypted *__pyx_freelist_7opendht_5_core___pyx_scope_struct_4_putEncrypted[8];
int __pyx_freecount_7opendht_5_core___pyx_scope_struct_4_putEncrypted;
#endif

#if CYTHON_USE_FREELISTS
struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_ *__pyx_freelist___pyx_scope_struct____Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_[8];
int __pyx_freecount___pyx_scope_struct____Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_;
#endif
/* CodeObjectCache.module_state_decls */
struct __Pyx_CodeObjectCache __pyx_code_cache;

/* #### Code section: module_state_end ### */
} __pyx_mstatetype;
#ifdef __cplusplus
} /* anonymous namespace */
#endif

#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_global (__Pyx_PyModule_GetState(__Pyx_State_FindModule(&__pyx_moduledef)))

#define __pyx_m (__Pyx_State_FindModule(&__pyx_moduledef))
#else
static __pyx_mstatetype __pyx_mstate_global_static =
#ifdef __cplusplus
    {};
#else
    {0};
#endif
static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_static;
#endif
/* #### Code section: constant_name_defines ### */
#define __pyx_kp_u__5 __pyx_string_tab[0]
#define __pyx_kp_u__7 __pyx_string_tab[1]
#define __pyx_kp_u__6 __pyx_string_tab[2]
#define __pyx_kp_u__3 __pyx_string_tab[3]
#define __pyx_kp_u__4 __pyx_string_tab[4]
#define __pyx_kp_u_to_must_be_PublicKey_or_PkId __pyx_string_tab[5]
#define __pyx_kp_u_to_must_be_provided __pyx_string_tab[6]
#define __pyx_kp_u__12 __pyx_string_tab[7]
#define __pyx_kp_u_tree_fragment __pyx_string_tab[8]
#define __pyx_kp_u__14 __pyx_string_tab[9]
#define __pyx_kp_u__13 __pyx_string_tab[10]
#define __pyx_kp_u__15 __pyx_string_tab[11]
#define __pyx_kp_u__2 __pyx_string_tab[12]
#define __pyx_kp_u_ __pyx_string_tab[13]
#define __pyx_kp_u_Certificate_is_not_initialized __pyx_string_tab[14]
#define __pyx_kp_u_DhtRunner_is_not_initialized __pyx_string_tab[15]
#define __pyx_kp_u_Failed_to_initialize_GnuTLS __pyx_string_tab[16]
#define __pyx_kp_u_Note_that_Cython_is_deliberately __pyx_string_tab[17]
#define __pyx_kp_u_PrivateKey_is_not_initialized __pyx_string_tab[18]
#define __pyx_kp_u_PublicKey_is_not_initialized __pyx_string_tab[19]
#define __pyx_kp_u_add_note __pyx_string_tab[20]
#define __pyx_kp_u_cfunc_to_py __pyx_string_tab[21]
#define __pyx_kp_u_disable __pyx_string_tab[22]
#define __pyx_kp_u_enable __pyx_string_tab[23]
#define __pyx_kp_u_expiration_argument_must_be_of_t __pyx_string_tab[24]
#define __pyx_kp_u_gc __pyx_string_tab[25]
#define __pyx_kp_u_isenabled __pyx_string_tab[26]
#define __pyx_kp_u_no_default___reduce___due_to_non __pyx_string_tab[27]
#define __pyx_kp_u_opendht_pyx __pyx_string_tab[28]
#define __pyx_kp_u_self__addr_cannot_be_converted_t __pyx_string_tab[29]
#define __pyx_kp_u_self__cert_cannot_be_converted_t __pyx_string_tab[30]
#define __pyx_kp_u_self__config_cannot_be_converted __pyx_string_tab[31]
#define __pyx_kp_u_self__curIter_self__nodes_cannot __pyx_string_tab[32]
#define __pyx_kp_u_self__h_self__t_cannot_be_conver __pyx_string_tab[33]
#define __pyx_kp_u_self__id_cannot_be_converted_to __pyx_string_tab[34]
#define __pyx_kp_u_self__key_cannot_be_converted_to __pyx_string_tab[35]
#define __pyx_kp_u_self__node_cannot_be_converted_t __pyx_string_tab[36]
#define __pyx_kp_u_self__nodes_cannot_be_converted __pyx_string_tab[37]
#define __pyx_kp_u_self__result_cannot_be_converted __pyx_string_tab[38]
#define __pyx_kp_u_self__trust_cannot_be_converted __pyx_string_tab[39]
#define __pyx_kp_u_self__v_cannot_be_converted_to_a __pyx_string_tab[40]
#define __pyx_kp_u_self__value_cannot_be_converted __pyx_string_tab[41]
#define __pyx_kp_u_utf_8 __pyx_string_tab[42]
#define __pyx_n_u_Certificate __pyx_string_tab[43]
#define __pyx_n_u_Certificate___bytes __pyx_string_tab[44]
#define __pyx_n_u_Certificate___reduce_cython __pyx_string_tab[45]
#define __pyx_n_u_Certificate___setstate_cython __pyx_string_tab[46]
#define __pyx_n_u_Certificate_generate __pyx_string_tab[47]
#define __pyx_n_u_Certificate_getId __pyx_string_tab[48]
#define __pyx_n_u_Certificate_getLongId __pyx_string_tab[49]
#define __pyx_n_u_Certificate_getName __pyx_string_tab[50]
#define __pyx_n_u_Certificate_revoke __pyx_string_tab[51]
#define __pyx_n_u_Certificate_toString __pyx_string_tab[52]
#define __pyx_n_u_Condition __pyx_string_tab[53]
#define __pyx_n_u_DhtConfig __pyx_string_tab[54]
#define __pyx_n_u_DhtConfig___reduce_cython __pyx_string_tab[55]
#define __pyx_n_u_DhtConfig___setstate_cython __pyx_string_tab[56]
#define __pyx_n_u_DhtConfig_setBootstrapMode __pyx_string_tab[57]
#define __pyx_n_u_DhtConfig_setBound __pyx_string_tab[58]
#define __pyx_n_u_DhtConfig_setIdentity __pyx_string_tab[59]
#define __pyx_n_u_DhtConfig_setMaintainStorage __pyx_string_tab[60]
#define __pyx_n_u_DhtConfig_setNetwork __pyx_string_tab[61]
#define __pyx_n_u_DhtConfig_setNodeId __pyx_string_tab[62]
#define __pyx_n_u_DhtConfig_setPeerDiscovery __pyx_string_tab[63]
#define __pyx_n_u_DhtConfig_setProxyInfo __pyx_string_tab[64]
#define __pyx_n_u_DhtConfig_setRateLimit __pyx_string_tab[65]
#define __pyx_n_u_DhtRunner __pyx_string_tab[66]
#define __pyx_n_u_DhtRunner___reduce_cython __pyx_string_tab[67]
#define __pyx_n_u_DhtRunner___setstate_cython __pyx_string_tab[68]
#define __pyx_n_u_DhtRunner_bootstrap __pyx_string_tab[69]
#define __pyx_n_u_DhtRunner_cancelListen __pyx_string_tab[70]
#define __pyx_n_u_DhtRunner_cancelPut __pyx_string_tab[71]
#define __pyx_n_u_DhtRunner_disableLogging __pyx_string_tab[72]
#define __pyx_n_u_DhtRunner_enableFileLogging __pyx_string_tab[73]
#define __pyx_n_u_DhtRunner_enableLogging __pyx_string_tab[74]
#define __pyx_n_u_DhtRunner_get __pyx_string_tab[75]
#define __pyx_n_u_DhtRunner_getBound __pyx_string_tab[76]
#define __pyx_n_u_DhtRunner_getId __pyx_string_tab[77]
#define __pyx_n_u_DhtRunner_getNodeId __pyx_string_tab[78]
#define __pyx_n_u_DhtRunner_getNodeMessageStats __pyx_string_tab[79]
#define __pyx_n_u_DhtRunner_getPublicKey __pyx_string_tab[80]
#define __pyx_n_u_DhtRunner_getRoutingTablesLog __pyx_string_tab[81]
#define __pyx_n_u_DhtRunner_getSearchesLog __pyx_string_tab[82]
#define __pyx_n_u_DhtRunner_getStorageLog __pyx_string_tab[83]
#define __pyx_n_u_DhtRunner_isRunning __pyx_string_tab[84]
#define __pyx_n_u_DhtRunner_join __pyx_string_tab[85]
#define __pyx_n_u_DhtRunner_listen __pyx_string_tab[86]
#define __pyx_n_u_DhtRunner_ping __pyx_string_tab[87]
#define __pyx_n_u_DhtRunner_put __pyx_string_tab[88]
#define __pyx_n_u_DhtRunner_putEncrypted __pyx_string_tab[89]
#define __pyx_n_u_DhtRunner_putSigned __pyx_string_tab[90]
#define __pyx_n_u_DhtRunner_registerType __pyx_string_tab[91]
#define __pyx_n_u_DhtRunner_run __pyx_string_tab[92]
#define __pyx_n_u_DhtRunner_shutdown __pyx_string_tab[93]
#define __pyx_n_u_Identity __pyx_string_tab[94]
#define __pyx_n_u_Identity___reduce_cython __pyx_string_tab[95]
#define __pyx_n_u_Identity___setstate_cython __pyx_string_tab[96]
#define __pyx_n_u_Identity_generate __pyx_string_tab[97]
#define __pyx_n_u_IndexValue __pyx_string_tab[98]
#define __pyx_n_u_IndexValue___reduce_cython __pyx_string_tab[99]
#define __pyx_n_u_IndexValue___setstate_cython __pyx_string_tab[100]
#define __pyx_n_u_IndexValue_getKey __pyx_string_tab[101]
#define __pyx_n_u_IndexValue_getValueId __pyx_string_tab[102]
#define __pyx_n_u_InfoHash __pyx_string_tab[103]
#define __pyx_n_u_InfoHash___reduce_cython __pyx_string_tab[104]
#define __pyx_n_u_InfoHash___setstate_cython __pyx_string_tab[105]
#define __pyx_n_u_InfoHash_commonBits __pyx_string_tab[106]
#define __pyx_n_u_InfoHash_get __pyx_string_tab[107]
#define __pyx_n_u_InfoHash_getBit __pyx_string_tab[108]
#define __pyx_n_u_InfoHash_getId __pyx_string_tab[109]
#define __pyx_n_u_InfoHash_getRandom __pyx_string_tab[110]
#define __pyx_n_u_InfoHash_setBit __pyx_string_tab[111]
#define __pyx_n_u_InfoHash_toFloat __pyx_string_tab[112]
#define __pyx_n_u_InfoHash_toString __pyx_string_tab[113]
#define __pyx_n_u_ListenToken __pyx_string_tab[114]
#define __pyx_n_u_ListenToken___reduce_cython __pyx_string_tab[115]
#define __pyx_n_u_ListenToken___setstate_cython __pyx_string_tab[116]
#define __pyx_n_u_Node __pyx_string_tab[117]
#define __pyx_n_u_Node___reduce_cython __pyx_string_tab[118]
#define __pyx_n_u_Node___setstate_cython __pyx_string_tab[119]
#define __pyx_n_u_Node_getAddr __pyx_string_tab[120]
#define __pyx_n_u_Node_getId __pyx_string_tab[121]
#define __pyx_n_u_Node_isExpired __pyx_string_tab[122]
#define __pyx_n_u_NodeEntry __pyx_string_tab[123]
#define __pyx_n_u_NodeEntry___reduce_cython __pyx_string_tab[124]
#define __pyx_n_u_NodeEntry___setstate_cython __pyx_string_tab[125]
#define __pyx_n_u_NodeEntry_getId __pyx_string_tab[126]
#define __pyx_n_u_NodeEntry_getNode __pyx_string_tab[127]
#define __pyx_n_u_NodeSet __pyx_string_tab[128]
#define __pyx_n_u_NodeSet___reduce_cython __pyx_string_tab[129]
#define __pyx_n_u_NodeSet___setstate_cython __pyx_string_tab[130]
#define __pyx_n_u_NodeSet_extend __pyx_string_tab[131]
#define __pyx_n_u_NodeSet_first __pyx_string_tab[132]
#define __pyx_n_u_NodeSet_insert __pyx_string_tab[133]
#define __pyx_n_u_NodeSet_last __pyx_string_tab[134]
#define __pyx_n_u_NodeSet_size __pyx_string_tab[135]
#define __pyx_n_u_NodeSetIter __pyx_string_tab[136]
#define __pyx_n_u_NodeSetIter___reduce_cython __pyx_string_tab[137]
#define __pyx_n_u_NodeSetIter___setstate_cython __pyx_string_tab[138]
#define __pyx_n_u_NotImplemented __pyx_string_tab[139]
#define __pyx_n_u_Pht __pyx_string_tab[140]
#define __pyx_n_u_Pht___reduce_cython __pyx_string_tab[141]
#define __pyx_n_u_Pht___setstate_cython __pyx_string_tab[142]
#define __pyx_n_u_Pht_insert __pyx_string_tab[143]
#define __pyx_n_u_Pht_lookup __pyx_string_tab[144]
#define __pyx_n_u_PkId __pyx_string_tab[145]
#define __pyx_n_u_PkId___reduce_cython __pyx_string_tab[146]
#define __pyx_n_u_PkId___setstate_cython __pyx_string_tab[147]
#define __pyx_n_u_PkId_commonBits __pyx_string_tab[148]
#define __pyx_n_u_PkId_get __pyx_string_tab[149]
#define __pyx_n_u_PkId_getBit __pyx_string_tab[150]
#define __pyx_n_u_PkId_getLongId __pyx_string_tab[151]
#define __pyx_n_u_PkId_getRandom __pyx_string_tab[152]
#define __pyx_n_u_PkId_setBit __pyx_string_tab[153]
#define __pyx_n_u_PkId_toFloat __pyx_string_tab[154]
#define __pyx_n_u_PkId_toString __pyx_string_tab[155]
#define __pyx_n_u_PrivateKey __pyx_string_tab[156]
#define __pyx_n_u_PrivateKey___reduce_cython __pyx_string_tab[157]
#define __pyx_n_u_PrivateKey___setstate_cython __pyx_string_tab[158]
#define __pyx_n_u_PrivateKey_decrypt __pyx_string_tab[159]
#define __pyx_n_u_PrivateKey_generate __pyx_string_tab[160]
#define __pyx_n_u_PrivateKey_generateEC __pyx_string_tab[161]
#define __pyx_n_u_PrivateKey_getId __pyx_string_tab[162]
#define __pyx_n_u_PrivateKey_getLongId __pyx_string_tab[163]
#define __pyx_n_u_PrivateKey_getPublicKey __pyx_string_tab[164]
#define __pyx_n_u_PrivateKey_sign __pyx_string_tab[165]
#define __pyx_n_u_PublicKey __pyx_string_tab[166]
#define __pyx_n_u_PublicKey___reduce_cython __pyx_string_tab[167]
#define __pyx_n_u_PublicKey___setstate_cython __pyx_string_tab[168]
#define __pyx_n_u_PublicKey_checkSignature __pyx_string_tab[169]
#define __pyx_n_u_PublicKey_encrypt __pyx_string_tab[170]
#define __pyx_n_u_PublicKey_getId __pyx_string_tab[171]
#define __pyx_n_u_PublicKey_getLongId __pyx_string_tab[172]
#define __pyx_n_u_Query __pyx_string_tab[173]
#define __pyx_n_u_Query___reduce_cython __pyx_string_tab[174]
#define __pyx_n_u_Query___setstate_cython __pyx_string_tab[175]
#define __pyx_n_u_Query_buildFrom __pyx_string_tab[176]
#define __pyx_n_u_Query_isSatisfiedBy __pyx_string_tab[177]
#define __pyx_n_u_Select __pyx_string_tab[178]
#define __pyx_n_u_Select___reduce_cython __pyx_string_tab[179]
#define __pyx_n_u_Select___setstate_cython __pyx_string_tab[180]
#define __pyx_n_u_Select_field __pyx_string_tab[181]
#define __pyx_n_u_Select_isSatisfiedBy __pyx_string_tab[182]
#define __pyx_n_u_SockAddr __pyx_string_tab[183]
#define __pyx_n_u_SockAddr___reduce_cython __pyx_string_tab[184]
#define __pyx_n_u_SockAddr___setstate_cython __pyx_string_tab[185]
#define __pyx_n_u_SockAddr_getFamily __pyx_string_tab[186]
#define __pyx_n_u_SockAddr_getPort __pyx_string_tab[187]
#define __pyx_n_u_SockAddr_isLoopback __pyx_string_tab[188]
#define __pyx_n_u_SockAddr_isPrivate __pyx_string_tab[189]
#define __pyx_n_u_SockAddr_isUnspecified __pyx_string_tab[190]
#define __pyx_n_u_SockAddr_resolve __pyx_string_tab[191]
#define __pyx_n_u_SockAddr_setFamily __pyx_string_tab[192]
#define __pyx_n_u_SockAddr_setPort __pyx_string_tab[193]
#define __pyx_n_u_SockAddr_toString __pyx_string_tab[194]
#define __pyx_n_u_TrustList __pyx_string_tab[195]
#define __pyx_n_u_TrustList___reduce_cython __pyx_string_tab[196]
#define __pyx_n_u_TrustList___setstate_cython __pyx_string_tab[197]
#define __pyx_n_u_TrustList_add __pyx_string_tab[198]
#define __pyx_n_u_TrustList_remove __pyx_string_tab[199]
#define __pyx_n_u_TrustList_verify __pyx_string_tab[200]
#define __pyx_n_u_Value __pyx_string_tab[201]
#define __pyx_n_u_Value___reduce_cython __pyx_string_tab[202]
#define __pyx_n_u_Value___setstate_cython __pyx_string_tab[203]
#define __pyx_n_u_ValueType __pyx_string_tab[204]
#define __pyx_n_u_ValueType___reduce_cython __pyx_string_tab[205]
#define __pyx_n_u_ValueType___setstate_cython __pyx_string_tab[206]
#define __pyx_n_u_VerifyResult __pyx_string_tab[207]
#define __pyx_n_u_VerifyResult___reduce_cython __pyx_string_tab[208]
#define __pyx_n_u_VerifyResult___setstate_cython __pyx_string_tab[209]
#define __pyx_n_u_VerifyResult___str __pyx_string_tab[210]
#define __pyx_n_u_Where __pyx_string_tab[211]
#define __pyx_n_u_Where___reduce_cython __pyx_string_tab[212]
#define __pyx_n_u_Where___setstate_cython __pyx_string_tab[213]
#define __pyx_n_u_Where_id __pyx_string_tab[214]
#define __pyx_n_u_Where_isSatisfiedBy __pyx_string_tab[215]
#define __pyx_n_u_Where_owner __pyx_string_tab[216]
#define __pyx_n_u_Where_seq __pyx_string_tab[217]
#define __pyx_n_u_Where_userType __pyx_string_tab[218]
#define __pyx_n_u_Where_valueType __pyx_string_tab[219]
#define __pyx_n_u_VerifyResult__str __pyx_string_tab[220]
#define __pyx_n_u_WithID __pyx_string_tab[221]
#define __pyx_n_u_WithID___reduce_cython __pyx_string_tab[222]
#define __pyx_n_u_WithID___setstate_cython __pyx_string_tab[223]
#define __pyx_n_u_WithPk __pyx_string_tab[224]
#define __pyx_n_u_WithPk___reduce_cython __pyx_string_tab[225]
#define __pyx_n_u_WithPk___setstate_cython __pyx_string_tab[226]
#define __pyx_n_u_Pyx_CFunc_7opendht_5_core_obje __pyx_string_tab[227]
#define __pyx_n_u_Pyx_PyDict_NextRef __pyx_string_tab[228]
#define __pyx_n_u_annotate __pyx_string_tab[229]
#define __pyx_n_u_bytes_2 __pyx_string_tab[230]
#define __pyx_n_u_class __pyx_string_tab[231]
#define __pyx_n_u_dict __pyx_string_tab[232]
#define __pyx_n_u_enter __pyx_string_tab[233]
#define __pyx_n_u_exit __pyx_string_tab[234]
#define __pyx_n_u_func __pyx_string_tab[235]
#define __pyx_n_u_getstate __pyx_string_tab[236]
#define __pyx_n_u_main __pyx_string_tab[237]
#define __pyx_n_u_module __pyx_string_tab[238]
#define __pyx_n_u_name __pyx_string_tab[239]
#define __pyx_n_u_new __pyx_string_tab[240]
#define __pyx_n_u_pyx_checksum __pyx_string_tab[241]
#define __pyx_n_u_pyx_result __pyx_string_tab[242]
#define __pyx_n_u_pyx_state __pyx_string_tab[243]
#define __pyx_n_u_pyx_type __pyx_string_tab[244]
#define __pyx_n_u_pyx_unpickle__WithID __pyx_string_tab[245]
#define __pyx_n_u_pyx_unpickle__WithPk __pyx_string_tab[246]
#define __pyx_n_u_qualname __pyx_string_tab[247]
#define __pyx_n_u_reduce __pyx_string_tab[248]
#define __pyx_n_u_reduce_cython __pyx_string_tab[249]
#define __pyx_n_u_reduce_ex __pyx_string_tab[250]
#define __pyx_n_u_set_name __pyx_string_tab[251]
#define __pyx_n_u_setstate __pyx_string_tab[252]
#define __pyx_n_u_setstate_cython __pyx_string_tab[253]
#define __pyx_n_u_str_2 __pyx_string_tab[254]
#define __pyx_n_u_test __pyx_string_tab[255]
#define __pyx_n_u_cb __pyx_string_tab[256]
#define __pyx_n_u_dict_2 __pyx_string_tab[257]
#define __pyx_n_u_is_coroutine __pyx_string_tab[258]
#define __pyx_n_u_a __pyx_string_tab[259]
#define __pyx_n_u_add __pyx_string_tab[260]
#define __pyx_n_u_addr __pyx_string_tab[261]
#define __pyx_n_u_aesDecrypt __pyx_string_tab[262]
#define __pyx_n_u_aesEncrypt __pyx_string_tab[263]
#define __pyx_n_u_af __pyx_string_tab[264]
#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[265]
#define __pyx_n_u_atexit __pyx_string_tab[266]
#define __pyx_n_u_b __pyx_string_tab[267]
#define __pyx_n_u_bind4 __pyx_string_tab[268]
#define __pyx_n_u_bind6 __pyx_string_tab[269]
#define __pyx_n_u_bit __pyx_string_tab[270]
#define __pyx_n_u_bits __pyx_string_tab[271]
#define __pyx_n_u_bool __pyx_string_tab[272]
#define __pyx_n_u_bootstrap __pyx_string_tab[273]
#define __pyx_n_u_buildFrom __pyx_string_tab[274]
#define __pyx_n_u_bytes __pyx_string_tab[275]
#define __pyx_n_u_c __pyx_string_tab[276]
#define __pyx_n_u_ca __pyx_string_tab[277]
#define __pyx_n_u_cancelListen __pyx_string_tab[278]
#define __pyx_n_u_cancelPut __pyx_string_tab[279]
#define __pyx_n_u_cb_2 __pyx_string_tab[280]
#define __pyx_n_u_cb_obj __pyx_string_tab[281]
#define __pyx_n_u_cert __pyx_string_tab[282]
#define __pyx_n_u_cfunc_to_py __pyx_string_tab[283]
#define __pyx_n_u_checkSignature __pyx_string_tab[284]
#define __pyx_n_u_cline_in_traceback __pyx_string_tab[285]
#define __pyx_n_u_commonBits __pyx_string_tab[286]
#define __pyx_n_u_config __pyx_string_tab[287]
#define __pyx_n_u_cppk __pyx_string_tab[288]
#define __pyx_n_u_d_len __pyx_string_tab[289]
#define __pyx_n_u_d_ptr __pyx_string_tab[290]
#define __pyx_n_u_dat __pyx_string_tab[291]
#define __pyx_n_u_data __pyx_string_tab[292]
#define __pyx_n_u_datetime __pyx_string_tab[293]
#define __pyx_n_u_decode __pyx_string_tab[294]
#define __pyx_n_u_decrypt __pyx_string_tab[295]
#define __pyx_n_u_decrypted __pyx_string_tab[296]
#define __pyx_n_u_decrypted_c_str __pyx_string_tab[297]
#define __pyx_n_u_dht __pyx_string_tab[298]
#define __pyx_n_u_disableLogging __pyx_string_tab[299]
#define __pyx_n_u_done __pyx_string_tab[300]
#define __pyx_n_u_done_cb __pyx_string_tab[301]
#define __pyx_n_u_enableFileLogging __pyx_string_tab[302]
#define __pyx_n_u_enableLogging __pyx_string_tab[303]
#define __pyx_n_u_encode __pyx_string_tab[304]
#define __pyx_n_u_encrypt __pyx_string_tab[305]
#define __pyx_n_u_encrypted __pyx_string_tab[306]
#define __pyx_n_u_encrypted_c_str __pyx_string_tab[307]
#define __pyx_n_u_expiration __pyx_string_tab[308]
#define __pyx_n_u_extend __pyx_string_tab[309]
#define __pyx_n_u_field __pyx_string_tab[310]
#define __pyx_n_u_filter __pyx_string_tab[311]
#define __pyx_n_u_first __pyx_string_tab[312]
#define __pyx_n_u_float __pyx_string_tab[313]
#define __pyx_n_u_generate __pyx_string_tab[314]
#define __pyx_n_u_generateEC __pyx_string_tab[315]
#define __pyx_n_u_get __pyx_string_tab[316]
#define __pyx_n_u_get_locals_tmp_done __pyx_string_tab[317]
#define __pyx_n_u_get_locals_tmp_get __pyx_string_tab[318]
#define __pyx_n_u_getAddr __pyx_string_tab[319]
#define __pyx_n_u_getBit __pyx_string_tab[320]
#define __pyx_n_u_getBound __pyx_string_tab[321]
#define __pyx_n_u_getFamily __pyx_string_tab[322]
#define __pyx_n_u_getId __pyx_string_tab[323]
#define __pyx_n_u_getKey __pyx_string_tab[324]
#define __pyx_n_u_getLongId __pyx_string_tab[325]
#define __pyx_n_u_getName __pyx_string_tab[326]
#define __pyx_n_u_getNode __pyx_string_tab[327]
#define __pyx_n_u_getNodeId __pyx_string_tab[328]
#define __pyx_n_u_getNodeMessageStats __pyx_string_tab[329]
#define __pyx_n_u_getPort __pyx_string_tab[330]
#define __pyx_n_u_getPublicKey __pyx_string_tab[331]
#define __pyx_n_u_getRandom __pyx_string_tab[332]
#define __pyx_n_u_getRoutingTablesLog __pyx_string_tab[333]
#define __pyx_n_u_getSearchesLog __pyx_string_tab[334]
#define __pyx_n_u_getStorageLog __pyx_string_tab[335]
#define __pyx_n_u_getValueId __pyx_string_tab[336]
#define __pyx_n_u_get_cb __pyx_string_tab[337]
#define __pyx_n_u_h __pyx_string_tab[338]
#define __pyx_n_u_host __pyx_string_tab[339]
#define __pyx_n_u_host_bytes __pyx_string_tab[340]
#define __pyx_n_u_i __pyx_string_tab[341]
#define __pyx_n_u_id __pyx_string_tab[342]
#define __pyx_n_u_indat __pyx_string_tab[343]
#define __pyx_n_u_insert __pyx_string_tab[344]
#define __pyx_n_u_int __pyx_string_tab[345]
#define __pyx_n_u_ipv4 __pyx_string_tab[346]
#define __pyx_n_u_ipv6 __pyx_string_tab[347]
#define __pyx_n_u_isExpired __pyx_string_tab[348]
#define __pyx_n_u_isLoopback __pyx_string_tab[349]
#define __pyx_n_u_isPrivate __pyx_string_tab[350]
#define __pyx_n_u_isRunning __pyx_string_tab[351]
#define __pyx_n_u_isSatisfiedBy __pyx_string_tab[352]
#define __pyx_n_u_isUnspecified __pyx_string_tab[353]
#define __pyx_n_u_is_bootstrap __pyx_string_tab[354]
#define __pyx_n_u_is_ca __pyx_string_tab[355]
#define __pyx_n_u_items __pyx_string_tab[356]
#define __pyx_n_u_join __pyx_string_tab[357]
#define __pyx_n_u_k __pyx_string_tab[358]
#define __pyx_n_u_key __pyx_string_tab[359]
#define __pyx_n_u_key_spec __pyx_string_tab[360]
#define __pyx_n_u_kk __pyx_string_tab[361]
#define __pyx_n_u_l __pyx_string_tab[362]
#define __pyx_n_u_last __pyx_string_tab[363]
#define __pyx_n_u_length __pyx_string_tab[364]
#define __pyx_n_u_li __pyx_string_tab[365]
#define __pyx_n_u_listen __pyx_string_tab[366]
#define __pyx_n_u_lock __pyx_string_tab[367]
#define __pyx_n_u_lookup __pyx_string_tab[368]
#define __pyx_n_u_lookup_cb __pyx_string_tab[369]
#define __pyx_n_u_maintain_storage __pyx_string_tab[370]
#define __pyx_n_u_max_peer_req_per_sec __pyx_string_tab[371]
#define __pyx_n_u_max_req_per_sec __pyx_string_tab[372]
#define __pyx_n_u_n __pyx_string_tab[373]
#define __pyx_n_u_name_2 __pyx_string_tab[374]
#define __pyx_n_u_netid __pyx_string_tab[375]
#define __pyx_n_u_nodes __pyx_string_tab[376]
#define __pyx_n_u_notify __pyx_string_tab[377]
#define __pyx_n_u_ok __pyx_string_tab[378]
#define __pyx_n_u_ok_ret __pyx_string_tab[379]
#define __pyx_n_u_opendht__core __pyx_string_tab[380]
#define __pyx_n_u_os __pyx_string_tab[381]
#define __pyx_n_u_owner __pyx_string_tab[382]
#define __pyx_n_u_owner_pk_hash __pyx_string_tab[383]
#define __pyx_n_u_password __pyx_string_tab[384]
#define __pyx_n_u_path __pyx_string_tab[385]
#define __pyx_n_u_peer_discovery __pyx_string_tab[386]
#define __pyx_n_u_peer_publish __pyx_string_tab[387]
#define __pyx_n_u_pending __pyx_string_tab[388]
#define __pyx_n_u_permanent __pyx_string_tab[389]
#define __pyx_n_u_ping __pyx_string_tab[390]
#define __pyx_n_u_ping_locals_tmp_done __pyx_string_tab[391]
#define __pyx_n_u_pk __pyx_string_tab[392]
#define __pyx_n_u_pop __pyx_string_tab[393]
#define __pyx_n_u_port __pyx_string_tab[394]
#define __pyx_n_u_port_bytes __pyx_string_tab[395]
#define __pyx_n_u_print __pyx_string_tab[396]
#define __pyx_n_u_proxy_server __pyx_string_tab[397]
#define __pyx_n_u_push_node_id __pyx_string_tab[398]
#define __pyx_n_u_push_platform __pyx_string_tab[399]
#define __pyx_n_u_push_token __pyx_string_tab[400]
#define __pyx_n_u_push_topic __pyx_string_tab[401]
#define __pyx_n_u_put __pyx_string_tab[402]
#define __pyx_n_u_put_locals_tmp_done __pyx_string_tab[403]
#define __pyx_n_u_putEncrypted __pyx_string_tab[404]
#define __pyx_n_u_putEncrypted_locals_tmp_done __pyx_string_tab[405]
#define __pyx_n_u_putSigned __pyx_string_tab[406]
#define __pyx_n_u_putSigned_locals_tmp_done __pyx_string_tab[407]
#define __pyx_n_u_pydht __pyx_string_tab[408]
#define __pyx_n_u_q __pyx_string_tab[409]
#define __pyx_n_u_q_str __pyx_string_tab[410]
#define __pyx_n_u_r __pyx_string_tab[411]
#define __pyx_n_u_register __pyx_string_tab[412]
#define __pyx_n_u_registerType __pyx_string_tab[413]
#define __pyx_n_u_remove __pyx_string_tab[414]
#define __pyx_n_u_res __pyx_string_tab[415]
#define __pyx_n_u_resolve __pyx_string_tab[416]
#define __pyx_n_u_result __pyx_string_tab[417]
#define __pyx_n_u_return __pyx_string_tab[418]
#define __pyx_n_u_revoke __pyx_string_tab[419]
#define __pyx_n_u_run __pyx_string_tab[420]
#define __pyx_n_u_s __pyx_string_tab[421]
#define __pyx_n_u_s_len __pyx_string_tab[422]
#define __pyx_n_u_s_ptr __pyx_string_tab[423]
#define __pyx_n_u_self __pyx_string_tab[424]
#define __pyx_n_u_seq __pyx_string_tab[425]
#define __pyx_n_u_seq_no __pyx_string_tab[426]
#define __pyx_n_u_server_ca __pyx_string_tab[427]
#define __pyx_n_u_service __pyx_string_tab[428]
#define __pyx_n_u_setBit __pyx_string_tab[429]
#define __pyx_n_u_setBootstrapMode __pyx_string_tab[430]
#define __pyx_n_u_setBound __pyx_string_tab[431]
#define __pyx_n_u_setFamily __pyx_string_tab[432]
#define __pyx_n_u_setIdentity __pyx_string_tab[433]
#define __pyx_n_u_setMaintainStorage __pyx_string_tab[434]
#define __pyx_n_u_setNetwork __pyx_string_tab[435]
#define __pyx_n_u_setNodeId __pyx_string_tab[436]
#define __pyx_n_u_setPeerDiscovery __pyx_string_tab[437]
#define __pyx_n_u_setPort __pyx_string_tab[438]
#define __pyx_n_u_setProxyInfo __pyx_string_tab[439]
#define __pyx_n_u_setRateLimit __pyx_string_tab[440]
#define __pyx_n_u_setdefault __pyx_string_tab[441]
#define __pyx_n_u_shutdown __pyx_string_tab[442]
#define __pyx_n_u_shutdown_cb __pyx_string_tab[443]
#define __pyx_n_u_sig __pyx_string_tab[444]
#define __pyx_n_u_sign __pyx_string_tab[445]
#define __pyx_n_u_signature __pyx_string_tab[446]
#define __pyx_n_u_signature_c_str __pyx_string_tab[447]
#define __pyx_n_u_size __pyx_string_tab[448]
#define __pyx_n_u_state __pyx_string_tab[449]
#define __pyx_n_u_staticmethod __pyx_string_tab[450]
#define __pyx_n_u_stats __pyx_string_tab[451]
#define __pyx_n_u_str __pyx_string_tab[452]
#define __pyx_n_u_t __pyx_string_tab[453]
#define __pyx_n_u_threading __pyx_string_tab[454]
#define __pyx_n_u_timedelta __pyx_string_tab[455]
#define __pyx_n_u_tmp_done __pyx_string_tab[456]
#define __pyx_n_u_tmp_get __pyx_string_tab[457]
#define __pyx_n_u_to __pyx_string_tab[458]
#define __pyx_n_u_toFloat __pyx_string_tab[459]
#define __pyx_n_u_toString __pyx_string_tab[460]
#define __pyx_n_u_token __pyx_string_tab[461]
#define __pyx_n_u_total_seconds __pyx_string_tab[462]
#define __pyx_n_u_type __pyx_string_tab[463]
#define __pyx_n_u_update __pyx_string_tab[464]
#define __pyx_n_u_use_setstate __pyx_string_tab[465]
#define __pyx_n_u_userType __pyx_string_tab[466]
#define __pyx_n_u_user_agent __pyx_string_tab[467]
#define __pyx_n_u_user_type __pyx_string_tab[468]
#define __pyx_n_u_v __pyx_string_tab[469]
#define __pyx_n_u_val __pyx_string_tab[470]
#define __pyx_n_u_valcb __pyx_string_tab[471]
#define __pyx_n_u_vals __pyx_string_tab[472]
#define __pyx_n_u_value __pyx_string_tab[473]
#define __pyx_n_u_valueType __pyx_string_tab[474]
#define __pyx_n_u_value_cb __pyx_string_tab[475]
#define __pyx_n_u_values __pyx_string_tab[476]
#define __pyx_n_u_verify __pyx_string_tab[477]
#define __pyx_n_u_version __pyx_string_tab[478]
#define __pyx_n_u_vid __pyx_string_tab[479]
#define __pyx_n_u_w __pyx_string_tab[480]
#define __pyx_n_u_wait __pyx_string_tab[481]
#define __pyx_n_u_where __pyx_string_tab[482]
#define __pyx_n_u_wrap __pyx_string_tab[483]
#define __pyx_kp_b__5 __pyx_string_tab[484]
#define __pyx_kp_b_4222 __pyx_string_tab[485]
#define __pyx_kp_b_iso88591_Q __pyx_string_tab[486]
#define __pyx_kp_b_iso88591_QfA __pyx_string_tab[487]
#define __pyx_kp_b_iso88591_q_0_kQR_7_1_7_N_1 __pyx_string_tab[488]
#define __pyx_kp_b_iso88591_q_l_vWE_Q_q_q_q_AWKwa_AWKq __pyx_string_tab[489]
#define __pyx_kp_b_iso88591_A_4wfA_A_HA_fD_G4t1_q __pyx_string_tab[490]
#define __pyx_kp_b_iso88591_A_4wfA_A_HA_fD_vS_q __pyx_string_tab[491]
#define __pyx_kp_b_iso88591_A_D_c_q __pyx_string_tab[492]
#define __pyx_kp_b_iso88591_A_E_q __pyx_string_tab[493]
#define __pyx_kp_b_iso88591_A_F_b_q_auD_V1F_a __pyx_string_tab[494]
#define __pyx_kp_b_iso88591_A_F_q __pyx_string_tab[495]
#define __pyx_kp_b_iso88591_A_G3aq_q __pyx_string_tab[496]
#define __pyx_kp_b_iso88591_A_G4q_q __pyx_string_tab[497]
#define __pyx_kp_b_iso88591_A_G4q_d_A __pyx_string_tab[498]
#define __pyx_kp_b_iso88591_A_G6_q_q __pyx_string_tab[499]
#define __pyx_kp_b_iso88591_A_G7_6_V4q __pyx_string_tab[500]
#define __pyx_kp_b_iso88591_A_G9AYgQ_q __pyx_string_tab[501]
#define __pyx_kp_b_iso88591_A_G_Qa_q __pyx_string_tab[502]
#define __pyx_kp_b_iso88591_A_HA_d_Q_q __pyx_string_tab[503]
#define __pyx_kp_b_iso88591_A_HA_d_BfA_q __pyx_string_tab[504]
#define __pyx_kp_b_iso88591_A_HA_d_Rq_q __pyx_string_tab[505]
#define __pyx_kp_b_iso88591_A_HD_q __pyx_string_tab[506]
#define __pyx_kp_b_iso88591_A_HD_AS_Cq __pyx_string_tab[507]
#define __pyx_kp_b_iso88591_A_HD_q_U_q_Qhe4q __pyx_string_tab[508]
#define __pyx_kp_b_iso88591_A_HD_q_d __pyx_string_tab[509]
#define __pyx_kp_b_iso88591_A_HF_q_q __pyx_string_tab[510]
#define __pyx_kp_b_iso88591_A_HIU_HIU __pyx_string_tab[511]
#define __pyx_kp_b_iso88591_A_HKvRq __pyx_string_tab[512]
#define __pyx_kp_b_iso88591_A_HK_a __pyx_string_tab[513]
#define __pyx_kp_b_iso88591_A_HK_b __pyx_string_tab[514]
#define __pyx_kp_b_iso88591_A_HK_1 __pyx_string_tab[515]
#define __pyx_kp_b_iso88591_A_HK_a_HK_C1 __pyx_string_tab[516]
#define __pyx_kp_b_iso88591_A_HK_q __pyx_string_tab[517]
#define __pyx_kp_b_iso88591_A_H_a_H_A __pyx_string_tab[518]
#define __pyx_kp_b_iso88591_A_JgQe1 __pyx_string_tab[519]
#define __pyx_kp_b_iso88591_A_Kq_s_Qha_Qa_t84r_a_OwV_dde_q __pyx_string_tab[520]
#define __pyx_kp_b_iso88591_A_L_D_wavT_t1_q __pyx_string_tab[521]
#define __pyx_kp_b_iso88591_A_M_q_1A __pyx_string_tab[522]
#define __pyx_kp_b_iso88591_A_q_2 __pyx_string_tab[523]
#define __pyx_kp_b_iso88591_A_t6_Ry_t_q __pyx_string_tab[524]
#define __pyx_kp_b_iso88591_A_t6_Rz __pyx_string_tab[525]
#define __pyx_kp_b_iso88591_A_t6_R __pyx_string_tab[526]
#define __pyx_kp_b_iso88591_A_t6 __pyx_string_tab[527]
#define __pyx_kp_b_iso88591_A_t6_3 __pyx_string_tab[528]
#define __pyx_kp_b_iso88591_A_t6_4 __pyx_string_tab[529]
#define __pyx_kp_b_iso88591_A_t6_2 __pyx_string_tab[530]
#define __pyx_kp_b_iso88591_A_t6_1 __pyx_string_tab[531]
#define __pyx_kp_b_iso88591_A_t6_1A __pyx_string_tab[532]
#define __pyx_kp_b_iso88591_A_t6_A __pyx_string_tab[533]
#define __pyx_kp_b_iso88591_A_t6_q __pyx_string_tab[534]
#define __pyx_kp_b_iso88591_A_t7_b __pyx_string_tab[535]
#define __pyx_kp_b_iso88591_A_t7_q __pyx_string_tab[536]
#define __pyx_kp_b_iso88591_A_t7_4q __pyx_string_tab[537]
#define __pyx_kp_b_iso88591_A_t7 __pyx_string_tab[538]
#define __pyx_kp_b_iso88591_A_t84r_1 __pyx_string_tab[539]
#define __pyx_kp_b_iso88591_A_t84r_r __pyx_string_tab[540]
#define __pyx_kp_b_iso88591_A_t84r_G1 __pyx_string_tab[541]
#define __pyx_kp_b_iso88591_A_t84r_5Qc __pyx_string_tab[542]
#define __pyx_kp_b_iso88591_A_t89A __pyx_string_tab[543]
#define __pyx_kp_b_iso88591_A_t8_A __pyx_string_tab[544]
#define __pyx_kp_b_iso88591_A_t_WAQ __pyx_string_tab[545]
#define __pyx_kp_b_iso88591_A_t_XQ __pyx_string_tab[546]
#define __pyx_kp_b_iso88591_A_t_Ya __pyx_string_tab[547]
#define __pyx_kp_b_iso88591_A_HD_Naq_E_q __pyx_string_tab[548]
#define __pyx_kp_b_iso88591_A_hd_AQ __pyx_string_tab[549]
#define __pyx_kp_b_iso88591_A_4xt2Qa __pyx_string_tab[550]
#define __pyx_kp_b_iso88591_A_Qd_b_T __pyx_string_tab[551]
#define __pyx_kp_b_iso88591_A_Ja_L_0_y_q __pyx_string_tab[552]
#define __pyx_kp_b_iso88591_A_D_A_q __pyx_string_tab[553]
#define __pyx_kp_b_iso88591_A_HA_A_q __pyx_string_tab[554]
#define __pyx_kp_b_iso88591_A_D_as_q __pyx_string_tab[555]
#define __pyx_kp_b_iso88591_A_HA_as_q __pyx_string_tab[556]
#define __pyx_kp_b_iso88591_A_Ja_L_0_q __pyx_string_tab[557]
#define __pyx_kp_b_iso88591_A_38_Oq_HA_AT_BfA_q __pyx_string_tab[558]
#define __pyx_kp_b_iso88591_A_q_XQd_WG6_VW_G1_Ya_q_q __pyx_string_tab[559]
#define __pyx_kp_b_iso88591_A_1HAQ __pyx_string_tab[560]
#define __pyx_kp_b_iso88591_A_aq_AQ __pyx_string_tab[561]
#define __pyx_kp_b_iso88591_A6_Oq_Kq_22B_1FRSSXX_aaeellppqqw __pyx_string_tab[562]
#define __pyx_kp_b_iso88591_A_q __pyx_string_tab[563]
#define __pyx_kp_b_iso88591_A_7_1_q __pyx_string_tab[564]
#define __pyx_kp_b_iso88591_A_q_q __pyx_string_tab[565]
#define __pyx_kp_b_iso88591_A_q_q_2 __pyx_string_tab[566]
#define __pyx_kp_b_iso88591_hb_q __pyx_string_tab[567]
#define __pyx_kp_b_iso88591_A_1A_nA_vRq_AWHG1_q_Ye1_A __pyx_string_tab[568]
#define __pyx_kp_b_iso88591_q_4t1_AQ_HA_d_t2V1_q __pyx_string_tab[569]
#define __pyx_kp_b_iso88591_q_4t1_AQ_HA_d_t2_8_b_a_q __pyx_string_tab[570]
#define __pyx_kp_b_iso88591_q_4t1_AQ_HA_d_BfA_q __pyx_string_tab[571]
#define __pyx_kp_b_iso88591_q_HA_4q_hd_F_q __pyx_string_tab[572]
#define __pyx_kp_b_iso88591_t6_Rxr __pyx_string_tab[573]
#define __pyx_kp_b_iso88591_4t1_1_t6_Ry __pyx_string_tab[574]
#define __pyx_kp_b_iso88591_1_4t1_AQ_T_4uD_A_q __pyx_string_tab[575]
#define __pyx_kp_b_iso88591_1_4t1_AQ_T_4uD_5Rt2Zq_q __pyx_string_tab[576]
#define __pyx_kp_b_iso88591_1_4t1_AQ_T_4vT_Q_q __pyx_string_tab[577]
#define __pyx_kp_b_iso88591_1_HA_4q_hd_Ja_q __pyx_string_tab[578]
#define __pyx_kp_b_iso88591_a_4t1_AQ_Ya_e4r_4A_q __pyx_string_tab[579]
#define __pyx_kp_b_iso88591_a_4t1_AQ_Ya_hd_M_q __pyx_string_tab[580]
#define __pyx_kp_b_iso88591_a_t6 __pyx_string_tab[581]
#define __pyx_kp_b_iso88591_11K_Wddy_z_C_C_D_1_aq_5_1_D_vZq __pyx_string_tab[582]
#define __pyx_kp_b_iso88591_4t1_AQ_Cq_WAWO6_1_e4r_aq_XYe1_q __pyx_string_tab[583]
#define __pyx_kp_b_iso88591_1_Q_Qa_HD_4_a7J_QR __pyx_string_tab[584]
#define __pyx_kp_b_iso88591_A_4t1_AQ_Cq_WAWO6_1_e4r_XYe1_q __pyx_string_tab[585]
#define __pyx_kp_b_iso88591_A_Cq_WAWO6_1_e4r_XYe1_q_b __pyx_string_tab[586]
#define __pyx_kp_b_iso88591_N_gQ_Qa_D_S_a_at_uAQ_HG1_A_6gQ __pyx_string_tab[587]
#define __pyx_kp_b_iso88591_BTTU_1_fHG9IQ_vS_Q_Bd_3oZq_gUV __pyx_string_tab[588]
#define __pyx_kp_b_iso88591_1_gQ_Bj_8I_J_ggh_9Ja_a_1_E_hb_Q __pyx_string_tab[589]
#define __pyx_kp_b_iso88591_1_T_T_j_HD_A_6lBSST __pyx_string_tab[590]
#define __pyx_kp_b_iso88591_A_HA_hd_IQa_q __pyx_string_tab[591]
#define __pyx_kp_b_iso88591_A_t7_a __pyx_string_tab[592]
#define __pyx_kp_b_iso88591_33C1_1_gQ_Bd_3l_A__cczz_C_C_D_9 __pyx_string_tab[593]
#define __pyx_kp_b_iso88591_4A_Qa_D_S_a_at_uAQ_ZuG3a_U_Q_HG __pyx_string_tab[594]
#define __pyx_kp_b_iso88591_99I_1_gQ_Bj_L_RSSbbiirrs_9Ja_a __pyx_string_tab[595]
#define __pyx_kp_b_iso88591_A_4t1_AQ_Cq_WAWO6_1_Cq_7_7_r_t5 __pyx_string_tab[596]
#define __pyx_kp_b_iso88591_QQddz_N_N_j_j_u_u_v_H_L_q_H_L_q __pyx_string_tab[597]
#define __pyx_kp_b_iso88591_UUV_3c_AQ_1_gQ_Qd_Bm1_3gS_a_gYa __pyx_string_tab[598]
#define __pyx_int_0 __pyx_number_tab[0]
#define __pyx_int_1 __pyx_number_tab[1]
#define __pyx_int_4096 __pyx_number_tab[2]
#define __pyx_int_238750788 __pyx_number_tab[3]
/* #### Code section: module_state_clear ### */
#if CYTHON_USE_MODULE_STATE
static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) {
  __pyx_mstatetype *clear_module_state = __Pyx_PyModule_GetState(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);
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  __Pyx_State_RemoveModule(NULL);
  #endif
  Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4type_type);
  Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4bool_bool);
  Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_7complex_complex);
  Py_CLEAR(clear_module_state->__pyx_ptype_7opendht_5_core__WithID);
  Py_CLEAR(clear_module_state->__pyx_type_7opendht_5_core__WithID);
  Py_CLEAR(clear_module_state->__pyx_ptype_7opendht_5_core__WithPk);
  Py_CLEAR(clear_module_state->__pyx_type_7opendht_5_core__WithPk);
  Py_CLEAR(clear_module_state->__pyx_ptype_7opendht_5_core_InfoHash);
  Py_CLEAR(clear_module_state->__pyx_type_7opendht_5_core_InfoHash);
  Py_CLEAR(clear_module_state->__pyx_ptype_7opendht_5_core_PkId);
  Py_CLEAR(clear_module_state->__pyx_type_7opendht_5_core_PkId);
  Py_CLEAR(clear_module_state->__pyx_ptype_7opendht_5_core_SockAddr);
  Py_CLEAR(clear_module_state->__pyx_type_7opendht_5_core_SockAddr);
  Py_CLEAR(clear_module_state->__pyx_ptype_7opendht_5_core_Node);
  Py_CLEAR(clear_module_state->__pyx_type_7opendht_5_core_Node);
  Py_CLEAR(clear_module_state->__pyx_ptype_7opendht_5_core_NodeEntry);
  Py_CLEAR(clear_module_state->__pyx_type_7opendht_5_core_NodeEntry);
  Py_CLEAR(clear_module_state->__pyx_ptype_7opendht_5_core_Query);
  Py_CLEAR(clear_module_state->__pyx_type_7opendht_5_core_Query);
  Py_CLEAR(clear_module_state->__pyx_ptype_7opendht_5_core_Select);
  Py_CLEAR(clear_module_state->__pyx_type_7opendht_5_core_Select);
  Py_CLEAR(clear_module_state->__pyx_ptype_7opendht_5_core_Where);
  Py_CLEAR(clear_module_state->__pyx_type_7opendht_5_core_Where);
  Py_CLEAR(clear_module_state->__pyx_ptype_7opendht_5_core_Value);
  Py_CLEAR(clear_module_state->__pyx_type_7opendht_5_core_Value);
  Py_CLEAR(clear_module_state->__pyx_ptype_7opendht_5_core_ValueType);
  Py_CLEAR(clear_module_state->__pyx_type_7opendht_5_core_ValueType);
  Py_CLEAR(clear_module_state->__pyx_ptype_7opendht_5_core_NodeSetIter);
  Py_CLEAR(clear_module_state->__pyx_type_7opendht_5_core_NodeSetIter);
  Py_CLEAR(clear_module_state->__pyx_ptype_7opendht_5_core_NodeSet);
  Py_CLEAR(clear_module_state->__pyx_type_7opendht_5_core_NodeSet);
  Py_CLEAR(clear_module_state->__pyx_ptype_7opendht_5_core_PrivateKey);
  Py_CLEAR(clear_module_state->__pyx_type_7opendht_5_core_PrivateKey);
  Py_CLEAR(clear_module_state->__pyx_ptype_7opendht_5_core_PublicKey);
  Py_CLEAR(clear_module_state->__pyx_type_7opendht_5_core_PublicKey);
  Py_CLEAR(clear_module_state->__pyx_ptype_7opendht_5_core_Certificate);
  Py_CLEAR(clear_module_state->__pyx_type_7opendht_5_core_Certificate);
  Py_CLEAR(clear_module_state->__pyx_ptype_7opendht_5_core_VerifyResult);
  Py_CLEAR(clear_module_state->__pyx_type_7opendht_5_core_VerifyResult);
  Py_CLEAR(clear_module_state->__pyx_ptype_7opendht_5_core_TrustList);
  Py_CLEAR(clear_module_state->__pyx_type_7opendht_5_core_TrustList);
  Py_CLEAR(clear_module_state->__pyx_ptype_7opendht_5_core_ListenToken);
  Py_CLEAR(clear_module_state->__pyx_type_7opendht_5_core_ListenToken);
  Py_CLEAR(clear_module_state->__pyx_ptype_7opendht_5_core_Identity);
  Py_CLEAR(clear_module_state->__pyx_type_7opendht_5_core_Identity);
  Py_CLEAR(clear_module_state->__pyx_ptype_7opendht_5_core_DhtConfig);
  Py_CLEAR(clear_module_state->__pyx_type_7opendht_5_core_DhtConfig);
  Py_CLEAR(clear_module_state->__pyx_ptype_7opendht_5_core_DhtRunner);
  Py_CLEAR(clear_module_state->__pyx_type_7opendht_5_core_DhtRunner);
  Py_CLEAR(clear_module_state->__pyx_ptype_7opendht_5_core_IndexValue);
  Py_CLEAR(clear_module_state->__pyx_type_7opendht_5_core_IndexValue);
  Py_CLEAR(clear_module_state->__pyx_ptype_7opendht_5_core_Pht);
  Py_CLEAR(clear_module_state->__pyx_type_7opendht_5_core_Pht);
  Py_CLEAR(clear_module_state->__pyx_ptype_7opendht_5_core___pyx_scope_struct__ping);
  Py_CLEAR(clear_module_state->__pyx_type_7opendht_5_core___pyx_scope_struct__ping);
  Py_CLEAR(clear_module_state->__pyx_ptype_7opendht_5_core___pyx_scope_struct_1_get);
  Py_CLEAR(clear_module_state->__pyx_type_7opendht_5_core___pyx_scope_struct_1_get);
  Py_CLEAR(clear_module_state->__pyx_ptype_7opendht_5_core___pyx_scope_struct_2_put);
  Py_CLEAR(clear_module_state->__pyx_type_7opendht_5_core___pyx_scope_struct_2_put);
  Py_CLEAR(clear_module_state->__pyx_ptype_7opendht_5_core___pyx_scope_struct_3_putSigned);
  Py_CLEAR(clear_module_state->__pyx_type_7opendht_5_core___pyx_scope_struct_3_putSigned);
  Py_CLEAR(clear_module_state->__pyx_ptype_7opendht_5_core___pyx_scope_struct_4_putEncrypted);
  Py_CLEAR(clear_module_state->__pyx_type_7opendht_5_core___pyx_scope_struct_4_putEncrypted);
  Py_CLEAR(clear_module_state->__pyx_ptype___pyx_scope_struct____Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_);
  Py_CLEAR(clear_module_state->__pyx_scope_struct____Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_);
  Py_CLEAR(clear_module_state->__pyx_umethod_PyDict_Type_items.method);
  Py_CLEAR(clear_module_state->__pyx_umethod_PyDict_Type_pop.method);
  Py_CLEAR(clear_module_state->__pyx_umethod_PyDict_Type_values.method);
  Py_CLEAR(clear_module_state->__pyx_k__8);
  Py_CLEAR(clear_module_state->__pyx_k__9);
  Py_CLEAR(clear_module_state->__pyx_k__10);
  Py_CLEAR(clear_module_state->__pyx_k__11);
  for (int i=0; i<9; ++i) { Py_CLEAR(clear_module_state->__pyx_tuple[i]); }
  for (int i=0; i<168; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); }
  for (int i=0; i<599; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); }
  for (int i=0; i<4; ++i) { Py_CLEAR(clear_module_state->__pyx_number_tab[i]); }
/* #### Code section: module_state_clear_contents ### */
/* CommonTypesMetaclass.module_state_clear */
Py_CLEAR(clear_module_state->__pyx_CommonTypesMetaclassType);

/* CythonFunctionPerModule.module_state_clear */
Py_CLEAR(clear_module_state->__pyx_CyFunctionType);

/* #### Code section: module_state_clear_end ### */
return 0;
}
#endif
/* #### Code section: module_state_traverse ### */
#if CYTHON_USE_MODULE_STATE
static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
  __pyx_mstatetype *traverse_module_state = __Pyx_PyModule_GetState(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);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_tuple);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_bytes);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_unicode);
  Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4type_type);
  Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4bool_bool);
  Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_7complex_complex);
  Py_VISIT(traverse_module_state->__pyx_ptype_7opendht_5_core__WithID);
  Py_VISIT(traverse_module_state->__pyx_type_7opendht_5_core__WithID);
  Py_VISIT(traverse_module_state->__pyx_ptype_7opendht_5_core__WithPk);
  Py_VISIT(traverse_module_state->__pyx_type_7opendht_5_core__WithPk);
  Py_VISIT(traverse_module_state->__pyx_ptype_7opendht_5_core_InfoHash);
  Py_VISIT(traverse_module_state->__pyx_type_7opendht_5_core_InfoHash);
  Py_VISIT(traverse_module_state->__pyx_ptype_7opendht_5_core_PkId);
  Py_VISIT(traverse_module_state->__pyx_type_7opendht_5_core_PkId);
  Py_VISIT(traverse_module_state->__pyx_ptype_7opendht_5_core_SockAddr);
  Py_VISIT(traverse_module_state->__pyx_type_7opendht_5_core_SockAddr);
  Py_VISIT(traverse_module_state->__pyx_ptype_7opendht_5_core_Node);
  Py_VISIT(traverse_module_state->__pyx_type_7opendht_5_core_Node);
  Py_VISIT(traverse_module_state->__pyx_ptype_7opendht_5_core_NodeEntry);
  Py_VISIT(traverse_module_state->__pyx_type_7opendht_5_core_NodeEntry);
  Py_VISIT(traverse_module_state->__pyx_ptype_7opendht_5_core_Query);
  Py_VISIT(traverse_module_state->__pyx_type_7opendht_5_core_Query);
  Py_VISIT(traverse_module_state->__pyx_ptype_7opendht_5_core_Select);
  Py_VISIT(traverse_module_state->__pyx_type_7opendht_5_core_Select);
  Py_VISIT(traverse_module_state->__pyx_ptype_7opendht_5_core_Where);
  Py_VISIT(traverse_module_state->__pyx_type_7opendht_5_core_Where);
  Py_VISIT(traverse_module_state->__pyx_ptype_7opendht_5_core_Value);
  Py_VISIT(traverse_module_state->__pyx_type_7opendht_5_core_Value);
  Py_VISIT(traverse_module_state->__pyx_ptype_7opendht_5_core_ValueType);
  Py_VISIT(traverse_module_state->__pyx_type_7opendht_5_core_ValueType);
  Py_VISIT(traverse_module_state->__pyx_ptype_7opendht_5_core_NodeSetIter);
  Py_VISIT(traverse_module_state->__pyx_type_7opendht_5_core_NodeSetIter);
  Py_VISIT(traverse_module_state->__pyx_ptype_7opendht_5_core_NodeSet);
  Py_VISIT(traverse_module_state->__pyx_type_7opendht_5_core_NodeSet);
  Py_VISIT(traverse_module_state->__pyx_ptype_7opendht_5_core_PrivateKey);
  Py_VISIT(traverse_module_state->__pyx_type_7opendht_5_core_PrivateKey);
  Py_VISIT(traverse_module_state->__pyx_ptype_7opendht_5_core_PublicKey);
  Py_VISIT(traverse_module_state->__pyx_type_7opendht_5_core_PublicKey);
  Py_VISIT(traverse_module_state->__pyx_ptype_7opendht_5_core_Certificate);
  Py_VISIT(traverse_module_state->__pyx_type_7opendht_5_core_Certificate);
  Py_VISIT(traverse_module_state->__pyx_ptype_7opendht_5_core_VerifyResult);
  Py_VISIT(traverse_module_state->__pyx_type_7opendht_5_core_VerifyResult);
  Py_VISIT(traverse_module_state->__pyx_ptype_7opendht_5_core_TrustList);
  Py_VISIT(traverse_module_state->__pyx_type_7opendht_5_core_TrustList);
  Py_VISIT(traverse_module_state->__pyx_ptype_7opendht_5_core_ListenToken);
  Py_VISIT(traverse_module_state->__pyx_type_7opendht_5_core_ListenToken);
  Py_VISIT(traverse_module_state->__pyx_ptype_7opendht_5_core_Identity);
  Py_VISIT(traverse_module_state->__pyx_type_7opendht_5_core_Identity);
  Py_VISIT(traverse_module_state->__pyx_ptype_7opendht_5_core_DhtConfig);
  Py_VISIT(traverse_module_state->__pyx_type_7opendht_5_core_DhtConfig);
  Py_VISIT(traverse_module_state->__pyx_ptype_7opendht_5_core_DhtRunner);
  Py_VISIT(traverse_module_state->__pyx_type_7opendht_5_core_DhtRunner);
  Py_VISIT(traverse_module_state->__pyx_ptype_7opendht_5_core_IndexValue);
  Py_VISIT(traverse_module_state->__pyx_type_7opendht_5_core_IndexValue);
  Py_VISIT(traverse_module_state->__pyx_ptype_7opendht_5_core_Pht);
  Py_VISIT(traverse_module_state->__pyx_type_7opendht_5_core_Pht);
  Py_VISIT(traverse_module_state->__pyx_ptype_7opendht_5_core___pyx_scope_struct__ping);
  Py_VISIT(traverse_module_state->__pyx_type_7opendht_5_core___pyx_scope_struct__ping);
  Py_VISIT(traverse_module_state->__pyx_ptype_7opendht_5_core___pyx_scope_struct_1_get);
  Py_VISIT(traverse_module_state->__pyx_type_7opendht_5_core___pyx_scope_struct_1_get);
  Py_VISIT(traverse_module_state->__pyx_ptype_7opendht_5_core___pyx_scope_struct_2_put);
  Py_VISIT(traverse_module_state->__pyx_type_7opendht_5_core___pyx_scope_struct_2_put);
  Py_VISIT(traverse_module_state->__pyx_ptype_7opendht_5_core___pyx_scope_struct_3_putSigned);
  Py_VISIT(traverse_module_state->__pyx_type_7opendht_5_core___pyx_scope_struct_3_putSigned);
  Py_VISIT(traverse_module_state->__pyx_ptype_7opendht_5_core___pyx_scope_struct_4_putEncrypted);
  Py_VISIT(traverse_module_state->__pyx_type_7opendht_5_core___pyx_scope_struct_4_putEncrypted);
  Py_VISIT(traverse_module_state->__pyx_ptype___pyx_scope_struct____Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_);
  Py_VISIT(traverse_module_state->__pyx_scope_struct____Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_);
  Py_VISIT(traverse_module_state->__pyx_umethod_PyDict_Type_items.method);
  Py_VISIT(traverse_module_state->__pyx_umethod_PyDict_Type_pop.method);
  Py_VISIT(traverse_module_state->__pyx_umethod_PyDict_Type_values.method);
  Py_VISIT(traverse_module_state->__pyx_k__8);
  Py_VISIT(traverse_module_state->__pyx_k__9);
  Py_VISIT(traverse_module_state->__pyx_k__10);
  Py_VISIT(traverse_module_state->__pyx_k__11);
  for (int i=0; i<9; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_tuple[i]); }
  for (int i=0; i<168; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); }
  for (int i=0; i<599; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); }
  for (int i=0; i<4; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_number_tab[i]); }
/* #### Code section: module_state_traverse_contents ### */
/* CommonTypesMetaclass.module_state_traverse */
Py_VISIT(traverse_module_state->__pyx_CommonTypesMetaclassType);

/* CythonFunctionPerModule.module_state_traverse */
Py_VISIT(traverse_module_state->__pyx_CyFunctionType);

/* #### Code section: module_state_traverse_end ### */
return 0;
}
#endif
/* #### Code section: module_code ### */

/* "cfunc.to_py":86
 * @cname("__Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_")
 * cdef object __Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_(object (*f)() ):
 *     def wrap():             # <<<<<<<<<<<<<<
 *         """wrap()"""
 *         return f()
*/

/* Python wrapper */
static PyObject *__pyx_pw_11cfunc_dot_to_py_57__Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py__1wrap(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
PyDoc_STRVAR(__pyx_doc_11cfunc_dot_to_py_57__Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py__wrap, "wrap()");
static PyMethodDef __pyx_mdef_11cfunc_dot_to_py_57__Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py__1wrap = {"wrap", (PyCFunction)__pyx_pw_11cfunc_dot_to_py_57__Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py__1wrap, METH_NOARGS, __pyx_doc_11cfunc_dot_to_py_57__Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py__wrap};
static PyObject *__pyx_pw_11cfunc_dot_to_py_57__Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py__1wrap(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("wrap (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_11cfunc_dot_to_py_57__Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py__wrap(__pyx_self);

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

static PyObject *__pyx_pf_11cfunc_dot_to_py_57__Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py__wrap(PyObject *__pyx_self) {
  struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_ *__pyx_cur_scope;
  struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_ *__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("wrap", 0);
  __pyx_outer_scope = (struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_ *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "cfunc.to_py":88
 *     def wrap():
 *         """wrap()"""
 *         return f()             # <<<<<<<<<<<<<<
 *     return wrap
 * 
*/
  __pyx_t_1 = __pyx_cur_scope->__pyx_v_f(); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 88, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_1;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cfunc.to_py":86
 * @cname("__Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_")
 * cdef object __Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_(object (*f)() ):
 *     def wrap():             # <<<<<<<<<<<<<<
 *         """wrap()"""
 *         return f()
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cfunc.to_py.__Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_.wrap", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cfunc.to_py":84
 * 
 * 
 * @cname("__Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_")             # <<<<<<<<<<<<<<
 * cdef object __Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_(object (*f)() ):
 *     def wrap():
*/

static PyObject *__Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_(PyObject *(*__pyx_v_f)(void)) {
  struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_ *__pyx_cur_scope;
  PyObject *__pyx_v_wrap = 0;
  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("__Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_", 0);
  __pyx_cur_scope = (struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_ *)__pyx_tp_new___pyx_scope_struct____Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_(__pyx_mstate_global->__pyx_ptype___pyx_scope_struct____Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_, __pyx_mstate_global->__pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_ *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(1, 84, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_f = __pyx_v_f;



  /* "cfunc.to_py":86
 * @cname("__Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_")
 * cdef object __Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_(object (*f)() ):
 *     def wrap():             # <<<<<<<<<<<<<<
 *         """wrap()"""
 *         return f()
*/
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_11cfunc_dot_to_py_57__Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py__1wrap, 0, __pyx_mstate_global->__pyx_n_u_Pyx_CFunc_7opendht_5_core_obje, ((PyObject*)__pyx_cur_scope), __pyx_mstate_global->__pyx_n_u_cfunc_to_py, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 86, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_wrap = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cfunc.to_py":89
 *         """wrap()"""
 *         return f()
 *     return wrap             # <<<<<<<<<<<<<<
 * 
*/
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __Pyx_INCREF(__pyx_v_wrap);
      __pyx_r = __pyx_v_wrap;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  goto __pyx_L0;

  /* "cfunc.to_py":84
 * 
 * 
 * @cname("__Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_")             # <<<<<<<<<<<<<<
 * cdef object __Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_(object (*f)() ):
 *     def wrap():
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cfunc.to_py.__Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_wrap);
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "string.to_py":31
 *     cdef object __Pyx_PyObject_FromStringAndSize(const char*, size_t)
 * 
 * @cname("__pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string")             # <<<<<<<<<<<<<<
 * cdef inline object __pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string(const string& s):
 *     if s.size() > <size_t> PY_SSIZE_T_MAX:
*/

static CYTHON_INLINE PyObject *__pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string(std::string const &__pyx_v_s) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string", 0);

  /* "string.to_py":33
 * @cname("__pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string")
 * cdef inline object __pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string(const string& s):
 *     if s.size() > <size_t> PY_SSIZE_T_MAX:             # <<<<<<<<<<<<<<
 *         raise MemoryError()
 *     return __Pyx_PyObject_FromStringAndSize(s.data(), <Py_ssize_t> s.size())
*/
  __pyx_t_1 = (__pyx_v_s.size() > ((size_t)PY_SSIZE_T_MAX));

  if (unlikely(__pyx_t_1)) {


    /* "string.to_py":34
 * cdef inline object __pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string(const string& s):
 *     if s.size() > <size_t> PY_SSIZE_T_MAX:
 *         raise MemoryError()             # <<<<<<<<<<<<<<
 *     return __Pyx_PyObject_FromStringAndSize(s.data(), <Py_ssize_t> s.size())
 * cdef extern from *:
*/
    PyErr_NoMemory(); __PYX_ERR(1, 34, __pyx_L1_error)

    /* "string.to_py":33
 * @cname("__pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string")
 * cdef inline object __pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string(const string& s):
 *     if s.size() > <size_t> PY_SSIZE_T_MAX:             # <<<<<<<<<<<<<<
 *         raise MemoryError()
 *     return __Pyx_PyObject_FromStringAndSize(s.data(), <Py_ssize_t> s.size())
*/
  }

  /* "string.to_py":35
 *     if s.size() > <size_t> PY_SSIZE_T_MAX:
 *         raise MemoryError()
 *     return __Pyx_PyObject_FromStringAndSize(s.data(), <Py_ssize_t> s.size())             # <<<<<<<<<<<<<<
 * cdef extern from *:
 *     cdef object __Pyx_PyUnicode_FromStringAndSize(const char*, size_t)
*/
  __pyx_t_2 = __Pyx_PyObject_FromStringAndSize(__pyx_v_s.data(), ((Py_ssize_t)__pyx_v_s.size())); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_2;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "string.to_py":31
 *     cdef object __Pyx_PyObject_FromStringAndSize(const char*, size_t)
 * 
 * @cname("__pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string")             # <<<<<<<<<<<<<<
 * cdef inline object __pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string(const string& s):
 *     if s.size() > <size_t> PY_SSIZE_T_MAX:
*/

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

/* "string.to_py":39
 *     cdef object __Pyx_PyUnicode_FromStringAndSize(const char*, size_t)
 * 
 * @cname("__pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string")             # <<<<<<<<<<<<<<
 * cdef inline object __pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(const string& s):
 *     if s.size() > <size_t> PY_SSIZE_T_MAX:
*/

static CYTHON_INLINE PyObject *__pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(std::string const &__pyx_v_s) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string", 0);

  /* "string.to_py":41
 * @cname("__pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string")
 * cdef inline object __pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(const string& s):
 *     if s.size() > <size_t> PY_SSIZE_T_MAX:             # <<<<<<<<<<<<<<
 *         raise MemoryError()
 *     return __Pyx_PyUnicode_FromStringAndSize(s.data(), <Py_ssize_t> s.size())
*/
  __pyx_t_1 = (__pyx_v_s.size() > ((size_t)PY_SSIZE_T_MAX));

  if (unlikely(__pyx_t_1)) {


    /* "string.to_py":42
 * cdef inline object __pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(const string& s):
 *     if s.size() > <size_t> PY_SSIZE_T_MAX:
 *         raise MemoryError()             # <<<<<<<<<<<<<<
 *     return __Pyx_PyUnicode_FromStringAndSize(s.data(), <Py_ssize_t> s.size())
 * cdef extern from *:
*/
    PyErr_NoMemory(); __PYX_ERR(1, 42, __pyx_L1_error)

    /* "string.to_py":41
 * @cname("__pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string")
 * cdef inline object __pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(const string& s):
 *     if s.size() > <size_t> PY_SSIZE_T_MAX:             # <<<<<<<<<<<<<<
 *         raise MemoryError()
 *     return __Pyx_PyUnicode_FromStringAndSize(s.data(), <Py_ssize_t> s.size())
*/
  }

  /* "string.to_py":43
 *     if s.size() > <size_t> PY_SSIZE_T_MAX:
 *         raise MemoryError()
 *     return __Pyx_PyUnicode_FromStringAndSize(s.data(), <Py_ssize_t> s.size())             # <<<<<<<<<<<<<<
 * cdef extern from *:
 *     cdef object __Pyx_PyBytes_FromStringAndSize(const char*, size_t)
*/
  __pyx_t_2 = __Pyx_PyUnicode_FromStringAndSize(__pyx_v_s.data(), ((Py_ssize_t)__pyx_v_s.size())); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 43, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_2;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "string.to_py":39
 *     cdef object __Pyx_PyUnicode_FromStringAndSize(const char*, size_t)
 * 
 * @cname("__pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string")             # <<<<<<<<<<<<<<
 * cdef inline object __pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(const string& s):
 *     if s.size() > <size_t> PY_SSIZE_T_MAX:
*/

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

/* "string.to_py":47
 *     cdef object __Pyx_PyBytes_FromStringAndSize(const char*, size_t)
 * 
 * @cname("__pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string")             # <<<<<<<<<<<<<<
 * cdef inline object __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(const string& s):
 *     if s.size() > <size_t> PY_SSIZE_T_MAX:
*/

static CYTHON_INLINE PyObject *__pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(std::string const &__pyx_v_s) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string", 0);

  /* "string.to_py":49
 * @cname("__pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string")
 * cdef inline object __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(const string& s):
 *     if s.size() > <size_t> PY_SSIZE_T_MAX:             # <<<<<<<<<<<<<<
 *         raise MemoryError()
 *     return __Pyx_PyBytes_FromStringAndSize(s.data(), <Py_ssize_t> s.size())
*/
  __pyx_t_1 = (__pyx_v_s.size() > ((size_t)PY_SSIZE_T_MAX));

  if (unlikely(__pyx_t_1)) {


    /* "string.to_py":50
 * cdef inline object __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(const string& s):
 *     if s.size() > <size_t> PY_SSIZE_T_MAX:
 *         raise MemoryError()             # <<<<<<<<<<<<<<
 *     return __Pyx_PyBytes_FromStringAndSize(s.data(), <Py_ssize_t> s.size())
 * cdef extern from *:
*/
    PyErr_NoMemory(); __PYX_ERR(1, 50, __pyx_L1_error)

    /* "string.to_py":49
 * @cname("__pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string")
 * cdef inline object __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(const string& s):
 *     if s.size() > <size_t> PY_SSIZE_T_MAX:             # <<<<<<<<<<<<<<
 *         raise MemoryError()
 *     return __Pyx_PyBytes_FromStringAndSize(s.data(), <Py_ssize_t> s.size())
*/
  }

  /* "string.to_py":51
 *     if s.size() > <size_t> PY_SSIZE_T_MAX:
 *         raise MemoryError()
 *     return __Pyx_PyBytes_FromStringAndSize(s.data(), <Py_ssize_t> s.size())             # <<<<<<<<<<<<<<
 * cdef extern from *:
 *     cdef object __Pyx_PyByteArray_FromStringAndSize(const char*, size_t)
*/
  __pyx_t_2 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_s.data(), ((Py_ssize_t)__pyx_v_s.size())); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_2;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "string.to_py":47
 *     cdef object __Pyx_PyBytes_FromStringAndSize(const char*, size_t)
 * 
 * @cname("__pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string")             # <<<<<<<<<<<<<<
 * cdef inline object __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(const string& s):
 *     if s.size() > <size_t> PY_SSIZE_T_MAX:
*/

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

/* "string.to_py":55
 *     cdef object __Pyx_PyByteArray_FromStringAndSize(const char*, size_t)
 * 
 * @cname("__pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string")             # <<<<<<<<<<<<<<
 * cdef inline object __pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string(const string& s):
 *     if s.size() > <size_t> PY_SSIZE_T_MAX:
*/

static CYTHON_INLINE PyObject *__pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string(std::string const &__pyx_v_s) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string", 0);

  /* "string.to_py":57
 * @cname("__pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string")
 * cdef inline object __pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string(const string& s):
 *     if s.size() > <size_t> PY_SSIZE_T_MAX:             # <<<<<<<<<<<<<<
 *         raise MemoryError()
 *     return __Pyx_PyByteArray_FromStringAndSize(s.data(), <Py_ssize_t> s.size())
*/
  __pyx_t_1 = (__pyx_v_s.size() > ((size_t)PY_SSIZE_T_MAX));

  if (unlikely(__pyx_t_1)) {


    /* "string.to_py":58
 * cdef inline object __pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string(const string& s):
 *     if s.size() > <size_t> PY_SSIZE_T_MAX:
 *         raise MemoryError()             # <<<<<<<<<<<<<<
 *     return __Pyx_PyByteArray_FromStringAndSize(s.data(), <Py_ssize_t> s.size())
*/
    PyErr_NoMemory(); __PYX_ERR(1, 58, __pyx_L1_error)

    /* "string.to_py":57
 * @cname("__pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string")
 * cdef inline object __pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string(const string& s):
 *     if s.size() > <size_t> PY_SSIZE_T_MAX:             # <<<<<<<<<<<<<<
 *         raise MemoryError()
 *     return __Pyx_PyByteArray_FromStringAndSize(s.data(), <Py_ssize_t> s.size())
*/
  }

  /* "string.to_py":59
 *     if s.size() > <size_t> PY_SSIZE_T_MAX:
 *         raise MemoryError()
 *     return __Pyx_PyByteArray_FromStringAndSize(s.data(), <Py_ssize_t> s.size())             # <<<<<<<<<<<<<<
*/
  __pyx_t_2 = __Pyx_PyByteArray_FromStringAndSize(__pyx_v_s.data(), ((Py_ssize_t)__pyx_v_s.size())); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_2;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "string.to_py":55
 *     cdef object __Pyx_PyByteArray_FromStringAndSize(const char*, size_t)
 * 
 * @cname("__pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string")             # <<<<<<<<<<<<<<
 * cdef inline object __pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string(const string& s):
 *     if s.size() > <size_t> PY_SSIZE_T_MAX:
*/

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

/* "string.from_py":12
 *     cdef const char* __Pyx_PyObject_AsStringAndSize(object, Py_ssize_t*) except NULL
 * 
 * @cname("__pyx_convert_string_from_py_6libcpp_6string_std__in_string")             # <<<<<<<<<<<<<<
 * cdef string __pyx_convert_string_from_py_6libcpp_6string_std__in_string(object o) except *:
 *     cdef Py_ssize_t length = 0
*/

static std::string __pyx_convert_string_from_py_6libcpp_6string_std__in_string(PyObject *__pyx_v_o) {
  Py_ssize_t __pyx_v_length;
  char const *__pyx_v_data;
  std::string __pyx_r;
  char const *__pyx_t_1;
  std::string __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "string.from_py":14
 * @cname("__pyx_convert_string_from_py_6libcpp_6string_std__in_string")
 * cdef string __pyx_convert_string_from_py_6libcpp_6string_std__in_string(object o) except *:
 *     cdef Py_ssize_t length = 0             # <<<<<<<<<<<<<<
 *     cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length)
 *     return string(data, <size_t> length)
*/
  __pyx_v_length = 0;

  /* "string.from_py":15
 * cdef string __pyx_convert_string_from_py_6libcpp_6string_std__in_string(object o) except *:
 *     cdef Py_ssize_t length = 0
 *     cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length)             # <<<<<<<<<<<<<<
 *     return string(data, <size_t> length)
 * 
*/
  __pyx_t_1 = __Pyx_PyObject_AsStringAndSize(__pyx_v_o, (&__pyx_v_length)); if (unlikely(__pyx_t_1 == ((void *)NULL))) __PYX_ERR(1, 15, __pyx_L1_error)
  __pyx_v_data = __pyx_t_1;

  /* "string.from_py":16
 *     cdef Py_ssize_t length = 0
 *     cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length)
 *     return string(data, <size_t> length)             # <<<<<<<<<<<<<<
 * 
*/
  try {
    __pyx_t_2 = std::string(__pyx_v_data, ((size_t)__pyx_v_length));
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(1, 16, __pyx_L1_error)
  }
  {
    __pyx_r = __pyx_t_2;
  }
  goto __pyx_L0;

  /* "string.from_py":12
 *     cdef const char* __Pyx_PyObject_AsStringAndSize(object, Py_ssize_t*) except NULL
 * 
 * @cname("__pyx_convert_string_from_py_6libcpp_6string_std__in_string")             # <<<<<<<<<<<<<<
 * cdef string __pyx_convert_string_from_py_6libcpp_6string_std__in_string(object o) except *:
 *     cdef Py_ssize_t length = 0
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("string.from_py.__pyx_convert_string_from_py_6libcpp_6string_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;



  return __pyx_r;
}

/* "vector.from_py":51
 *     cdef Py_ssize_t __Pyx_PyObject_LengthHint(object o, Py_ssize_t defaultval) except -1
 * 
 * @cname("__pyx_convert_vector_from_py_uint8_t")             # <<<<<<<<<<<<<<
 * cdef vector[X] __pyx_convert_vector_from_py_uint8_t(object o) except *:
 * 
*/

static std::vector<uint8_t>  __pyx_convert_vector_from_py_uint8_t(PyObject *__pyx_v_o) {
  std::vector<uint8_t>  __pyx_v_v;
  Py_ssize_t __pyx_v_s;
  PyObject *__pyx_v_item = NULL;
  std::vector<uint8_t>  __pyx_r;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  uint8_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_convert_vector_from_py_uint8_t", 0);

  /* "vector.from_py":55
 * 
 *     cdef vector[X] v
 *     cdef Py_ssize_t s = __Pyx_PyObject_LengthHint(o, 0)             # <<<<<<<<<<<<<<
 * 
 *     if s > 0:
*/
  __pyx_t_1 = __Pyx_PyObject_LengthHint(__pyx_v_o, 0); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1L))) __PYX_ERR(1, 55, __pyx_L1_error)
  __pyx_v_s = __pyx_t_1;

  /* "vector.from_py":57
 *     cdef Py_ssize_t s = __Pyx_PyObject_LengthHint(o, 0)
 * 
 *     if s > 0:             # <<<<<<<<<<<<<<
 *         v.reserve(<size_t> s)
 * 
*/
  __pyx_t_2 = (__pyx_v_s > 0);

  if (__pyx_t_2) {


    /* "vector.from_py":58
 * 
 *     if s > 0:
 *         v.reserve(<size_t> s)             # <<<<<<<<<<<<<<
 * 
 *     for item in o:
*/
    try {
      __pyx_v_v.reserve(((size_t)__pyx_v_s));
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(1, 58, __pyx_L1_error)
    }

    /* "vector.from_py":57
 *     cdef Py_ssize_t s = __Pyx_PyObject_LengthHint(o, 0)
 * 
 *     if s > 0:             # <<<<<<<<<<<<<<
 *         v.reserve(<size_t> s)
 * 
*/
  }

  /* "vector.from_py":60
 *         v.reserve(<size_t> s)
 * 
 *     for item in o:             # <<<<<<<<<<<<<<
 *         v.push_back(<X>item)
 * 
*/
  if (likely(PyList_CheckExact(__pyx_v_o)) || PyTuple_CheckExact(__pyx_v_o)) {
    __pyx_t_3 = __pyx_v_o; __Pyx_INCREF(__pyx_t_3);
    __pyx_t_1 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_1 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_o); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 60, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 60, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 60, __pyx_L1_error)
          #endif
          if (__pyx_t_1 >= __pyx_temp) break;
        }
        __pyx_t_5 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_3, __pyx_t_1, __Pyx_ReferenceSharing_OwnStrongReference);
        ++__pyx_t_1;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 60, __pyx_L1_error)
          #endif
          if (__pyx_t_1 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1));
        #else
        __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_1);
        #endif
        ++__pyx_t_1;
      }
      if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 60, __pyx_L1_error)
    } else {
      __pyx_t_5 = __pyx_t_4(__pyx_t_3);
      if (unlikely(!__pyx_t_5)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(1, 60, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "vector.from_py":61
 * 
 *     for item in o:
 *         v.push_back(<X>item)             # <<<<<<<<<<<<<<
 * 
 *     return v
*/
    __pyx_t_6 = __Pyx_PyLong_As_uint8_t(__pyx_v_item); if (unlikely((__pyx_t_6 == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 61, __pyx_L1_error)
    try {
      __pyx_v_v.push_back(((uint8_t)__pyx_t_6));
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(1, 61, __pyx_L1_error)
    }


    /* "vector.from_py":60
 *         v.reserve(<size_t> s)
 * 
 *     for item in o:             # <<<<<<<<<<<<<<
 *         v.push_back(<X>item)
 * 
*/
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "vector.from_py":63
 *         v.push_back(<X>item)
 * 
 *     return v             # <<<<<<<<<<<<<<
 * 
*/
  {

    __pyx_r = __pyx_v_v;
  }
  goto __pyx_L0;

  /* "vector.from_py":51
 *     cdef Py_ssize_t __Pyx_PyObject_LengthHint(object o, Py_ssize_t defaultval) except -1
 * 
 * @cname("__pyx_convert_vector_from_py_uint8_t")             # <<<<<<<<<<<<<<
 * cdef vector[X] __pyx_convert_vector_from_py_uint8_t(object o) except *:
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("vector.from_py.__pyx_convert_vector_from_py_uint8_t", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;


  __Pyx_XDECREF(__pyx_v_item);

  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cpython/complex.pxd":20
 * 
 *         # unavailable in limited API
 *         @property             # <<<<<<<<<<<<<<
 *         @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API")
 *         cdef inline double real(self) noexcept:
*/

#if !CYTHON_COMPILING_IN_LIMITED_API
static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4real___get__(PyComplexObject *__pyx_v_self) {
  double __pyx_r;

  /* "cpython/complex.pxd":23
 *         @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API")
 *         cdef inline double real(self) noexcept:
 *             return self.cval.real             # <<<<<<<<<<<<<<
 * 
 *         # unavailable in limited API
*/
  {

    __pyx_r = __pyx_v_self->cval.real;
  }
  goto __pyx_L0;

  /* "cpython/complex.pxd":20
 * 
 *         # unavailable in limited API
 *         @property             # <<<<<<<<<<<<<<
 *         @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API")
 *         cdef inline double real(self) noexcept:
*/

  /* function exit code */
  __pyx_L0:;

  return __pyx_r;
}
#endif /*!(#if !CYTHON_COMPILING_IN_LIMITED_API)*/

/* "cpython/complex.pxd":26
 * 
 *         # unavailable in limited API
 *         @property             # <<<<<<<<<<<<<<
 *         @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API")
 *         cdef inline double imag(self) noexcept:
*/

#if !CYTHON_COMPILING_IN_LIMITED_API
static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4imag___get__(PyComplexObject *__pyx_v_self) {
  double __pyx_r;

  /* "cpython/complex.pxd":29
 *         @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API")
 *         cdef inline double imag(self) noexcept:
 *             return self.cval.imag             # <<<<<<<<<<<<<<
 * 
 *     # PyTypeObject PyComplex_Type
*/
  {

    __pyx_r = __pyx_v_self->cval.imag;
  }
  goto __pyx_L0;

  /* "cpython/complex.pxd":26
 * 
 *         # unavailable in limited API
 *         @property             # <<<<<<<<<<<<<<
 *         @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API")
 *         cdef inline double imag(self) noexcept:
*/

  /* function exit code */
  __pyx_L0:;

  return __pyx_r;
}
#endif /*!(#if !CYTHON_COMPILING_IN_LIMITED_API)*/

/* "cpython/contextvars.pxd":115
 * 
 * 
 * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API")             # <<<<<<<<<<<<<<
 * cdef inline object get_value(var, default_value=None):
 *     """Return a new reference to the value of the context variable,
*/

#if !CYTHON_COMPILING_IN_LIMITED_API
static CYTHON_INLINE PyObject *__pyx_f_7cpython_11contextvars_get_value(PyObject *__pyx_v_var, struct __pyx_opt_args_7cpython_11contextvars_get_value *__pyx_optional_args) {

  /* "cpython/contextvars.pxd":116
 * 
 * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API")
 * cdef inline object get_value(var, default_value=None):             # <<<<<<<<<<<<<<
 *     """Return a new reference to the value of the context variable,
 *     or the default value of the context variable,
*/
  PyObject *__pyx_v_default_value = ((PyObject *)Py_None);
  PyObject *__pyx_v_value;
  PyObject *__pyx_v_pyvalue = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_value", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_default_value = __pyx_optional_args->default_value;
    }
  }

  /* "cpython/contextvars.pxd":121
 *     or None if no such value or default was found.
 *     """
 *     cdef PyObject *value = NULL             # <<<<<<<<<<<<<<
 *     PyContextVar_Get(var, NULL, &value)
 *     if value is NULL:
*/
  __pyx_v_value = NULL;

  /* "cpython/contextvars.pxd":122
 *     """
 *     cdef PyObject *value = NULL
 *     PyContextVar_Get(var, NULL, &value)             # <<<<<<<<<<<<<<
 *     if value is NULL:
 *         # context variable does not have a default
*/
  __pyx_t_1 = PyContextVar_Get(__pyx_v_var, NULL, (&__pyx_v_value)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 122, __pyx_L1_error)


  /* "cpython/contextvars.pxd":123
 *     cdef PyObject *value = NULL
 *     PyContextVar_Get(var, NULL, &value)
 *     if value is NULL:             # <<<<<<<<<<<<<<
 *         # context variable does not have a default
 *         pyvalue = default_value
*/
  __pyx_t_2 = (__pyx_v_value == NULL);

  if (__pyx_t_2) {


    /* "cpython/contextvars.pxd":125
 *     if value is NULL:
 *         # context variable does not have a default
 *         pyvalue = default_value             # <<<<<<<<<<<<<<
 *     else:
 *         # value or default value of context variable
*/
    __Pyx_INCREF(__pyx_v_default_value);
    __pyx_v_pyvalue = __pyx_v_default_value;

    /* "cpython/contextvars.pxd":123
 *     cdef PyObject *value = NULL
 *     PyContextVar_Get(var, NULL, &value)
 *     if value is NULL:             # <<<<<<<<<<<<<<
 *         # context variable does not have a default
 *         pyvalue = default_value
*/
    goto __pyx_L3;
  }

  /* "cpython/contextvars.pxd":128
 *     else:
 *         # value or default value of context variable
 *         pyvalue = <object>value             # <<<<<<<<<<<<<<
 *         Py_XDECREF(value)  # PyContextVar_Get() returned an owned reference as 'PyObject*'
 *     return pyvalue
*/
  /*else*/ {
    __pyx_t_3 = ((PyObject *)__pyx_v_value);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_v_pyvalue = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "cpython/contextvars.pxd":129
 *         # value or default value of context variable
 *         pyvalue = <object>value
 *         Py_XDECREF(value)  # PyContextVar_Get() returned an owned reference as 'PyObject*'             # <<<<<<<<<<<<<<
 *     return pyvalue
 * 
*/
    Py_XDECREF(__pyx_v_value);
  }
  __pyx_L3:;

  /* "cpython/contextvars.pxd":130
 *         pyvalue = <object>value
 *         Py_XDECREF(value)  # PyContextVar_Get() returned an owned reference as 'PyObject*'
 *     return pyvalue             # <<<<<<<<<<<<<<
 * 
 * 
*/
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __Pyx_INCREF(__pyx_v_pyvalue);
      __pyx_r = __pyx_v_pyvalue;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  goto __pyx_L0;

  /* "cpython/contextvars.pxd":115
 * 
 * 
 * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API")             # <<<<<<<<<<<<<<
 * cdef inline object get_value(var, default_value=None):
 *     """Return a new reference to the value of the context variable,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cpython.contextvars.get_value", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;

  __Pyx_XDECREF(__pyx_v_pyvalue);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
#endif /*!(#if !CYTHON_COMPILING_IN_LIMITED_API)*/

/* "cpython/contextvars.pxd":133
 * 
 * 
 * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API")             # <<<<<<<<<<<<<<
 * cdef inline object get_value_no_default(var, default_value=None):
 *     """Return a new reference to the value of the context variable,
*/

#if !CYTHON_COMPILING_IN_LIMITED_API
static CYTHON_INLINE PyObject *__pyx_f_7cpython_11contextvars_get_value_no_default(PyObject *__pyx_v_var, struct __pyx_opt_args_7cpython_11contextvars_get_value_no_default *__pyx_optional_args) {

  /* "cpython/contextvars.pxd":134
 * 
 * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API")
 * cdef inline object get_value_no_default(var, default_value=None):             # <<<<<<<<<<<<<<
 *     """Return a new reference to the value of the context variable,
 *     or the provided default value if no such value was found.
*/
  PyObject *__pyx_v_default_value = ((PyObject *)Py_None);
  PyObject *__pyx_v_value;
  PyObject *__pyx_v_pyvalue = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_value_no_default", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_default_value = __pyx_optional_args->default_value;
    }
  }

  /* "cpython/contextvars.pxd":140
 *     Ignores the default value of the context variable, if any.
 *     """
 *     cdef PyObject *value = NULL             # <<<<<<<<<<<<<<
 *     PyContextVar_Get(var, <PyObject*>default_value, &value)
 *     # value of context variable or 'default_value'
*/
  __pyx_v_value = NULL;

  /* "cpython/contextvars.pxd":141
 *     """
 *     cdef PyObject *value = NULL
 *     PyContextVar_Get(var, <PyObject*>default_value, &value)             # <<<<<<<<<<<<<<
 *     # value of context variable or 'default_value'
 *     pyvalue = <object>value
*/
  __pyx_t_1 = PyContextVar_Get(__pyx_v_var, ((PyObject *)__pyx_v_default_value), (&__pyx_v_value)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 141, __pyx_L1_error)


  /* "cpython/contextvars.pxd":143
 *     PyContextVar_Get(var, <PyObject*>default_value, &value)
 *     # value of context variable or 'default_value'
 *     pyvalue = <object>value             # <<<<<<<<<<<<<<
 *     Py_XDECREF(value)  # PyContextVar_Get() returned an owned reference as 'PyObject*'
 *     return pyvalue
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_value);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_v_pyvalue = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cpython/contextvars.pxd":144
 *     # value of context variable or 'default_value'
 *     pyvalue = <object>value
 *     Py_XDECREF(value)  # PyContextVar_Get() returned an owned reference as 'PyObject*'             # <<<<<<<<<<<<<<
 *     return pyvalue
*/
  Py_XDECREF(__pyx_v_value);

  /* "cpython/contextvars.pxd":145
 *     pyvalue = <object>value
 *     Py_XDECREF(value)  # PyContextVar_Get() returned an owned reference as 'PyObject*'
 *     return pyvalue             # <<<<<<<<<<<<<<
*/
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __Pyx_INCREF(__pyx_v_pyvalue);
      __pyx_r = __pyx_v_pyvalue;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  goto __pyx_L0;

  /* "cpython/contextvars.pxd":133
 * 
 * 
 * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API")             # <<<<<<<<<<<<<<
 * cdef inline object get_value_no_default(var, default_value=None):
 *     """Return a new reference to the value of the context variable,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cpython.contextvars.get_value_no_default", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;

  __Pyx_XDECREF(__pyx_v_pyvalue);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
#endif /*!(#if !CYTHON_COMPILING_IN_LIMITED_API)*/

/* "opendht.pyx":25
 * import threading
 * 
 * cdef inline void _initialize_gnutls():             # <<<<<<<<<<<<<<
 *     cdef int err = cpp.gnutls_global_init()
 *     if err != 0:
*/

static CYTHON_INLINE void __pyx_f_7opendht_5_core__initialize_gnutls(void) {
  int __pyx_v_err;
  PyObject *__pyx_v_atexit = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  char const *__pyx_t_4;
  Py_ssize_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_initialize_gnutls", 0);

  /* "opendht.pyx":26
 * 
 * cdef inline void _initialize_gnutls():
 *     cdef int err = cpp.gnutls_global_init()             # <<<<<<<<<<<<<<
 *     if err != 0:
 *         print(f"Failed to initialize GnuTLS: {cpp.gnutls_strerror(err).decode()}")
*/
  __pyx_v_err = gnutls_global_init();

  /* "opendht.pyx":27
 * cdef inline void _initialize_gnutls():
 *     cdef int err = cpp.gnutls_global_init()
 *     if err != 0:             # <<<<<<<<<<<<<<
 *         print(f"Failed to initialize GnuTLS: {cpp.gnutls_strerror(err).decode()}")
 *     else:
*/
  __pyx_t_1 = (__pyx_v_err != 0);

  if (__pyx_t_1) {


    /* "opendht.pyx":28
 *     cdef int err = cpp.gnutls_global_init()
 *     if err != 0:
 *         print(f"Failed to initialize GnuTLS: {cpp.gnutls_strerror(err).decode()}")             # <<<<<<<<<<<<<<
 *     else:
 *         import atexit
*/
    __pyx_t_3 = NULL;

    __pyx_t_4 = gnutls_strerror(__pyx_v_err);
    __pyx_t_5 = __Pyx_ssize_strlen(__pyx_t_4); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 28, __pyx_L1_error)
    __pyx_t_6 = __Pyx_decode_c_string(__pyx_t_4, 0, __pyx_t_5, NULL, NULL, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 28, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);

    if (!(likely(PyUnicode_CheckExact(__pyx_t_6)) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_6))) __PYX_ERR(0, 28, __pyx_L1_error)
    __pyx_t_7 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Failed_to_initialize_GnuTLS, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 28, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_8 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_7};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_print, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "opendht.pyx":27
 * cdef inline void _initialize_gnutls():
 *     cdef int err = cpp.gnutls_global_init()
 *     if err != 0:             # <<<<<<<<<<<<<<
 *         print(f"Failed to initialize GnuTLS: {cpp.gnutls_strerror(err).decode()}")
 *     else:
*/
    goto __pyx_L3;
  }

  /* "opendht.pyx":30
 *         print(f"Failed to initialize GnuTLS: {cpp.gnutls_strerror(err).decode()}")
 *     else:
 *         import atexit             # <<<<<<<<<<<<<<
 *         atexit.register(_deinitialize_gnutls)
 * 
*/
  /*else*/ {
    __pyx_t_9 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_atexit, 0, 0, NULL, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 30, __pyx_L1_error)
    __pyx_t_2 = __pyx_t_9;
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_atexit = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "opendht.pyx":31
 *     else:
 *         import atexit
 *         atexit.register(_deinitialize_gnutls)             # <<<<<<<<<<<<<<
 * 
 * cdef inline _deinitialize_gnutls():
*/
    __pyx_t_7 = __pyx_v_atexit;
    __Pyx_INCREF(__pyx_t_7);
    __pyx_t_3 = __Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_(__pyx_f_7opendht_5_core__deinitialize_gnutls); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 31, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_3};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_register, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 31, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_L3:;

  /* "opendht.pyx":25
 * import threading
 * 
 * cdef inline void _initialize_gnutls():             # <<<<<<<<<<<<<<
 *     cdef int err = cpp.gnutls_global_init()
 *     if err != 0:
*/

  /* function exit 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_AddTraceback("opendht._core._initialize_gnutls", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;

  __Pyx_XDECREF(__pyx_v_atexit);

  __Pyx_RefNannyFinishContext();
}

/* "opendht.pyx":33
 *         atexit.register(_deinitialize_gnutls)
 * 
 * cdef inline _deinitialize_gnutls():             # <<<<<<<<<<<<<<
 *     cpp.gnutls_global_deinit()
 * 
*/

static CYTHON_INLINE PyObject *__pyx_f_7opendht_5_core__deinitialize_gnutls(void) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_deinitialize_gnutls", 0);

  /* "opendht.pyx":34
 * 
 * cdef inline _deinitialize_gnutls():
 *     cpp.gnutls_global_deinit()             # <<<<<<<<<<<<<<
 * 
 * # Initialize GnuTLS when this module is imported
*/
  gnutls_global_deinit();

  /* "opendht.pyx":33
 *         atexit.register(_deinitialize_gnutls)
 * 
 * cdef inline _deinitialize_gnutls():             # <<<<<<<<<<<<<<
 *     cpp.gnutls_global_deinit()
 * 
*/

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

/* "opendht.pyx":39
 * _initialize_gnutls()
 * 
 * def version() -> str:             # <<<<<<<<<<<<<<
 *     return cpp.version().decode()
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_1version(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_7opendht_5_core_1version = {"version", (PyCFunction)__pyx_pw_7opendht_5_core_1version, METH_NOARGS, 0};
static PyObject *__pyx_pw_7opendht_5_core_1version(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("version (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7opendht_5_core_version(__pyx_self);

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

static PyObject *__pyx_pf_7opendht_5_core_version(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  char const *__pyx_t_1;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("version", 0);

  /* "opendht.pyx":40
 * 
 * def version() -> str:
 *     return cpp.version().decode()             # <<<<<<<<<<<<<<
 * 
 * cdef inline void lookup_callback(cpp.vector[cpp.shared_ptr[cpp.IndexValue]]* values, cpp.Prefix* p, void *user_data) noexcept with gil:
*/

  __pyx_t_1 = dht::version();
  __pyx_t_2 = __Pyx_ssize_strlen(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 40, __pyx_L1_error)
  __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_1, 0, __pyx_t_2, NULL, NULL, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  if (!(likely(PyUnicode_CheckExact(__pyx_t_3)) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_3))) __PYX_ERR(0, 40, __pyx_L1_error)
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __Pyx_INCREF(__pyx_t_3);
      __pyx_r = ((PyObject*)__pyx_t_3);
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "opendht.pyx":39
 * _initialize_gnutls()
 * 
 * def version() -> str:             # <<<<<<<<<<<<<<
 *     return cpp.version().decode()
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("opendht._core.version", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":42
 *     return cpp.version().decode()
 * 
 * cdef inline void lookup_callback(cpp.vector[cpp.shared_ptr[cpp.IndexValue]]* values, cpp.Prefix* p, void *user_data) noexcept with gil:             # <<<<<<<<<<<<<<
 *     cbs = <object>user_data
 *     if 'lookup' in cbs and cbs['lookup']:
*/

static CYTHON_INLINE void __pyx_f_7opendht_5_core_lookup_callback(std::vector<std::shared_ptr<dht::indexation::Value> >  *__pyx_v_values, dht::indexation::Prefix *__pyx_v_p, void *__pyx_v_user_data) {
  PyObject *__pyx_v_cbs = NULL;
  PyObject *__pyx_v_vals = NULL;
  std::shared_ptr<dht::indexation::Value>  __pyx_v_val;
  struct __pyx_obj_7opendht_5_core_IndexValue *__pyx_v_v = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  std::vector<std::shared_ptr<dht::indexation::Value> > ::iterator __pyx_t_4;
  std::vector<std::shared_ptr<dht::indexation::Value> >  *__pyx_t_5;
  std::shared_ptr<dht::indexation::Value>  __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("lookup_callback", 0);




  /* "opendht.pyx":43
 * 
 * cdef inline void lookup_callback(cpp.vector[cpp.shared_ptr[cpp.IndexValue]]* values, cpp.Prefix* p, void *user_data) noexcept with gil:
 *     cbs = <object>user_data             # <<<<<<<<<<<<<<
 *     if 'lookup' in cbs and cbs['lookup']:
 *         vals = []
*/
  __pyx_t_1 = ((PyObject *)__pyx_v_user_data);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_cbs = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "opendht.pyx":44
 * cdef inline void lookup_callback(cpp.vector[cpp.shared_ptr[cpp.IndexValue]]* values, cpp.Prefix* p, void *user_data) noexcept with gil:
 *     cbs = <object>user_data
 *     if 'lookup' in cbs and cbs['lookup']:             # <<<<<<<<<<<<<<
 *         vals = []
 *         for val in deref(values):
*/
  __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_mstate_global->__pyx_n_u_lookup, __pyx_v_cbs, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 44, __pyx_L1_error)
  if (__pyx_t_3) {

  } else {

    __pyx_t_2 = __pyx_t_3;

    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_cbs, __pyx_mstate_global->__pyx_n_u_lookup); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 44, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 44, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  __pyx_t_2 = __pyx_t_3;

  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {


    /* "opendht.pyx":45
 *     cbs = <object>user_data
 *     if 'lookup' in cbs and cbs['lookup']:
 *         vals = []             # <<<<<<<<<<<<<<
 *         for val in deref(values):
 *             v = IndexValue()
*/
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_vals = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "opendht.pyx":46
 *     if 'lookup' in cbs and cbs['lookup']:
 *         vals = []
 *         for val in deref(values):             # <<<<<<<<<<<<<<
 *             v = IndexValue()
 *             v._value = val
*/
    __pyx_t_5 = &(*__pyx_v_values);
    __pyx_t_4 = __pyx_t_5->begin();
    for (; __pyx_t_4 != __pyx_t_5->end(); ++__pyx_t_4) {
      __pyx_t_6 = *__pyx_t_4;
      __pyx_v_val = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_6);

      /* "opendht.pyx":47
 *         vals = []
 *         for val in deref(values):
 *             v = IndexValue()             # <<<<<<<<<<<<<<
 *             v._value = val
 *             vals.append(v)
*/
      __pyx_t_7 = NULL;
      __pyx_t_8 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
        __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7opendht_5_core_IndexValue, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error)
        __Pyx_GOTREF((PyObject *)__pyx_t_1);
      }
      __Pyx_XDECREF_SET(__pyx_v_v, ((struct __pyx_obj_7opendht_5_core_IndexValue *)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "opendht.pyx":48
 *         for val in deref(values):
 *             v = IndexValue()
 *             v._value = val             # <<<<<<<<<<<<<<
 *             vals.append(v)
 *         cbs['lookup'](vals, p.toString())
*/
      __pyx_v_v->_value = __pyx_v_val;

      /* "opendht.pyx":49
 *             v = IndexValue()
 *             v._value = val
 *             vals.append(v)             # <<<<<<<<<<<<<<
 *         cbs['lookup'](vals, p.toString())
 * 
*/
      __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_vals, ((PyObject *)__pyx_v_v)); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 49, __pyx_L1_error)


      /* "opendht.pyx":46
 *     if 'lookup' in cbs and cbs['lookup']:
 *         vals = []
 *         for val in deref(values):             # <<<<<<<<<<<<<<
 *             v = IndexValue()
 *             v._value = val
*/
    }


    /* "opendht.pyx":50
 *             v._value = val
 *             vals.append(v)
 *         cbs['lookup'](vals, p.toString())             # <<<<<<<<<<<<<<
 * 
 * cdef inline void shutdown_callback(void* user_data) noexcept with gil:
*/
    __pyx_t_7 = NULL;
    __pyx_t_10 = __Pyx_PyObject_Dict_GetItem(__pyx_v_cbs, __pyx_mstate_global->__pyx_n_u_lookup); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 50, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_11 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(__pyx_v_p->toString()); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 50, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_8 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_10))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_10);
      assert(__pyx_t_7);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_10, __pyx__function);
      __pyx_t_8 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_v_vals, __pyx_t_11};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_10, __pyx_callargs+__pyx_t_8, (3-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 50, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "opendht.pyx":44
 * cdef inline void lookup_callback(cpp.vector[cpp.shared_ptr[cpp.IndexValue]]* values, cpp.Prefix* p, void *user_data) noexcept with gil:
 *     cbs = <object>user_data
 *     if 'lookup' in cbs and cbs['lookup']:             # <<<<<<<<<<<<<<
 *         vals = []
 *         for val in deref(values):
*/
  }

  /* "opendht.pyx":42
 *     return cpp.version().decode()
 * 
 * cdef inline void lookup_callback(cpp.vector[cpp.shared_ptr[cpp.IndexValue]]* values, cpp.Prefix* p, void *user_data) noexcept with gil:             # <<<<<<<<<<<<<<
 *     cbs = <object>user_data
 *     if 'lookup' in cbs and cbs['lookup']:
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_WriteUnraisable("opendht._core.lookup_callback", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_cbs);
  __Pyx_XDECREF(__pyx_v_vals);

  __Pyx_XDECREF((PyObject *)__pyx_v_v);




  __Pyx_RefNannyFinishContext();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
}

/* "opendht.pyx":52
 *         cbs['lookup'](vals, p.toString())
 * 
 * cdef inline void shutdown_callback(void* user_data) noexcept with gil:             # <<<<<<<<<<<<<<
 *     cbs = <object>user_data
 *     if 'shutdown' in cbs and cbs['shutdown']:
*/

static CYTHON_INLINE void __pyx_f_7opendht_5_core_shutdown_callback(void *__pyx_v_user_data) {
  PyObject *__pyx_v_cbs = 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;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("shutdown_callback", 0);


  /* "opendht.pyx":53
 * 
 * cdef inline void shutdown_callback(void* user_data) noexcept with gil:
 *     cbs = <object>user_data             # <<<<<<<<<<<<<<
 *     if 'shutdown' in cbs and cbs['shutdown']:
 *         cbs['shutdown']()
*/
  __pyx_t_1 = ((PyObject *)__pyx_v_user_data);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_cbs = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "opendht.pyx":54
 * cdef inline void shutdown_callback(void* user_data) noexcept with gil:
 *     cbs = <object>user_data
 *     if 'shutdown' in cbs and cbs['shutdown']:             # <<<<<<<<<<<<<<
 *         cbs['shutdown']()
 *     ref.Py_DECREF(cbs)
*/
  __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_mstate_global->__pyx_n_u_shutdown, __pyx_v_cbs, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 54, __pyx_L1_error)
  if (__pyx_t_3) {

  } else {

    __pyx_t_2 = __pyx_t_3;

    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_cbs, __pyx_mstate_global->__pyx_n_u_shutdown); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 54, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 54, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  __pyx_t_2 = __pyx_t_3;

  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {


    /* "opendht.pyx":55
 *     cbs = <object>user_data
 *     if 'shutdown' in cbs and cbs['shutdown']:
 *         cbs['shutdown']()             # <<<<<<<<<<<<<<
 *     ref.Py_DECREF(cbs)
 * 
*/
    __pyx_t_4 = NULL;
    __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_v_cbs, __pyx_mstate_global->__pyx_n_u_shutdown); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 55, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 55, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "opendht.pyx":54
 * cdef inline void shutdown_callback(void* user_data) noexcept with gil:
 *     cbs = <object>user_data
 *     if 'shutdown' in cbs and cbs['shutdown']:             # <<<<<<<<<<<<<<
 *         cbs['shutdown']()
 *     ref.Py_DECREF(cbs)
*/
  }

  /* "opendht.pyx":56
 *     if 'shutdown' in cbs and cbs['shutdown']:
 *         cbs['shutdown']()
 *     ref.Py_DECREF(cbs)             # <<<<<<<<<<<<<<
 * 
 * cdef inline bool get_callback(shared_ptr[cpp.Value] value, void *user_data) noexcept with gil:
*/
  Py_DECREF(__pyx_v_cbs);

  /* "opendht.pyx":52
 *         cbs['lookup'](vals, p.toString())
 * 
 * cdef inline void shutdown_callback(void* user_data) noexcept with gil:             # <<<<<<<<<<<<<<
 *     cbs = <object>user_data
 *     if 'shutdown' in cbs and cbs['shutdown']:
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_WriteUnraisable("opendht._core.shutdown_callback", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_cbs);


  __Pyx_RefNannyFinishContext();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
}

/* "opendht.pyx":58
 *     ref.Py_DECREF(cbs)
 * 
 * cdef inline bool get_callback(shared_ptr[cpp.Value] value, void *user_data) noexcept with gil:             # <<<<<<<<<<<<<<
 *     cbs = <object>user_data
 *     cb = cbs['get']
*/

static CYTHON_INLINE bool __pyx_f_7opendht_5_core_get_callback(std::shared_ptr<dht::Value>  __pyx_v_value, void *__pyx_v_user_data) {
  PyObject *__pyx_v_cbs = NULL;
  PyObject *__pyx_v_cb = NULL;
  PyObject *__pyx_v_f = NULL;
  struct __pyx_obj_7opendht_5_core_Value *__pyx_v_pv = NULL;
  bool __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  bool __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  bool __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("get_callback", 0);



  /* "opendht.pyx":59
 * 
 * cdef inline bool get_callback(shared_ptr[cpp.Value] value, void *user_data) noexcept with gil:
 *     cbs = <object>user_data             # <<<<<<<<<<<<<<
 *     cb = cbs['get']
 *     f = cbs['filter'] if 'filter' in cbs else None
*/
  __pyx_t_1 = ((PyObject *)__pyx_v_user_data);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_cbs = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "opendht.pyx":60
 * cdef inline bool get_callback(shared_ptr[cpp.Value] value, void *user_data) noexcept with gil:
 *     cbs = <object>user_data
 *     cb = cbs['get']             # <<<<<<<<<<<<<<
 *     f = cbs['filter'] if 'filter' in cbs else None
 *     pv = Value()
*/
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_cbs, __pyx_mstate_global->__pyx_n_u_get); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_cb = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "opendht.pyx":61
 *     cbs = <object>user_data
 *     cb = cbs['get']
 *     f = cbs['filter'] if 'filter' in cbs else None             # <<<<<<<<<<<<<<
 *     pv = Value()
 *     pv._value = value
*/
  __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_mstate_global->__pyx_n_u_filter, __pyx_v_cbs, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 61, __pyx_L1_error)
  if (__pyx_t_2) {
    __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_v_cbs, __pyx_mstate_global->__pyx_n_u_filter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 61, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
  } else {
    __Pyx_INCREF(Py_None);
    __pyx_t_1 = Py_None;
  }

  __pyx_v_f = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "opendht.pyx":62
 *     cb = cbs['get']
 *     f = cbs['filter'] if 'filter' in cbs else None
 *     pv = Value()             # <<<<<<<<<<<<<<
 *     pv._value = value
 *     return cb(pv) if not f or f(pv) else True
*/
  __pyx_t_3 = NULL;
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7opendht_5_core_Value, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 62, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_pv = ((struct __pyx_obj_7opendht_5_core_Value *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "opendht.pyx":63
 *     f = cbs['filter'] if 'filter' in cbs else None
 *     pv = Value()
 *     pv._value = value             # <<<<<<<<<<<<<<
 *     return cb(pv) if not f or f(pv) else True
 * 
*/
  __pyx_v_pv->_value = __pyx_v_value;

  /* "opendht.pyx":64
 *     pv = Value()
 *     pv._value = value
 *     return cb(pv) if not f or f(pv) else True             # <<<<<<<<<<<<<<
 * 
 * cdef inline bool value_callback(shared_ptr[cpp.Value] value, bool expired, void *user_data) noexcept with gil:
*/
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_f); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 64, __pyx_L1_error)
  __pyx_t_7 = (!__pyx_t_6);


  if (!__pyx_t_7) {

  } else {

    __pyx_t_2 = __pyx_t_7;

    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_3 = NULL;
  __Pyx_INCREF(__pyx_v_f);
  __pyx_t_8 = __pyx_v_f; 
  __pyx_t_4 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_8))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_8);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
    __pyx_t_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, ((PyObject *)__pyx_v_pv)};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 64, __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, 64, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  __pyx_t_2 = __pyx_t_7;

  __pyx_L3_bool_binop_done:;
  if (__pyx_t_2) {
    __pyx_t_8 = NULL;
    __Pyx_INCREF(__pyx_v_cb);
    __pyx_t_3 = __pyx_v_cb; 
    __pyx_t_4 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3);
      assert(__pyx_t_8);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
      __pyx_t_4 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, ((PyObject *)__pyx_v_pv)};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 64, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_9 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 64, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = __pyx_t_9;
  } else {

    __pyx_t_5 = 1;
  }

  {
    __pyx_r = __pyx_t_5;
  }
  goto __pyx_L0;

  /* "opendht.pyx":58
 *     ref.Py_DECREF(cbs)
 * 
 * cdef inline bool get_callback(shared_ptr[cpp.Value] value, void *user_data) noexcept with gil:             # <<<<<<<<<<<<<<
 *     cbs = <object>user_data
 *     cb = cbs['get']
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_WriteUnraisable("opendht._core.get_callback", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_cbs);
  __Pyx_XDECREF(__pyx_v_cb);
  __Pyx_XDECREF(__pyx_v_f);
  __Pyx_XDECREF((PyObject *)__pyx_v_pv);



  __Pyx_RefNannyFinishContext();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "opendht.pyx":66
 *     return cb(pv) if not f or f(pv) else True
 * 
 * cdef inline bool value_callback(shared_ptr[cpp.Value] value, bool expired, void *user_data) noexcept with gil:             # <<<<<<<<<<<<<<
 *     cbs = <object>user_data
 *     cb = cbs['valcb']
*/

static CYTHON_INLINE bool __pyx_f_7opendht_5_core_value_callback(std::shared_ptr<dht::Value>  __pyx_v_value, bool __pyx_v_expired, void *__pyx_v_user_data) {
  PyObject *__pyx_v_cbs = NULL;
  PyObject *__pyx_v_cb = NULL;
  PyObject *__pyx_v_f = NULL;
  struct __pyx_obj_7opendht_5_core_Value *__pyx_v_pv = NULL;
  bool __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  bool __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  bool __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("value_callback", 0);




  /* "opendht.pyx":67
 * 
 * cdef inline bool value_callback(shared_ptr[cpp.Value] value, bool expired, void *user_data) noexcept with gil:
 *     cbs = <object>user_data             # <<<<<<<<<<<<<<
 *     cb = cbs['valcb']
 *     f = cbs['filter'] if 'filter' in cbs else None
*/
  __pyx_t_1 = ((PyObject *)__pyx_v_user_data);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_cbs = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "opendht.pyx":68
 * cdef inline bool value_callback(shared_ptr[cpp.Value] value, bool expired, void *user_data) noexcept with gil:
 *     cbs = <object>user_data
 *     cb = cbs['valcb']             # <<<<<<<<<<<<<<
 *     f = cbs['filter'] if 'filter' in cbs else None
 *     pv = Value()
*/
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_cbs, __pyx_mstate_global->__pyx_n_u_valcb); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 68, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_cb = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "opendht.pyx":69
 *     cbs = <object>user_data
 *     cb = cbs['valcb']
 *     f = cbs['filter'] if 'filter' in cbs else None             # <<<<<<<<<<<<<<
 *     pv = Value()
 *     pv._value = value
*/
  __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_mstate_global->__pyx_n_u_filter, __pyx_v_cbs, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 69, __pyx_L1_error)
  if (__pyx_t_2) {
    __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_v_cbs, __pyx_mstate_global->__pyx_n_u_filter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 69, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
  } else {
    __Pyx_INCREF(Py_None);
    __pyx_t_1 = Py_None;
  }

  __pyx_v_f = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "opendht.pyx":70
 *     cb = cbs['valcb']
 *     f = cbs['filter'] if 'filter' in cbs else None
 *     pv = Value()             # <<<<<<<<<<<<<<
 *     pv._value = value
 *     return cb(pv, expired) if not f or f(pv) else True
*/
  __pyx_t_3 = NULL;
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7opendht_5_core_Value, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 70, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_pv = ((struct __pyx_obj_7opendht_5_core_Value *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "opendht.pyx":71
 *     f = cbs['filter'] if 'filter' in cbs else None
 *     pv = Value()
 *     pv._value = value             # <<<<<<<<<<<<<<
 *     return cb(pv, expired) if not f or f(pv) else True
 * 
*/
  __pyx_v_pv->_value = __pyx_v_value;

  /* "opendht.pyx":72
 *     pv = Value()
 *     pv._value = value
 *     return cb(pv, expired) if not f or f(pv) else True             # <<<<<<<<<<<<<<
 * 
 * cdef inline void done_callback(bool done, cpp.vector[shared_ptr[cpp.Node]]* nodes, void *user_data) noexcept with gil:
*/
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_f); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 72, __pyx_L1_error)
  __pyx_t_7 = (!__pyx_t_6);


  if (!__pyx_t_7) {

  } else {

    __pyx_t_2 = __pyx_t_7;

    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_3 = NULL;
  __Pyx_INCREF(__pyx_v_f);
  __pyx_t_8 = __pyx_v_f; 
  __pyx_t_4 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_8))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_8);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
    __pyx_t_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, ((PyObject *)__pyx_v_pv)};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 72, __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, 72, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  __pyx_t_2 = __pyx_t_7;

  __pyx_L3_bool_binop_done:;
  if (__pyx_t_2) {
    __pyx_t_8 = NULL;
    __Pyx_INCREF(__pyx_v_cb);
    __pyx_t_3 = __pyx_v_cb; 
    __pyx_t_9 = __Pyx_PyBool_FromLong(__pyx_v_expired); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 72, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_4 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3);
      assert(__pyx_t_8);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
      __pyx_t_4 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_8, ((PyObject *)__pyx_v_pv), __pyx_t_9};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (3-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 72, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_10 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 72, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = __pyx_t_10;
  } else {

    __pyx_t_5 = 1;
  }

  {
    __pyx_r = __pyx_t_5;
  }
  goto __pyx_L0;

  /* "opendht.pyx":66
 *     return cb(pv) if not f or f(pv) else True
 * 
 * cdef inline bool value_callback(shared_ptr[cpp.Value] value, bool expired, void *user_data) noexcept with gil:             # <<<<<<<<<<<<<<
 *     cbs = <object>user_data
 *     cb = cbs['valcb']
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_WriteUnraisable("opendht._core.value_callback", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_cbs);
  __Pyx_XDECREF(__pyx_v_cb);
  __Pyx_XDECREF(__pyx_v_f);
  __Pyx_XDECREF((PyObject *)__pyx_v_pv);




  __Pyx_RefNannyFinishContext();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "opendht.pyx":74
 *     return cb(pv, expired) if not f or f(pv) else True
 * 
 * cdef inline void done_callback(bool done, cpp.vector[shared_ptr[cpp.Node]]* nodes, void *user_data) noexcept with gil:             # <<<<<<<<<<<<<<
 *     node_ids = []
 *     for n in deref(nodes):
*/

static CYTHON_INLINE void __pyx_f_7opendht_5_core_done_callback(bool __pyx_v_done, std::vector<std::shared_ptr<dht::Node> >  *__pyx_v_nodes, void *__pyx_v_user_data) {
  PyObject *__pyx_v_node_ids = NULL;
  std::shared_ptr<dht::Node>  __pyx_v_n;
  struct __pyx_obj_7opendht_5_core_NodeEntry *__pyx_v_h = NULL;
  PyObject *__pyx_v_cbs = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  std::vector<std::shared_ptr<dht::Node> > ::iterator __pyx_t_2;
  std::vector<std::shared_ptr<dht::Node> >  *__pyx_t_3;
  std::shared_ptr<dht::Node>  __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("done_callback", 0);




  /* "opendht.pyx":75
 * 
 * cdef inline void done_callback(bool done, cpp.vector[shared_ptr[cpp.Node]]* nodes, void *user_data) noexcept with gil:
 *     node_ids = []             # <<<<<<<<<<<<<<
 *     for n in deref(nodes):
 *         h = NodeEntry()
*/
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 75, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_node_ids = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "opendht.pyx":76
 * cdef inline void done_callback(bool done, cpp.vector[shared_ptr[cpp.Node]]* nodes, void *user_data) noexcept with gil:
 *     node_ids = []
 *     for n in deref(nodes):             # <<<<<<<<<<<<<<
 *         h = NodeEntry()
 *         h._v.first = n.get().getId()
*/
  __pyx_t_3 = &(*__pyx_v_nodes);
  __pyx_t_2 = __pyx_t_3->begin();
  for (; __pyx_t_2 != __pyx_t_3->end(); ++__pyx_t_2) {
    __pyx_t_4 = *__pyx_t_2;
    __pyx_v_n = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_4);

    /* "opendht.pyx":77
 *     node_ids = []
 *     for n in deref(nodes):
 *         h = NodeEntry()             # <<<<<<<<<<<<<<
 *         h._v.first = n.get().getId()
 *         h._v.second = n
*/
    __pyx_t_5 = NULL;
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7opendht_5_core_NodeEntry, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 77, __pyx_L1_error)
      __Pyx_GOTREF((PyObject *)__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_h, ((struct __pyx_obj_7opendht_5_core_NodeEntry *)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "opendht.pyx":78
 *     for n in deref(nodes):
 *         h = NodeEntry()
 *         h._v.first = n.get().getId()             # <<<<<<<<<<<<<<
 *         h._v.second = n
 *         node_ids.append(h)
*/
    __pyx_v_h->_v.first = __pyx_v_n.get()->getId();

    /* "opendht.pyx":79
 *         h = NodeEntry()
 *         h._v.first = n.get().getId()
 *         h._v.second = n             # <<<<<<<<<<<<<<
 *         node_ids.append(h)
 *     cbs = <object>user_data
*/
    __pyx_v_h->_v.second = __pyx_v_n;

    /* "opendht.pyx":80
 *         h._v.first = n.get().getId()
 *         h._v.second = n
 *         node_ids.append(h)             # <<<<<<<<<<<<<<
 *     cbs = <object>user_data
 *     if 'done' in cbs and cbs['done']:
*/
    __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_node_ids, ((PyObject *)__pyx_v_h)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 80, __pyx_L1_error)


    /* "opendht.pyx":76
 * cdef inline void done_callback(bool done, cpp.vector[shared_ptr[cpp.Node]]* nodes, void *user_data) noexcept with gil:
 *     node_ids = []
 *     for n in deref(nodes):             # <<<<<<<<<<<<<<
 *         h = NodeEntry()
 *         h._v.first = n.get().getId()
*/
  }


  /* "opendht.pyx":81
 *         h._v.second = n
 *         node_ids.append(h)
 *     cbs = <object>user_data             # <<<<<<<<<<<<<<
 *     if 'done' in cbs and cbs['done']:
 *         cbs['done'](done, node_ids)
*/
  __pyx_t_1 = ((PyObject *)__pyx_v_user_data);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_cbs = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "opendht.pyx":82
 *         node_ids.append(h)
 *     cbs = <object>user_data
 *     if 'done' in cbs and cbs['done']:             # <<<<<<<<<<<<<<
 *         cbs['done'](done, node_ids)
 *     ref.Py_DECREF(cbs)
*/
  __pyx_t_9 = (__Pyx_PySequence_ContainsTF(__pyx_mstate_global->__pyx_n_u_done, __pyx_v_cbs, Py_EQ)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 82, __pyx_L1_error)
  if (__pyx_t_9) {

  } else {

    __pyx_t_8 = __pyx_t_9;

    goto __pyx_L7_bool_binop_done;
  }
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_cbs, __pyx_mstate_global->__pyx_n_u_done); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 82, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 82, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  __pyx_t_8 = __pyx_t_9;

  __pyx_L7_bool_binop_done:;
  if (__pyx_t_8) {


    /* "opendht.pyx":83
 *     cbs = <object>user_data
 *     if 'done' in cbs and cbs['done']:
 *         cbs['done'](done, node_ids)             # <<<<<<<<<<<<<<
 *     ref.Py_DECREF(cbs)
 * 
*/
    __pyx_t_5 = NULL;
    __pyx_t_10 = __Pyx_PyObject_Dict_GetItem(__pyx_v_cbs, __pyx_mstate_global->__pyx_n_u_done); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 83, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_11 = __Pyx_PyBool_FromLong(__pyx_v_done); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 83, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_10))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_10);
      assert(__pyx_t_5);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_10, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_t_11, __pyx_v_node_ids};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_10, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 83, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "opendht.pyx":82
 *         node_ids.append(h)
 *     cbs = <object>user_data
 *     if 'done' in cbs and cbs['done']:             # <<<<<<<<<<<<<<
 *         cbs['done'](done, node_ids)
 *     ref.Py_DECREF(cbs)
*/
  }

  /* "opendht.pyx":84
 *     if 'done' in cbs and cbs['done']:
 *         cbs['done'](done, node_ids)
 *     ref.Py_DECREF(cbs)             # <<<<<<<<<<<<<<
 * 
 * cdef inline void done_callback_simple(bool done, void *user_data) noexcept with gil:
*/
  Py_DECREF(__pyx_v_cbs);

  /* "opendht.pyx":74
 *     return cb(pv, expired) if not f or f(pv) else True
 * 
 * cdef inline void done_callback(bool done, cpp.vector[shared_ptr[cpp.Node]]* nodes, void *user_data) noexcept with gil:             # <<<<<<<<<<<<<<
 *     node_ids = []
 *     for n in deref(nodes):
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_WriteUnraisable("opendht._core.done_callback", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_node_ids);

  __Pyx_XDECREF((PyObject *)__pyx_v_h);
  __Pyx_XDECREF(__pyx_v_cbs);




  __Pyx_RefNannyFinishContext();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
}

/* "opendht.pyx":86
 *     ref.Py_DECREF(cbs)
 * 
 * cdef inline void done_callback_simple(bool done, void *user_data) noexcept with gil:             # <<<<<<<<<<<<<<
 *     cbs = <object>user_data
 *     if 'done' in cbs and cbs['done']:
*/

static CYTHON_INLINE void __pyx_f_7opendht_5_core_done_callback_simple(bool __pyx_v_done, void *__pyx_v_user_data) {
  PyObject *__pyx_v_cbs = 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;
  size_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("done_callback_simple", 0);



  /* "opendht.pyx":87
 * 
 * cdef inline void done_callback_simple(bool done, void *user_data) noexcept with gil:
 *     cbs = <object>user_data             # <<<<<<<<<<<<<<
 *     if 'done' in cbs and cbs['done']:
 *         cbs['done'](done)
*/
  __pyx_t_1 = ((PyObject *)__pyx_v_user_data);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_cbs = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "opendht.pyx":88
 * cdef inline void done_callback_simple(bool done, void *user_data) noexcept with gil:
 *     cbs = <object>user_data
 *     if 'done' in cbs and cbs['done']:             # <<<<<<<<<<<<<<
 *         cbs['done'](done)
 *     ref.Py_DECREF(cbs)
*/
  __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_mstate_global->__pyx_n_u_done, __pyx_v_cbs, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 88, __pyx_L1_error)
  if (__pyx_t_3) {

  } else {

    __pyx_t_2 = __pyx_t_3;

    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_cbs, __pyx_mstate_global->__pyx_n_u_done); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 88, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 88, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  __pyx_t_2 = __pyx_t_3;

  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {


    /* "opendht.pyx":89
 *     cbs = <object>user_data
 *     if 'done' in cbs and cbs['done']:
 *         cbs['done'](done)             # <<<<<<<<<<<<<<
 *     ref.Py_DECREF(cbs)
 * 
*/
    __pyx_t_4 = NULL;
    __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_v_cbs, __pyx_mstate_global->__pyx_n_u_done); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 89, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_v_done); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 89, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_7 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_6};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 89, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "opendht.pyx":88
 * cdef inline void done_callback_simple(bool done, void *user_data) noexcept with gil:
 *     cbs = <object>user_data
 *     if 'done' in cbs and cbs['done']:             # <<<<<<<<<<<<<<
 *         cbs['done'](done)
 *     ref.Py_DECREF(cbs)
*/
  }

  /* "opendht.pyx":90
 *     if 'done' in cbs and cbs['done']:
 *         cbs['done'](done)
 *     ref.Py_DECREF(cbs)             # <<<<<<<<<<<<<<
 * 
 * cdef class _WithID(object):
*/
  Py_DECREF(__pyx_v_cbs);

  /* "opendht.pyx":86
 *     ref.Py_DECREF(cbs)
 * 
 * cdef inline void done_callback_simple(bool done, void *user_data) noexcept with gil:             # <<<<<<<<<<<<<<
 *     cbs = <object>user_data
 *     if 'done' in cbs and cbs['done']:
*/

  /* function exit code */
  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_WriteUnraisable("opendht._core.done_callback_simple", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_cbs);



  __Pyx_RefNannyFinishContext();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
}

/* "opendht.pyx":93
 * 
 * cdef class _WithID(object):
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return "<%s '%s'>" % (self.__class__.__name__, str(self))
 *     def __str__(self):
*/

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

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

static PyObject *__pyx_pf_7opendht_5_core_7_WithID___repr__(struct __pyx_obj_7opendht_5_core__WithID *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3[5];
  Py_ssize_t __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "opendht.pyx":94
 * cdef class _WithID(object):
 *     def __repr__(self):
 *         return "<%s '%s'>" % (self.__class__.__name__, str(self))             # <<<<<<<<<<<<<<
 *     def __str__(self):
 *         return self.getId().toString().decode()
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 94, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_2), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Unicode(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 94, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3[0] = __pyx_mstate_global->__pyx_kp_u__2;
  __pyx_t_3[1] = __pyx_t_1;
  __pyx_t_3[2] = __pyx_mstate_global->__pyx_kp_u__3;
  __pyx_t_3[3] = __pyx_t_2;
  __pyx_t_3[4] = __pyx_mstate_global->__pyx_kp_u__4;
  __pyx_t_4 = 5;
  #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
  __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3[1]) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3[3]);
  #endif
  __pyx_t_5 = 0;
  #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
  __pyx_t_5 |= __Pyx_PyUnicode_KIND_04(__pyx_t_3[1]) | __Pyx_PyUnicode_KIND_04(__pyx_t_3[3]);
  #endif
  __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_3, 5, __pyx_t_4, __pyx_t_5);
  if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 94, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_6;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_6 = 0;
  goto __pyx_L0;

  /* "opendht.pyx":93
 * 
 * cdef class _WithID(object):
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return "<%s '%s'>" % (self.__class__.__name__, str(self))
 *     def __str__(self):
*/

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

/* "opendht.pyx":95
 *     def __repr__(self):
 *         return "<%s '%s'>" % (self.__class__.__name__, str(self))
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return self.getId().toString().decode()
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_7_WithID_3__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7opendht_5_core_7_WithID_3__str__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7opendht_5_core_7_WithID_2__str__(((struct __pyx_obj_7opendht_5_core__WithID *)__pyx_v_self));

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

static PyObject *__pyx_pf_7opendht_5_core_7_WithID_2__str__(struct __pyx_obj_7opendht_5_core__WithID *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__str__", 0);

  /* "opendht.pyx":96
 *         return "<%s '%s'>" % (self.__class__.__name__, str(self))
 *     def __str__(self):
 *         return self.getId().toString().decode()             # <<<<<<<<<<<<<<
 * 
 * cdef class _WithPk(object):
*/
  __pyx_t_6 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_6);
  __pyx_t_7 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
    __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getId, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 96, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
  }
  __pyx_t_4 = __pyx_t_5;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_7 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
    __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_toString, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_2 = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_7 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_decode, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_1;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "opendht.pyx":95
 *     def __repr__(self):
 *         return "<%s '%s'>" % (self.__class__.__name__, str(self))
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return self.getId().toString().decode()
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("opendht._core._WithID.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_7_WithID_5__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_7_WithID_5__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_7_WithID_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_7_WithID_5__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7opendht_5_core_7_WithID_4__reduce_cython__(((struct __pyx_obj_7opendht_5_core__WithID *)__pyx_v_self));

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

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

  /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     with CRITICAL_SECTION(self):             # <<<<<<<<<<<<<<
 *         state = ()
 *         _dict = getattr(self, '__dict__', None)
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

        /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     with CRITICAL_SECTION(self):
 *         state = ()             # <<<<<<<<<<<<<<
 *         _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:
*/
        __Pyx_INCREF(__pyx_mstate_global->__pyx_empty_tuple);
        __pyx_v_state = __pyx_mstate_global->__pyx_empty_tuple;

        /* "(tree fragment)":7
 *     with CRITICAL_SECTION(self):
 *         state = ()
 *         _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None and _dict:
 *         state += (_dict,)
*/
        __pyx_t_2 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_dict, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_v__dict = __pyx_t_2;
        __pyx_t_2 = 0;
      }

      /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     with CRITICAL_SECTION(self):             # <<<<<<<<<<<<<<
 *         state = ()
 *         _dict = getattr(self, '__dict__', None)
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

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

  } else {

    __pyx_t_3 = __pyx_t_4;

    goto __pyx_L7_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v__dict); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 8, __pyx_L1_error)

  __pyx_t_3 = __pyx_t_4;

  __pyx_L7_bool_binop_done:;
  if (__pyx_t_3) {


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

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

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

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

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

    /* "(tree fragment)":14
 *         use_setstate = False
 *     if use_setstate:
 *         return __pyx_unpickle__WithID, (type(self), 0xe3b0c44, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle__WithID, (type(self), 0xe3b0c44, state)
*/
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_pyx_unpickle__WithID); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(1, 14, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_238750788);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_238750788);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_238750788) != (0)) __PYX_ERR(1, 14, __pyx_L1_error);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None) != (0)) __PYX_ERR(1, 14, __pyx_L1_error);
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_2);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2) != (0)) __PYX_ERR(1, 14, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1) != (0)) __PYX_ERR(1, 14, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state) != (0)) __PYX_ERR(1, 14, __pyx_L1_error);
    __pyx_t_2 = 0;
    __pyx_t_1 = 0;
    {
      PyObject *__pyx_temp;
      {
        __pyx_temp = __pyx_r;
        __pyx_r = __pyx_t_5;
      }
      __Pyx_XDECREF(__pyx_temp);
    }
    __pyx_t_5 = 0;
    goto __pyx_L0;

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

  /* "(tree fragment)":16
 *         return __pyx_unpickle__WithID, (type(self), 0xe3b0c44, None), state
 *     else:
 *         return __pyx_unpickle__WithID, (type(self), 0xe3b0c44, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle__WithID__set_state(self, __pyx_state)
*/
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_pyx_unpickle__WithID); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 16, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 16, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(1, 16, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_238750788);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_238750788);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_238750788) != (0)) __PYX_ERR(1, 16, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state) != (0)) __PYX_ERR(1, 16, __pyx_L1_error);
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 16, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_5);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5) != (0)) __PYX_ERR(1, 16, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1) != (0)) __PYX_ERR(1, 16, __pyx_L1_error);
    __pyx_t_5 = 0;
    __pyx_t_1 = 0;
    {
      PyObject *__pyx_temp;
      {
        __pyx_temp = __pyx_r;
        __pyx_r = __pyx_t_2;
      }
      __Pyx_XDECREF(__pyx_temp);
    }
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("opendht._core._WithID.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v__dict);

  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":17
 *     else:
 *         return __pyx_unpickle__WithID, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle__WithID__set_state(self, __pyx_state)
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_7_WithID_7__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_7_WithID_7__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_7_WithID_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_7_WithID_7__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 17, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 17, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(1, 17, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 17, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 17, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 17, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core._WithID.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7opendht_5_core_7_WithID_6__setstate_cython__(((struct __pyx_obj_7opendht_5_core__WithID *)__pyx_v_self), __pyx_v___pyx_state);

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

static PyObject *__pyx_pf_7opendht_5_core_7_WithID_6__setstate_cython__(struct __pyx_obj_7opendht_5_core__WithID *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  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("__setstate_cython__", 0);

  /* "(tree fragment)":18
 *         return __pyx_unpickle__WithID, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle__WithID__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
*/
  __pyx_t_1 = __pyx_v___pyx_state;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(1, 18, __pyx_L1_error)
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared \047not None\047");
    __PYX_ERR(1, 18, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_f_7opendht_5_core___pyx_unpickle__WithID__set_state(__pyx_v_self, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 18, __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;

  /* "(tree fragment)":17
 *     else:
 *         return __pyx_unpickle__WithID, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle__WithID__set_state(self, __pyx_state)
*/

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

/* "opendht.pyx":99
 * 
 * cdef class _WithPk(object):
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return "<%s '%s'>" % (self.__class__.__name__, str(self))
 *     def __str__(self):
*/

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

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

static PyObject *__pyx_pf_7opendht_5_core_7_WithPk___repr__(struct __pyx_obj_7opendht_5_core__WithPk *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3[5];
  Py_ssize_t __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "opendht.pyx":100
 * cdef class _WithPk(object):
 *     def __repr__(self):
 *         return "<%s '%s'>" % (self.__class__.__name__, str(self))             # <<<<<<<<<<<<<<
 *     def __str__(self):
 *         return self.getLongId().toString().decode()
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_2), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Unicode(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3[0] = __pyx_mstate_global->__pyx_kp_u__2;
  __pyx_t_3[1] = __pyx_t_1;
  __pyx_t_3[2] = __pyx_mstate_global->__pyx_kp_u__3;
  __pyx_t_3[3] = __pyx_t_2;
  __pyx_t_3[4] = __pyx_mstate_global->__pyx_kp_u__4;
  __pyx_t_4 = 5;
  #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
  __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3[1]) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3[3]);
  #endif
  __pyx_t_5 = 0;
  #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
  __pyx_t_5 |= __Pyx_PyUnicode_KIND_04(__pyx_t_3[1]) | __Pyx_PyUnicode_KIND_04(__pyx_t_3[3]);
  #endif
  __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_3, 5, __pyx_t_4, __pyx_t_5);
  if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_6;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_6 = 0;
  goto __pyx_L0;

  /* "opendht.pyx":99
 * 
 * cdef class _WithPk(object):
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return "<%s '%s'>" % (self.__class__.__name__, str(self))
 *     def __str__(self):
*/

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

/* "opendht.pyx":101
 *     def __repr__(self):
 *         return "<%s '%s'>" % (self.__class__.__name__, str(self))
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return self.getLongId().toString().decode()
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_7_WithPk_3__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7opendht_5_core_7_WithPk_3__str__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7opendht_5_core_7_WithPk_2__str__(((struct __pyx_obj_7opendht_5_core__WithPk *)__pyx_v_self));

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

static PyObject *__pyx_pf_7opendht_5_core_7_WithPk_2__str__(struct __pyx_obj_7opendht_5_core__WithPk *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__str__", 0);

  /* "opendht.pyx":102
 *         return "<%s '%s'>" % (self.__class__.__name__, str(self))
 *     def __str__(self):
 *         return self.getLongId().toString().decode()             # <<<<<<<<<<<<<<
 * 
 * cdef class InfoHash(_WithID):
*/
  __pyx_t_6 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_6);
  __pyx_t_7 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
    __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getLongId, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 102, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
  }
  __pyx_t_4 = __pyx_t_5;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_7 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
    __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_toString, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 102, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_2 = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_7 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_decode, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 102, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_1;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "opendht.pyx":101
 *     def __repr__(self):
 *         return "<%s '%s'>" % (self.__class__.__name__, str(self))
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return self.getLongId().toString().decode()
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("opendht._core._WithPk.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_7_WithPk_5__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_7_WithPk_5__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_7_WithPk_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_7_WithPk_5__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7opendht_5_core_7_WithPk_4__reduce_cython__(((struct __pyx_obj_7opendht_5_core__WithPk *)__pyx_v_self));

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

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

  /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     with CRITICAL_SECTION(self):             # <<<<<<<<<<<<<<
 *         state = ()
 *         _dict = getattr(self, '__dict__', None)
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

        /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     with CRITICAL_SECTION(self):
 *         state = ()             # <<<<<<<<<<<<<<
 *         _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:
*/
        __Pyx_INCREF(__pyx_mstate_global->__pyx_empty_tuple);
        __pyx_v_state = __pyx_mstate_global->__pyx_empty_tuple;

        /* "(tree fragment)":7
 *     with CRITICAL_SECTION(self):
 *         state = ()
 *         _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None and _dict:
 *         state += (_dict,)
*/
        __pyx_t_2 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_dict, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_v__dict = __pyx_t_2;
        __pyx_t_2 = 0;
      }

      /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     with CRITICAL_SECTION(self):             # <<<<<<<<<<<<<<
 *         state = ()
 *         _dict = getattr(self, '__dict__', None)
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

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

  } else {

    __pyx_t_3 = __pyx_t_4;

    goto __pyx_L7_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v__dict); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 8, __pyx_L1_error)

  __pyx_t_3 = __pyx_t_4;

  __pyx_L7_bool_binop_done:;
  if (__pyx_t_3) {


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

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

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

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

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

    /* "(tree fragment)":14
 *         use_setstate = False
 *     if use_setstate:
 *         return __pyx_unpickle__WithPk, (type(self), 0xe3b0c44, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle__WithPk, (type(self), 0xe3b0c44, state)
*/
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_pyx_unpickle__WithPk); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(1, 14, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_238750788);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_238750788);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_238750788) != (0)) __PYX_ERR(1, 14, __pyx_L1_error);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None) != (0)) __PYX_ERR(1, 14, __pyx_L1_error);
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_2);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2) != (0)) __PYX_ERR(1, 14, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1) != (0)) __PYX_ERR(1, 14, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state) != (0)) __PYX_ERR(1, 14, __pyx_L1_error);
    __pyx_t_2 = 0;
    __pyx_t_1 = 0;
    {
      PyObject *__pyx_temp;
      {
        __pyx_temp = __pyx_r;
        __pyx_r = __pyx_t_5;
      }
      __Pyx_XDECREF(__pyx_temp);
    }
    __pyx_t_5 = 0;
    goto __pyx_L0;

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

  /* "(tree fragment)":16
 *         return __pyx_unpickle__WithPk, (type(self), 0xe3b0c44, None), state
 *     else:
 *         return __pyx_unpickle__WithPk, (type(self), 0xe3b0c44, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle__WithPk__set_state(self, __pyx_state)
*/
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_pyx_unpickle__WithPk); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 16, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 16, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(1, 16, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_238750788);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_238750788);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_238750788) != (0)) __PYX_ERR(1, 16, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state) != (0)) __PYX_ERR(1, 16, __pyx_L1_error);
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 16, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_5);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5) != (0)) __PYX_ERR(1, 16, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1) != (0)) __PYX_ERR(1, 16, __pyx_L1_error);
    __pyx_t_5 = 0;
    __pyx_t_1 = 0;
    {
      PyObject *__pyx_temp;
      {
        __pyx_temp = __pyx_r;
        __pyx_r = __pyx_t_2;
      }
      __Pyx_XDECREF(__pyx_temp);
    }
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("opendht._core._WithPk.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v__dict);

  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":17
 *     else:
 *         return __pyx_unpickle__WithPk, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle__WithPk__set_state(self, __pyx_state)
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_7_WithPk_7__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_7_WithPk_7__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_7_WithPk_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_7_WithPk_7__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 17, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 17, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(1, 17, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 17, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 17, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 17, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core._WithPk.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7opendht_5_core_7_WithPk_6__setstate_cython__(((struct __pyx_obj_7opendht_5_core__WithPk *)__pyx_v_self), __pyx_v___pyx_state);

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

static PyObject *__pyx_pf_7opendht_5_core_7_WithPk_6__setstate_cython__(struct __pyx_obj_7opendht_5_core__WithPk *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  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("__setstate_cython__", 0);

  /* "(tree fragment)":18
 *         return __pyx_unpickle__WithPk, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle__WithPk__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
*/
  __pyx_t_1 = __pyx_v___pyx_state;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(1, 18, __pyx_L1_error)
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared \047not None\047");
    __PYX_ERR(1, 18, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_f_7opendht_5_core___pyx_unpickle__WithPk__set_state(__pyx_v_self, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 18, __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;

  /* "(tree fragment)":17
 *     else:
 *         return __pyx_unpickle__WithPk, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle__WithPk__set_state(self, __pyx_state)
*/

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

/* "opendht.pyx":106
 * cdef class InfoHash(_WithID):
 *     cdef cpp.InfoHash _infohash
 *     def __cinit__(self, bytes str=b''):             # <<<<<<<<<<<<<<
 *         self._infohash = cpp.InfoHash(str) if str else cpp.InfoHash()
 *     def __bool__(InfoHash self):
*/

/* Python wrapper */
static int __pyx_pw_7opendht_5_core_8InfoHash_1__cinit__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL_TPNEW
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_pw_7opendht_5_core_8InfoHash_1__cinit__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL_TPNEW
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_str = 0;
  #if !CYTHON_VECTORCALL_TPNEW
  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;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  #if !CYTHON_VECTORCALL_TPNEW
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL_TPNEW(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_str,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL_TPNEW(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 106, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 106, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__cinit__", 0) < (0)) __PYX_ERR(0, 106, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_kp_b__5));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 106, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_kp_b__5));
    }
    __pyx_v_str = ((PyObject*)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 106, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.InfoHash.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_str), (&PyBytes_Type), 1, "str", 1))) __PYX_ERR(0, 106, __pyx_L1_error)
  __pyx_r = __pyx_pf_7opendht_5_core_8InfoHash___cinit__(((struct __pyx_obj_7opendht_5_core_InfoHash *)__pyx_v_self), __pyx_v_str);

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

static int __pyx_pf_7opendht_5_core_8InfoHash___cinit__(struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_v_self, PyObject *__pyx_v_str) {
  int __pyx_r;
  dht::InfoHash __pyx_t_1;
  int __pyx_t_2;
  std::string __pyx_t_3;
  dht::InfoHash __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "opendht.pyx":107
 *     cdef cpp.InfoHash _infohash
 *     def __cinit__(self, bytes str=b''):
 *         self._infohash = cpp.InfoHash(str) if str else cpp.InfoHash()             # <<<<<<<<<<<<<<
 *     def __bool__(InfoHash self):
 *         return <bool>self._infohash
*/
  if (__pyx_v_str == Py_None) __pyx_t_2 = 0;
  else
  {
    Py_ssize_t __pyx_temp = __Pyx_PyBytes_GET_SIZE(__pyx_v_str);
    if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(0, 107, __pyx_L1_error)
    __pyx_t_2 = (__pyx_temp != 0);
  }

  if (__pyx_t_2) {
    __pyx_t_3 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_v_str); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 107, __pyx_L1_error)
    try {
      __pyx_t_4 = dht::InfoHash(__pyx_t_3);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(0, 107, __pyx_L1_error)
    }

    __pyx_t_1 = __pyx_t_4;
  } else {
    try {
      __pyx_t_4 = dht::InfoHash();
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(0, 107, __pyx_L1_error)
    }
    __pyx_t_1 = __pyx_t_4;
  }

  __pyx_v_self->_infohash = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_1);

  /* "opendht.pyx":106
 * cdef class InfoHash(_WithID):
 *     cdef cpp.InfoHash _infohash
 *     def __cinit__(self, bytes str=b''):             # <<<<<<<<<<<<<<
 *         self._infohash = cpp.InfoHash(str) if str else cpp.InfoHash()
 *     def __bool__(InfoHash self):
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("opendht._core.InfoHash.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;

  return __pyx_r;
}

/* "opendht.pyx":108
 *     def __cinit__(self, bytes str=b''):
 *         self._infohash = cpp.InfoHash(str) if str else cpp.InfoHash()
 *     def __bool__(InfoHash self):             # <<<<<<<<<<<<<<
 *         return <bool>self._infohash
 *     def __richcmp__(InfoHash self, InfoHash other, int op):
*/

/* Python wrapper */
static int __pyx_pw_7opendht_5_core_8InfoHash_3__bool__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_7opendht_5_core_8InfoHash_3__bool__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__bool__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7opendht_5_core_8InfoHash_2__bool__(((struct __pyx_obj_7opendht_5_core_InfoHash *)__pyx_v_self));

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

static int __pyx_pf_7opendht_5_core_8InfoHash_2__bool__(struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_v_self) {
  int __pyx_r;

  /* "opendht.pyx":109
 *         self._infohash = cpp.InfoHash(str) if str else cpp.InfoHash()
 *     def __bool__(InfoHash self):
 *         return <bool>self._infohash             # <<<<<<<<<<<<<<
 *     def __richcmp__(InfoHash self, InfoHash other, int op):
 *         if op == 0:
*/
  {

    __pyx_r = ((bool)__pyx_v_self->_infohash);
  }
  goto __pyx_L0;

  /* "opendht.pyx":108
 *     def __cinit__(self, bytes str=b''):
 *         self._infohash = cpp.InfoHash(str) if str else cpp.InfoHash()
 *     def __bool__(InfoHash self):             # <<<<<<<<<<<<<<
 *         return <bool>self._infohash
 *     def __richcmp__(InfoHash self, InfoHash other, int op):
*/

  /* function exit code */
  __pyx_L0:;

  return __pyx_r;
}

/* "opendht.pyx":110
 *     def __bool__(InfoHash self):
 *         return <bool>self._infohash
 *     def __richcmp__(InfoHash self, InfoHash other, int op):             # <<<<<<<<<<<<<<
 *         if op == 0:
 *             return self._infohash < other._infohash
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_8InfoHash_5__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op); /*proto*/
static PyObject *__pyx_pw_7opendht_5_core_8InfoHash_5__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__richcmp__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_mstate_global->__pyx_ptype_7opendht_5_core_InfoHash, 1, "other", 0))) __PYX_ERR(0, 110, __pyx_L1_error)
  __pyx_r = __pyx_pf_7opendht_5_core_8InfoHash_4__richcmp__(((struct __pyx_obj_7opendht_5_core_InfoHash *)__pyx_v_self), ((struct __pyx_obj_7opendht_5_core_InfoHash *)__pyx_v_other), ((int)__pyx_v_op));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  goto __pyx_L5_cleaned_up;
  __pyx_L0:;
  __pyx_L5_cleaned_up:;

  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7opendht_5_core_8InfoHash_4__richcmp__(struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_v_self, struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_v_other, int __pyx_v_op) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  bool __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__richcmp__", 0);

  /* "opendht.pyx":111
 *         return <bool>self._infohash
 *     def __richcmp__(InfoHash self, InfoHash other, int op):
 *         if op == 0:             # <<<<<<<<<<<<<<
 *             return self._infohash < other._infohash
 *         if op == 1:
*/
  __pyx_t_1 = (__pyx_v_op == 0);

  if (__pyx_t_1) {


    /* "opendht.pyx":112
 *     def __richcmp__(InfoHash self, InfoHash other, int op):
 *         if op == 0:
 *             return self._infohash < other._infohash             # <<<<<<<<<<<<<<
 *         if op == 1:
 *             return self._infohash < other._infohash or self._infohash == other._infohash
*/
    __pyx_t_2 = __Pyx_PyBool_FromLong((__pyx_v_self->_infohash < __pyx_v_other->_infohash)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 112, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    {
      PyObject *__pyx_temp;
      {
        __pyx_temp = __pyx_r;
        __pyx_r = __pyx_t_2;
      }
      __Pyx_XDECREF(__pyx_temp);
    }
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "opendht.pyx":111
 *         return <bool>self._infohash
 *     def __richcmp__(InfoHash self, InfoHash other, int op):
 *         if op == 0:             # <<<<<<<<<<<<<<
 *             return self._infohash < other._infohash
 *         if op == 1:
*/
  }

  /* "opendht.pyx":113
 *         if op == 0:
 *             return self._infohash < other._infohash
 *         if op == 1:             # <<<<<<<<<<<<<<
 *             return self._infohash < other._infohash or self._infohash == other._infohash
 *         if op == 2:
*/
  __pyx_t_1 = (__pyx_v_op == 1);

  if (__pyx_t_1) {


    /* "opendht.pyx":114
 *             return self._infohash < other._infohash
 *         if op == 1:
 *             return self._infohash < other._infohash or self._infohash == other._infohash             # <<<<<<<<<<<<<<
 *         if op == 2:
 *             return self._infohash == other._infohash
*/
    __pyx_t_3 = (__pyx_v_self->_infohash < __pyx_v_other->_infohash);

    if (!__pyx_t_3) {

    } else {
      __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 114, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_2 = __pyx_t_4;
      __pyx_t_4 = 0;

      goto __pyx_L5_bool_binop_done;
    }
    __pyx_t_3 = (__pyx_v_self->_infohash == __pyx_v_other->_infohash);

    __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 114, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = __pyx_t_4;
    __pyx_t_4 = 0;

    __pyx_L5_bool_binop_done:;
    {
      PyObject *__pyx_temp;
      {
        __pyx_temp = __pyx_r;
        __pyx_r = __pyx_t_2;
      }
      __Pyx_XDECREF(__pyx_temp);
    }
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "opendht.pyx":113
 *         if op == 0:
 *             return self._infohash < other._infohash
 *         if op == 1:             # <<<<<<<<<<<<<<
 *             return self._infohash < other._infohash or self._infohash == other._infohash
 *         if op == 2:
*/
  }

  /* "opendht.pyx":115
 *         if op == 1:
 *             return self._infohash < other._infohash or self._infohash == other._infohash
 *         if op == 2:             # <<<<<<<<<<<<<<
 *             return self._infohash == other._infohash
 *         return NotImplemented
*/
  __pyx_t_1 = (__pyx_v_op == 2);

  if (__pyx_t_1) {


    /* "opendht.pyx":116
 *             return self._infohash < other._infohash or self._infohash == other._infohash
 *         if op == 2:
 *             return self._infohash == other._infohash             # <<<<<<<<<<<<<<
 *         return NotImplemented
 *     def getBit(InfoHash self, bit):
*/
    __pyx_t_2 = __Pyx_PyBool_FromLong((__pyx_v_self->_infohash == __pyx_v_other->_infohash)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 116, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    {
      PyObject *__pyx_temp;
      {
        __pyx_temp = __pyx_r;
        __pyx_r = __pyx_t_2;
      }
      __Pyx_XDECREF(__pyx_temp);
    }
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "opendht.pyx":115
 *         if op == 1:
 *             return self._infohash < other._infohash or self._infohash == other._infohash
 *         if op == 2:             # <<<<<<<<<<<<<<
 *             return self._infohash == other._infohash
 *         return NotImplemented
*/
  }

  /* "opendht.pyx":117
 *         if op == 2:
 *             return self._infohash == other._infohash
 *         return NotImplemented             # <<<<<<<<<<<<<<
 *     def getBit(InfoHash self, bit):
 *         return self._infohash.getBit(bit)
*/
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __Pyx_INCREF(__pyx_builtin_NotImplemented);
      __pyx_r = __pyx_builtin_NotImplemented;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  goto __pyx_L0;

  /* "opendht.pyx":110
 *     def __bool__(InfoHash self):
 *         return <bool>self._infohash
 *     def __richcmp__(InfoHash self, InfoHash other, int op):             # <<<<<<<<<<<<<<
 *         if op == 0:
 *             return self._infohash < other._infohash
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("opendht._core.InfoHash.__richcmp__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":118
 *             return self._infohash == other._infohash
 *         return NotImplemented
 *     def getBit(InfoHash self, bit):             # <<<<<<<<<<<<<<
 *         return self._infohash.getBit(bit)
 *     def setBit(InfoHash self, bit, b):
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_8InfoHash_7getBit(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_8InfoHash_7getBit = {"getBit", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_8InfoHash_7getBit, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_8InfoHash_7getBit(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_bit = 0;
  #if !CYTHON_VECTORCALL
  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("getBit (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_bit,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 118, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 118, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getBit", 0) < (0)) __PYX_ERR(0, 118, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getBit", 1, 1, 1, i); __PYX_ERR(0, 118, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 118, __pyx_L3_error)
    }
    __pyx_v_bit = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getBit", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 118, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.InfoHash.getBit", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7opendht_5_core_8InfoHash_6getBit(((struct __pyx_obj_7opendht_5_core_InfoHash *)__pyx_v_self), __pyx_v_bit);

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

static PyObject *__pyx_pf_7opendht_5_core_8InfoHash_6getBit(struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_v_self, PyObject *__pyx_v_bit) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  unsigned int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getBit", 0);

  /* "opendht.pyx":119
 *         return NotImplemented
 *     def getBit(InfoHash self, bit):
 *         return self._infohash.getBit(bit)             # <<<<<<<<<<<<<<
 *     def setBit(InfoHash self, bit, b):
 *         self._infohash.setBit(bit, b)
*/
  __pyx_t_1 = __Pyx_PyLong_As_unsigned_int(__pyx_v_bit); if (unlikely((__pyx_t_1 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 119, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->_infohash.getBit(__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 119, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_2;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "opendht.pyx":118
 *             return self._infohash == other._infohash
 *         return NotImplemented
 *     def getBit(InfoHash self, bit):             # <<<<<<<<<<<<<<
 *         return self._infohash.getBit(bit)
 *     def setBit(InfoHash self, bit, b):
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("opendht._core.InfoHash.getBit", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":120
 *     def getBit(InfoHash self, bit):
 *         return self._infohash.getBit(bit)
 *     def setBit(InfoHash self, bit, b):             # <<<<<<<<<<<<<<
 *         self._infohash.setBit(bit, b)
 *     def getId(InfoHash self):
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_8InfoHash_9setBit(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_8InfoHash_9setBit = {"setBit", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_8InfoHash_9setBit, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_8InfoHash_9setBit(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_bit = 0;
  PyObject *__pyx_v_b = 0;
  #if !CYTHON_VECTORCALL
  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("setBit (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_bit,&__pyx_mstate_global->__pyx_n_u_b,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 120, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 120, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 120, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setBit", 0) < (0)) __PYX_ERR(0, 120, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setBit", 1, 2, 2, i); __PYX_ERR(0, 120, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 120, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 120, __pyx_L3_error)
    }
    __pyx_v_bit = values[0];
    __pyx_v_b = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setBit", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 120, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.InfoHash.setBit", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7opendht_5_core_8InfoHash_8setBit(((struct __pyx_obj_7opendht_5_core_InfoHash *)__pyx_v_self), __pyx_v_bit, __pyx_v_b);

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

static PyObject *__pyx_pf_7opendht_5_core_8InfoHash_8setBit(struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_v_self, PyObject *__pyx_v_bit, PyObject *__pyx_v_b) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  unsigned int __pyx_t_1;
  bool __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("setBit", 0);

  /* "opendht.pyx":121
 *         return self._infohash.getBit(bit)
 *     def setBit(InfoHash self, bit, b):
 *         self._infohash.setBit(bit, b)             # <<<<<<<<<<<<<<
 *     def getId(InfoHash self):
 *         return self
*/
  __pyx_t_1 = __Pyx_PyLong_As_unsigned_int(__pyx_v_bit); if (unlikely((__pyx_t_1 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 121, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_b); if (unlikely((__pyx_t_2 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 121, __pyx_L1_error)
  __pyx_v_self->_infohash.setBit(__pyx_t_1, __pyx_t_2);



  /* "opendht.pyx":120
 *     def getBit(InfoHash self, bit):
 *         return self._infohash.getBit(bit)
 *     def setBit(InfoHash self, bit, b):             # <<<<<<<<<<<<<<
 *         self._infohash.setBit(bit, b)
 *     def getId(InfoHash self):
*/

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

/* "opendht.pyx":122
 *     def setBit(InfoHash self, bit, b):
 *         self._infohash.setBit(bit, b)
 *     def getId(InfoHash self):             # <<<<<<<<<<<<<<
 *         return self
 *     def toString(InfoHash self):
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_8InfoHash_11getId(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_8InfoHash_11getId = {"getId", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_8InfoHash_11getId, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_8InfoHash_11getId(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getId (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getId", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getId", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7opendht_5_core_8InfoHash_10getId(((struct __pyx_obj_7opendht_5_core_InfoHash *)__pyx_v_self));

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

static PyObject *__pyx_pf_7opendht_5_core_8InfoHash_10getId(struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getId", 0);

  /* "opendht.pyx":123
 *         self._infohash.setBit(bit, b)
 *     def getId(InfoHash self):
 *         return self             # <<<<<<<<<<<<<<
 *     def toString(InfoHash self):
 *         return self._infohash.toString()
*/
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __Pyx_INCREF((PyObject *)__pyx_v_self);
      __pyx_r = ((PyObject *)__pyx_v_self);
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  goto __pyx_L0;

  /* "opendht.pyx":122
 *     def setBit(InfoHash self, bit, b):
 *         self._infohash.setBit(bit, b)
 *     def getId(InfoHash self):             # <<<<<<<<<<<<<<
 *         return self
 *     def toString(InfoHash self):
*/

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

/* "opendht.pyx":124
 *     def getId(InfoHash self):
 *         return self
 *     def toString(InfoHash self):             # <<<<<<<<<<<<<<
 *         return self._infohash.toString()
 *     def toFloat(InfoHash self):
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_8InfoHash_13toString(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_8InfoHash_13toString = {"toString", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_8InfoHash_13toString, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_8InfoHash_13toString(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("toString (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("toString", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("toString", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7opendht_5_core_8InfoHash_12toString(((struct __pyx_obj_7opendht_5_core_InfoHash *)__pyx_v_self));

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

static PyObject *__pyx_pf_7opendht_5_core_8InfoHash_12toString(struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("toString", 0);

  /* "opendht.pyx":125
 *         return self
 *     def toString(InfoHash self):
 *         return self._infohash.toString()             # <<<<<<<<<<<<<<
 *     def toFloat(InfoHash self):
 *         return self._infohash.toFloat()
*/
  __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(__pyx_v_self->_infohash.toString()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 125, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_1;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "opendht.pyx":124
 *     def getId(InfoHash self):
 *         return self
 *     def toString(InfoHash self):             # <<<<<<<<<<<<<<
 *         return self._infohash.toString()
 *     def toFloat(InfoHash self):
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("opendht._core.InfoHash.toString", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":126
 *     def toString(InfoHash self):
 *         return self._infohash.toString()
 *     def toFloat(InfoHash self):             # <<<<<<<<<<<<<<
 *         return self._infohash.toFloat()
 *     @staticmethod
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_8InfoHash_15toFloat(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_8InfoHash_15toFloat = {"toFloat", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_8InfoHash_15toFloat, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_8InfoHash_15toFloat(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("toFloat (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("toFloat", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("toFloat", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7opendht_5_core_8InfoHash_14toFloat(((struct __pyx_obj_7opendht_5_core_InfoHash *)__pyx_v_self));

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

static PyObject *__pyx_pf_7opendht_5_core_8InfoHash_14toFloat(struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("toFloat", 0);

  /* "opendht.pyx":127
 *         return self._infohash.toString()
 *     def toFloat(InfoHash self):
 *         return self._infohash.toFloat()             # <<<<<<<<<<<<<<
 *     @staticmethod
 *     def commonBits(InfoHash a, InfoHash b) -> int:
*/
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->_infohash.toFloat()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 127, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_1;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "opendht.pyx":126
 *     def toString(InfoHash self):
 *         return self._infohash.toString()
 *     def toFloat(InfoHash self):             # <<<<<<<<<<<<<<
 *         return self._infohash.toFloat()
 *     @staticmethod
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("opendht._core.InfoHash.toFloat", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":128
 *     def toFloat(InfoHash self):
 *         return self._infohash.toFloat()
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def commonBits(InfoHash a, InfoHash b) -> int:
 *         return cpp.InfoHash.commonBits(a._infohash, b._infohash)
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_8InfoHash_17commonBits(CYTHON_UNUSED PyObject *__pyx_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_8InfoHash_17commonBits = {"commonBits", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_8InfoHash_17commonBits, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_8InfoHash_17commonBits(CYTHON_UNUSED PyObject *__pyx_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_v_a = 0;
  struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_v_b = 0;
  #if !CYTHON_VECTORCALL
  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("commonBits (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_a,&__pyx_mstate_global->__pyx_n_u_b,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 128, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 128, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 128, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "commonBits", 0) < (0)) __PYX_ERR(0, 128, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("commonBits", 1, 2, 2, i); __PYX_ERR(0, 128, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 128, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 128, __pyx_L3_error)
    }
    __pyx_v_a = ((struct __pyx_obj_7opendht_5_core_InfoHash *)values[0]);
    __pyx_v_b = ((struct __pyx_obj_7opendht_5_core_InfoHash *)values[1]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("commonBits", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 128, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.InfoHash.commonBits", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_mstate_global->__pyx_ptype_7opendht_5_core_InfoHash, 1, "a", 0))) __PYX_ERR(0, 129, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b), __pyx_mstate_global->__pyx_ptype_7opendht_5_core_InfoHash, 1, "b", 0))) __PYX_ERR(0, 129, __pyx_L1_error)
  __pyx_r = __pyx_pf_7opendht_5_core_8InfoHash_16commonBits(__pyx_v_a, __pyx_v_b);

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

static PyObject *__pyx_pf_7opendht_5_core_8InfoHash_16commonBits(struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_v_a, struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_v_b) {
  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("commonBits", 0);

  /* "opendht.pyx":130
 *     @staticmethod
 *     def commonBits(InfoHash a, InfoHash b) -> int:
 *         return cpp.InfoHash.commonBits(a._infohash, b._infohash)             # <<<<<<<<<<<<<<
 *     @staticmethod
 *     def get(str key) -> InfoHash:
*/
  __pyx_t_1 = __Pyx_PyLong_From_unsigned_int(dht::InfoHash::commonBits(__pyx_v_a->_infohash, __pyx_v_b->_infohash)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 130, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyInt_FromNumber(&__pyx_t_1, NULL, 0) < (0)) __PYX_ERR(0, 130, __pyx_L1_error)
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = ((PyObject*)__pyx_t_1);
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "opendht.pyx":128
 *     def toFloat(InfoHash self):
 *         return self._infohash.toFloat()
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def commonBits(InfoHash a, InfoHash b) -> int:
 *         return cpp.InfoHash.commonBits(a._infohash, b._infohash)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("opendht._core.InfoHash.commonBits", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":131
 *     def commonBits(InfoHash a, InfoHash b) -> int:
 *         return cpp.InfoHash.commonBits(a._infohash, b._infohash)
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def get(str key) -> InfoHash:
 *         h = InfoHash()
*/

/* Python wrapper */
static struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_pw_7opendht_5_core_8InfoHash_19get(CYTHON_UNUSED PyObject *__pyx_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_8InfoHash_19get = {"get", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_8InfoHash_19get, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_pw_7opendht_5_core_8InfoHash_19get(CYTHON_UNUSED PyObject *__pyx_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_key = 0;
  #if !CYTHON_VECTORCALL
  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;
  struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_key,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 131, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 131, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "get", 0) < (0)) __PYX_ERR(0, 131, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("get", 1, 1, 1, i); __PYX_ERR(0, 131, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 131, __pyx_L3_error)
    }
    __pyx_v_key = ((PyObject*)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 131, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.InfoHash.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_key), (&PyUnicode_Type), 1, "key", 1))) __PYX_ERR(0, 132, __pyx_L1_error)
  __pyx_r = __pyx_pf_7opendht_5_core_8InfoHash_18get(__pyx_v_key);

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

static struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_pf_7opendht_5_core_8InfoHash_18get(PyObject *__pyx_v_key) {
  struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_v_h = NULL;
  struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  std::string __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get", 0);

  /* "opendht.pyx":133
 *     @staticmethod
 *     def get(str key) -> InfoHash:
 *         h = InfoHash()             # <<<<<<<<<<<<<<
 *         h._infohash = cpp.InfoHash.get(key.encode())
 *         return h
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7opendht_5_core_InfoHash, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 133, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_h = ((struct __pyx_obj_7opendht_5_core_InfoHash *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "opendht.pyx":134
 *     def get(str key) -> InfoHash:
 *         h = InfoHash()
 *         h._infohash = cpp.InfoHash.get(key.encode())             # <<<<<<<<<<<<<<
 *         return h
 *     @staticmethod
*/
  if (unlikely(__pyx_v_key == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "\047NoneType\047 object has no attribute \047%.30s\047", "encode");
    __PYX_ERR(0, 134, __pyx_L1_error)
  }
  __pyx_t_1 = PyUnicode_AsEncodedString(__pyx_v_key, NULL, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 134, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 134, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_h->_infohash = dht::InfoHash::get(__PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_4));


  /* "opendht.pyx":135
 *         h = InfoHash()
 *         h._infohash = cpp.InfoHash.get(key.encode())
 *         return h             # <<<<<<<<<<<<<<
 *     @staticmethod
 *     def getRandom() -> InfoHash:
*/
  {
    struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __Pyx_INCREF((PyObject *)__pyx_v_h);
      __pyx_r = __pyx_v_h;
    }
    __Pyx_XDECREF((PyObject *)__pyx_temp);
  }
  goto __pyx_L0;

  /* "opendht.pyx":131
 *     def commonBits(InfoHash a, InfoHash b) -> int:
 *         return cpp.InfoHash.commonBits(a._infohash, b._infohash)
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def get(str key) -> InfoHash:
 *         h = InfoHash()
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("opendht._core.InfoHash.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_h);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":136
 *         h._infohash = cpp.InfoHash.get(key.encode())
 *         return h
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def getRandom() -> InfoHash:
 *         h = InfoHash()
*/

/* Python wrapper */
static struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_pw_7opendht_5_core_8InfoHash_21getRandom(CYTHON_UNUSED PyObject *__pyx_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_8InfoHash_21getRandom = {"getRandom", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_8InfoHash_21getRandom, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_pw_7opendht_5_core_8InfoHash_21getRandom(CYTHON_UNUSED PyObject *__pyx_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getRandom (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getRandom", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getRandom", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7opendht_5_core_8InfoHash_20getRandom();

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

static struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_pf_7opendht_5_core_8InfoHash_20getRandom(void) {
  struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_v_h = NULL;
  struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getRandom", 0);

  /* "opendht.pyx":138
 *     @staticmethod
 *     def getRandom() -> InfoHash:
 *         h = InfoHash()             # <<<<<<<<<<<<<<
 *         h._infohash = cpp.InfoHash.getRandom()
 *         return h
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7opendht_5_core_InfoHash, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 138, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_h = ((struct __pyx_obj_7opendht_5_core_InfoHash *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "opendht.pyx":139
 *     def getRandom() -> InfoHash:
 *         h = InfoHash()
 *         h._infohash = cpp.InfoHash.getRandom()             # <<<<<<<<<<<<<<
 *         return h
 * 
*/
  __pyx_v_h->_infohash = dht::InfoHash::getRandom();

  /* "opendht.pyx":140
 *         h = InfoHash()
 *         h._infohash = cpp.InfoHash.getRandom()
 *         return h             # <<<<<<<<<<<<<<
 * 
 * cdef class PkId(_WithPk):
*/
  {
    struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __Pyx_INCREF((PyObject *)__pyx_v_h);
      __pyx_r = __pyx_v_h;
    }
    __Pyx_XDECREF((PyObject *)__pyx_temp);
  }
  goto __pyx_L0;

  /* "opendht.pyx":136
 *         h._infohash = cpp.InfoHash.get(key.encode())
 *         return h
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def getRandom() -> InfoHash:
 *         h = InfoHash()
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("opendht._core.InfoHash.getRandom", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_h);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_8InfoHash_23__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_8InfoHash_23__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_8InfoHash_23__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_8InfoHash_23__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7opendht_5_core_8InfoHash_22__reduce_cython__(((struct __pyx_obj_7opendht_5_core_InfoHash *)__pyx_v_self));

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

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

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(1, 2, __pyx_L1_error)

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

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

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

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_8InfoHash_25__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_8InfoHash_25__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_8InfoHash_25__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_8InfoHash_25__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(1, 3, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.InfoHash.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7opendht_5_core_8InfoHash_24__setstate_cython__(((struct __pyx_obj_7opendht_5_core_InfoHash *)__pyx_v_self), __pyx_v___pyx_state);

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

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

  /* "(tree fragment)":4
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(1, 4, __pyx_L1_error)

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

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

/* "opendht.pyx":144
 * cdef class PkId(_WithPk):
 *     cdef cpp.PkId _pkid
 *     def __cinit__(self, bytes str=b''):             # <<<<<<<<<<<<<<
 *         self._pkid = cpp.PkId(str) if str else cpp.PkId()
 *     def __bool__(PkId self):
*/

/* Python wrapper */
static int __pyx_pw_7opendht_5_core_4PkId_1__cinit__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL_TPNEW
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_pw_7opendht_5_core_4PkId_1__cinit__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL_TPNEW
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_str = 0;
  #if !CYTHON_VECTORCALL_TPNEW
  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;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  #if !CYTHON_VECTORCALL_TPNEW
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL_TPNEW(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_str,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL_TPNEW(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 144, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 144, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__cinit__", 0) < (0)) __PYX_ERR(0, 144, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_kp_b__5));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 144, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_kp_b__5));
    }
    __pyx_v_str = ((PyObject*)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 144, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.PkId.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_str), (&PyBytes_Type), 1, "str", 1))) __PYX_ERR(0, 144, __pyx_L1_error)
  __pyx_r = __pyx_pf_7opendht_5_core_4PkId___cinit__(((struct __pyx_obj_7opendht_5_core_PkId *)__pyx_v_self), __pyx_v_str);

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

static int __pyx_pf_7opendht_5_core_4PkId___cinit__(struct __pyx_obj_7opendht_5_core_PkId *__pyx_v_self, PyObject *__pyx_v_str) {
  int __pyx_r;
  dht::PkId __pyx_t_1;
  int __pyx_t_2;
  std::string __pyx_t_3;
  dht::PkId __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "opendht.pyx":145
 *     cdef cpp.PkId _pkid
 *     def __cinit__(self, bytes str=b''):
 *         self._pkid = cpp.PkId(str) if str else cpp.PkId()             # <<<<<<<<<<<<<<
 *     def __bool__(PkId self):
 *         return <bool>self._pkid
*/
  if (__pyx_v_str == Py_None) __pyx_t_2 = 0;
  else
  {
    Py_ssize_t __pyx_temp = __Pyx_PyBytes_GET_SIZE(__pyx_v_str);
    if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(0, 145, __pyx_L1_error)
    __pyx_t_2 = (__pyx_temp != 0);
  }

  if (__pyx_t_2) {
    __pyx_t_3 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_v_str); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 145, __pyx_L1_error)
    try {
      __pyx_t_4 = dht::PkId(__pyx_t_3);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(0, 145, __pyx_L1_error)
    }

    __pyx_t_1 = __pyx_t_4;
  } else {
    try {
      __pyx_t_4 = dht::PkId();
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(0, 145, __pyx_L1_error)
    }
    __pyx_t_1 = __pyx_t_4;
  }

  __pyx_v_self->_pkid = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_1);

  /* "opendht.pyx":144
 * cdef class PkId(_WithPk):
 *     cdef cpp.PkId _pkid
 *     def __cinit__(self, bytes str=b''):             # <<<<<<<<<<<<<<
 *         self._pkid = cpp.PkId(str) if str else cpp.PkId()
 *     def __bool__(PkId self):
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("opendht._core.PkId.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;

  return __pyx_r;
}

/* "opendht.pyx":146
 *     def __cinit__(self, bytes str=b''):
 *         self._pkid = cpp.PkId(str) if str else cpp.PkId()
 *     def __bool__(PkId self):             # <<<<<<<<<<<<<<
 *         return <bool>self._pkid
 *     def __richcmp__(PkId self, PkId other, int op):
*/

/* Python wrapper */
static int __pyx_pw_7opendht_5_core_4PkId_3__bool__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_7opendht_5_core_4PkId_3__bool__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__bool__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7opendht_5_core_4PkId_2__bool__(((struct __pyx_obj_7opendht_5_core_PkId *)__pyx_v_self));

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

static int __pyx_pf_7opendht_5_core_4PkId_2__bool__(struct __pyx_obj_7opendht_5_core_PkId *__pyx_v_self) {
  int __pyx_r;

  /* "opendht.pyx":147
 *         self._pkid = cpp.PkId(str) if str else cpp.PkId()
 *     def __bool__(PkId self):
 *         return <bool>self._pkid             # <<<<<<<<<<<<<<
 *     def __richcmp__(PkId self, PkId other, int op):
 *         if op == 0:
*/
  {

    __pyx_r = ((bool)__pyx_v_self->_pkid);
  }
  goto __pyx_L0;

  /* "opendht.pyx":146
 *     def __cinit__(self, bytes str=b''):
 *         self._pkid = cpp.PkId(str) if str else cpp.PkId()
 *     def __bool__(PkId self):             # <<<<<<<<<<<<<<
 *         return <bool>self._pkid
 *     def __richcmp__(PkId self, PkId other, int op):
*/

  /* function exit code */
  __pyx_L0:;

  return __pyx_r;
}

/* "opendht.pyx":148
 *     def __bool__(PkId self):
 *         return <bool>self._pkid
 *     def __richcmp__(PkId self, PkId other, int op):             # <<<<<<<<<<<<<<
 *         if op == 0:
 *             return self._pkid < other._pkid
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_4PkId_5__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op); /*proto*/
static PyObject *__pyx_pw_7opendht_5_core_4PkId_5__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__richcmp__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_mstate_global->__pyx_ptype_7opendht_5_core_PkId, 1, "other", 0))) __PYX_ERR(0, 148, __pyx_L1_error)
  __pyx_r = __pyx_pf_7opendht_5_core_4PkId_4__richcmp__(((struct __pyx_obj_7opendht_5_core_PkId *)__pyx_v_self), ((struct __pyx_obj_7opendht_5_core_PkId *)__pyx_v_other), ((int)__pyx_v_op));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  goto __pyx_L5_cleaned_up;
  __pyx_L0:;
  __pyx_L5_cleaned_up:;

  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7opendht_5_core_4PkId_4__richcmp__(struct __pyx_obj_7opendht_5_core_PkId *__pyx_v_self, struct __pyx_obj_7opendht_5_core_PkId *__pyx_v_other, int __pyx_v_op) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  bool __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__richcmp__", 0);

  /* "opendht.pyx":149
 *         return <bool>self._pkid
 *     def __richcmp__(PkId self, PkId other, int op):
 *         if op == 0:             # <<<<<<<<<<<<<<
 *             return self._pkid < other._pkid
 *         if op == 1:
*/
  __pyx_t_1 = (__pyx_v_op == 0);

  if (__pyx_t_1) {


    /* "opendht.pyx":150
 *     def __richcmp__(PkId self, PkId other, int op):
 *         if op == 0:
 *             return self._pkid < other._pkid             # <<<<<<<<<<<<<<
 *         if op == 1:
 *             return self._pkid < other._pkid or self._pkid == other._pkid
*/
    __pyx_t_2 = __Pyx_PyBool_FromLong((__pyx_v_self->_pkid < __pyx_v_other->_pkid)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 150, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    {
      PyObject *__pyx_temp;
      {
        __pyx_temp = __pyx_r;
        __pyx_r = __pyx_t_2;
      }
      __Pyx_XDECREF(__pyx_temp);
    }
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "opendht.pyx":149
 *         return <bool>self._pkid
 *     def __richcmp__(PkId self, PkId other, int op):
 *         if op == 0:             # <<<<<<<<<<<<<<
 *             return self._pkid < other._pkid
 *         if op == 1:
*/
  }

  /* "opendht.pyx":151
 *         if op == 0:
 *             return self._pkid < other._pkid
 *         if op == 1:             # <<<<<<<<<<<<<<
 *             return self._pkid < other._pkid or self._pkid == other._pkid
 *         if op == 2:
*/
  __pyx_t_1 = (__pyx_v_op == 1);

  if (__pyx_t_1) {


    /* "opendht.pyx":152
 *             return self._pkid < other._pkid
 *         if op == 1:
 *             return self._pkid < other._pkid or self._pkid == other._pkid             # <<<<<<<<<<<<<<
 *         if op == 2:
 *             return self._pkid == other._pkid
*/
    __pyx_t_3 = (__pyx_v_self->_pkid < __pyx_v_other->_pkid);

    if (!__pyx_t_3) {

    } else {
      __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 152, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_2 = __pyx_t_4;
      __pyx_t_4 = 0;

      goto __pyx_L5_bool_binop_done;
    }
    __pyx_t_3 = (__pyx_v_self->_pkid == __pyx_v_other->_pkid);

    __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 152, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = __pyx_t_4;
    __pyx_t_4 = 0;

    __pyx_L5_bool_binop_done:;
    {
      PyObject *__pyx_temp;
      {
        __pyx_temp = __pyx_r;
        __pyx_r = __pyx_t_2;
      }
      __Pyx_XDECREF(__pyx_temp);
    }
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "opendht.pyx":151
 *         if op == 0:
 *             return self._pkid < other._pkid
 *         if op == 1:             # <<<<<<<<<<<<<<
 *             return self._pkid < other._pkid or self._pkid == other._pkid
 *         if op == 2:
*/
  }

  /* "opendht.pyx":153
 *         if op == 1:
 *             return self._pkid < other._pkid or self._pkid == other._pkid
 *         if op == 2:             # <<<<<<<<<<<<<<
 *             return self._pkid == other._pkid
 *         return NotImplemented
*/
  __pyx_t_1 = (__pyx_v_op == 2);

  if (__pyx_t_1) {


    /* "opendht.pyx":154
 *             return self._pkid < other._pkid or self._pkid == other._pkid
 *         if op == 2:
 *             return self._pkid == other._pkid             # <<<<<<<<<<<<<<
 *         return NotImplemented
 *     def getBit(PkId self, bit):
*/
    __pyx_t_2 = __Pyx_PyBool_FromLong((__pyx_v_self->_pkid == __pyx_v_other->_pkid)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 154, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    {
      PyObject *__pyx_temp;
      {
        __pyx_temp = __pyx_r;
        __pyx_r = __pyx_t_2;
      }
      __Pyx_XDECREF(__pyx_temp);
    }
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "opendht.pyx":153
 *         if op == 1:
 *             return self._pkid < other._pkid or self._pkid == other._pkid
 *         if op == 2:             # <<<<<<<<<<<<<<
 *             return self._pkid == other._pkid
 *         return NotImplemented
*/
  }

  /* "opendht.pyx":155
 *         if op == 2:
 *             return self._pkid == other._pkid
 *         return NotImplemented             # <<<<<<<<<<<<<<
 *     def getBit(PkId self, bit):
 *         return self._pkid.getBit(bit)
*/
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __Pyx_INCREF(__pyx_builtin_NotImplemented);
      __pyx_r = __pyx_builtin_NotImplemented;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  goto __pyx_L0;

  /* "opendht.pyx":148
 *     def __bool__(PkId self):
 *         return <bool>self._pkid
 *     def __richcmp__(PkId self, PkId other, int op):             # <<<<<<<<<<<<<<
 *         if op == 0:
 *             return self._pkid < other._pkid
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("opendht._core.PkId.__richcmp__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":156
 *             return self._pkid == other._pkid
 *         return NotImplemented
 *     def getBit(PkId self, bit):             # <<<<<<<<<<<<<<
 *         return self._pkid.getBit(bit)
 *     def setBit(PkId self, bit, b):
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_4PkId_7getBit(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_4PkId_7getBit = {"getBit", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_4PkId_7getBit, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_4PkId_7getBit(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_bit = 0;
  #if !CYTHON_VECTORCALL
  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("getBit (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_bit,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 156, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 156, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getBit", 0) < (0)) __PYX_ERR(0, 156, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getBit", 1, 1, 1, i); __PYX_ERR(0, 156, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 156, __pyx_L3_error)
    }
    __pyx_v_bit = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getBit", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 156, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.PkId.getBit", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7opendht_5_core_4PkId_6getBit(((struct __pyx_obj_7opendht_5_core_PkId *)__pyx_v_self), __pyx_v_bit);

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

static PyObject *__pyx_pf_7opendht_5_core_4PkId_6getBit(struct __pyx_obj_7opendht_5_core_PkId *__pyx_v_self, PyObject *__pyx_v_bit) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  unsigned int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getBit", 0);

  /* "opendht.pyx":157
 *         return NotImplemented
 *     def getBit(PkId self, bit):
 *         return self._pkid.getBit(bit)             # <<<<<<<<<<<<<<
 *     def setBit(PkId self, bit, b):
 *         self._pkid.setBit(bit, b)
*/
  __pyx_t_1 = __Pyx_PyLong_As_unsigned_int(__pyx_v_bit); if (unlikely((__pyx_t_1 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 157, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->_pkid.getBit(__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_2;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "opendht.pyx":156
 *             return self._pkid == other._pkid
 *         return NotImplemented
 *     def getBit(PkId self, bit):             # <<<<<<<<<<<<<<
 *         return self._pkid.getBit(bit)
 *     def setBit(PkId self, bit, b):
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("opendht._core.PkId.getBit", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":158
 *     def getBit(PkId self, bit):
 *         return self._pkid.getBit(bit)
 *     def setBit(PkId self, bit, b):             # <<<<<<<<<<<<<<
 *         self._pkid.setBit(bit, b)
 *     def getLongId(PkId self):
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_4PkId_9setBit(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_4PkId_9setBit = {"setBit", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_4PkId_9setBit, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_4PkId_9setBit(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_bit = 0;
  PyObject *__pyx_v_b = 0;
  #if !CYTHON_VECTORCALL
  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("setBit (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_bit,&__pyx_mstate_global->__pyx_n_u_b,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 158, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 158, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 158, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setBit", 0) < (0)) __PYX_ERR(0, 158, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setBit", 1, 2, 2, i); __PYX_ERR(0, 158, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 158, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 158, __pyx_L3_error)
    }
    __pyx_v_bit = values[0];
    __pyx_v_b = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setBit", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 158, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.PkId.setBit", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7opendht_5_core_4PkId_8setBit(((struct __pyx_obj_7opendht_5_core_PkId *)__pyx_v_self), __pyx_v_bit, __pyx_v_b);

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

static PyObject *__pyx_pf_7opendht_5_core_4PkId_8setBit(struct __pyx_obj_7opendht_5_core_PkId *__pyx_v_self, PyObject *__pyx_v_bit, PyObject *__pyx_v_b) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  unsigned int __pyx_t_1;
  bool __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("setBit", 0);

  /* "opendht.pyx":159
 *         return self._pkid.getBit(bit)
 *     def setBit(PkId self, bit, b):
 *         self._pkid.setBit(bit, b)             # <<<<<<<<<<<<<<
 *     def getLongId(PkId self):
 *         return self
*/
  __pyx_t_1 = __Pyx_PyLong_As_unsigned_int(__pyx_v_bit); if (unlikely((__pyx_t_1 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 159, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_b); if (unlikely((__pyx_t_2 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 159, __pyx_L1_error)
  __pyx_v_self->_pkid.setBit(__pyx_t_1, __pyx_t_2);



  /* "opendht.pyx":158
 *     def getBit(PkId self, bit):
 *         return self._pkid.getBit(bit)
 *     def setBit(PkId self, bit, b):             # <<<<<<<<<<<<<<
 *         self._pkid.setBit(bit, b)
 *     def getLongId(PkId self):
*/

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

/* "opendht.pyx":160
 *     def setBit(PkId self, bit, b):
 *         self._pkid.setBit(bit, b)
 *     def getLongId(PkId self):             # <<<<<<<<<<<<<<
 *         return self
 *     def toString(PkId self):
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_4PkId_11getLongId(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_4PkId_11getLongId = {"getLongId", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_4PkId_11getLongId, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_4PkId_11getLongId(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getLongId (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getLongId", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getLongId", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7opendht_5_core_4PkId_10getLongId(((struct __pyx_obj_7opendht_5_core_PkId *)__pyx_v_self));

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

static PyObject *__pyx_pf_7opendht_5_core_4PkId_10getLongId(struct __pyx_obj_7opendht_5_core_PkId *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getLongId", 0);

  /* "opendht.pyx":161
 *         self._pkid.setBit(bit, b)
 *     def getLongId(PkId self):
 *         return self             # <<<<<<<<<<<<<<
 *     def toString(PkId self):
 *         return self._pkid.toString()
*/
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __Pyx_INCREF((PyObject *)__pyx_v_self);
      __pyx_r = ((PyObject *)__pyx_v_self);
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  goto __pyx_L0;

  /* "opendht.pyx":160
 *     def setBit(PkId self, bit, b):
 *         self._pkid.setBit(bit, b)
 *     def getLongId(PkId self):             # <<<<<<<<<<<<<<
 *         return self
 *     def toString(PkId self):
*/

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

/* "opendht.pyx":162
 *     def getLongId(PkId self):
 *         return self
 *     def toString(PkId self):             # <<<<<<<<<<<<<<
 *         return self._pkid.toString()
 *     def toFloat(PkId self) -> float:
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_4PkId_13toString(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_4PkId_13toString = {"toString", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_4PkId_13toString, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_4PkId_13toString(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("toString (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("toString", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("toString", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7opendht_5_core_4PkId_12toString(((struct __pyx_obj_7opendht_5_core_PkId *)__pyx_v_self));

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

static PyObject *__pyx_pf_7opendht_5_core_4PkId_12toString(struct __pyx_obj_7opendht_5_core_PkId *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("toString", 0);

  /* "opendht.pyx":163
 *         return self
 *     def toString(PkId self):
 *         return self._pkid.toString()             # <<<<<<<<<<<<<<
 *     def toFloat(PkId self) -> float:
 *         return self._pkid.toFloat()
*/
  __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(__pyx_v_self->_pkid.toString()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_1;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "opendht.pyx":162
 *     def getLongId(PkId self):
 *         return self
 *     def toString(PkId self):             # <<<<<<<<<<<<<<
 *         return self._pkid.toString()
 *     def toFloat(PkId self) -> float:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("opendht._core.PkId.toString", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":164
 *     def toString(PkId self):
 *         return self._pkid.toString()
 *     def toFloat(PkId self) -> float:             # <<<<<<<<<<<<<<
 *         return self._pkid.toFloat()
 *     @staticmethod
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_4PkId_15toFloat(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_4PkId_15toFloat = {"toFloat", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_4PkId_15toFloat, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_4PkId_15toFloat(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("toFloat (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("toFloat", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("toFloat", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7opendht_5_core_4PkId_14toFloat(((struct __pyx_obj_7opendht_5_core_PkId *)__pyx_v_self));

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

static PyObject *__pyx_pf_7opendht_5_core_4PkId_14toFloat(struct __pyx_obj_7opendht_5_core_PkId *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("toFloat", 0);

  /* "opendht.pyx":165
 *         return self._pkid.toString()
 *     def toFloat(PkId self) -> float:
 *         return self._pkid.toFloat()             # <<<<<<<<<<<<<<
 *     @staticmethod
 *     def commonBits(PkId a, PkId b) -> int:
*/
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->_pkid.toFloat()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_1;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "opendht.pyx":164
 *     def toString(PkId self):
 *         return self._pkid.toString()
 *     def toFloat(PkId self) -> float:             # <<<<<<<<<<<<<<
 *         return self._pkid.toFloat()
 *     @staticmethod
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("opendht._core.PkId.toFloat", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":166
 *     def toFloat(PkId self) -> float:
 *         return self._pkid.toFloat()
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def commonBits(PkId a, PkId b) -> int:
 *         return cpp.PkId.commonBits(a._pkid, b._pkid)
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_4PkId_17commonBits(CYTHON_UNUSED PyObject *__pyx_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_4PkId_17commonBits = {"commonBits", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_4PkId_17commonBits, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_4PkId_17commonBits(CYTHON_UNUSED PyObject *__pyx_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_7opendht_5_core_PkId *__pyx_v_a = 0;
  struct __pyx_obj_7opendht_5_core_PkId *__pyx_v_b = 0;
  #if !CYTHON_VECTORCALL
  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("commonBits (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_a,&__pyx_mstate_global->__pyx_n_u_b,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 166, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 166, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 166, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "commonBits", 0) < (0)) __PYX_ERR(0, 166, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("commonBits", 1, 2, 2, i); __PYX_ERR(0, 166, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 166, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 166, __pyx_L3_error)
    }
    __pyx_v_a = ((struct __pyx_obj_7opendht_5_core_PkId *)values[0]);
    __pyx_v_b = ((struct __pyx_obj_7opendht_5_core_PkId *)values[1]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("commonBits", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 166, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.PkId.commonBits", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_mstate_global->__pyx_ptype_7opendht_5_core_PkId, 1, "a", 0))) __PYX_ERR(0, 167, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b), __pyx_mstate_global->__pyx_ptype_7opendht_5_core_PkId, 1, "b", 0))) __PYX_ERR(0, 167, __pyx_L1_error)
  __pyx_r = __pyx_pf_7opendht_5_core_4PkId_16commonBits(__pyx_v_a, __pyx_v_b);

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

static PyObject *__pyx_pf_7opendht_5_core_4PkId_16commonBits(struct __pyx_obj_7opendht_5_core_PkId *__pyx_v_a, struct __pyx_obj_7opendht_5_core_PkId *__pyx_v_b) {
  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("commonBits", 0);

  /* "opendht.pyx":168
 *     @staticmethod
 *     def commonBits(PkId a, PkId b) -> int:
 *         return cpp.PkId.commonBits(a._pkid, b._pkid)             # <<<<<<<<<<<<<<
 *     @staticmethod
 *     def get(str key) -> PkId:
*/
  __pyx_t_1 = __Pyx_PyLong_From_unsigned_int(dht::PkId::commonBits(__pyx_v_a->_pkid, __pyx_v_b->_pkid)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 168, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyInt_FromNumber(&__pyx_t_1, NULL, 0) < (0)) __PYX_ERR(0, 168, __pyx_L1_error)
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = ((PyObject*)__pyx_t_1);
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "opendht.pyx":166
 *     def toFloat(PkId self) -> float:
 *         return self._pkid.toFloat()
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def commonBits(PkId a, PkId b) -> int:
 *         return cpp.PkId.commonBits(a._pkid, b._pkid)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("opendht._core.PkId.commonBits", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":169
 *     def commonBits(PkId a, PkId b) -> int:
 *         return cpp.PkId.commonBits(a._pkid, b._pkid)
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def get(str key) -> PkId:
 *         h = PkId()
*/

/* Python wrapper */
static struct __pyx_obj_7opendht_5_core_PkId *__pyx_pw_7opendht_5_core_4PkId_19get(CYTHON_UNUSED PyObject *__pyx_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_4PkId_19get = {"get", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_4PkId_19get, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static struct __pyx_obj_7opendht_5_core_PkId *__pyx_pw_7opendht_5_core_4PkId_19get(CYTHON_UNUSED PyObject *__pyx_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_key = 0;
  #if !CYTHON_VECTORCALL
  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;
  struct __pyx_obj_7opendht_5_core_PkId *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_key,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 169, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 169, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "get", 0) < (0)) __PYX_ERR(0, 169, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("get", 1, 1, 1, i); __PYX_ERR(0, 169, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 169, __pyx_L3_error)
    }
    __pyx_v_key = ((PyObject*)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 169, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.PkId.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_key), (&PyUnicode_Type), 1, "key", 1))) __PYX_ERR(0, 170, __pyx_L1_error)
  __pyx_r = __pyx_pf_7opendht_5_core_4PkId_18get(__pyx_v_key);

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

static struct __pyx_obj_7opendht_5_core_PkId *__pyx_pf_7opendht_5_core_4PkId_18get(PyObject *__pyx_v_key) {
  struct __pyx_obj_7opendht_5_core_PkId *__pyx_v_h = NULL;
  struct __pyx_obj_7opendht_5_core_PkId *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  std::string __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get", 0);

  /* "opendht.pyx":171
 *     @staticmethod
 *     def get(str key) -> PkId:
 *         h = PkId()             # <<<<<<<<<<<<<<
 *         h._pkid = cpp.PkId.get(key.encode())
 *         return h
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7opendht_5_core_PkId, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_h = ((struct __pyx_obj_7opendht_5_core_PkId *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "opendht.pyx":172
 *     def get(str key) -> PkId:
 *         h = PkId()
 *         h._pkid = cpp.PkId.get(key.encode())             # <<<<<<<<<<<<<<
 *         return h
 *     @staticmethod
*/
  if (unlikely(__pyx_v_key == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "\047NoneType\047 object has no attribute \047%.30s\047", "encode");
    __PYX_ERR(0, 172, __pyx_L1_error)
  }
  __pyx_t_1 = PyUnicode_AsEncodedString(__pyx_v_key, NULL, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 172, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 172, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_h->_pkid = dht::PkId::get(__PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_4));


  /* "opendht.pyx":173
 *         h = PkId()
 *         h._pkid = cpp.PkId.get(key.encode())
 *         return h             # <<<<<<<<<<<<<<
 *     @staticmethod
 *     def getRandom() -> PkId:
*/
  {
    struct __pyx_obj_7opendht_5_core_PkId *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __Pyx_INCREF((PyObject *)__pyx_v_h);
      __pyx_r = __pyx_v_h;
    }
    __Pyx_XDECREF((PyObject *)__pyx_temp);
  }
  goto __pyx_L0;

  /* "opendht.pyx":169
 *     def commonBits(PkId a, PkId b) -> int:
 *         return cpp.PkId.commonBits(a._pkid, b._pkid)
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def get(str key) -> PkId:
 *         h = PkId()
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("opendht._core.PkId.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_h);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":174
 *         h._pkid = cpp.PkId.get(key.encode())
 *         return h
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def getRandom() -> PkId:
 *         h = PkId()
*/

/* Python wrapper */
static struct __pyx_obj_7opendht_5_core_PkId *__pyx_pw_7opendht_5_core_4PkId_21getRandom(CYTHON_UNUSED PyObject *__pyx_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_4PkId_21getRandom = {"getRandom", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_4PkId_21getRandom, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static struct __pyx_obj_7opendht_5_core_PkId *__pyx_pw_7opendht_5_core_4PkId_21getRandom(CYTHON_UNUSED PyObject *__pyx_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  struct __pyx_obj_7opendht_5_core_PkId *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getRandom (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getRandom", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getRandom", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7opendht_5_core_4PkId_20getRandom();

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

static struct __pyx_obj_7opendht_5_core_PkId *__pyx_pf_7opendht_5_core_4PkId_20getRandom(void) {
  struct __pyx_obj_7opendht_5_core_PkId *__pyx_v_h = NULL;
  struct __pyx_obj_7opendht_5_core_PkId *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getRandom", 0);

  /* "opendht.pyx":176
 *     @staticmethod
 *     def getRandom() -> PkId:
 *         h = PkId()             # <<<<<<<<<<<<<<
 *         h._pkid = cpp.PkId.getRandom()
 *         return h
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7opendht_5_core_PkId, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 176, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_h = ((struct __pyx_obj_7opendht_5_core_PkId *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "opendht.pyx":177
 *     def getRandom() -> PkId:
 *         h = PkId()
 *         h._pkid = cpp.PkId.getRandom()             # <<<<<<<<<<<<<<
 *         return h
 * 
*/
  __pyx_v_h->_pkid = dht::PkId::getRandom();

  /* "opendht.pyx":178
 *         h = PkId()
 *         h._pkid = cpp.PkId.getRandom()
 *         return h             # <<<<<<<<<<<<<<
 * 
 * cdef class SockAddr(object):
*/
  {
    struct __pyx_obj_7opendht_5_core_PkId *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __Pyx_INCREF((PyObject *)__pyx_v_h);
      __pyx_r = __pyx_v_h;
    }
    __Pyx_XDECREF((PyObject *)__pyx_temp);
  }
  goto __pyx_L0;

  /* "opendht.pyx":174
 *         h._pkid = cpp.PkId.get(key.encode())
 *         return h
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def getRandom() -> PkId:
 *         h = PkId()
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("opendht._core.PkId.getRandom", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_h);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_4PkId_23__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_4PkId_23__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_4PkId_23__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_4PkId_23__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7opendht_5_core_4PkId_22__reduce_cython__(((struct __pyx_obj_7opendht_5_core_PkId *)__pyx_v_self));

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

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

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(1, 2, __pyx_L1_error)

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

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

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

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_4PkId_25__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_4PkId_25__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_4PkId_25__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_4PkId_25__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(1, 3, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.PkId.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7opendht_5_core_4PkId_24__setstate_cython__(((struct __pyx_obj_7opendht_5_core_PkId *)__pyx_v_self), __pyx_v___pyx_state);

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

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

  /* "(tree fragment)":4
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(1, 4, __pyx_L1_error)

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

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

/* "opendht.pyx":182
 * cdef class SockAddr(object):
 *     cdef cpp.SockAddr _addr
 *     def toString(SockAddr self):             # <<<<<<<<<<<<<<
 *         return self._addr.toString()
 *     def getPort(SockAddr self):
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_8SockAddr_1toString(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_8SockAddr_1toString = {"toString", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_8SockAddr_1toString, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_8SockAddr_1toString(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("toString (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("toString", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("toString", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7opendht_5_core_8SockAddr_toString(((struct __pyx_obj_7opendht_5_core_SockAddr *)__pyx_v_self));

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

static PyObject *__pyx_pf_7opendht_5_core_8SockAddr_toString(struct __pyx_obj_7opendht_5_core_SockAddr *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("toString", 0);

  /* "opendht.pyx":183
 *     cdef cpp.SockAddr _addr
 *     def toString(SockAddr self):
 *         return self._addr.toString()             # <<<<<<<<<<<<<<
 *     def getPort(SockAddr self):
 *         return self._addr.getPort()
*/
  __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(__pyx_v_self->_addr.toString()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 183, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_1;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "opendht.pyx":182
 * cdef class SockAddr(object):
 *     cdef cpp.SockAddr _addr
 *     def toString(SockAddr self):             # <<<<<<<<<<<<<<
 *         return self._addr.toString()
 *     def getPort(SockAddr self):
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("opendht._core.SockAddr.toString", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":184
 *     def toString(SockAddr self):
 *         return self._addr.toString()
 *     def getPort(SockAddr self):             # <<<<<<<<<<<<<<
 *         return self._addr.getPort()
 *     def getFamily(SockAddr self):
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_8SockAddr_3getPort(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_8SockAddr_3getPort = {"getPort", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_8SockAddr_3getPort, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_8SockAddr_3getPort(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getPort (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getPort", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getPort", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7opendht_5_core_8SockAddr_2getPort(((struct __pyx_obj_7opendht_5_core_SockAddr *)__pyx_v_self));

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

static PyObject *__pyx_pf_7opendht_5_core_8SockAddr_2getPort(struct __pyx_obj_7opendht_5_core_SockAddr *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getPort", 0);

  /* "opendht.pyx":185
 *         return self._addr.toString()
 *     def getPort(SockAddr self):
 *         return self._addr.getPort()             # <<<<<<<<<<<<<<
 *     def getFamily(SockAddr self):
 *         return self._addr.getFamily()
*/
  __pyx_t_1 = __Pyx_PyLong_From_uint16_t(__pyx_v_self->_addr.getPort()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 185, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_1;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "opendht.pyx":184
 *     def toString(SockAddr self):
 *         return self._addr.toString()
 *     def getPort(SockAddr self):             # <<<<<<<<<<<<<<
 *         return self._addr.getPort()
 *     def getFamily(SockAddr self):
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("opendht._core.SockAddr.getPort", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":186
 *     def getPort(SockAddr self):
 *         return self._addr.getPort()
 *     def getFamily(SockAddr self):             # <<<<<<<<<<<<<<
 *         return self._addr.getFamily()
 *     def setPort(SockAddr self, cpp.in_port_t port):
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_8SockAddr_5getFamily(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_8SockAddr_5getFamily = {"getFamily", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_8SockAddr_5getFamily, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_8SockAddr_5getFamily(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getFamily (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getFamily", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getFamily", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7opendht_5_core_8SockAddr_4getFamily(((struct __pyx_obj_7opendht_5_core_SockAddr *)__pyx_v_self));

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

static PyObject *__pyx_pf_7opendht_5_core_8SockAddr_4getFamily(struct __pyx_obj_7opendht_5_core_SockAddr *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getFamily", 0);

  /* "opendht.pyx":187
 *         return self._addr.getPort()
 *     def getFamily(SockAddr self):
 *         return self._addr.getFamily()             # <<<<<<<<<<<<<<
 *     def setPort(SockAddr self, cpp.in_port_t port):
 *         return self._addr.setPort(port)
*/
  __pyx_t_1 = __Pyx_PyLong_From_unsigned_short(__pyx_v_self->_addr.getFamily()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_1;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "opendht.pyx":186
 *     def getPort(SockAddr self):
 *         return self._addr.getPort()
 *     def getFamily(SockAddr self):             # <<<<<<<<<<<<<<
 *         return self._addr.getFamily()
 *     def setPort(SockAddr self, cpp.in_port_t port):
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("opendht._core.SockAddr.getFamily", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":188
 *     def getFamily(SockAddr self):
 *         return self._addr.getFamily()
 *     def setPort(SockAddr self, cpp.in_port_t port):             # <<<<<<<<<<<<<<
 *         return self._addr.setPort(port)
 *     def setFamily(SockAddr self, cpp.sa_family_t af):
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_8SockAddr_7setPort(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_8SockAddr_7setPort = {"setPort", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_8SockAddr_7setPort, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_8SockAddr_7setPort(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  __pyx_t_11opendht_cpp_in_port_t __pyx_v_port;
  #if !CYTHON_VECTORCALL
  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("setPort (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_port,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 188, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 188, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setPort", 0) < (0)) __PYX_ERR(0, 188, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setPort", 1, 1, 1, i); __PYX_ERR(0, 188, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 188, __pyx_L3_error)
    }
    __pyx_v_port = __Pyx_PyLong_As_uint16_t(values[0]); if (unlikely((__pyx_v_port == ((uint16_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 188, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setPort", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 188, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.SockAddr.setPort", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7opendht_5_core_8SockAddr_6setPort(((struct __pyx_obj_7opendht_5_core_SockAddr *)__pyx_v_self), __pyx_v_port);

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

  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7opendht_5_core_8SockAddr_6setPort(struct __pyx_obj_7opendht_5_core_SockAddr *__pyx_v_self, __pyx_t_11opendht_cpp_in_port_t __pyx_v_port) {
  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("setPort", 0);

  /* "opendht.pyx":189
 *         return self._addr.getFamily()
 *     def setPort(SockAddr self, cpp.in_port_t port):
 *         return self._addr.setPort(port)             # <<<<<<<<<<<<<<
 *     def setFamily(SockAddr self, cpp.sa_family_t af):
 *         return self._addr.setFamily(af)
*/
  __pyx_t_1 = __Pyx_void_to_None(__pyx_v_self->_addr.setPort(__pyx_v_port)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 189, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_1;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "opendht.pyx":188
 *     def getFamily(SockAddr self):
 *         return self._addr.getFamily()
 *     def setPort(SockAddr self, cpp.in_port_t port):             # <<<<<<<<<<<<<<
 *         return self._addr.setPort(port)
 *     def setFamily(SockAddr self, cpp.sa_family_t af):
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("opendht._core.SockAddr.setPort", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":190
 *     def setPort(SockAddr self, cpp.in_port_t port):
 *         return self._addr.setPort(port)
 *     def setFamily(SockAddr self, cpp.sa_family_t af):             # <<<<<<<<<<<<<<
 *         return self._addr.setFamily(af)
 *     def isLoopback(SockAddr self):
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_8SockAddr_9setFamily(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_8SockAddr_9setFamily = {"setFamily", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_8SockAddr_9setFamily, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_8SockAddr_9setFamily(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  __pyx_t_11opendht_cpp_sa_family_t __pyx_v_af;
  #if !CYTHON_VECTORCALL
  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("setFamily (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_af,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 190, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 190, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setFamily", 0) < (0)) __PYX_ERR(0, 190, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setFamily", 1, 1, 1, i); __PYX_ERR(0, 190, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 190, __pyx_L3_error)
    }
    __pyx_v_af = __Pyx_PyLong_As_unsigned_short(values[0]); if (unlikely((__pyx_v_af == (unsigned short)-1) && PyErr_Occurred())) __PYX_ERR(0, 190, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setFamily", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 190, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.SockAddr.setFamily", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7opendht_5_core_8SockAddr_8setFamily(((struct __pyx_obj_7opendht_5_core_SockAddr *)__pyx_v_self), __pyx_v_af);

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

  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7opendht_5_core_8SockAddr_8setFamily(struct __pyx_obj_7opendht_5_core_SockAddr *__pyx_v_self, __pyx_t_11opendht_cpp_sa_family_t __pyx_v_af) {
  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("setFamily", 0);

  /* "opendht.pyx":191
 *         return self._addr.setPort(port)
 *     def setFamily(SockAddr self, cpp.sa_family_t af):
 *         return self._addr.setFamily(af)             # <<<<<<<<<<<<<<
 *     def isLoopback(SockAddr self):
 *         return self._addr.isLoopback()
*/
  __pyx_t_1 = __Pyx_void_to_None(__pyx_v_self->_addr.setFamily(__pyx_v_af)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 191, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_1;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "opendht.pyx":190
 *     def setPort(SockAddr self, cpp.in_port_t port):
 *         return self._addr.setPort(port)
 *     def setFamily(SockAddr self, cpp.sa_family_t af):             # <<<<<<<<<<<<<<
 *         return self._addr.setFamily(af)
 *     def isLoopback(SockAddr self):
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("opendht._core.SockAddr.setFamily", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":192
 *     def setFamily(SockAddr self, cpp.sa_family_t af):
 *         return self._addr.setFamily(af)
 *     def isLoopback(SockAddr self):             # <<<<<<<<<<<<<<
 *         return self._addr.isLoopback()
 *     def isPrivate(SockAddr self):
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_8SockAddr_11isLoopback(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_8SockAddr_11isLoopback = {"isLoopback", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_8SockAddr_11isLoopback, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_8SockAddr_11isLoopback(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("isLoopback (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("isLoopback", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("isLoopback", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7opendht_5_core_8SockAddr_10isLoopback(((struct __pyx_obj_7opendht_5_core_SockAddr *)__pyx_v_self));

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

static PyObject *__pyx_pf_7opendht_5_core_8SockAddr_10isLoopback(struct __pyx_obj_7opendht_5_core_SockAddr *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("isLoopback", 0);

  /* "opendht.pyx":193
 *         return self._addr.setFamily(af)
 *     def isLoopback(SockAddr self):
 *         return self._addr.isLoopback()             # <<<<<<<<<<<<<<
 *     def isPrivate(SockAddr self):
 *         return self._addr.isPrivate()
*/
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->_addr.isLoopback()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 193, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_1;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "opendht.pyx":192
 *     def setFamily(SockAddr self, cpp.sa_family_t af):
 *         return self._addr.setFamily(af)
 *     def isLoopback(SockAddr self):             # <<<<<<<<<<<<<<
 *         return self._addr.isLoopback()
 *     def isPrivate(SockAddr self):
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("opendht._core.SockAddr.isLoopback", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":194
 *     def isLoopback(SockAddr self):
 *         return self._addr.isLoopback()
 *     def isPrivate(SockAddr self):             # <<<<<<<<<<<<<<
 *         return self._addr.isPrivate()
 *     def isUnspecified(SockAddr self):
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_8SockAddr_13isPrivate(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_8SockAddr_13isPrivate = {"isPrivate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_8SockAddr_13isPrivate, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_8SockAddr_13isPrivate(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("isPrivate (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("isPrivate", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("isPrivate", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7opendht_5_core_8SockAddr_12isPrivate(((struct __pyx_obj_7opendht_5_core_SockAddr *)__pyx_v_self));

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

static PyObject *__pyx_pf_7opendht_5_core_8SockAddr_12isPrivate(struct __pyx_obj_7opendht_5_core_SockAddr *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("isPrivate", 0);

  /* "opendht.pyx":195
 *         return self._addr.isLoopback()
 *     def isPrivate(SockAddr self):
 *         return self._addr.isPrivate()             # <<<<<<<<<<<<<<
 *     def isUnspecified(SockAddr self):
 *         return self._addr.isUnspecified()
*/
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->_addr.isPrivate()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 195, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_1;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "opendht.pyx":194
 *     def isLoopback(SockAddr self):
 *         return self._addr.isLoopback()
 *     def isPrivate(SockAddr self):             # <<<<<<<<<<<<<<
 *         return self._addr.isPrivate()
 *     def isUnspecified(SockAddr self):
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("opendht._core.SockAddr.isPrivate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":196
 *     def isPrivate(SockAddr self):
 *         return self._addr.isPrivate()
 *     def isUnspecified(SockAddr self):             # <<<<<<<<<<<<<<
 *         return self._addr.isUnspecified()
 *     def __str__(self):
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_8SockAddr_15isUnspecified(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_8SockAddr_15isUnspecified = {"isUnspecified", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_8SockAddr_15isUnspecified, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_8SockAddr_15isUnspecified(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("isUnspecified (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("isUnspecified", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("isUnspecified", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7opendht_5_core_8SockAddr_14isUnspecified(((struct __pyx_obj_7opendht_5_core_SockAddr *)__pyx_v_self));

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

static PyObject *__pyx_pf_7opendht_5_core_8SockAddr_14isUnspecified(struct __pyx_obj_7opendht_5_core_SockAddr *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("isUnspecified", 0);

  /* "opendht.pyx":197
 *         return self._addr.isPrivate()
 *     def isUnspecified(SockAddr self):
 *         return self._addr.isUnspecified()             # <<<<<<<<<<<<<<
 *     def __str__(self):
 *         return self.toString().decode()
*/
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->_addr.isUnspecified()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_1;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "opendht.pyx":196
 *     def isPrivate(SockAddr self):
 *         return self._addr.isPrivate()
 *     def isUnspecified(SockAddr self):             # <<<<<<<<<<<<<<
 *         return self._addr.isUnspecified()
 *     def __str__(self):
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("opendht._core.SockAddr.isUnspecified", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":198
 *     def isUnspecified(SockAddr self):
 *         return self._addr.isUnspecified()
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return self.toString().decode()
 *     def __repr__(self):
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_8SockAddr_17__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7opendht_5_core_8SockAddr_17__str__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7opendht_5_core_8SockAddr_16__str__(((struct __pyx_obj_7opendht_5_core_SockAddr *)__pyx_v_self));

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

static PyObject *__pyx_pf_7opendht_5_core_8SockAddr_16__str__(struct __pyx_obj_7opendht_5_core_SockAddr *__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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__str__", 0);

  /* "opendht.pyx":199
 *         return self._addr.isUnspecified()
 *     def __str__(self):
 *         return self.toString().decode()             # <<<<<<<<<<<<<<
 *     def __repr__(self):
 *         return "<%s '%s'>" % (self.__class__.__name__, str(self))
*/
  __pyx_t_4 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
    __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_toString, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 199, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_2 = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_decode, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_1;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "opendht.pyx":198
 *     def isUnspecified(SockAddr self):
 *         return self._addr.isUnspecified()
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return self.toString().decode()
 *     def __repr__(self):
*/

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

/* "opendht.pyx":200
 *     def __str__(self):
 *         return self.toString().decode()
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return "<%s '%s'>" % (self.__class__.__name__, str(self))
 *     @staticmethod
*/

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

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

static PyObject *__pyx_pf_7opendht_5_core_8SockAddr_18__repr__(struct __pyx_obj_7opendht_5_core_SockAddr *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3[5];
  Py_ssize_t __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "opendht.pyx":201
 *         return self.toString().decode()
 *     def __repr__(self):
 *         return "<%s '%s'>" % (self.__class__.__name__, str(self))             # <<<<<<<<<<<<<<
 *     @staticmethod
 *     def resolve(str host, str service=None):
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 201, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_2), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Unicode(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 201, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3[0] = __pyx_mstate_global->__pyx_kp_u__2;
  __pyx_t_3[1] = __pyx_t_1;
  __pyx_t_3[2] = __pyx_mstate_global->__pyx_kp_u__3;
  __pyx_t_3[3] = __pyx_t_2;
  __pyx_t_3[4] = __pyx_mstate_global->__pyx_kp_u__4;
  __pyx_t_4 = 5;
  #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
  __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3[1]) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3[3]);
  #endif
  __pyx_t_5 = 0;
  #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
  __pyx_t_5 |= __Pyx_PyUnicode_KIND_04(__pyx_t_3[1]) | __Pyx_PyUnicode_KIND_04(__pyx_t_3[3]);
  #endif
  __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_3, 5, __pyx_t_4, __pyx_t_5);
  if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 201, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_6;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_6 = 0;
  goto __pyx_L0;

  /* "opendht.pyx":200
 *     def __str__(self):
 *         return self.toString().decode()
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return "<%s '%s'>" % (self.__class__.__name__, str(self))
 *     @staticmethod
*/

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

/* "opendht.pyx":202
 *     def __repr__(self):
 *         return "<%s '%s'>" % (self.__class__.__name__, str(self))
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def resolve(str host, str service=None):
 *         vals = []
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_8SockAddr_21resolve(CYTHON_UNUSED PyObject *__pyx_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_8SockAddr_21resolve = {"resolve", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_8SockAddr_21resolve, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_8SockAddr_21resolve(CYTHON_UNUSED PyObject *__pyx_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_host = 0;
  PyObject *__pyx_v_service = 0;
  #if !CYTHON_VECTORCALL
  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("resolve (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_host,&__pyx_mstate_global->__pyx_n_u_service,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 202, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 202, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 202, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "resolve", 0) < (0)) __PYX_ERR(0, 202, __pyx_L3_error)

      /* "opendht.pyx":203
 *         return "<%s '%s'>" % (self.__class__.__name__, str(self))
 *     @staticmethod
 *     def resolve(str host, str service=None):             # <<<<<<<<<<<<<<
 *         vals = []
 *         result = cpp.SockAddr.resolve(host.encode(), service.encode() if service else b'')
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject*)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("resolve", 0, 1, 2, i); __PYX_ERR(0, 202, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 202, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 202, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject*)Py_None));
    }
    __pyx_v_host = ((PyObject*)values[0]);
    __pyx_v_service = ((PyObject*)values[1]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("resolve", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 202, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.SockAddr.resolve", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_host), (&PyUnicode_Type), 1, "host", 1))) __PYX_ERR(0, 203, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_service), (&PyUnicode_Type), 1, "service", 1))) __PYX_ERR(0, 203, __pyx_L1_error)
  __pyx_r = __pyx_pf_7opendht_5_core_8SockAddr_20resolve(__pyx_v_host, __pyx_v_service);

  /* "opendht.pyx":202
 *     def __repr__(self):
 *         return "<%s '%s'>" % (self.__class__.__name__, str(self))
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def resolve(str host, str service=None):
 *         vals = []
*/

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

static PyObject *__pyx_pf_7opendht_5_core_8SockAddr_20resolve(PyObject *__pyx_v_host, PyObject *__pyx_v_service) {
  PyObject *__pyx_v_vals = NULL;
  std::vector<dht::SockAddr>  __pyx_v_result;
  dht::SockAddr __pyx_v_val;
  struct __pyx_obj_7opendht_5_core_SockAddr *__pyx_v_a = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  std::string __pyx_t_2;
  std::string __pyx_t_3;
  int __pyx_t_4;
  std::string __pyx_t_5;
  std::vector<dht::SockAddr>  __pyx_t_6;
  std::vector<dht::SockAddr> ::iterator __pyx_t_7;
  dht::SockAddr __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  size_t __pyx_t_10;
  int __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("resolve", 0);

  /* "opendht.pyx":204
 *     @staticmethod
 *     def resolve(str host, str service=None):
 *         vals = []             # <<<<<<<<<<<<<<
 *         result = cpp.SockAddr.resolve(host.encode(), service.encode() if service else b'')
 *         for val in result:
*/
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 204, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_vals = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "opendht.pyx":205
 *     def resolve(str host, str service=None):
 *         vals = []
 *         result = cpp.SockAddr.resolve(host.encode(), service.encode() if service else b'')             # <<<<<<<<<<<<<<
 *         for val in result:
 *             a = SockAddr()
*/
  if (unlikely(__pyx_v_host == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "\047NoneType\047 object has no attribute \047%.30s\047", "encode");
    __PYX_ERR(0, 205, __pyx_L1_error)
  }
  __pyx_t_1 = PyUnicode_AsEncodedString(__pyx_v_host, NULL, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 205, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 205, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_v_service == Py_None) __pyx_t_4 = 0;
  else
  {
    Py_ssize_t __pyx_temp = __Pyx_PyUnicode_IS_TRUE(__pyx_v_service);
    if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(0, 205, __pyx_L1_error)
    __pyx_t_4 = (__pyx_temp != 0);
  }

  if (__pyx_t_4) {
    if (unlikely(__pyx_v_service == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "\047NoneType\047 object has no attribute \047%.30s\047", "encode");
      __PYX_ERR(0, 205, __pyx_L1_error)
    }
    __pyx_t_1 = PyUnicode_AsEncodedString(__pyx_v_service, NULL, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 205, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 205, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_3 = __pyx_t_5;
  } else {
    __pyx_t_5 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_mstate_global->__pyx_kp_b__5); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 205, __pyx_L1_error)
    __pyx_t_3 = __pyx_t_5;
  }

  try {
    __pyx_t_6 = dht::SockAddr::resolve(__PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_2), __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_3));
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(0, 205, __pyx_L1_error)
  }


  __pyx_v_result = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_6);

  /* "opendht.pyx":206
 *         vals = []
 *         result = cpp.SockAddr.resolve(host.encode(), service.encode() if service else b'')
 *         for val in result:             # <<<<<<<<<<<<<<
 *             a = SockAddr()
 *             a._addr = val
*/
  __pyx_t_7 = __pyx_v_result.begin();
  for (; __pyx_t_7 != __pyx_v_result.end(); ++__pyx_t_7) {
    __pyx_t_8 = *__pyx_t_7;
    __pyx_v_val = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_8);

    /* "opendht.pyx":207
 *         result = cpp.SockAddr.resolve(host.encode(), service.encode() if service else b'')
 *         for val in result:
 *             a = SockAddr()             # <<<<<<<<<<<<<<
 *             a._addr = val
 *             vals.append(a)
*/
    __pyx_t_9 = NULL;
    __pyx_t_10 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_9, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7opendht_5_core_SockAddr, __pyx_callargs+__pyx_t_10, (1-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 207, __pyx_L1_error)
      __Pyx_GOTREF((PyObject *)__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_a, ((struct __pyx_obj_7opendht_5_core_SockAddr *)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "opendht.pyx":208
 *         for val in result:
 *             a = SockAddr()
 *             a._addr = val             # <<<<<<<<<<<<<<
 *             vals.append(a)
 *         return vals
*/
    __pyx_v_a->_addr = __pyx_v_val;

    /* "opendht.pyx":209
 *             a = SockAddr()
 *             a._addr = val
 *             vals.append(a)             # <<<<<<<<<<<<<<
 *         return vals
 * 
*/
    __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_vals, ((PyObject *)__pyx_v_a)); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 209, __pyx_L1_error)


    /* "opendht.pyx":206
 *         vals = []
 *         result = cpp.SockAddr.resolve(host.encode(), service.encode() if service else b'')
 *         for val in result:             # <<<<<<<<<<<<<<
 *             a = SockAddr()
 *             a._addr = val
*/
  }


  /* "opendht.pyx":210
 *             a._addr = val
 *             vals.append(a)
 *         return vals             # <<<<<<<<<<<<<<
 * 
 * cdef class Node(_WithID):
*/
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __Pyx_INCREF(__pyx_v_vals);
      __pyx_r = __pyx_v_vals;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  goto __pyx_L0;

  /* "opendht.pyx":202
 *     def __repr__(self):
 *         return "<%s '%s'>" % (self.__class__.__name__, str(self))
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def resolve(str host, str service=None):
 *         vals = []
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("opendht._core.SockAddr.resolve", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_vals);


  __Pyx_XDECREF((PyObject *)__pyx_v_a);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._addr cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_8SockAddr_23__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_8SockAddr_23__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_8SockAddr_23__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_8SockAddr_23__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7opendht_5_core_8SockAddr_22__reduce_cython__(((struct __pyx_obj_7opendht_5_core_SockAddr *)__pyx_v_self));

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

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

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "self._addr cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._addr cannot be converted to a Python object for pickling"
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self__addr_cannot_be_converted_t, 0, 0);
  __PYX_ERR(1, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._addr cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/

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

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._addr cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._addr cannot be converted to a Python object for pickling"
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_8SockAddr_25__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_8SockAddr_25__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_8SockAddr_25__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_8SockAddr_25__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(1, 3, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.SockAddr.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7opendht_5_core_8SockAddr_24__setstate_cython__(((struct __pyx_obj_7opendht_5_core_SockAddr *)__pyx_v_self), __pyx_v___pyx_state);

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

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

  /* "(tree fragment)":4
 *     raise TypeError, "self._addr cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._addr cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self__addr_cannot_be_converted_t, 0, 0);
  __PYX_ERR(1, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._addr cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._addr cannot be converted to a Python object for pickling"
*/

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

/* "opendht.pyx":214
 * cdef class Node(_WithID):
 *     cdef shared_ptr[cpp.Node] _node
 *     def getId(self):             # <<<<<<<<<<<<<<
 *         h = InfoHash()
 *         h._infohash = self._node.get().getId()
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_4Node_1getId(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_4Node_1getId = {"getId", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_4Node_1getId, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_4Node_1getId(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getId (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getId", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getId", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7opendht_5_core_4Node_getId(((struct __pyx_obj_7opendht_5_core_Node *)__pyx_v_self));

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

static PyObject *__pyx_pf_7opendht_5_core_4Node_getId(struct __pyx_obj_7opendht_5_core_Node *__pyx_v_self) {
  struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_v_h = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getId", 0);

  /* "opendht.pyx":215
 *     cdef shared_ptr[cpp.Node] _node
 *     def getId(self):
 *         h = InfoHash()             # <<<<<<<<<<<<<<
 *         h._infohash = self._node.get().getId()
 *         return h
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7opendht_5_core_InfoHash, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 215, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_h = ((struct __pyx_obj_7opendht_5_core_InfoHash *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "opendht.pyx":216
 *     def getId(self):
 *         h = InfoHash()
 *         h._infohash = self._node.get().getId()             # <<<<<<<<<<<<<<
 *         return h
 *     def getAddr(self):
*/
  __pyx_v_h->_infohash = __pyx_v_self->_node.get()->getId();

  /* "opendht.pyx":217
 *         h = InfoHash()
 *         h._infohash = self._node.get().getId()
 *         return h             # <<<<<<<<<<<<<<
 *     def getAddr(self):
 *         return self._node.get().getAddrStr()
*/
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __Pyx_INCREF((PyObject *)__pyx_v_h);
      __pyx_r = ((PyObject *)__pyx_v_h);
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  goto __pyx_L0;

  /* "opendht.pyx":214
 * cdef class Node(_WithID):
 *     cdef shared_ptr[cpp.Node] _node
 *     def getId(self):             # <<<<<<<<<<<<<<
 *         h = InfoHash()
 *         h._infohash = self._node.get().getId()
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("opendht._core.Node.getId", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_h);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":218
 *         h._infohash = self._node.get().getId()
 *         return h
 *     def getAddr(self):             # <<<<<<<<<<<<<<
 *         return self._node.get().getAddrStr()
 *     def isExpired(self):
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_4Node_3getAddr(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_4Node_3getAddr = {"getAddr", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_4Node_3getAddr, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_4Node_3getAddr(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getAddr (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getAddr", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getAddr", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7opendht_5_core_4Node_2getAddr(((struct __pyx_obj_7opendht_5_core_Node *)__pyx_v_self));

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

static PyObject *__pyx_pf_7opendht_5_core_4Node_2getAddr(struct __pyx_obj_7opendht_5_core_Node *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getAddr", 0);

  /* "opendht.pyx":219
 *         return h
 *     def getAddr(self):
 *         return self._node.get().getAddrStr()             # <<<<<<<<<<<<<<
 *     def isExpired(self):
 *         return self._node.get().isExpired()
*/
  __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(__pyx_v_self->_node.get()->getAddrStr()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 219, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_1;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "opendht.pyx":218
 *         h._infohash = self._node.get().getId()
 *         return h
 *     def getAddr(self):             # <<<<<<<<<<<<<<
 *         return self._node.get().getAddrStr()
 *     def isExpired(self):
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("opendht._core.Node.getAddr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":220
 *     def getAddr(self):
 *         return self._node.get().getAddrStr()
 *     def isExpired(self):             # <<<<<<<<<<<<<<
 *         return self._node.get().isExpired()
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_4Node_5isExpired(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_4Node_5isExpired = {"isExpired", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_4Node_5isExpired, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_4Node_5isExpired(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("isExpired (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("isExpired", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("isExpired", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7opendht_5_core_4Node_4isExpired(((struct __pyx_obj_7opendht_5_core_Node *)__pyx_v_self));

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

static PyObject *__pyx_pf_7opendht_5_core_4Node_4isExpired(struct __pyx_obj_7opendht_5_core_Node *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("isExpired", 0);

  /* "opendht.pyx":221
 *         return self._node.get().getAddrStr()
 *     def isExpired(self):
 *         return self._node.get().isExpired()             # <<<<<<<<<<<<<<
 * 
 * cdef class NodeEntry(_WithID):
*/
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->_node.get()->isExpired()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_1;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "opendht.pyx":220
 *     def getAddr(self):
 *         return self._node.get().getAddrStr()
 *     def isExpired(self):             # <<<<<<<<<<<<<<
 *         return self._node.get().isExpired()
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("opendht._core.Node.isExpired", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._node cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_4Node_7__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_4Node_7__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_4Node_7__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_4Node_7__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7opendht_5_core_4Node_6__reduce_cython__(((struct __pyx_obj_7opendht_5_core_Node *)__pyx_v_self));

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

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

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "self._node cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._node cannot be converted to a Python object for pickling"
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self__node_cannot_be_converted_t, 0, 0);
  __PYX_ERR(1, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._node cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/

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

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._node cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._node cannot be converted to a Python object for pickling"
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_4Node_9__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_4Node_9__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_4Node_9__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_4Node_9__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(1, 3, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.Node.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7opendht_5_core_4Node_8__setstate_cython__(((struct __pyx_obj_7opendht_5_core_Node *)__pyx_v_self), __pyx_v___pyx_state);

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

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

  /* "(tree fragment)":4
 *     raise TypeError, "self._node cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._node cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self__node_cannot_be_converted_t, 0, 0);
  __PYX_ERR(1, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._node cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._node cannot be converted to a Python object for pickling"
*/

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

/* "opendht.pyx":225
 * cdef class NodeEntry(_WithID):
 *     cdef cpp.pair[cpp.InfoHash, shared_ptr[cpp.Node]] _v
 *     def getId(self):             # <<<<<<<<<<<<<<
 *         h = InfoHash()
 *         h._infohash = self._v.first
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_9NodeEntry_1getId(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_9NodeEntry_1getId = {"getId", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9NodeEntry_1getId, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_9NodeEntry_1getId(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getId (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getId", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getId", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7opendht_5_core_9NodeEntry_getId(((struct __pyx_obj_7opendht_5_core_NodeEntry *)__pyx_v_self));

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

static PyObject *__pyx_pf_7opendht_5_core_9NodeEntry_getId(struct __pyx_obj_7opendht_5_core_NodeEntry *__pyx_v_self) {
  struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_v_h = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  dht::InfoHash __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getId", 0);

  /* "opendht.pyx":226
 *     cdef cpp.pair[cpp.InfoHash, shared_ptr[cpp.Node]] _v
 *     def getId(self):
 *         h = InfoHash()             # <<<<<<<<<<<<<<
 *         h._infohash = self._v.first
 *         return h
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7opendht_5_core_InfoHash, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 226, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_h = ((struct __pyx_obj_7opendht_5_core_InfoHash *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "opendht.pyx":227
 *     def getId(self):
 *         h = InfoHash()
 *         h._infohash = self._v.first             # <<<<<<<<<<<<<<
 *         return h
 *     def getNode(self):
*/
  __pyx_t_4 = __pyx_v_self->_v.first;

  __pyx_v_h->_infohash = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_4);

  /* "opendht.pyx":228
 *         h = InfoHash()
 *         h._infohash = self._v.first
 *         return h             # <<<<<<<<<<<<<<
 *     def getNode(self):
 *         n = Node()
*/
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __Pyx_INCREF((PyObject *)__pyx_v_h);
      __pyx_r = ((PyObject *)__pyx_v_h);
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  goto __pyx_L0;

  /* "opendht.pyx":225
 * cdef class NodeEntry(_WithID):
 *     cdef cpp.pair[cpp.InfoHash, shared_ptr[cpp.Node]] _v
 *     def getId(self):             # <<<<<<<<<<<<<<
 *         h = InfoHash()
 *         h._infohash = self._v.first
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("opendht._core.NodeEntry.getId", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_h);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":229
 *         h._infohash = self._v.first
 *         return h
 *     def getNode(self):             # <<<<<<<<<<<<<<
 *         n = Node()
 *         n._node = self._v.second
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_9NodeEntry_3getNode(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_9NodeEntry_3getNode = {"getNode", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9NodeEntry_3getNode, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_9NodeEntry_3getNode(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getNode (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getNode", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getNode", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7opendht_5_core_9NodeEntry_2getNode(((struct __pyx_obj_7opendht_5_core_NodeEntry *)__pyx_v_self));

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

static PyObject *__pyx_pf_7opendht_5_core_9NodeEntry_2getNode(struct __pyx_obj_7opendht_5_core_NodeEntry *__pyx_v_self) {
  struct __pyx_obj_7opendht_5_core_Node *__pyx_v_n = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  std::shared_ptr<dht::Node>  __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getNode", 0);

  /* "opendht.pyx":230
 *         return h
 *     def getNode(self):
 *         n = Node()             # <<<<<<<<<<<<<<
 *         n._node = self._v.second
 *         return n
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7opendht_5_core_Node, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 230, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_n = ((struct __pyx_obj_7opendht_5_core_Node *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "opendht.pyx":231
 *     def getNode(self):
 *         n = Node()
 *         n._node = self._v.second             # <<<<<<<<<<<<<<
 *         return n
 * 
*/
  __pyx_t_4 = __pyx_v_self->_v.second;

  __pyx_v_n->_node = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_4);

  /* "opendht.pyx":232
 *         n = Node()
 *         n._node = self._v.second
 *         return n             # <<<<<<<<<<<<<<
 * 
 * cdef class Query(object):
*/
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __Pyx_INCREF((PyObject *)__pyx_v_n);
      __pyx_r = ((PyObject *)__pyx_v_n);
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  goto __pyx_L0;

  /* "opendht.pyx":229
 *         h._infohash = self._v.first
 *         return h
 *     def getNode(self):             # <<<<<<<<<<<<<<
 *         n = Node()
 *         n._node = self._v.second
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("opendht._core.NodeEntry.getNode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_n);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._v cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_9NodeEntry_5__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_9NodeEntry_5__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9NodeEntry_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_9NodeEntry_5__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7opendht_5_core_9NodeEntry_4__reduce_cython__(((struct __pyx_obj_7opendht_5_core_NodeEntry *)__pyx_v_self));

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

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

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "self._v cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._v cannot be converted to a Python object for pickling"
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self__v_cannot_be_converted_to_a, 0, 0);
  __PYX_ERR(1, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._v cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/

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

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._v cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._v cannot be converted to a Python object for pickling"
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_9NodeEntry_7__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_9NodeEntry_7__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9NodeEntry_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_9NodeEntry_7__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(1, 3, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.NodeEntry.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7opendht_5_core_9NodeEntry_6__setstate_cython__(((struct __pyx_obj_7opendht_5_core_NodeEntry *)__pyx_v_self), __pyx_v___pyx_state);

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

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

  /* "(tree fragment)":4
 *     raise TypeError, "self._v cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._v cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self__v_cannot_be_converted_to_a, 0, 0);
  __PYX_ERR(1, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._v cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._v cannot be converted to a Python object for pickling"
*/

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

/* "opendht.pyx":236
 * cdef class Query(object):
 *     cdef cpp.Query _query
 *     def __cinit__(self, str q_str=''):             # <<<<<<<<<<<<<<
 *         self._query = cpp.Query(q_str.encode())
 *     def __str__(self):
*/

/* Python wrapper */
static int __pyx_pw_7opendht_5_core_5Query_1__cinit__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL_TPNEW
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_pw_7opendht_5_core_5Query_1__cinit__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL_TPNEW
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_q_str = 0;
  #if !CYTHON_VECTORCALL_TPNEW
  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;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  #if !CYTHON_VECTORCALL_TPNEW
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL_TPNEW(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_q_str,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL_TPNEW(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 236, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 236, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__cinit__", 0) < (0)) __PYX_ERR(0, 236, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_kp_u__5));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 236, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_kp_u__5));
    }
    __pyx_v_q_str = ((PyObject*)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 236, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.Query.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_str), (&PyUnicode_Type), 1, "q_str", 1))) __PYX_ERR(0, 236, __pyx_L1_error)
  __pyx_r = __pyx_pf_7opendht_5_core_5Query___cinit__(((struct __pyx_obj_7opendht_5_core_Query *)__pyx_v_self), __pyx_v_q_str);

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

static int __pyx_pf_7opendht_5_core_5Query___cinit__(struct __pyx_obj_7opendht_5_core_Query *__pyx_v_self, PyObject *__pyx_v_q_str) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  std::string __pyx_t_2;
  dht::Query __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "opendht.pyx":237
 *     cdef cpp.Query _query
 *     def __cinit__(self, str q_str=''):
 *         self._query = cpp.Query(q_str.encode())             # <<<<<<<<<<<<<<
 *     def __str__(self):
 *         return self._query.toString().decode()
*/
  if (unlikely(__pyx_v_q_str == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "\047NoneType\047 object has no attribute \047%.30s\047", "encode");
    __PYX_ERR(0, 237, __pyx_L1_error)
  }
  __pyx_t_1 = PyUnicode_AsEncodedString(__pyx_v_q_str, NULL, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 237, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  try {
    __pyx_t_3 = dht::Query(__pyx_t_2);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(0, 237, __pyx_L1_error)
  }

  __pyx_v_self->_query = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_3);

  /* "opendht.pyx":236
 * cdef class Query(object):
 *     cdef cpp.Query _query
 *     def __cinit__(self, str q_str=''):             # <<<<<<<<<<<<<<
 *         self._query = cpp.Query(q_str.encode())
 *     def __str__(self):
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("opendht._core.Query.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;

  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":238
 *     def __cinit__(self, str q_str=''):
 *         self._query = cpp.Query(q_str.encode())
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return self._query.toString().decode()
 *     def buildFrom(self, Select s, Where w):
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_5Query_3__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7opendht_5_core_5Query_3__str__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7opendht_5_core_5Query_2__str__(((struct __pyx_obj_7opendht_5_core_Query *)__pyx_v_self));

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

static PyObject *__pyx_pf_7opendht_5_core_5Query_2__str__(struct __pyx_obj_7opendht_5_core_Query *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__str__", 0);

  /* "opendht.pyx":239
 *         self._query = cpp.Query(q_str.encode())
 *     def __str__(self):
 *         return self._query.toString().decode()             # <<<<<<<<<<<<<<
 *     def buildFrom(self, Select s, Where w):
 *         self._query = cpp.Query(s._select, w._where)
*/
  __pyx_t_1 = __Pyx_decode_cpp_string(__pyx_v_self->_query.toString(), 0, PY_SSIZE_T_MAX, NULL, NULL, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 239, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_1;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "opendht.pyx":238
 *     def __cinit__(self, str q_str=''):
 *         self._query = cpp.Query(q_str.encode())
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return self._query.toString().decode()
 *     def buildFrom(self, Select s, Where w):
*/

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

/* "opendht.pyx":240
 *     def __str__(self):
 *         return self._query.toString().decode()
 *     def buildFrom(self, Select s, Where w):             # <<<<<<<<<<<<<<
 *         self._query = cpp.Query(s._select, w._where)
 *     def isSatisfiedBy(self, Query q):
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_5Query_5buildFrom(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_5Query_5buildFrom = {"buildFrom", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_5Query_5buildFrom, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_5Query_5buildFrom(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_7opendht_5_core_Select *__pyx_v_s = 0;
  struct __pyx_obj_7opendht_5_core_Where *__pyx_v_w = 0;
  #if !CYTHON_VECTORCALL
  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("buildFrom (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_s,&__pyx_mstate_global->__pyx_n_u_w,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 240, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 240, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 240, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "buildFrom", 0) < (0)) __PYX_ERR(0, 240, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("buildFrom", 1, 2, 2, i); __PYX_ERR(0, 240, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 240, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 240, __pyx_L3_error)
    }
    __pyx_v_s = ((struct __pyx_obj_7opendht_5_core_Select *)values[0]);
    __pyx_v_w = ((struct __pyx_obj_7opendht_5_core_Where *)values[1]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("buildFrom", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 240, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.Query.buildFrom", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_s), __pyx_mstate_global->__pyx_ptype_7opendht_5_core_Select, 1, "s", 0))) __PYX_ERR(0, 240, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_w), __pyx_mstate_global->__pyx_ptype_7opendht_5_core_Where, 1, "w", 0))) __PYX_ERR(0, 240, __pyx_L1_error)
  __pyx_r = __pyx_pf_7opendht_5_core_5Query_4buildFrom(((struct __pyx_obj_7opendht_5_core_Query *)__pyx_v_self), __pyx_v_s, __pyx_v_w);

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

static PyObject *__pyx_pf_7opendht_5_core_5Query_4buildFrom(struct __pyx_obj_7opendht_5_core_Query *__pyx_v_self, struct __pyx_obj_7opendht_5_core_Select *__pyx_v_s, struct __pyx_obj_7opendht_5_core_Where *__pyx_v_w) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  dht::Query __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("buildFrom", 0);

  /* "opendht.pyx":241
 *         return self._query.toString().decode()
 *     def buildFrom(self, Select s, Where w):
 *         self._query = cpp.Query(s._select, w._where)             # <<<<<<<<<<<<<<
 *     def isSatisfiedBy(self, Query q):
 *         return self._query.isSatisfiedBy(q._query)
*/
  try {
    __pyx_t_1 = dht::Query(__pyx_v_s->_select, __pyx_v_w->_where);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(0, 241, __pyx_L1_error)
  }
  __pyx_v_self->_query = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_1);

  /* "opendht.pyx":240
 *     def __str__(self):
 *         return self._query.toString().decode()
 *     def buildFrom(self, Select s, Where w):             # <<<<<<<<<<<<<<
 *         self._query = cpp.Query(s._select, w._where)
 *     def isSatisfiedBy(self, Query q):
*/

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

/* "opendht.pyx":242
 *     def buildFrom(self, Select s, Where w):
 *         self._query = cpp.Query(s._select, w._where)
 *     def isSatisfiedBy(self, Query q):             # <<<<<<<<<<<<<<
 *         return self._query.isSatisfiedBy(q._query)
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_5Query_7isSatisfiedBy(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_5Query_7isSatisfiedBy = {"isSatisfiedBy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_5Query_7isSatisfiedBy, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_5Query_7isSatisfiedBy(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_7opendht_5_core_Query *__pyx_v_q = 0;
  #if !CYTHON_VECTORCALL
  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("isSatisfiedBy (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_q,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 242, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 242, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "isSatisfiedBy", 0) < (0)) __PYX_ERR(0, 242, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("isSatisfiedBy", 1, 1, 1, i); __PYX_ERR(0, 242, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 242, __pyx_L3_error)
    }
    __pyx_v_q = ((struct __pyx_obj_7opendht_5_core_Query *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("isSatisfiedBy", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 242, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.Query.isSatisfiedBy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q), __pyx_mstate_global->__pyx_ptype_7opendht_5_core_Query, 1, "q", 0))) __PYX_ERR(0, 242, __pyx_L1_error)
  __pyx_r = __pyx_pf_7opendht_5_core_5Query_6isSatisfiedBy(((struct __pyx_obj_7opendht_5_core_Query *)__pyx_v_self), __pyx_v_q);

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

static PyObject *__pyx_pf_7opendht_5_core_5Query_6isSatisfiedBy(struct __pyx_obj_7opendht_5_core_Query *__pyx_v_self, struct __pyx_obj_7opendht_5_core_Query *__pyx_v_q) {
  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("isSatisfiedBy", 0);

  /* "opendht.pyx":243
 *         self._query = cpp.Query(s._select, w._where)
 *     def isSatisfiedBy(self, Query q):
 *         return self._query.isSatisfiedBy(q._query)             # <<<<<<<<<<<<<<
 * 
 * cdef class Select(object):
*/
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->_query.isSatisfiedBy(__pyx_v_q->_query)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 243, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_1;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "opendht.pyx":242
 *     def buildFrom(self, Select s, Where w):
 *         self._query = cpp.Query(s._select, w._where)
 *     def isSatisfiedBy(self, Query q):             # <<<<<<<<<<<<<<
 *         return self._query.isSatisfiedBy(q._query)
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("opendht._core.Query.isSatisfiedBy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_5Query_9__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_5Query_9__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_5Query_9__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_5Query_9__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7opendht_5_core_5Query_8__reduce_cython__(((struct __pyx_obj_7opendht_5_core_Query *)__pyx_v_self));

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

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

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(1, 2, __pyx_L1_error)

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

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

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

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_5Query_11__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_5Query_11__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_5Query_11__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_5Query_11__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(1, 3, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.Query.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7opendht_5_core_5Query_10__setstate_cython__(((struct __pyx_obj_7opendht_5_core_Query *)__pyx_v_self), __pyx_v___pyx_state);

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

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

  /* "(tree fragment)":4
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(1, 4, __pyx_L1_error)

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

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

/* "opendht.pyx":247
 * cdef class Select(object):
 *     cdef cpp.Select _select
 *     def __cinit__(self, str q_str=None):             # <<<<<<<<<<<<<<
 *         if q_str:
 *             self._select = cpp.Select(q_str.encode())
*/

/* Python wrapper */
static int __pyx_pw_7opendht_5_core_6Select_1__cinit__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL_TPNEW
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_pw_7opendht_5_core_6Select_1__cinit__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL_TPNEW
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_q_str = 0;
  #if !CYTHON_VECTORCALL_TPNEW
  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;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  #if !CYTHON_VECTORCALL_TPNEW
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL_TPNEW(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_q_str,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL_TPNEW(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 247, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 247, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__cinit__", 0) < (0)) __PYX_ERR(0, 247, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject*)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 247, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject*)Py_None));
    }
    __pyx_v_q_str = ((PyObject*)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 247, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.Select.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_str), (&PyUnicode_Type), 1, "q_str", 1))) __PYX_ERR(0, 247, __pyx_L1_error)
  __pyx_r = __pyx_pf_7opendht_5_core_6Select___cinit__(((struct __pyx_obj_7opendht_5_core_Select *)__pyx_v_self), __pyx_v_q_str);

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

static int __pyx_pf_7opendht_5_core_6Select___cinit__(struct __pyx_obj_7opendht_5_core_Select *__pyx_v_self, PyObject *__pyx_v_q_str) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  std::string __pyx_t_3;
  dht::Select __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "opendht.pyx":248
 *     cdef cpp.Select _select
 *     def __cinit__(self, str q_str=None):
 *         if q_str:             # <<<<<<<<<<<<<<
 *             self._select = cpp.Select(q_str.encode())
 *         else:
*/
  if (__pyx_v_q_str == Py_None) __pyx_t_1 = 0;
  else
  {
    Py_ssize_t __pyx_temp = __Pyx_PyUnicode_IS_TRUE(__pyx_v_q_str);
    if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(0, 248, __pyx_L1_error)
    __pyx_t_1 = (__pyx_temp != 0);
  }

  if (__pyx_t_1) {


    /* "opendht.pyx":249
 *     def __cinit__(self, str q_str=None):
 *         if q_str:
 *             self._select = cpp.Select(q_str.encode())             # <<<<<<<<<<<<<<
 *         else:
 *             self._select = cpp.Select()
*/
    if (unlikely(__pyx_v_q_str == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "\047NoneType\047 object has no attribute \047%.30s\047", "encode");
      __PYX_ERR(0, 249, __pyx_L1_error)
    }
    __pyx_t_2 = PyUnicode_AsEncodedString(__pyx_v_q_str, NULL, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 249, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 249, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    try {
      __pyx_t_4 = dht::Select(__pyx_t_3);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(0, 249, __pyx_L1_error)
    }

    __pyx_v_self->_select = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_4);

    /* "opendht.pyx":248
 *     cdef cpp.Select _select
 *     def __cinit__(self, str q_str=None):
 *         if q_str:             # <<<<<<<<<<<<<<
 *             self._select = cpp.Select(q_str.encode())
 *         else:
*/
    goto __pyx_L3;
  }

  /* "opendht.pyx":251
 *             self._select = cpp.Select(q_str.encode())
 *         else:
 *             self._select = cpp.Select()             # <<<<<<<<<<<<<<
 *     def __str__(self):
 *         return self._select.toString().decode()
*/
  /*else*/ {
    try {
      __pyx_t_4 = dht::Select();
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(0, 251, __pyx_L1_error)
    }
    __pyx_v_self->_select = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_4);
  }
  __pyx_L3:;

  /* "opendht.pyx":247
 * cdef class Select(object):
 *     cdef cpp.Select _select
 *     def __cinit__(self, str q_str=None):             # <<<<<<<<<<<<<<
 *         if q_str:
 *             self._select = cpp.Select(q_str.encode())
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("opendht._core.Select.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;

  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":252
 *         else:
 *             self._select = cpp.Select()
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return self._select.toString().decode()
 *     def isSatisfiedBy(self, Select os):
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_6Select_3__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7opendht_5_core_6Select_3__str__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7opendht_5_core_6Select_2__str__(((struct __pyx_obj_7opendht_5_core_Select *)__pyx_v_self));

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

static PyObject *__pyx_pf_7opendht_5_core_6Select_2__str__(struct __pyx_obj_7opendht_5_core_Select *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__str__", 0);

  /* "opendht.pyx":253
 *             self._select = cpp.Select()
 *     def __str__(self):
 *         return self._select.toString().decode()             # <<<<<<<<<<<<<<
 *     def isSatisfiedBy(self, Select os):
 *         return self._select.isSatisfiedBy(os._select)
*/
  __pyx_t_1 = __Pyx_decode_cpp_string(__pyx_v_self->_select.toString(), 0, PY_SSIZE_T_MAX, NULL, NULL, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 253, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_1;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "opendht.pyx":252
 *         else:
 *             self._select = cpp.Select()
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return self._select.toString().decode()
 *     def isSatisfiedBy(self, Select os):
*/

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

/* "opendht.pyx":254
 *     def __str__(self):
 *         return self._select.toString().decode()
 *     def isSatisfiedBy(self, Select os):             # <<<<<<<<<<<<<<
 *         return self._select.isSatisfiedBy(os._select)
 *     def field(self, int field):
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_6Select_5isSatisfiedBy(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_6Select_5isSatisfiedBy = {"isSatisfiedBy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_6Select_5isSatisfiedBy, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_6Select_5isSatisfiedBy(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_7opendht_5_core_Select *__pyx_v_os = 0;
  #if !CYTHON_VECTORCALL
  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("isSatisfiedBy (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_os,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 254, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 254, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "isSatisfiedBy", 0) < (0)) __PYX_ERR(0, 254, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("isSatisfiedBy", 1, 1, 1, i); __PYX_ERR(0, 254, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 254, __pyx_L3_error)
    }
    __pyx_v_os = ((struct __pyx_obj_7opendht_5_core_Select *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("isSatisfiedBy", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 254, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.Select.isSatisfiedBy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_os), __pyx_mstate_global->__pyx_ptype_7opendht_5_core_Select, 1, "os", 0))) __PYX_ERR(0, 254, __pyx_L1_error)
  __pyx_r = __pyx_pf_7opendht_5_core_6Select_4isSatisfiedBy(((struct __pyx_obj_7opendht_5_core_Select *)__pyx_v_self), __pyx_v_os);

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

static PyObject *__pyx_pf_7opendht_5_core_6Select_4isSatisfiedBy(struct __pyx_obj_7opendht_5_core_Select *__pyx_v_self, struct __pyx_obj_7opendht_5_core_Select *__pyx_v_os) {
  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("isSatisfiedBy", 0);

  /* "opendht.pyx":255
 *         return self._select.toString().decode()
 *     def isSatisfiedBy(self, Select os):
 *         return self._select.isSatisfiedBy(os._select)             # <<<<<<<<<<<<<<
 *     def field(self, int field):
 *         self._select.field(<cpp.Field> field)
*/
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->_select.isSatisfiedBy(__pyx_v_os->_select)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 255, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_1;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "opendht.pyx":254
 *     def __str__(self):
 *         return self._select.toString().decode()
 *     def isSatisfiedBy(self, Select os):             # <<<<<<<<<<<<<<
 *         return self._select.isSatisfiedBy(os._select)
 *     def field(self, int field):
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("opendht._core.Select.isSatisfiedBy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":256
 *     def isSatisfiedBy(self, Select os):
 *         return self._select.isSatisfiedBy(os._select)
 *     def field(self, int field):             # <<<<<<<<<<<<<<
 *         self._select.field(<cpp.Field> field)
 *         return self
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_6Select_7field(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_6Select_7field = {"field", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_6Select_7field, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_6Select_7field(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  int __pyx_v_field;
  #if !CYTHON_VECTORCALL
  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("field (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_field,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 256, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 256, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "field", 0) < (0)) __PYX_ERR(0, 256, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("field", 1, 1, 1, i); __PYX_ERR(0, 256, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 256, __pyx_L3_error)
    }
    __pyx_v_field = __Pyx_PyLong_As_int(values[0]); if (unlikely((__pyx_v_field == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 256, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("field", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 256, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.Select.field", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7opendht_5_core_6Select_6field(((struct __pyx_obj_7opendht_5_core_Select *)__pyx_v_self), __pyx_v_field);

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

  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7opendht_5_core_6Select_6field(struct __pyx_obj_7opendht_5_core_Select *__pyx_v_self, int __pyx_v_field) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("field", 0);

  /* "opendht.pyx":257
 *         return self._select.isSatisfiedBy(os._select)
 *     def field(self, int field):
 *         self._select.field(<cpp.Field> field)             # <<<<<<<<<<<<<<
 *         return self
 * 
*/
  (void)(__pyx_v_self->_select.field(((dht::Value::Field)__pyx_v_field)));

  /* "opendht.pyx":258
 *     def field(self, int field):
 *         self._select.field(<cpp.Field> field)
 *         return self             # <<<<<<<<<<<<<<
 * 
 * cdef class Where(object):
*/
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __Pyx_INCREF((PyObject *)__pyx_v_self);
      __pyx_r = ((PyObject *)__pyx_v_self);
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  goto __pyx_L0;

  /* "opendht.pyx":256
 *     def isSatisfiedBy(self, Select os):
 *         return self._select.isSatisfiedBy(os._select)
 *     def field(self, int field):             # <<<<<<<<<<<<<<
 *         self._select.field(<cpp.Field> field)
 *         return self
*/

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

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

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_6Select_9__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_6Select_9__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_6Select_9__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_6Select_9__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7opendht_5_core_6Select_8__reduce_cython__(((struct __pyx_obj_7opendht_5_core_Select *)__pyx_v_self));

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

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

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(1, 2, __pyx_L1_error)

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

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

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

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_6Select_11__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_6Select_11__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_6Select_11__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_6Select_11__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(1, 3, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.Select.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7opendht_5_core_6Select_10__setstate_cython__(((struct __pyx_obj_7opendht_5_core_Select *)__pyx_v_self), __pyx_v___pyx_state);

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

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

  /* "(tree fragment)":4
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(1, 4, __pyx_L1_error)

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

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

/* "opendht.pyx":262
 * cdef class Where(object):
 *     cdef cpp.Where _where
 *     def __cinit__(self, str q_str=None):             # <<<<<<<<<<<<<<
 *         if q_str:
 *             self._where = cpp.Where(q_str.encode())
*/

/* Python wrapper */
static int __pyx_pw_7opendht_5_core_5Where_1__cinit__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL_TPNEW
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_pw_7opendht_5_core_5Where_1__cinit__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL_TPNEW
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_q_str = 0;
  #if !CYTHON_VECTORCALL_TPNEW
  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;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  #if !CYTHON_VECTORCALL_TPNEW
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL_TPNEW(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_q_str,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL_TPNEW(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 262, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 262, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__cinit__", 0) < (0)) __PYX_ERR(0, 262, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject*)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 262, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject*)Py_None));
    }
    __pyx_v_q_str = ((PyObject*)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 262, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.Where.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_str), (&PyUnicode_Type), 1, "q_str", 1))) __PYX_ERR(0, 262, __pyx_L1_error)
  __pyx_r = __pyx_pf_7opendht_5_core_5Where___cinit__(((struct __pyx_obj_7opendht_5_core_Where *)__pyx_v_self), __pyx_v_q_str);

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

static int __pyx_pf_7opendht_5_core_5Where___cinit__(struct __pyx_obj_7opendht_5_core_Where *__pyx_v_self, PyObject *__pyx_v_q_str) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  std::string __pyx_t_3;
  dht::Where __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "opendht.pyx":263
 *     cdef cpp.Where _where
 *     def __cinit__(self, str q_str=None):
 *         if q_str:             # <<<<<<<<<<<<<<
 *             self._where = cpp.Where(q_str.encode())
 *         else:
*/
  if (__pyx_v_q_str == Py_None) __pyx_t_1 = 0;
  else
  {
    Py_ssize_t __pyx_temp = __Pyx_PyUnicode_IS_TRUE(__pyx_v_q_str);
    if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(0, 263, __pyx_L1_error)
    __pyx_t_1 = (__pyx_temp != 0);
  }

  if (__pyx_t_1) {


    /* "opendht.pyx":264
 *     def __cinit__(self, str q_str=None):
 *         if q_str:
 *             self._where = cpp.Where(q_str.encode())             # <<<<<<<<<<<<<<
 *         else:
 *             self._where = cpp.Where()
*/
    if (unlikely(__pyx_v_q_str == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "\047NoneType\047 object has no attribute \047%.30s\047", "encode");
      __PYX_ERR(0, 264, __pyx_L1_error)
    }
    __pyx_t_2 = PyUnicode_AsEncodedString(__pyx_v_q_str, NULL, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 264, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 264, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_self->_where = dht::Where(__pyx_t_3);


    /* "opendht.pyx":263
 *     cdef cpp.Where _where
 *     def __cinit__(self, str q_str=None):
 *         if q_str:             # <<<<<<<<<<<<<<
 *             self._where = cpp.Where(q_str.encode())
 *         else:
*/
    goto __pyx_L3;
  }

  /* "opendht.pyx":266
 *             self._where = cpp.Where(q_str.encode())
 *         else:
 *             self._where = cpp.Where()             # <<<<<<<<<<<<<<
 *     def __str__(self):
 *         return self._where.toString().decode()
*/
  /*else*/ {
    try {
      __pyx_t_4 = dht::Where();
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(0, 266, __pyx_L1_error)
    }
    __pyx_v_self->_where = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_4);
  }
  __pyx_L3:;

  /* "opendht.pyx":262
 * cdef class Where(object):
 *     cdef cpp.Where _where
 *     def __cinit__(self, str q_str=None):             # <<<<<<<<<<<<<<
 *         if q_str:
 *             self._where = cpp.Where(q_str.encode())
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("opendht._core.Where.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;

  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":267
 *         else:
 *             self._where = cpp.Where()
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return self._where.toString().decode()
 *     def isSatisfiedBy(self, Where where) -> bool:
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_5Where_3__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7opendht_5_core_5Where_3__str__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7opendht_5_core_5Where_2__str__(((struct __pyx_obj_7opendht_5_core_Where *)__pyx_v_self));

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

static PyObject *__pyx_pf_7opendht_5_core_5Where_2__str__(struct __pyx_obj_7opendht_5_core_Where *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__str__", 0);

  /* "opendht.pyx":268
 *             self._where = cpp.Where()
 *     def __str__(self):
 *         return self._where.toString().decode()             # <<<<<<<<<<<<<<
 *     def isSatisfiedBy(self, Where where) -> bool:
 *         return self._where.isSatisfiedBy(where._where)
*/
  __pyx_t_1 = __Pyx_decode_cpp_string(__pyx_v_self->_where.toString(), 0, PY_SSIZE_T_MAX, NULL, NULL, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 268, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_1;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "opendht.pyx":267
 *         else:
 *             self._where = cpp.Where()
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return self._where.toString().decode()
 *     def isSatisfiedBy(self, Where where) -> bool:
*/

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

/* "opendht.pyx":269
 *     def __str__(self):
 *         return self._where.toString().decode()
 *     def isSatisfiedBy(self, Where where) -> bool:             # <<<<<<<<<<<<<<
 *         return self._where.isSatisfiedBy(where._where)
 *     def id(self, cpp.uint64_t id):
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_5Where_5isSatisfiedBy(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_5Where_5isSatisfiedBy = {"isSatisfiedBy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_5Where_5isSatisfiedBy, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_5Where_5isSatisfiedBy(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_7opendht_5_core_Where *__pyx_v_where = 0;
  #if !CYTHON_VECTORCALL
  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("isSatisfiedBy (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_where,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 269, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 269, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "isSatisfiedBy", 0) < (0)) __PYX_ERR(0, 269, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("isSatisfiedBy", 1, 1, 1, i); __PYX_ERR(0, 269, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 269, __pyx_L3_error)
    }
    __pyx_v_where = ((struct __pyx_obj_7opendht_5_core_Where *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("isSatisfiedBy", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 269, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.Where.isSatisfiedBy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_where), __pyx_mstate_global->__pyx_ptype_7opendht_5_core_Where, 1, "where", 0))) __PYX_ERR(0, 269, __pyx_L1_error)
  __pyx_r = __pyx_pf_7opendht_5_core_5Where_4isSatisfiedBy(((struct __pyx_obj_7opendht_5_core_Where *)__pyx_v_self), __pyx_v_where);

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

static PyObject *__pyx_pf_7opendht_5_core_5Where_4isSatisfiedBy(struct __pyx_obj_7opendht_5_core_Where *__pyx_v_self, struct __pyx_obj_7opendht_5_core_Where *__pyx_v_where) {
  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("isSatisfiedBy", 0);

  /* "opendht.pyx":270
 *         return self._where.toString().decode()
 *     def isSatisfiedBy(self, Where where) -> bool:
 *         return self._where.isSatisfiedBy(where._where)             # <<<<<<<<<<<<<<
 *     def id(self, cpp.uint64_t id):
 *         self._where.id(id)
*/
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->_where.isSatisfiedBy(__pyx_v_where->_where)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 270, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_1;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "opendht.pyx":269
 *     def __str__(self):
 *         return self._where.toString().decode()
 *     def isSatisfiedBy(self, Where where) -> bool:             # <<<<<<<<<<<<<<
 *         return self._where.isSatisfiedBy(where._where)
 *     def id(self, cpp.uint64_t id):
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("opendht._core.Where.isSatisfiedBy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":271
 *     def isSatisfiedBy(self, Where where) -> bool:
 *         return self._where.isSatisfiedBy(where._where)
 *     def id(self, cpp.uint64_t id):             # <<<<<<<<<<<<<<
 *         self._where.id(id)
 *         return self
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_5Where_7id(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_5Where_7id = {"id", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_5Where_7id, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_5Where_7id(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  uint64_t __pyx_v_id;
  #if !CYTHON_VECTORCALL
  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("id (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_id,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 271, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 271, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "id", 0) < (0)) __PYX_ERR(0, 271, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("id", 1, 1, 1, i); __PYX_ERR(0, 271, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 271, __pyx_L3_error)
    }
    __pyx_v_id = __Pyx_PyLong_As_uint64_t(values[0]); if (unlikely((__pyx_v_id == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 271, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("id", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 271, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.Where.id", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7opendht_5_core_5Where_6id(((struct __pyx_obj_7opendht_5_core_Where *)__pyx_v_self), __pyx_v_id);

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

  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7opendht_5_core_5Where_6id(struct __pyx_obj_7opendht_5_core_Where *__pyx_v_self, uint64_t __pyx_v_id) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("id", 0);

  /* "opendht.pyx":272
 *         return self._where.isSatisfiedBy(where._where)
 *     def id(self, cpp.uint64_t id):
 *         self._where.id(id)             # <<<<<<<<<<<<<<
 *         return self
 *     def valueType(self, cpp.uint16_t type):
*/
  (void)(__pyx_v_self->_where.id(__pyx_v_id));

  /* "opendht.pyx":273
 *     def id(self, cpp.uint64_t id):
 *         self._where.id(id)
 *         return self             # <<<<<<<<<<<<<<
 *     def valueType(self, cpp.uint16_t type):
 *         self._where.valueType(type)
*/
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __Pyx_INCREF((PyObject *)__pyx_v_self);
      __pyx_r = ((PyObject *)__pyx_v_self);
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  goto __pyx_L0;

  /* "opendht.pyx":271
 *     def isSatisfiedBy(self, Where where) -> bool:
 *         return self._where.isSatisfiedBy(where._where)
 *     def id(self, cpp.uint64_t id):             # <<<<<<<<<<<<<<
 *         self._where.id(id)
 *         return self
*/

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

/* "opendht.pyx":274
 *         self._where.id(id)
 *         return self
 *     def valueType(self, cpp.uint16_t type):             # <<<<<<<<<<<<<<
 *         self._where.valueType(type)
 *         return self
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_5Where_9valueType(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_5Where_9valueType = {"valueType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_5Where_9valueType, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_5Where_9valueType(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  uint16_t __pyx_v_type;
  #if !CYTHON_VECTORCALL
  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("valueType (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 274, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 274, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "valueType", 0) < (0)) __PYX_ERR(0, 274, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("valueType", 1, 1, 1, i); __PYX_ERR(0, 274, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 274, __pyx_L3_error)
    }
    __pyx_v_type = __Pyx_PyLong_As_uint16_t(values[0]); if (unlikely((__pyx_v_type == ((uint16_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 274, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("valueType", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 274, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.Where.valueType", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7opendht_5_core_5Where_8valueType(((struct __pyx_obj_7opendht_5_core_Where *)__pyx_v_self), __pyx_v_type);

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

  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7opendht_5_core_5Where_8valueType(struct __pyx_obj_7opendht_5_core_Where *__pyx_v_self, uint16_t __pyx_v_type) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("valueType", 0);

  /* "opendht.pyx":275
 *         return self
 *     def valueType(self, cpp.uint16_t type):
 *         self._where.valueType(type)             # <<<<<<<<<<<<<<
 *         return self
 *     def owner(self, InfoHash owner_pk_hash):
*/
  (void)(__pyx_v_self->_where.valueType(__pyx_v_type));

  /* "opendht.pyx":276
 *     def valueType(self, cpp.uint16_t type):
 *         self._where.valueType(type)
 *         return self             # <<<<<<<<<<<<<<
 *     def owner(self, InfoHash owner_pk_hash):
 *         self._where.owner(owner_pk_hash._infohash)
*/
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __Pyx_INCREF((PyObject *)__pyx_v_self);
      __pyx_r = ((PyObject *)__pyx_v_self);
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  goto __pyx_L0;

  /* "opendht.pyx":274
 *         self._where.id(id)
 *         return self
 *     def valueType(self, cpp.uint16_t type):             # <<<<<<<<<<<<<<
 *         self._where.valueType(type)
 *         return self
*/

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

/* "opendht.pyx":277
 *         self._where.valueType(type)
 *         return self
 *     def owner(self, InfoHash owner_pk_hash):             # <<<<<<<<<<<<<<
 *         self._where.owner(owner_pk_hash._infohash)
 *         return self
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_5Where_11owner(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_5Where_11owner = {"owner", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_5Where_11owner, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_5Where_11owner(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_v_owner_pk_hash = 0;
  #if !CYTHON_VECTORCALL
  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("owner (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_owner_pk_hash,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 277, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 277, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "owner", 0) < (0)) __PYX_ERR(0, 277, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("owner", 1, 1, 1, i); __PYX_ERR(0, 277, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 277, __pyx_L3_error)
    }
    __pyx_v_owner_pk_hash = ((struct __pyx_obj_7opendht_5_core_InfoHash *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("owner", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 277, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.Where.owner", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_owner_pk_hash), __pyx_mstate_global->__pyx_ptype_7opendht_5_core_InfoHash, 1, "owner_pk_hash", 0))) __PYX_ERR(0, 277, __pyx_L1_error)
  __pyx_r = __pyx_pf_7opendht_5_core_5Where_10owner(((struct __pyx_obj_7opendht_5_core_Where *)__pyx_v_self), __pyx_v_owner_pk_hash);

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

static PyObject *__pyx_pf_7opendht_5_core_5Where_10owner(struct __pyx_obj_7opendht_5_core_Where *__pyx_v_self, struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_v_owner_pk_hash) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("owner", 0);

  /* "opendht.pyx":278
 *         return self
 *     def owner(self, InfoHash owner_pk_hash):
 *         self._where.owner(owner_pk_hash._infohash)             # <<<<<<<<<<<<<<
 *         return self
 *     def seq(self, cpp.uint16_t seq_no):
*/
  (void)(__pyx_v_self->_where.owner(__pyx_v_owner_pk_hash->_infohash));

  /* "opendht.pyx":279
 *     def owner(self, InfoHash owner_pk_hash):
 *         self._where.owner(owner_pk_hash._infohash)
 *         return self             # <<<<<<<<<<<<<<
 *     def seq(self, cpp.uint16_t seq_no):
 *         self._where.seq(seq_no)
*/
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __Pyx_INCREF((PyObject *)__pyx_v_self);
      __pyx_r = ((PyObject *)__pyx_v_self);
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  goto __pyx_L0;

  /* "opendht.pyx":277
 *         self._where.valueType(type)
 *         return self
 *     def owner(self, InfoHash owner_pk_hash):             # <<<<<<<<<<<<<<
 *         self._where.owner(owner_pk_hash._infohash)
 *         return self
*/

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

/* "opendht.pyx":280
 *         self._where.owner(owner_pk_hash._infohash)
 *         return self
 *     def seq(self, cpp.uint16_t seq_no):             # <<<<<<<<<<<<<<
 *         self._where.seq(seq_no)
 *         return self
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_5Where_13seq(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_5Where_13seq = {"seq", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_5Where_13seq, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_5Where_13seq(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  uint16_t __pyx_v_seq_no;
  #if !CYTHON_VECTORCALL
  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("seq (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_seq_no,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 280, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 280, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "seq", 0) < (0)) __PYX_ERR(0, 280, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("seq", 1, 1, 1, i); __PYX_ERR(0, 280, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 280, __pyx_L3_error)
    }
    __pyx_v_seq_no = __Pyx_PyLong_As_uint16_t(values[0]); if (unlikely((__pyx_v_seq_no == ((uint16_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 280, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("seq", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 280, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.Where.seq", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7opendht_5_core_5Where_12seq(((struct __pyx_obj_7opendht_5_core_Where *)__pyx_v_self), __pyx_v_seq_no);

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

  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7opendht_5_core_5Where_12seq(struct __pyx_obj_7opendht_5_core_Where *__pyx_v_self, uint16_t __pyx_v_seq_no) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("seq", 0);

  /* "opendht.pyx":281
 *         return self
 *     def seq(self, cpp.uint16_t seq_no):
 *         self._where.seq(seq_no)             # <<<<<<<<<<<<<<
 *         return self
 *     def userType(self, str user_type):
*/
  (void)(__pyx_v_self->_where.seq(__pyx_v_seq_no));

  /* "opendht.pyx":282
 *     def seq(self, cpp.uint16_t seq_no):
 *         self._where.seq(seq_no)
 *         return self             # <<<<<<<<<<<<<<
 *     def userType(self, str user_type):
 *         self._where.userType(user_type.encode())
*/
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __Pyx_INCREF((PyObject *)__pyx_v_self);
      __pyx_r = ((PyObject *)__pyx_v_self);
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  goto __pyx_L0;

  /* "opendht.pyx":280
 *         self._where.owner(owner_pk_hash._infohash)
 *         return self
 *     def seq(self, cpp.uint16_t seq_no):             # <<<<<<<<<<<<<<
 *         self._where.seq(seq_no)
 *         return self
*/

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

/* "opendht.pyx":283
 *         self._where.seq(seq_no)
 *         return self
 *     def userType(self, str user_type):             # <<<<<<<<<<<<<<
 *         self._where.userType(user_type.encode())
 *         return self
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_5Where_15userType(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_5Where_15userType = {"userType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_5Where_15userType, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_5Where_15userType(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_user_type = 0;
  #if !CYTHON_VECTORCALL
  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("userType (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_user_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 283, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 283, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "userType", 0) < (0)) __PYX_ERR(0, 283, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("userType", 1, 1, 1, i); __PYX_ERR(0, 283, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 283, __pyx_L3_error)
    }
    __pyx_v_user_type = ((PyObject*)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("userType", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 283, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.Where.userType", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_user_type), (&PyUnicode_Type), 1, "user_type", 1))) __PYX_ERR(0, 283, __pyx_L1_error)
  __pyx_r = __pyx_pf_7opendht_5_core_5Where_14userType(((struct __pyx_obj_7opendht_5_core_Where *)__pyx_v_self), __pyx_v_user_type);

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

static PyObject *__pyx_pf_7opendht_5_core_5Where_14userType(struct __pyx_obj_7opendht_5_core_Where *__pyx_v_self, PyObject *__pyx_v_user_type) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  std::string __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("userType", 0);

  /* "opendht.pyx":284
 *         return self
 *     def userType(self, str user_type):
 *         self._where.userType(user_type.encode())             # <<<<<<<<<<<<<<
 *         return self
 * 
*/
  if (unlikely(__pyx_v_user_type == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "\047NoneType\047 object has no attribute \047%.30s\047", "encode");
    __PYX_ERR(0, 284, __pyx_L1_error)
  }
  __pyx_t_1 = PyUnicode_AsEncodedString(__pyx_v_user_type, NULL, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 284, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 284, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  (void)(__pyx_v_self->_where.userType(__PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_2)));


  /* "opendht.pyx":285
 *     def userType(self, str user_type):
 *         self._where.userType(user_type.encode())
 *         return self             # <<<<<<<<<<<<<<
 * 
 * cdef class Value(object):
*/
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __Pyx_INCREF((PyObject *)__pyx_v_self);
      __pyx_r = ((PyObject *)__pyx_v_self);
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  goto __pyx_L0;

  /* "opendht.pyx":283
 *         self._where.seq(seq_no)
 *         return self
 *     def userType(self, str user_type):             # <<<<<<<<<<<<<<
 *         self._where.userType(user_type.encode())
 *         return self
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("opendht._core.Where.userType", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_5Where_17__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_5Where_17__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_5Where_17__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_5Where_17__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7opendht_5_core_5Where_16__reduce_cython__(((struct __pyx_obj_7opendht_5_core_Where *)__pyx_v_self));

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

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

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(1, 2, __pyx_L1_error)

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

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

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

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_5Where_19__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_5Where_19__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_5Where_19__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_5Where_19__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(1, 3, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.Where.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7opendht_5_core_5Where_18__setstate_cython__(((struct __pyx_obj_7opendht_5_core_Where *)__pyx_v_self), __pyx_v___pyx_state);

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

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

  /* "(tree fragment)":4
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(1, 4, __pyx_L1_error)

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

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

/* "opendht.pyx":289
 * cdef class Value(object):
 *     cdef shared_ptr[cpp.Value] _value
 *     def __init__(self, bytes val=b'', cpp.uint16_t id=0):             # <<<<<<<<<<<<<<
 *         self._value.reset(new cpp.Value(id, val, len(val)))
 *     def __str__(self):
*/

/* Python wrapper */
static int __pyx_pw_7opendht_5_core_5Value_1__init__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL_TPNEW
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_pw_7opendht_5_core_5Value_1__init__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL_TPNEW
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_val = 0;
  uint16_t __pyx_v_id;
  #if !CYTHON_VECTORCALL_TPNEW
  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;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if !CYTHON_VECTORCALL_TPNEW
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL_TPNEW(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_val,&__pyx_mstate_global->__pyx_n_u_id,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL_TPNEW(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 289, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 289, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 289, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(0, 289, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_kp_b__5));
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 289, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 289, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_kp_b__5));
    }
    __pyx_v_val = ((PyObject*)values[0]);
    if (values[1]) {
      __pyx_v_id = __Pyx_PyLong_As_uint16_t(values[1]); if (unlikely((__pyx_v_id == ((uint16_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 289, __pyx_L3_error)
    } else {
      __pyx_v_id = ((uint16_t)0);
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 2, __pyx_nargs); __PYX_ERR(0, 289, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.Value.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_val), (&PyBytes_Type), 1, "val", 1))) __PYX_ERR(0, 289, __pyx_L1_error)
  __pyx_r = __pyx_pf_7opendht_5_core_5Value___init__(((struct __pyx_obj_7opendht_5_core_Value *)__pyx_v_self), __pyx_v_val, __pyx_v_id);

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

  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7opendht_5_core_5Value___init__(struct __pyx_obj_7opendht_5_core_Value *__pyx_v_self, PyObject *__pyx_v_val, uint16_t __pyx_v_id) {
  int __pyx_r;
  uint8_t const *__pyx_t_1;
  Py_ssize_t __pyx_t_2;
  dht::Value *__pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "opendht.pyx":290
 *     cdef shared_ptr[cpp.Value] _value
 *     def __init__(self, bytes val=b'', cpp.uint16_t id=0):
 *         self._value.reset(new cpp.Value(id, val, len(val)))             # <<<<<<<<<<<<<<
 *     def __str__(self):
 *         return self._value.get().toString().decode()
*/
  if (unlikely(__pyx_v_val == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
    __PYX_ERR(0, 290, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_PyBytes_AsUString(__pyx_v_val); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 290, __pyx_L1_error)
  if (unlikely(__pyx_v_val == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type \047NoneType\047 has no len()");
    __PYX_ERR(0, 290, __pyx_L1_error)
  }
  __pyx_t_2 = __Pyx_PyBytes_GET_SIZE(__pyx_v_val); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 290, __pyx_L1_error)
  try {
    __pyx_t_3 = new dht::Value(__pyx_v_id, __pyx_t_1, __pyx_t_2);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(0, 290, __pyx_L1_error)
  }


  __pyx_v_self->_value.reset(__pyx_t_3);


  /* "opendht.pyx":289
 * cdef class Value(object):
 *     cdef shared_ptr[cpp.Value] _value
 *     def __init__(self, bytes val=b'', cpp.uint16_t id=0):             # <<<<<<<<<<<<<<
 *         self._value.reset(new cpp.Value(id, val, len(val)))
 *     def __str__(self):
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("opendht._core.Value.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;

  return __pyx_r;
}

/* "opendht.pyx":291
 *     def __init__(self, bytes val=b'', cpp.uint16_t id=0):
 *         self._value.reset(new cpp.Value(id, val, len(val)))
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return self._value.get().toString().decode()
 *     @property
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_5Value_3__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7opendht_5_core_5Value_3__str__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7opendht_5_core_5Value_2__str__(((struct __pyx_obj_7opendht_5_core_Value *)__pyx_v_self));

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

static PyObject *__pyx_pf_7opendht_5_core_5Value_2__str__(struct __pyx_obj_7opendht_5_core_Value *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__str__", 0);

  /* "opendht.pyx":292
 *         self._value.reset(new cpp.Value(id, val, len(val)))
 *     def __str__(self):
 *         return self._value.get().toString().decode()             # <<<<<<<<<<<<<<
 *     @property
 *     def owner(self) -> PublicKey:
*/
  __pyx_t_1 = __Pyx_decode_cpp_string(__pyx_v_self->_value.get()->toString(), 0, PY_SSIZE_T_MAX, NULL, NULL, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 292, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_1;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "opendht.pyx":291
 *     def __init__(self, bytes val=b'', cpp.uint16_t id=0):
 *         self._value.reset(new cpp.Value(id, val, len(val)))
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return self._value.get().toString().decode()
 *     @property
*/

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

/* "opendht.pyx":293
 *     def __str__(self):
 *         return self._value.get().toString().decode()
 *     @property             # <<<<<<<<<<<<<<
 *     def owner(self) -> PublicKey:
 *         h = PublicKey()
*/

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

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

static PyObject *__pyx_pf_7opendht_5_core_5Value_5owner___get__(struct __pyx_obj_7opendht_5_core_Value *__pyx_v_self) {
  struct __pyx_obj_7opendht_5_core_PublicKey *__pyx_v_h = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  std::shared_ptr<dht::crypto::PublicKey>  __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "opendht.pyx":295
 *     @property
 *     def owner(self) -> PublicKey:
 *         h = PublicKey()             # <<<<<<<<<<<<<<
 *         h._key = self._value.get().owner
 *         return h
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7opendht_5_core_PublicKey, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 295, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_h = ((struct __pyx_obj_7opendht_5_core_PublicKey *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "opendht.pyx":296
 *     def owner(self) -> PublicKey:
 *         h = PublicKey()
 *         h._key = self._value.get().owner             # <<<<<<<<<<<<<<
 *         return h
 *     @property
*/
  __pyx_t_4 = __pyx_v_self->_value.get()->owner;

  __pyx_v_h->_key = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_4);

  /* "opendht.pyx":297
 *         h = PublicKey()
 *         h._key = self._value.get().owner
 *         return h             # <<<<<<<<<<<<<<
 *     @property
 *     def recipient(self) -> InfoHash:
*/
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __Pyx_INCREF((PyObject *)__pyx_v_h);
      __pyx_r = ((PyObject *)__pyx_v_h);
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  goto __pyx_L0;

  /* "opendht.pyx":293
 *     def __str__(self):
 *         return self._value.get().toString().decode()
 *     @property             # <<<<<<<<<<<<<<
 *     def owner(self) -> PublicKey:
 *         h = PublicKey()
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("opendht._core.Value.owner.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_h);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":298
 *         h._key = self._value.get().owner
 *         return h
 *     @property             # <<<<<<<<<<<<<<
 *     def recipient(self) -> InfoHash:
 *         h = InfoHash()
*/

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

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

static PyObject *__pyx_pf_7opendht_5_core_5Value_9recipient___get__(struct __pyx_obj_7opendht_5_core_Value *__pyx_v_self) {
  struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_v_h = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  dht::InfoHash __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "opendht.pyx":300
 *     @property
 *     def recipient(self) -> InfoHash:
 *         h = InfoHash()             # <<<<<<<<<<<<<<
 *         h._infohash = self._value.get().recipient
 *         return h
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7opendht_5_core_InfoHash, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 300, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_h = ((struct __pyx_obj_7opendht_5_core_InfoHash *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "opendht.pyx":301
 *     def recipient(self) -> InfoHash:
 *         h = InfoHash()
 *         h._infohash = self._value.get().recipient             # <<<<<<<<<<<<<<
 *         return h
 *     @recipient.setter
*/
  __pyx_t_4 = __pyx_v_self->_value.get()->recipient;

  __pyx_v_h->_infohash = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_4);

  /* "opendht.pyx":302
 *         h = InfoHash()
 *         h._infohash = self._value.get().recipient
 *         return h             # <<<<<<<<<<<<<<
 *     @recipient.setter
 *     def recipient(self, InfoHash h):
*/
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __Pyx_INCREF((PyObject *)__pyx_v_h);
      __pyx_r = ((PyObject *)__pyx_v_h);
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  goto __pyx_L0;

  /* "opendht.pyx":298
 *         h._key = self._value.get().owner
 *         return h
 *     @property             # <<<<<<<<<<<<<<
 *     def recipient(self) -> InfoHash:
 *         h = InfoHash()
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("opendht._core.Value.recipient.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_h);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":303
 *         h._infohash = self._value.get().recipient
 *         return h
 *     @recipient.setter             # <<<<<<<<<<<<<<
 *     def recipient(self, InfoHash h):
 *         self._value.get().recipient = h._infohash
*/

/* Python wrapper */
static int __pyx_pw_7opendht_5_core_5Value_9recipient_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_h); /*proto*/
static int __pyx_pw_7opendht_5_core_5Value_9recipient_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_h) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_h), __pyx_mstate_global->__pyx_ptype_7opendht_5_core_InfoHash, 1, "h", 0))) __PYX_ERR(0, 304, __pyx_L1_error)
  __pyx_r = __pyx_pf_7opendht_5_core_5Value_9recipient_2__set__(((struct __pyx_obj_7opendht_5_core_Value *)__pyx_v_self), ((struct __pyx_obj_7opendht_5_core_InfoHash *)__pyx_v_h));

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

static int __pyx_pf_7opendht_5_core_5Value_9recipient_2__set__(struct __pyx_obj_7opendht_5_core_Value *__pyx_v_self, struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_v_h) {
  int __pyx_r;
  dht::InfoHash __pyx_t_1;

  /* "opendht.pyx":305
 *     @recipient.setter
 *     def recipient(self, InfoHash h):
 *         self._value.get().recipient = h._infohash             # <<<<<<<<<<<<<<
 *     @property
 *     def data(self) -> bytes:
*/
  __pyx_t_1 = __pyx_v_h->_infohash;

  __pyx_v_self->_value.get()->recipient = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_1);

  /* "opendht.pyx":303
 *         h._infohash = self._value.get().recipient
 *         return h
 *     @recipient.setter             # <<<<<<<<<<<<<<
 *     def recipient(self, InfoHash h):
 *         self._value.get().recipient = h._infohash
*/

  /* function exit code */
  __pyx_r = 0;

  return __pyx_r;
}

/* "opendht.pyx":306
 *     def recipient(self, InfoHash h):
 *         self._value.get().recipient = h._infohash
 *     @property             # <<<<<<<<<<<<<<
 *     def data(self) -> bytes:
 *         cdef char* data_ptr = <char*>self._value.get().data.data()
*/

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

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

static PyObject *__pyx_pf_7opendht_5_core_5Value_4data___get__(struct __pyx_obj_7opendht_5_core_Value *__pyx_v_self) {
  char *__pyx_v_data_ptr;
  int __pyx_v_data_size;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "opendht.pyx":308
 *     @property
 *     def data(self) -> bytes:
 *         cdef char* data_ptr = <char*>self._value.get().data.data()             # <<<<<<<<<<<<<<
 *         cdef int data_size = self._value.get().data.size()
 *         return data_ptr[:data_size]
*/
  __pyx_v_data_ptr = ((char *)__pyx_v_self->_value.get()->data.data());

  /* "opendht.pyx":309
 *     def data(self) -> bytes:
 *         cdef char* data_ptr = <char*>self._value.get().data.data()
 *         cdef int data_size = self._value.get().data.size()             # <<<<<<<<<<<<<<
 *         return data_ptr[:data_size]
 *     @data.setter
*/
  __pyx_v_data_size = __pyx_v_self->_value.get()->data.size();

  /* "opendht.pyx":310
 *         cdef char* data_ptr = <char*>self._value.get().data.data()
 *         cdef int data_size = self._value.get().data.size()
 *         return data_ptr[:data_size]             # <<<<<<<<<<<<<<
 *     @data.setter
 *     def data(self, bytes value):
*/
  __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_data_ptr + 0, __pyx_v_data_size - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 310, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_1;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "opendht.pyx":306
 *     def recipient(self, InfoHash h):
 *         self._value.get().recipient = h._infohash
 *     @property             # <<<<<<<<<<<<<<
 *     def data(self) -> bytes:
 *         cdef char* data_ptr = <char*>self._value.get().data.data()
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("opendht._core.Value.data.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;


  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":311
 *         cdef int data_size = self._value.get().data.size()
 *         return data_ptr[:data_size]
 *     @data.setter             # <<<<<<<<<<<<<<
 *     def data(self, bytes value):
 *         self._value.get().data = value
*/

/* Python wrapper */
static int __pyx_pw_7opendht_5_core_5Value_4data_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_7opendht_5_core_5Value_4data_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyBytes_Type), 1, "value", 1))) __PYX_ERR(0, 312, __pyx_L1_error)
  __pyx_r = __pyx_pf_7opendht_5_core_5Value_4data_2__set__(((struct __pyx_obj_7opendht_5_core_Value *)__pyx_v_self), ((PyObject*)__pyx_v_value));

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

static int __pyx_pf_7opendht_5_core_5Value_4data_2__set__(struct __pyx_obj_7opendht_5_core_Value *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  std::vector<uint8_t>  __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "opendht.pyx":313
 *     @data.setter
 *     def data(self, bytes value):
 *         self._value.get().data = value             # <<<<<<<<<<<<<<
 *     @property
 *     def user_type(self) -> str:
*/
  __pyx_t_1 = __pyx_convert_vector_from_py_uint8_t(__pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 313, __pyx_L1_error)
  __pyx_v_self->_value.get()->data = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_1);

  /* "opendht.pyx":311
 *         cdef int data_size = self._value.get().data.size()
 *         return data_ptr[:data_size]
 *     @data.setter             # <<<<<<<<<<<<<<
 *     def data(self, bytes value):
 *         self._value.get().data = value
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("opendht._core.Value.data.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;

  return __pyx_r;
}

/* "opendht.pyx":314
 *     def data(self, bytes value):
 *         self._value.get().data = value
 *     @property             # <<<<<<<<<<<<<<
 *     def user_type(self) -> str:
 *         return self._value.get().user_type.decode()
*/

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

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

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

  /* "opendht.pyx":316
 *     @property
 *     def user_type(self) -> str:
 *         return self._value.get().user_type.decode()             # <<<<<<<<<<<<<<
 *     @user_type.setter
 *     def user_type(self, str t):
*/
  __pyx_t_1 = __Pyx_decode_cpp_string(__pyx_v_self->_value.get()->user_type, 0, PY_SSIZE_T_MAX, NULL, NULL, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 316, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_1;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "opendht.pyx":314
 *     def data(self, bytes value):
 *         self._value.get().data = value
 *     @property             # <<<<<<<<<<<<<<
 *     def user_type(self) -> str:
 *         return self._value.get().user_type.decode()
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("opendht._core.Value.user_type.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":317
 *     def user_type(self) -> str:
 *         return self._value.get().user_type.decode()
 *     @user_type.setter             # <<<<<<<<<<<<<<
 *     def user_type(self, str t):
 *         self._value.get().user_type = t.encode()
*/

/* Python wrapper */
static int __pyx_pw_7opendht_5_core_5Value_9user_type_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_t); /*proto*/
static int __pyx_pw_7opendht_5_core_5Value_9user_type_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_t) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_t), (&PyUnicode_Type), 1, "t", 1))) __PYX_ERR(0, 318, __pyx_L1_error)
  __pyx_r = __pyx_pf_7opendht_5_core_5Value_9user_type_2__set__(((struct __pyx_obj_7opendht_5_core_Value *)__pyx_v_self), ((PyObject*)__pyx_v_t));

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

static int __pyx_pf_7opendht_5_core_5Value_9user_type_2__set__(struct __pyx_obj_7opendht_5_core_Value *__pyx_v_self, PyObject *__pyx_v_t) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  std::string __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "opendht.pyx":319
 *     @user_type.setter
 *     def user_type(self, str t):
 *         self._value.get().user_type = t.encode()             # <<<<<<<<<<<<<<
 *     @property
 *     def id(self):
*/
  if (unlikely(__pyx_v_t == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "\047NoneType\047 object has no attribute \047%.30s\047", "encode");
    __PYX_ERR(0, 319, __pyx_L1_error)
  }
  __pyx_t_1 = PyUnicode_AsEncodedString(__pyx_v_t, NULL, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 319, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 319, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_self->_value.get()->user_type = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_2);

  /* "opendht.pyx":317
 *     def user_type(self) -> str:
 *         return self._value.get().user_type.decode()
 *     @user_type.setter             # <<<<<<<<<<<<<<
 *     def user_type(self, str t):
 *         self._value.get().user_type = t.encode()
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("opendht._core.Value.user_type.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;

  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":320
 *     def user_type(self, str t):
 *         self._value.get().user_type = t.encode()
 *     @property             # <<<<<<<<<<<<<<
 *     def id(self):
 *         return self._value.get().id
*/

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

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

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

  /* "opendht.pyx":322
 *     @property
 *     def id(self):
 *         return self._value.get().id             # <<<<<<<<<<<<<<
 *     @id.setter
 *     def id(self, cpp.uint64_t value):
*/
  __pyx_t_1 = __Pyx_PyLong_From_uint64_t(__pyx_v_self->_value.get()->id); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 322, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_1;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "opendht.pyx":320
 *     def user_type(self, str t):
 *         self._value.get().user_type = t.encode()
 *     @property             # <<<<<<<<<<<<<<
 *     def id(self):
 *         return self._value.get().id
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("opendht._core.Value.id.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":323
 *     def id(self):
 *         return self._value.get().id
 *     @id.setter             # <<<<<<<<<<<<<<
 *     def id(self, cpp.uint64_t value):
 *         self._value.get().id = value
*/

/* Python wrapper */
static int __pyx_pw_7opendht_5_core_5Value_2id_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/
static int __pyx_pw_7opendht_5_core_5Value_2id_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value) {
  uint64_t __pyx_v_value;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  assert(__pyx_arg_value); {
    __pyx_v_value = __Pyx_PyLong_As_uint64_t(__pyx_arg_value); if (unlikely((__pyx_v_value == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 324, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("opendht._core.Value.id.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7opendht_5_core_5Value_2id_2__set__(((struct __pyx_obj_7opendht_5_core_Value *)__pyx_v_self), ((uint64_t)__pyx_v_value));

  /* function exit code */

  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7opendht_5_core_5Value_2id_2__set__(struct __pyx_obj_7opendht_5_core_Value *__pyx_v_self, uint64_t __pyx_v_value) {
  int __pyx_r;

  /* "opendht.pyx":325
 *     @id.setter
 *     def id(self, cpp.uint64_t value):
 *         self._value.get().id = value             # <<<<<<<<<<<<<<
 *     @property
 *     def size(self) -> int:
*/
  __pyx_v_self->_value.get()->id = __pyx_v_value;

  /* "opendht.pyx":323
 *     def id(self):
 *         return self._value.get().id
 *     @id.setter             # <<<<<<<<<<<<<<
 *     def id(self, cpp.uint64_t value):
 *         self._value.get().id = value
*/

  /* function exit code */
  __pyx_r = 0;


  return __pyx_r;
}

/* "opendht.pyx":326
 *     def id(self, cpp.uint64_t value):
 *         self._value.get().id = value
 *     @property             # <<<<<<<<<<<<<<
 *     def size(self) -> int:
 *         return self._value.get().size()
*/

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

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

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

  /* "opendht.pyx":328
 *     @property
 *     def size(self) -> int:
 *         return self._value.get().size()             # <<<<<<<<<<<<<<
 * 
 * cdef class ValueType(object):
*/
  __pyx_t_1 = __Pyx_PyLong_FromSize_t(__pyx_v_self->_value.get()->size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 328, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_1;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "opendht.pyx":326
 *     def id(self, cpp.uint64_t value):
 *         self._value.get().id = value
 *     @property             # <<<<<<<<<<<<<<
 *     def size(self) -> int:
 *         return self._value.get().size()
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("opendht._core.Value.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._value cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_5Value_5__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_5Value_5__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_5Value_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_5Value_5__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7opendht_5_core_5Value_4__reduce_cython__(((struct __pyx_obj_7opendht_5_core_Value *)__pyx_v_self));

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

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

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "self._value cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._value cannot be converted to a Python object for pickling"
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self__value_cannot_be_converted, 0, 0);
  __PYX_ERR(1, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._value cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/

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

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._value cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._value cannot be converted to a Python object for pickling"
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_5Value_7__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_5Value_7__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_5Value_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_5Value_7__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(1, 3, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.Value.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7opendht_5_core_5Value_6__setstate_cython__(((struct __pyx_obj_7opendht_5_core_Value *)__pyx_v_self), __pyx_v___pyx_state);

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

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

  /* "(tree fragment)":4
 *     raise TypeError, "self._value cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._value cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self__value_cannot_be_converted, 0, 0);
  __PYX_ERR(1, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._value cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._value cannot be converted to a Python object for pickling"
*/

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

/* "opendht.pyx":332
 * cdef class ValueType(object):
 *     cdef cpp.ValueType * _value
 *     def __init__(self, cpp.uint16_t id, str name, expiration: timedelta):             # <<<<<<<<<<<<<<
 *         if not isinstance(expiration, timedelta):
 *             raise TypeError("expiration argument must be of type timedelta")
*/

/* Python wrapper */
static int __pyx_pw_7opendht_5_core_9ValueType_1__init__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL_TPNEW
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_pw_7opendht_5_core_9ValueType_1__init__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL_TPNEW
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  uint16_t __pyx_v_id;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_expiration = 0;
  #if !CYTHON_VECTORCALL_TPNEW
  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;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if !CYTHON_VECTORCALL_TPNEW
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL_TPNEW(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_id,&__pyx_mstate_global->__pyx_n_u_name_2,&__pyx_mstate_global->__pyx_n_u_expiration,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL_TPNEW(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 332, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 332, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 332, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 332, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(0, 332, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, i); __PYX_ERR(0, 332, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 332, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 332, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 332, __pyx_L3_error)
    }
    __pyx_v_id = __Pyx_PyLong_As_uint16_t(values[0]); if (unlikely((__pyx_v_id == ((uint16_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 332, __pyx_L3_error)
    __pyx_v_name = ((PyObject*)values[1]);
    __pyx_v_expiration = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 332, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.ValueType.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_name), (&PyUnicode_Type), 1, "name", 1))) __PYX_ERR(0, 332, __pyx_L1_error)
  __pyx_r = __pyx_pf_7opendht_5_core_9ValueType___init__(((struct __pyx_obj_7opendht_5_core_ValueType *)__pyx_v_self), __pyx_v_id, __pyx_v_name, __pyx_v_expiration);

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

  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7opendht_5_core_9ValueType___init__(struct __pyx_obj_7opendht_5_core_ValueType *__pyx_v_self, uint16_t __pyx_v_id, PyObject *__pyx_v_name, PyObject *__pyx_v_expiration) {
  std::chrono::seconds __pyx_v_duration;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  uint64_t __pyx_t_6;
  std::chrono::seconds __pyx_t_7;
  std::string __pyx_t_8;
  dht::ValueType *__pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "opendht.pyx":333
 *     cdef cpp.ValueType * _value
 *     def __init__(self, cpp.uint16_t id, str name, expiration: timedelta):
 *         if not isinstance(expiration, timedelta):             # <<<<<<<<<<<<<<
 *             raise TypeError("expiration argument must be of type timedelta")
 *         cdef cpp.seconds duration = cpp.seconds(int(expiration.total_seconds()))
*/
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_timedelta); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 333, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_expiration, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 333, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (!__pyx_t_2);


  if (unlikely(__pyx_t_3)) {


    /* "opendht.pyx":334
 *     def __init__(self, cpp.uint16_t id, str name, expiration: timedelta):
 *         if not isinstance(expiration, timedelta):
 *             raise TypeError("expiration argument must be of type timedelta")             # <<<<<<<<<<<<<<
 *         cdef cpp.seconds duration = cpp.seconds(int(expiration.total_seconds()))
 *         self._value =  new cpp.ValueType(id, name.encode(), duration)
*/
    __pyx_t_4 = NULL;
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_expiration_argument_must_be_of_t};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 334, __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, 334, __pyx_L1_error)

    /* "opendht.pyx":333
 *     cdef cpp.ValueType * _value
 *     def __init__(self, cpp.uint16_t id, str name, expiration: timedelta):
 *         if not isinstance(expiration, timedelta):             # <<<<<<<<<<<<<<
 *             raise TypeError("expiration argument must be of type timedelta")
 *         cdef cpp.seconds duration = cpp.seconds(int(expiration.total_seconds()))
*/
  }

  /* "opendht.pyx":335
 *         if not isinstance(expiration, timedelta):
 *             raise TypeError("expiration argument must be of type timedelta")
 *         cdef cpp.seconds duration = cpp.seconds(int(expiration.total_seconds()))             # <<<<<<<<<<<<<<
 *         self._value =  new cpp.ValueType(id, name.encode(), duration)
 * 
*/
  __pyx_t_4 = __pyx_v_expiration;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_total_seconds, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 335, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_4 = __Pyx_PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 335, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = __Pyx_PyLong_As_uint64_t(__pyx_t_4); if (unlikely((__pyx_t_6 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 335, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  try {
    __pyx_t_7 = std::chrono::seconds(__pyx_t_6);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(0, 335, __pyx_L1_error)
  }

  __pyx_v_duration = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_7);

  /* "opendht.pyx":336
 *             raise TypeError("expiration argument must be of type timedelta")
 *         cdef cpp.seconds duration = cpp.seconds(int(expiration.total_seconds()))
 *         self._value =  new cpp.ValueType(id, name.encode(), duration)             # <<<<<<<<<<<<<<
 * 
 * cdef class NodeSetIter(object):
*/
  if (unlikely(__pyx_v_name == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "\047NoneType\047 object has no attribute \047%.30s\047", "encode");
    __PYX_ERR(0, 336, __pyx_L1_error)
  }
  __pyx_t_4 = PyUnicode_AsEncodedString(__pyx_v_name, NULL, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 336, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_8 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_4); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 336, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  try {
    __pyx_t_9 = new dht::ValueType(__pyx_v_id, __pyx_t_8, __pyx_v_duration);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(0, 336, __pyx_L1_error)
  }

  __pyx_v_self->_value = __pyx_t_9;

  /* "opendht.pyx":332
 * cdef class ValueType(object):
 *     cdef cpp.ValueType * _value
 *     def __init__(self, cpp.uint16_t id, str name, expiration: timedelta):             # <<<<<<<<<<<<<<
 *         if not isinstance(expiration, timedelta):
 *             raise TypeError("expiration argument must be of type timedelta")
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("opendht._core.ValueType.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;


  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._value cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_9ValueType_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_9ValueType_3__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9ValueType_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_9ValueType_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7opendht_5_core_9ValueType_2__reduce_cython__(((struct __pyx_obj_7opendht_5_core_ValueType *)__pyx_v_self));

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

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

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "self._value cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._value cannot be converted to a Python object for pickling"
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self__value_cannot_be_converted, 0, 0);
  __PYX_ERR(1, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._value cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/

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

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._value cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._value cannot be converted to a Python object for pickling"
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_9ValueType_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_9ValueType_5__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9ValueType_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_9ValueType_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(1, 3, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.ValueType.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7opendht_5_core_9ValueType_4__setstate_cython__(((struct __pyx_obj_7opendht_5_core_ValueType *)__pyx_v_self), __pyx_v___pyx_state);

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

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

  /* "(tree fragment)":4
 *     raise TypeError, "self._value cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._value cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self__value_cannot_be_converted, 0, 0);
  __PYX_ERR(1, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._value cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._value cannot be converted to a Python object for pickling"
*/

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

/* "opendht.pyx":341
 *     cdef map[cpp.InfoHash, shared_ptr[cpp.Node]]* _nodes
 *     cdef map[cpp.InfoHash, shared_ptr[cpp.Node]].iterator _curIter
 *     def __init__(self, NodeSet s):             # <<<<<<<<<<<<<<
 *         self._nodes = &s._nodes
 *         self._curIter = self._nodes.begin()
*/

/* Python wrapper */
static int __pyx_pw_7opendht_5_core_11NodeSetIter_1__init__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL_TPNEW
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_pw_7opendht_5_core_11NodeSetIter_1__init__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL_TPNEW
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_7opendht_5_core_NodeSet *__pyx_v_s = 0;
  #if !CYTHON_VECTORCALL_TPNEW
  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;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if !CYTHON_VECTORCALL_TPNEW
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL_TPNEW(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_s,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL_TPNEW(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 341, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 341, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(0, 341, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, i); __PYX_ERR(0, 341, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 341, __pyx_L3_error)
    }
    __pyx_v_s = ((struct __pyx_obj_7opendht_5_core_NodeSet *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 341, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.NodeSetIter.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_s), __pyx_mstate_global->__pyx_ptype_7opendht_5_core_NodeSet, 1, "s", 0))) __PYX_ERR(0, 341, __pyx_L1_error)
  __pyx_r = __pyx_pf_7opendht_5_core_11NodeSetIter___init__(((struct __pyx_obj_7opendht_5_core_NodeSetIter *)__pyx_v_self), __pyx_v_s);

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

static int __pyx_pf_7opendht_5_core_11NodeSetIter___init__(struct __pyx_obj_7opendht_5_core_NodeSetIter *__pyx_v_self, struct __pyx_obj_7opendht_5_core_NodeSet *__pyx_v_s) {
  int __pyx_r;

  /* "opendht.pyx":342
 *     cdef map[cpp.InfoHash, shared_ptr[cpp.Node]].iterator _curIter
 *     def __init__(self, NodeSet s):
 *         self._nodes = &s._nodes             # <<<<<<<<<<<<<<
 *         self._curIter = self._nodes.begin()
 *     def __next__(self):
*/
  __pyx_v_self->_nodes = (&__pyx_v_s->_nodes);

  /* "opendht.pyx":343
 *     def __init__(self, NodeSet s):
 *         self._nodes = &s._nodes
 *         self._curIter = self._nodes.begin()             # <<<<<<<<<<<<<<
 *     def __next__(self):
 *         if self._curIter == self._nodes.end():
*/
  __pyx_v_self->_curIter = __pyx_v_self->_nodes->begin();

  /* "opendht.pyx":341
 *     cdef map[cpp.InfoHash, shared_ptr[cpp.Node]]* _nodes
 *     cdef map[cpp.InfoHash, shared_ptr[cpp.Node]].iterator _curIter
 *     def __init__(self, NodeSet s):             # <<<<<<<<<<<<<<
 *         self._nodes = &s._nodes
 *         self._curIter = self._nodes.begin()
*/

  /* function exit code */
  __pyx_r = 0;

  return __pyx_r;
}

/* "opendht.pyx":344
 *         self._nodes = &s._nodes
 *         self._curIter = self._nodes.begin()
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         if self._curIter == self._nodes.end():
 *             raise StopIteration
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_11NodeSetIter_3__next__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7opendht_5_core_11NodeSetIter_3__next__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7opendht_5_core_11NodeSetIter_2__next__(((struct __pyx_obj_7opendht_5_core_NodeSetIter *)__pyx_v_self));

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

static PyObject *__pyx_pf_7opendht_5_core_11NodeSetIter_2__next__(struct __pyx_obj_7opendht_5_core_NodeSetIter *__pyx_v_self) {
  struct __pyx_obj_7opendht_5_core_NodeEntry *__pyx_v_h = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_error_without_exception = 0; /* StopIteration */
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__next__", 0);

  /* "opendht.pyx":345
 *         self._curIter = self._nodes.begin()
 *     def __next__(self):
 *         if self._curIter == self._nodes.end():             # <<<<<<<<<<<<<<
 *             raise StopIteration
 *         h = NodeEntry()
*/
  __pyx_t_1 = (__pyx_v_self->_curIter == __pyx_v_self->_nodes->end());

  if (unlikely(__pyx_t_1)) {


    /* "opendht.pyx":346
 *     def __next__(self):
 *         if self._curIter == self._nodes.end():
 *             raise StopIteration             # <<<<<<<<<<<<<<
 *         h = NodeEntry()
 *         h._v = deref(self._curIter)
*/
    __pyx_error_without_exception = 1;
    __PYX_ERR(0, 346, __pyx_L1_error)

    /* "opendht.pyx":345
 *         self._curIter = self._nodes.begin()
 *     def __next__(self):
 *         if self._curIter == self._nodes.end():             # <<<<<<<<<<<<<<
 *             raise StopIteration
 *         h = NodeEntry()
*/
  }

  /* "opendht.pyx":347
 *         if self._curIter == self._nodes.end():
 *             raise StopIteration
 *         h = NodeEntry()             # <<<<<<<<<<<<<<
 *         h._v = deref(self._curIter)
 *         inc(self._curIter)
*/
  __pyx_t_3 = NULL;
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7opendht_5_core_NodeEntry, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 347, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_2);
  }
  __pyx_v_h = ((struct __pyx_obj_7opendht_5_core_NodeEntry *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "opendht.pyx":348
 *             raise StopIteration
 *         h = NodeEntry()
 *         h._v = deref(self._curIter)             # <<<<<<<<<<<<<<
 *         inc(self._curIter)
 *         return h
*/
  __pyx_v_h->_v = (*__pyx_v_self->_curIter);

  /* "opendht.pyx":349
 *         h = NodeEntry()
 *         h._v = deref(self._curIter)
 *         inc(self._curIter)             # <<<<<<<<<<<<<<
 *         return h
 * 
*/
  (void)((++__pyx_v_self->_curIter));

  /* "opendht.pyx":350
 *         h._v = deref(self._curIter)
 *         inc(self._curIter)
 *         return h             # <<<<<<<<<<<<<<
 * 
 * cdef class NodeSet(object):
*/
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __Pyx_INCREF((PyObject *)__pyx_v_h);
      __pyx_r = ((PyObject *)__pyx_v_h);
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  goto __pyx_L0;

  /* "opendht.pyx":344
 *         self._nodes = &s._nodes
 *         self._curIter = self._nodes.begin()
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         if self._curIter == self._nodes.end():
 *             raise StopIteration
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  if (!__pyx_error_without_exception) {
    __Pyx_AddTraceback("opendht._core.NodeSetIter.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  }
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_h);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._curIter,self._nodes cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_11NodeSetIter_5__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_11NodeSetIter_5__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_11NodeSetIter_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_11NodeSetIter_5__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7opendht_5_core_11NodeSetIter_4__reduce_cython__(((struct __pyx_obj_7opendht_5_core_NodeSetIter *)__pyx_v_self));

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

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

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "self._curIter,self._nodes cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._curIter,self._nodes cannot be converted to a Python object for pickling"
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self__curIter_self__nodes_cannot, 0, 0);
  __PYX_ERR(1, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._curIter,self._nodes cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/

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

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._curIter,self._nodes cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._curIter,self._nodes cannot be converted to a Python object for pickling"
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_11NodeSetIter_7__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_11NodeSetIter_7__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_11NodeSetIter_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_11NodeSetIter_7__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(1, 3, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.NodeSetIter.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7opendht_5_core_11NodeSetIter_6__setstate_cython__(((struct __pyx_obj_7opendht_5_core_NodeSetIter *)__pyx_v_self), __pyx_v___pyx_state);

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

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

  /* "(tree fragment)":4
 *     raise TypeError, "self._curIter,self._nodes cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._curIter,self._nodes cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self__curIter_self__nodes_cannot, 0, 0);
  __PYX_ERR(1, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._curIter,self._nodes cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._curIter,self._nodes cannot be converted to a Python object for pickling"
*/

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

/* "opendht.pyx":354
 * cdef class NodeSet(object):
 *     cdef map[cpp.InfoHash, shared_ptr[cpp.Node]] _nodes
 *     def size(self):             # <<<<<<<<<<<<<<
 *         return self._nodes.size()
 *     def insert(self, NodeEntry l):
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_7NodeSet_1size(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_7NodeSet_1size = {"size", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_7NodeSet_1size, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_7NodeSet_1size(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("size (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("size", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("size", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7opendht_5_core_7NodeSet_size(((struct __pyx_obj_7opendht_5_core_NodeSet *)__pyx_v_self));

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

static PyObject *__pyx_pf_7opendht_5_core_7NodeSet_size(struct __pyx_obj_7opendht_5_core_NodeSet *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("size", 0);

  /* "opendht.pyx":355
 *     cdef map[cpp.InfoHash, shared_ptr[cpp.Node]] _nodes
 *     def size(self):
 *         return self._nodes.size()             # <<<<<<<<<<<<<<
 *     def insert(self, NodeEntry l):
 *         return self._nodes.insert(l._v).second
*/
  __pyx_t_1 = __Pyx_PyLong_FromSize_t(__pyx_v_self->_nodes.size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 355, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_1;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "opendht.pyx":354
 * cdef class NodeSet(object):
 *     cdef map[cpp.InfoHash, shared_ptr[cpp.Node]] _nodes
 *     def size(self):             # <<<<<<<<<<<<<<
 *         return self._nodes.size()
 *     def insert(self, NodeEntry l):
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("opendht._core.NodeSet.size", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":356
 *     def size(self):
 *         return self._nodes.size()
 *     def insert(self, NodeEntry l):             # <<<<<<<<<<<<<<
 *         return self._nodes.insert(l._v).second
 *     def extend(self, li):
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_7NodeSet_3insert(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_7NodeSet_3insert = {"insert", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_7NodeSet_3insert, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_7NodeSet_3insert(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_7opendht_5_core_NodeEntry *__pyx_v_l = 0;
  #if !CYTHON_VECTORCALL
  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("insert (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_l,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 356, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 356, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "insert", 0) < (0)) __PYX_ERR(0, 356, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("insert", 1, 1, 1, i); __PYX_ERR(0, 356, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 356, __pyx_L3_error)
    }
    __pyx_v_l = ((struct __pyx_obj_7opendht_5_core_NodeEntry *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("insert", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 356, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.NodeSet.insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_l), __pyx_mstate_global->__pyx_ptype_7opendht_5_core_NodeEntry, 1, "l", 0))) __PYX_ERR(0, 356, __pyx_L1_error)
  __pyx_r = __pyx_pf_7opendht_5_core_7NodeSet_2insert(((struct __pyx_obj_7opendht_5_core_NodeSet *)__pyx_v_self), __pyx_v_l);

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

static PyObject *__pyx_pf_7opendht_5_core_7NodeSet_2insert(struct __pyx_obj_7opendht_5_core_NodeSet *__pyx_v_self, struct __pyx_obj_7opendht_5_core_NodeEntry *__pyx_v_l) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::pair<std::map<dht::InfoHash,std::shared_ptr<dht::Node> > ::iterator,int>  __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("insert", 0);

  /* "opendht.pyx":357
 *         return self._nodes.size()
 *     def insert(self, NodeEntry l):
 *         return self._nodes.insert(l._v).second             # <<<<<<<<<<<<<<
 *     def extend(self, li):
 *         for n in li:
*/
  try {
    __pyx_t_1 = __pyx_v_self->_nodes.insert(__pyx_v_l->_v);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(0, 357, __pyx_L1_error)
  }
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1.second); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 357, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_2;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "opendht.pyx":356
 *     def size(self):
 *         return self._nodes.size()
 *     def insert(self, NodeEntry l):             # <<<<<<<<<<<<<<
 *         return self._nodes.insert(l._v).second
 *     def extend(self, li):
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("opendht._core.NodeSet.insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":358
 *     def insert(self, NodeEntry l):
 *         return self._nodes.insert(l._v).second
 *     def extend(self, li):             # <<<<<<<<<<<<<<
 *         for n in li:
 *             self.insert(n)
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_7NodeSet_5extend(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_7NodeSet_5extend = {"extend", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_7NodeSet_5extend, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_7NodeSet_5extend(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_li = 0;
  #if !CYTHON_VECTORCALL
  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("extend (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_li,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 358, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 358, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "extend", 0) < (0)) __PYX_ERR(0, 358, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("extend", 1, 1, 1, i); __PYX_ERR(0, 358, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 358, __pyx_L3_error)
    }
    __pyx_v_li = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("extend", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 358, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.NodeSet.extend", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7opendht_5_core_7NodeSet_4extend(((struct __pyx_obj_7opendht_5_core_NodeSet *)__pyx_v_self), __pyx_v_li);

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

static PyObject *__pyx_pf_7opendht_5_core_7NodeSet_4extend(struct __pyx_obj_7opendht_5_core_NodeSet *__pyx_v_self, PyObject *__pyx_v_li) {
  PyObject *__pyx_v_n = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("extend", 0);

  /* "opendht.pyx":359
 *         return self._nodes.insert(l._v).second
 *     def extend(self, li):
 *         for n in li:             # <<<<<<<<<<<<<<
 *             self.insert(n)
 *     def first(self):
*/
  if (likely(PyList_CheckExact(__pyx_v_li)) || PyTuple_CheckExact(__pyx_v_li)) {
    __pyx_t_1 = __pyx_v_li; __Pyx_INCREF(__pyx_t_1);
    __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_li); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 359, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 359, __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_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 359, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference);
        ++__pyx_t_2;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 359, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2));
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2);
        #endif
        ++__pyx_t_2;
      }
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 359, __pyx_L1_error)
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 359, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "opendht.pyx":360
 *     def extend(self, li):
 *         for n in li:
 *             self.insert(n)             # <<<<<<<<<<<<<<
 *     def first(self):
 *         if self._nodes.empty():
*/
    __pyx_t_5 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_5);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_n};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_insert, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 360, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "opendht.pyx":359
 *         return self._nodes.insert(l._v).second
 *     def extend(self, li):
 *         for n in li:             # <<<<<<<<<<<<<<
 *             self.insert(n)
 *     def first(self):
*/
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opendht.pyx":358
 *     def insert(self, NodeEntry l):
 *         return self._nodes.insert(l._v).second
 *     def extend(self, li):             # <<<<<<<<<<<<<<
 *         for n in li:
 *             self.insert(n)
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("opendht._core.NodeSet.extend", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_n);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":361
 *         for n in li:
 *             self.insert(n)
 *     def first(self):             # <<<<<<<<<<<<<<
 *         if self._nodes.empty():
 *             raise IndexError()
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_7NodeSet_7first(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_7NodeSet_7first = {"first", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_7NodeSet_7first, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_7NodeSet_7first(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("first (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("first", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("first", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7opendht_5_core_7NodeSet_6first(((struct __pyx_obj_7opendht_5_core_NodeSet *)__pyx_v_self));

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

static PyObject *__pyx_pf_7opendht_5_core_7NodeSet_6first(struct __pyx_obj_7opendht_5_core_NodeSet *__pyx_v_self) {
  struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_v_h = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  dht::InfoHash __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("first", 0);

  /* "opendht.pyx":362
 *             self.insert(n)
 *     def first(self):
 *         if self._nodes.empty():             # <<<<<<<<<<<<<<
 *             raise IndexError()
 *         h = InfoHash()
*/
  __pyx_t_1 = __pyx_v_self->_nodes.empty();

  if (unlikely(__pyx_t_1)) {


    /* "opendht.pyx":363
 *     def first(self):
 *         if self._nodes.empty():
 *             raise IndexError()             # <<<<<<<<<<<<<<
 *         h = InfoHash()
 *         h._infohash = deref(self._nodes.begin()).first
*/
    __pyx_t_3 = NULL;
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_IndexError)), __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 363, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 363, __pyx_L1_error)

    /* "opendht.pyx":362
 *             self.insert(n)
 *     def first(self):
 *         if self._nodes.empty():             # <<<<<<<<<<<<<<
 *             raise IndexError()
 *         h = InfoHash()
*/
  }

  /* "opendht.pyx":364
 *         if self._nodes.empty():
 *             raise IndexError()
 *         h = InfoHash()             # <<<<<<<<<<<<<<
 *         h._infohash = deref(self._nodes.begin()).first
 *         return h
*/
  __pyx_t_3 = NULL;
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7opendht_5_core_InfoHash, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 364, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_2);
  }
  __pyx_v_h = ((struct __pyx_obj_7opendht_5_core_InfoHash *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "opendht.pyx":365
 *             raise IndexError()
 *         h = InfoHash()
 *         h._infohash = deref(self._nodes.begin()).first             # <<<<<<<<<<<<<<
 *         return h
 *     def last(self):
*/
  __pyx_t_5 = (*__pyx_v_self->_nodes.begin()).first;

  __pyx_v_h->_infohash = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_5);

  /* "opendht.pyx":366
 *         h = InfoHash()
 *         h._infohash = deref(self._nodes.begin()).first
 *         return h             # <<<<<<<<<<<<<<
 *     def last(self):
 *         if self._nodes.empty():
*/
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __Pyx_INCREF((PyObject *)__pyx_v_h);
      __pyx_r = ((PyObject *)__pyx_v_h);
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  goto __pyx_L0;

  /* "opendht.pyx":361
 *         for n in li:
 *             self.insert(n)
 *     def first(self):             # <<<<<<<<<<<<<<
 *         if self._nodes.empty():
 *             raise IndexError()
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("opendht._core.NodeSet.first", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_h);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":367
 *         h._infohash = deref(self._nodes.begin()).first
 *         return h
 *     def last(self):             # <<<<<<<<<<<<<<
 *         if self._nodes.empty():
 *             raise IndexError()
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_7NodeSet_9last(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_7NodeSet_9last = {"last", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_7NodeSet_9last, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_7NodeSet_9last(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("last (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("last", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("last", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7opendht_5_core_7NodeSet_8last(((struct __pyx_obj_7opendht_5_core_NodeSet *)__pyx_v_self));

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

static PyObject *__pyx_pf_7opendht_5_core_7NodeSet_8last(struct __pyx_obj_7opendht_5_core_NodeSet *__pyx_v_self) {
  struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_v_h = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  dht::InfoHash __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("last", 0);

  /* "opendht.pyx":368
 *         return h
 *     def last(self):
 *         if self._nodes.empty():             # <<<<<<<<<<<<<<
 *             raise IndexError()
 *         h = InfoHash()
*/
  __pyx_t_1 = __pyx_v_self->_nodes.empty();

  if (unlikely(__pyx_t_1)) {


    /* "opendht.pyx":369
 *     def last(self):
 *         if self._nodes.empty():
 *             raise IndexError()             # <<<<<<<<<<<<<<
 *         h = InfoHash()
 *         h._infohash = deref(dec(self._nodes.end())).first
*/
    __pyx_t_3 = NULL;
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_IndexError)), __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 369, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 369, __pyx_L1_error)

    /* "opendht.pyx":368
 *         return h
 *     def last(self):
 *         if self._nodes.empty():             # <<<<<<<<<<<<<<
 *             raise IndexError()
 *         h = InfoHash()
*/
  }

  /* "opendht.pyx":370
 *         if self._nodes.empty():
 *             raise IndexError()
 *         h = InfoHash()             # <<<<<<<<<<<<<<
 *         h._infohash = deref(dec(self._nodes.end())).first
 *         return h
*/
  __pyx_t_3 = NULL;
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7opendht_5_core_InfoHash, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 370, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_2);
  }
  __pyx_v_h = ((struct __pyx_obj_7opendht_5_core_InfoHash *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "opendht.pyx":371
 *             raise IndexError()
 *         h = InfoHash()
 *         h._infohash = deref(dec(self._nodes.end())).first             # <<<<<<<<<<<<<<
 *         return h
 *     def __str__(self):
*/
  __pyx_t_5 = (*(--__pyx_v_self->_nodes.end())).first;

  __pyx_v_h->_infohash = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_5);

  /* "opendht.pyx":372
 *         h = InfoHash()
 *         h._infohash = deref(dec(self._nodes.end())).first
 *         return h             # <<<<<<<<<<<<<<
 *     def __str__(self):
 *         s = ''
*/
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __Pyx_INCREF((PyObject *)__pyx_v_h);
      __pyx_r = ((PyObject *)__pyx_v_h);
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  goto __pyx_L0;

  /* "opendht.pyx":367
 *         h._infohash = deref(self._nodes.begin()).first
 *         return h
 *     def last(self):             # <<<<<<<<<<<<<<
 *         if self._nodes.empty():
 *             raise IndexError()
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("opendht._core.NodeSet.last", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_h);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":373
 *         h._infohash = deref(dec(self._nodes.end())).first
 *         return h
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         s = ''
 *         cdef map[cpp.InfoHash, shared_ptr[cpp.Node]].iterator it = self._nodes.begin()
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_7NodeSet_11__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7opendht_5_core_7NodeSet_11__str__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7opendht_5_core_7NodeSet_10__str__(((struct __pyx_obj_7opendht_5_core_NodeSet *)__pyx_v_self));

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

static PyObject *__pyx_pf_7opendht_5_core_7NodeSet_10__str__(struct __pyx_obj_7opendht_5_core_NodeSet *__pyx_v_self) {
  PyObject *__pyx_v_s = NULL;
  std::map<dht::InfoHash,std::shared_ptr<dht::Node> > ::iterator __pyx_v_it;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__str__", 0);

  /* "opendht.pyx":374
 *         return h
 *     def __str__(self):
 *         s = ''             # <<<<<<<<<<<<<<
 *         cdef map[cpp.InfoHash, shared_ptr[cpp.Node]].iterator it = self._nodes.begin()
 *         while it != self._nodes.end():
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__5);
  __pyx_v_s = __pyx_mstate_global->__pyx_kp_u__5;

  /* "opendht.pyx":375
 *     def __str__(self):
 *         s = ''
 *         cdef map[cpp.InfoHash, shared_ptr[cpp.Node]].iterator it = self._nodes.begin()             # <<<<<<<<<<<<<<
 *         while it != self._nodes.end():
 *             s += deref(it).first.toString().decode() + ' ' + deref(it).second.get().getAddrStr().decode() + '\n'
*/
  __pyx_v_it = __pyx_v_self->_nodes.begin();

  /* "opendht.pyx":376
 *         s = ''
 *         cdef map[cpp.InfoHash, shared_ptr[cpp.Node]].iterator it = self._nodes.begin()
 *         while it != self._nodes.end():             # <<<<<<<<<<<<<<
 *             s += deref(it).first.toString().decode() + ' ' + deref(it).second.get().getAddrStr().decode() + '\n'
 *             inc(it)
*/
  while (1) {
    __pyx_t_1 = (__pyx_v_it != __pyx_v_self->_nodes.end());


    if (!__pyx_t_1) break;

    /* "opendht.pyx":377
 *         cdef map[cpp.InfoHash, shared_ptr[cpp.Node]].iterator it = self._nodes.begin()
 *         while it != self._nodes.end():
 *             s += deref(it).first.toString().decode() + ' ' + deref(it).second.get().getAddrStr().decode() + '\n'             # <<<<<<<<<<<<<<
 *             inc(it)
 *         return s
*/
    __pyx_t_2 = __Pyx_decode_cpp_string((*__pyx_v_it).first.toString(), 0, PY_SSIZE_T_MAX, NULL, NULL, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 377, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlace(__pyx_t_2, __pyx_mstate_global->__pyx_kp_u__6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 377, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_decode_cpp_string((*__pyx_v_it).second.get()->getAddrStr(), 0, PY_SSIZE_T_MAX, NULL, NULL, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 377, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlace(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 377, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlace(__pyx_t_4, __pyx_mstate_global->__pyx_kp_u__7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 377, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_s, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 377, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF_SET(__pyx_v_s, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "opendht.pyx":378
 *         while it != self._nodes.end():
 *             s += deref(it).first.toString().decode() + ' ' + deref(it).second.get().getAddrStr().decode() + '\n'
 *             inc(it)             # <<<<<<<<<<<<<<
 *         return s
 *     def __iter__(self):
*/
    (void)((++__pyx_v_it));
  }

  /* "opendht.pyx":379
 *             s += deref(it).first.toString().decode() + ' ' + deref(it).second.get().getAddrStr().decode() + '\n'
 *             inc(it)
 *         return s             # <<<<<<<<<<<<<<
 *     def __iter__(self):
 *         return NodeSetIter(self)
*/
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __Pyx_INCREF(__pyx_v_s);
      __pyx_r = __pyx_v_s;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  goto __pyx_L0;

  /* "opendht.pyx":373
 *         h._infohash = deref(dec(self._nodes.end())).first
 *         return h
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         s = ''
 *         cdef map[cpp.InfoHash, shared_ptr[cpp.Node]].iterator it = self._nodes.begin()
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("opendht._core.NodeSet.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_s);

  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":380
 *             inc(it)
 *         return s
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return NodeSetIter(self)
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_7NodeSet_13__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7opendht_5_core_7NodeSet_13__iter__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7opendht_5_core_7NodeSet_12__iter__(((struct __pyx_obj_7opendht_5_core_NodeSet *)__pyx_v_self));

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

static PyObject *__pyx_pf_7opendht_5_core_7NodeSet_12__iter__(struct __pyx_obj_7opendht_5_core_NodeSet *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__iter__", 0);

  /* "opendht.pyx":381
 *         return s
 *     def __iter__(self):
 *         return NodeSetIter(self)             # <<<<<<<<<<<<<<
 * 
 * cdef class PrivateKey(_WithPk):
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, ((PyObject *)__pyx_v_self)};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7opendht_5_core_NodeSetIter, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 381, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = ((PyObject *)__pyx_t_1);
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "opendht.pyx":380
 *             inc(it)
 *         return s
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return NodeSetIter(self)
 * 
*/

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

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._nodes cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_7NodeSet_15__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_7NodeSet_15__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_7NodeSet_15__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_7NodeSet_15__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7opendht_5_core_7NodeSet_14__reduce_cython__(((struct __pyx_obj_7opendht_5_core_NodeSet *)__pyx_v_self));

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

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

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "self._nodes cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._nodes cannot be converted to a Python object for pickling"
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self__nodes_cannot_be_converted, 0, 0);
  __PYX_ERR(1, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._nodes cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/

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

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._nodes cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._nodes cannot be converted to a Python object for pickling"
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_7NodeSet_17__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_7NodeSet_17__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_7NodeSet_17__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_7NodeSet_17__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(1, 3, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.NodeSet.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7opendht_5_core_7NodeSet_16__setstate_cython__(((struct __pyx_obj_7opendht_5_core_NodeSet *)__pyx_v_self), __pyx_v___pyx_state);

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

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

  /* "(tree fragment)":4
 *     raise TypeError, "self._nodes cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._nodes cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self__nodes_cannot_be_converted, 0, 0);
  __PYX_ERR(1, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._nodes cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._nodes cannot be converted to a Python object for pickling"
*/

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

/* "opendht.pyx":386
 *     cdef shared_ptr[cpp.PrivateKey] _key
 * 
 *     def getId(self) -> InfoHash:             # <<<<<<<<<<<<<<
 *         if not self._key:
 *             raise ValueError("PrivateKey is not initialized")
*/

/* Python wrapper */
static struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_pw_7opendht_5_core_10PrivateKey_1getId(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_10PrivateKey_1getId = {"getId", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_10PrivateKey_1getId, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_pw_7opendht_5_core_10PrivateKey_1getId(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getId (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getId", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getId", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7opendht_5_core_10PrivateKey_getId(((struct __pyx_obj_7opendht_5_core_PrivateKey *)__pyx_v_self));

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

static struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_pf_7opendht_5_core_10PrivateKey_getId(struct __pyx_obj_7opendht_5_core_PrivateKey *__pyx_v_self) {
  struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_v_h = NULL;
  struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getId", 0);

  /* "opendht.pyx":387
 * 
 *     def getId(self) -> InfoHash:
 *         if not self._key:             # <<<<<<<<<<<<<<
 *             raise ValueError("PrivateKey is not initialized")
 *         h = InfoHash()
*/
  __pyx_t_1 = ((!__pyx_v_self->_key) != 0);

  if (unlikely(__pyx_t_1)) {


    /* "opendht.pyx":388
 *     def getId(self) -> InfoHash:
 *         if not self._key:
 *             raise ValueError("PrivateKey is not initialized")             # <<<<<<<<<<<<<<
 *         h = InfoHash()
 *         h._infohash = self._key.get().getSharedPublicKey().get().getId()
*/
    __pyx_t_3 = NULL;
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_PrivateKey_is_not_initialized};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 388, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 388, __pyx_L1_error)

    /* "opendht.pyx":387
 * 
 *     def getId(self) -> InfoHash:
 *         if not self._key:             # <<<<<<<<<<<<<<
 *             raise ValueError("PrivateKey is not initialized")
 *         h = InfoHash()
*/
  }

  /* "opendht.pyx":389
 *         if not self._key:
 *             raise ValueError("PrivateKey is not initialized")
 *         h = InfoHash()             # <<<<<<<<<<<<<<
 *         h._infohash = self._key.get().getSharedPublicKey().get().getId()
 *         return h
*/
  __pyx_t_3 = NULL;
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7opendht_5_core_InfoHash, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 389, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_2);
  }
  __pyx_v_h = ((struct __pyx_obj_7opendht_5_core_InfoHash *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "opendht.pyx":390
 *             raise ValueError("PrivateKey is not initialized")
 *         h = InfoHash()
 *         h._infohash = self._key.get().getSharedPublicKey().get().getId()             # <<<<<<<<<<<<<<
 *         return h
 * 
*/
  __pyx_v_h->_infohash = __pyx_v_self->_key.get()->getSharedPublicKey().get()->getId();

  /* "opendht.pyx":391
 *         h = InfoHash()
 *         h._infohash = self._key.get().getSharedPublicKey().get().getId()
 *         return h             # <<<<<<<<<<<<<<
 * 
 *     def getLongId(self) -> PkId:
*/
  {
    struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __Pyx_INCREF((PyObject *)__pyx_v_h);
      __pyx_r = __pyx_v_h;
    }
    __Pyx_XDECREF((PyObject *)__pyx_temp);
  }
  goto __pyx_L0;

  /* "opendht.pyx":386
 *     cdef shared_ptr[cpp.PrivateKey] _key
 * 
 *     def getId(self) -> InfoHash:             # <<<<<<<<<<<<<<
 *         if not self._key:
 *             raise ValueError("PrivateKey is not initialized")
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("opendht._core.PrivateKey.getId", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_h);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":393
 *         return h
 * 
 *     def getLongId(self) -> PkId:             # <<<<<<<<<<<<<<
 *         if not self._key:
 *             raise ValueError("PrivateKey is not initialized")
*/

/* Python wrapper */
static struct __pyx_obj_7opendht_5_core_PkId *__pyx_pw_7opendht_5_core_10PrivateKey_3getLongId(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_10PrivateKey_3getLongId = {"getLongId", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_10PrivateKey_3getLongId, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static struct __pyx_obj_7opendht_5_core_PkId *__pyx_pw_7opendht_5_core_10PrivateKey_3getLongId(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  struct __pyx_obj_7opendht_5_core_PkId *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getLongId (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getLongId", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getLongId", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7opendht_5_core_10PrivateKey_2getLongId(((struct __pyx_obj_7opendht_5_core_PrivateKey *)__pyx_v_self));

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

static struct __pyx_obj_7opendht_5_core_PkId *__pyx_pf_7opendht_5_core_10PrivateKey_2getLongId(struct __pyx_obj_7opendht_5_core_PrivateKey *__pyx_v_self) {
  struct __pyx_obj_7opendht_5_core_PkId *__pyx_v_id = NULL;
  struct __pyx_obj_7opendht_5_core_PkId *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getLongId", 0);

  /* "opendht.pyx":394
 * 
 *     def getLongId(self) -> PkId:
 *         if not self._key:             # <<<<<<<<<<<<<<
 *             raise ValueError("PrivateKey is not initialized")
 *         id = PkId()
*/
  __pyx_t_1 = ((!__pyx_v_self->_key) != 0);

  if (unlikely(__pyx_t_1)) {


    /* "opendht.pyx":395
 *     def getLongId(self) -> PkId:
 *         if not self._key:
 *             raise ValueError("PrivateKey is not initialized")             # <<<<<<<<<<<<<<
 *         id = PkId()
 *         id._pkid = self._key.get().getSharedPublicKey().get().getLongId()
*/
    __pyx_t_3 = NULL;
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_PrivateKey_is_not_initialized};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 395, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 395, __pyx_L1_error)

    /* "opendht.pyx":394
 * 
 *     def getLongId(self) -> PkId:
 *         if not self._key:             # <<<<<<<<<<<<<<
 *             raise ValueError("PrivateKey is not initialized")
 *         id = PkId()
*/
  }

  /* "opendht.pyx":396
 *         if not self._key:
 *             raise ValueError("PrivateKey is not initialized")
 *         id = PkId()             # <<<<<<<<<<<<<<
 *         id._pkid = self._key.get().getSharedPublicKey().get().getLongId()
 *         return id
*/
  __pyx_t_3 = NULL;
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7opendht_5_core_PkId, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 396, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_2);
  }
  __pyx_v_id = ((struct __pyx_obj_7opendht_5_core_PkId *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "opendht.pyx":397
 *             raise ValueError("PrivateKey is not initialized")
 *         id = PkId()
 *         id._pkid = self._key.get().getSharedPublicKey().get().getLongId()             # <<<<<<<<<<<<<<
 *         return id
 * 
*/
  __pyx_v_id->_pkid = __pyx_v_self->_key.get()->getSharedPublicKey().get()->getLongId();

  /* "opendht.pyx":398
 *         id = PkId()
 *         id._pkid = self._key.get().getSharedPublicKey().get().getLongId()
 *         return id             # <<<<<<<<<<<<<<
 * 
 *     def getPublicKey(self) -> PublicKey:
*/
  {
    struct __pyx_obj_7opendht_5_core_PkId *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __Pyx_INCREF((PyObject *)__pyx_v_id);
      __pyx_r = __pyx_v_id;
    }
    __Pyx_XDECREF((PyObject *)__pyx_temp);
  }
  goto __pyx_L0;

  /* "opendht.pyx":393
 *         return h
 * 
 *     def getLongId(self) -> PkId:             # <<<<<<<<<<<<<<
 *         if not self._key:
 *             raise ValueError("PrivateKey is not initialized")
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("opendht._core.PrivateKey.getLongId", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_id);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":400
 *         return id
 * 
 *     def getPublicKey(self) -> PublicKey:             # <<<<<<<<<<<<<<
 *         if not self._key:
 *             raise ValueError("PrivateKey is not initialized")
*/

/* Python wrapper */
static struct __pyx_obj_7opendht_5_core_PublicKey *__pyx_pw_7opendht_5_core_10PrivateKey_5getPublicKey(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_10PrivateKey_5getPublicKey = {"getPublicKey", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_10PrivateKey_5getPublicKey, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static struct __pyx_obj_7opendht_5_core_PublicKey *__pyx_pw_7opendht_5_core_10PrivateKey_5getPublicKey(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  struct __pyx_obj_7opendht_5_core_PublicKey *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getPublicKey (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getPublicKey", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getPublicKey", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7opendht_5_core_10PrivateKey_4getPublicKey(((struct __pyx_obj_7opendht_5_core_PrivateKey *)__pyx_v_self));

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

static struct __pyx_obj_7opendht_5_core_PublicKey *__pyx_pf_7opendht_5_core_10PrivateKey_4getPublicKey(struct __pyx_obj_7opendht_5_core_PrivateKey *__pyx_v_self) {
  struct __pyx_obj_7opendht_5_core_PublicKey *__pyx_v_pk = NULL;
  struct __pyx_obj_7opendht_5_core_PublicKey *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getPublicKey", 0);

  /* "opendht.pyx":401
 * 
 *     def getPublicKey(self) -> PublicKey:
 *         if not self._key:             # <<<<<<<<<<<<<<
 *             raise ValueError("PrivateKey is not initialized")
 *         pk = PublicKey()
*/
  __pyx_t_1 = ((!__pyx_v_self->_key) != 0);

  if (unlikely(__pyx_t_1)) {


    /* "opendht.pyx":402
 *     def getPublicKey(self) -> PublicKey:
 *         if not self._key:
 *             raise ValueError("PrivateKey is not initialized")             # <<<<<<<<<<<<<<
 *         pk = PublicKey()
 *         pk._key = self._key.get().getSharedPublicKey()
*/
    __pyx_t_3 = NULL;
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_PrivateKey_is_not_initialized};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 402, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 402, __pyx_L1_error)

    /* "opendht.pyx":401
 * 
 *     def getPublicKey(self) -> PublicKey:
 *         if not self._key:             # <<<<<<<<<<<<<<
 *             raise ValueError("PrivateKey is not initialized")
 *         pk = PublicKey()
*/
  }

  /* "opendht.pyx":403
 *         if not self._key:
 *             raise ValueError("PrivateKey is not initialized")
 *         pk = PublicKey()             # <<<<<<<<<<<<<<
 *         pk._key = self._key.get().getSharedPublicKey()
 *         return pk
*/
  __pyx_t_3 = NULL;
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7opendht_5_core_PublicKey, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 403, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_2);
  }
  __pyx_v_pk = ((struct __pyx_obj_7opendht_5_core_PublicKey *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "opendht.pyx":404
 *             raise ValueError("PrivateKey is not initialized")
 *         pk = PublicKey()
 *         pk._key = self._key.get().getSharedPublicKey()             # <<<<<<<<<<<<<<
 *         return pk
 * 
*/
  __pyx_v_pk->_key = __pyx_v_self->_key.get()->getSharedPublicKey();

  /* "opendht.pyx":405
 *         pk = PublicKey()
 *         pk._key = self._key.get().getSharedPublicKey()
 *         return pk             # <<<<<<<<<<<<<<
 * 
 *     def decrypt(self, bytes dat) -> bytes:
*/
  {
    struct __pyx_obj_7opendht_5_core_PublicKey *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __Pyx_INCREF((PyObject *)__pyx_v_pk);
      __pyx_r = __pyx_v_pk;
    }
    __Pyx_XDECREF((PyObject *)__pyx_temp);
  }
  goto __pyx_L0;

  /* "opendht.pyx":400
 *         return id
 * 
 *     def getPublicKey(self) -> PublicKey:             # <<<<<<<<<<<<<<
 *         if not self._key:
 *             raise ValueError("PrivateKey is not initialized")
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("opendht._core.PrivateKey.getPublicKey", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_pk);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":407
 *         return pk
 * 
 *     def decrypt(self, bytes dat) -> bytes:             # <<<<<<<<<<<<<<
 *         cdef size_t d_len = len(dat)
 *         cdef cpp.uint8_t* d_ptr = <cpp.uint8_t*>dat
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_10PrivateKey_7decrypt(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_10PrivateKey_7decrypt = {"decrypt", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_10PrivateKey_7decrypt, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_10PrivateKey_7decrypt(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_dat = 0;
  #if !CYTHON_VECTORCALL
  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("decrypt (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_dat,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 407, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 407, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "decrypt", 0) < (0)) __PYX_ERR(0, 407, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("decrypt", 1, 1, 1, i); __PYX_ERR(0, 407, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 407, __pyx_L3_error)
    }
    __pyx_v_dat = ((PyObject*)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("decrypt", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 407, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.PrivateKey.decrypt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dat), (&PyBytes_Type), 1, "dat", 1))) __PYX_ERR(0, 407, __pyx_L1_error)
  __pyx_r = __pyx_pf_7opendht_5_core_10PrivateKey_6decrypt(((struct __pyx_obj_7opendht_5_core_PrivateKey *)__pyx_v_self), __pyx_v_dat);

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

static PyObject *__pyx_pf_7opendht_5_core_10PrivateKey_6decrypt(struct __pyx_obj_7opendht_5_core_PrivateKey *__pyx_v_self, PyObject *__pyx_v_dat) {
  size_t __pyx_v_d_len;
  uint8_t *__pyx_v_d_ptr;
  __pyx_t_11opendht_cpp_Blob __pyx_v_indat;
  __pyx_t_11opendht_cpp_Blob __pyx_v_decrypted;
  char *__pyx_v_decrypted_c_str;
  Py_ssize_t __pyx_v_length;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  uint8_t *__pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("decrypt", 0);

  /* "opendht.pyx":408
 * 
 *     def decrypt(self, bytes dat) -> bytes:
 *         cdef size_t d_len = len(dat)             # <<<<<<<<<<<<<<
 *         cdef cpp.uint8_t* d_ptr = <cpp.uint8_t*>dat
 *         cdef cpp.Blob indat
*/
  if (unlikely(__pyx_v_dat == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type \047NoneType\047 has no len()");
    __PYX_ERR(0, 408, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_PyBytes_GET_SIZE(__pyx_v_dat); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 408, __pyx_L1_error)
  __pyx_v_d_len = __pyx_t_1;

  /* "opendht.pyx":409
 *     def decrypt(self, bytes dat) -> bytes:
 *         cdef size_t d_len = len(dat)
 *         cdef cpp.uint8_t* d_ptr = <cpp.uint8_t*>dat             # <<<<<<<<<<<<<<
 *         cdef cpp.Blob indat
 *         indat.assign(d_ptr, <cpp.uint8_t*>(d_ptr + d_len))
*/
  if (unlikely(__pyx_v_dat == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
    __PYX_ERR(0, 409, __pyx_L1_error)
  }
  __pyx_t_2 = __Pyx_PyBytes_AsWritableUString(__pyx_v_dat); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 409, __pyx_L1_error)
  __pyx_v_d_ptr = ((uint8_t *)__pyx_t_2);


  /* "opendht.pyx":411
 *         cdef cpp.uint8_t* d_ptr = <cpp.uint8_t*>dat
 *         cdef cpp.Blob indat
 *         indat.assign(d_ptr, <cpp.uint8_t*>(d_ptr + d_len))             # <<<<<<<<<<<<<<
 *         cdef cpp.Blob decrypted = self._key.get().decrypt(indat)
 *         cdef char* decrypted_c_str = <char *>decrypted.data()
*/
  try {
    __pyx_v_indat.assign(__pyx_v_d_ptr, ((uint8_t *)(__pyx_v_d_ptr + __pyx_v_d_len)));
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(0, 411, __pyx_L1_error)
  }

  /* "opendht.pyx":412
 *         cdef cpp.Blob indat
 *         indat.assign(d_ptr, <cpp.uint8_t*>(d_ptr + d_len))
 *         cdef cpp.Blob decrypted = self._key.get().decrypt(indat)             # <<<<<<<<<<<<<<
 *         cdef char* decrypted_c_str = <char *>decrypted.data()
 *         cdef Py_ssize_t length = decrypted.size()
*/
  __pyx_v_decrypted = __pyx_v_self->_key.get()->decrypt(__pyx_v_indat);

  /* "opendht.pyx":413
 *         indat.assign(d_ptr, <cpp.uint8_t*>(d_ptr + d_len))
 *         cdef cpp.Blob decrypted = self._key.get().decrypt(indat)
 *         cdef char* decrypted_c_str = <char *>decrypted.data()             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t length = decrypted.size()
 *         return decrypted_c_str[:length]
*/
  __pyx_v_decrypted_c_str = ((char *)__pyx_v_decrypted.data());

  /* "opendht.pyx":414
 *         cdef cpp.Blob decrypted = self._key.get().decrypt(indat)
 *         cdef char* decrypted_c_str = <char *>decrypted.data()
 *         cdef Py_ssize_t length = decrypted.size()             # <<<<<<<<<<<<<<
 *         return decrypted_c_str[:length]
 * 
*/
  __pyx_v_length = __pyx_v_decrypted.size();

  /* "opendht.pyx":415
 *         cdef char* decrypted_c_str = <char *>decrypted.data()
 *         cdef Py_ssize_t length = decrypted.size()
 *         return decrypted_c_str[:length]             # <<<<<<<<<<<<<<
 * 
 *     def sign(self, bytes dat) -> bytes:
*/
  __pyx_t_3 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_decrypted_c_str + 0, __pyx_v_length - 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 415, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = ((PyObject*)__pyx_t_3);
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "opendht.pyx":407
 *         return pk
 * 
 *     def decrypt(self, bytes dat) -> bytes:             # <<<<<<<<<<<<<<
 *         cdef size_t d_len = len(dat)
 *         cdef cpp.uint8_t* d_ptr = <cpp.uint8_t*>dat
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("opendht._core.PrivateKey.decrypt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;






  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":417
 *         return decrypted_c_str[:length]
 * 
 *     def sign(self, bytes dat) -> bytes:             # <<<<<<<<<<<<<<
 *         if not self._key:
 *             raise ValueError("PrivateKey is not initialized")
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_10PrivateKey_9sign(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_10PrivateKey_9sign = {"sign", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_10PrivateKey_9sign, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_10PrivateKey_9sign(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_dat = 0;
  #if !CYTHON_VECTORCALL
  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("sign (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_dat,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 417, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 417, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "sign", 0) < (0)) __PYX_ERR(0, 417, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("sign", 1, 1, 1, i); __PYX_ERR(0, 417, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 417, __pyx_L3_error)
    }
    __pyx_v_dat = ((PyObject*)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sign", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 417, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.PrivateKey.sign", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dat), (&PyBytes_Type), 1, "dat", 1))) __PYX_ERR(0, 417, __pyx_L1_error)
  __pyx_r = __pyx_pf_7opendht_5_core_10PrivateKey_8sign(((struct __pyx_obj_7opendht_5_core_PrivateKey *)__pyx_v_self), __pyx_v_dat);

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

static PyObject *__pyx_pf_7opendht_5_core_10PrivateKey_8sign(struct __pyx_obj_7opendht_5_core_PrivateKey *__pyx_v_self, PyObject *__pyx_v_dat) {
  size_t __pyx_v_d_len;
  uint8_t *__pyx_v_d_ptr;
  __pyx_t_11opendht_cpp_Blob __pyx_v_indat;
  __pyx_t_11opendht_cpp_Blob __pyx_v_signature;
  char *__pyx_v_signature_c_str;
  Py_ssize_t __pyx_v_length;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  uint8_t *__pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("sign", 0);

  /* "opendht.pyx":418
 * 
 *     def sign(self, bytes dat) -> bytes:
 *         if not self._key:             # <<<<<<<<<<<<<<
 *             raise ValueError("PrivateKey is not initialized")
 *         cdef size_t d_len = len(dat)
*/
  __pyx_t_1 = ((!__pyx_v_self->_key) != 0);

  if (unlikely(__pyx_t_1)) {


    /* "opendht.pyx":419
 *     def sign(self, bytes dat) -> bytes:
 *         if not self._key:
 *             raise ValueError("PrivateKey is not initialized")             # <<<<<<<<<<<<<<
 *         cdef size_t d_len = len(dat)
 *         cdef cpp.uint8_t* d_ptr = <cpp.uint8_t*>dat
*/
    __pyx_t_3 = NULL;
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_PrivateKey_is_not_initialized};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 419, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 419, __pyx_L1_error)

    /* "opendht.pyx":418
 * 
 *     def sign(self, bytes dat) -> bytes:
 *         if not self._key:             # <<<<<<<<<<<<<<
 *             raise ValueError("PrivateKey is not initialized")
 *         cdef size_t d_len = len(dat)
*/
  }

  /* "opendht.pyx":420
 *         if not self._key:
 *             raise ValueError("PrivateKey is not initialized")
 *         cdef size_t d_len = len(dat)             # <<<<<<<<<<<<<<
 *         cdef cpp.uint8_t* d_ptr = <cpp.uint8_t*>dat
 *         cdef cpp.Blob indat
*/
  if (unlikely(__pyx_v_dat == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type \047NoneType\047 has no len()");
    __PYX_ERR(0, 420, __pyx_L1_error)
  }
  __pyx_t_5 = __Pyx_PyBytes_GET_SIZE(__pyx_v_dat); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 420, __pyx_L1_error)
  __pyx_v_d_len = __pyx_t_5;

  /* "opendht.pyx":421
 *             raise ValueError("PrivateKey is not initialized")
 *         cdef size_t d_len = len(dat)
 *         cdef cpp.uint8_t* d_ptr = <cpp.uint8_t*>dat             # <<<<<<<<<<<<<<
 *         cdef cpp.Blob indat
 *         indat.assign(d_ptr, <cpp.uint8_t*>(d_ptr + d_len))
*/
  if (unlikely(__pyx_v_dat == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
    __PYX_ERR(0, 421, __pyx_L1_error)
  }
  __pyx_t_6 = __Pyx_PyBytes_AsWritableUString(__pyx_v_dat); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 421, __pyx_L1_error)
  __pyx_v_d_ptr = ((uint8_t *)__pyx_t_6);


  /* "opendht.pyx":423
 *         cdef cpp.uint8_t* d_ptr = <cpp.uint8_t*>dat
 *         cdef cpp.Blob indat
 *         indat.assign(d_ptr, <cpp.uint8_t*>(d_ptr + d_len))             # <<<<<<<<<<<<<<
 *         cdef cpp.Blob signature = self._key.get().sign(indat)
 *         cdef char* signature_c_str = <char *>signature.data()
*/
  try {
    __pyx_v_indat.assign(__pyx_v_d_ptr, ((uint8_t *)(__pyx_v_d_ptr + __pyx_v_d_len)));
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(0, 423, __pyx_L1_error)
  }

  /* "opendht.pyx":424
 *         cdef cpp.Blob indat
 *         indat.assign(d_ptr, <cpp.uint8_t*>(d_ptr + d_len))
 *         cdef cpp.Blob signature = self._key.get().sign(indat)             # <<<<<<<<<<<<<<
 *         cdef char* signature_c_str = <char *>signature.data()
 *         cdef Py_ssize_t length = signature.size()
*/
  __pyx_v_signature = __pyx_v_self->_key.get()->sign(__pyx_v_indat);

  /* "opendht.pyx":425
 *         indat.assign(d_ptr, <cpp.uint8_t*>(d_ptr + d_len))
 *         cdef cpp.Blob signature = self._key.get().sign(indat)
 *         cdef char* signature_c_str = <char *>signature.data()             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t length = signature.size()
 *         return signature_c_str[:length]
*/
  __pyx_v_signature_c_str = ((char *)__pyx_v_signature.data());

  /* "opendht.pyx":426
 *         cdef cpp.Blob signature = self._key.get().sign(indat)
 *         cdef char* signature_c_str = <char *>signature.data()
 *         cdef Py_ssize_t length = signature.size()             # <<<<<<<<<<<<<<
 *         return signature_c_str[:length]
 * 
*/
  __pyx_v_length = __pyx_v_signature.size();

  /* "opendht.pyx":427
 *         cdef char* signature_c_str = <char *>signature.data()
 *         cdef Py_ssize_t length = signature.size()
 *         return signature_c_str[:length]             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
*/
  __pyx_t_2 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_signature_c_str + 0, __pyx_v_length - 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 427, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = ((PyObject*)__pyx_t_2);
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "opendht.pyx":417
 *         return decrypted_c_str[:length]
 * 
 *     def sign(self, bytes dat) -> bytes:             # <<<<<<<<<<<<<<
 *         if not self._key:
 *             raise ValueError("PrivateKey is not initialized")
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("opendht._core.PrivateKey.sign", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;






  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":429
 *         return signature_c_str[:length]
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def generate() -> PrivateKey:
 *         k = PrivateKey()
*/

/* Python wrapper */
static struct __pyx_obj_7opendht_5_core_PrivateKey *__pyx_pw_7opendht_5_core_10PrivateKey_11generate(CYTHON_UNUSED PyObject *__pyx_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_10PrivateKey_11generate = {"generate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_10PrivateKey_11generate, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static struct __pyx_obj_7opendht_5_core_PrivateKey *__pyx_pw_7opendht_5_core_10PrivateKey_11generate(CYTHON_UNUSED PyObject *__pyx_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  struct __pyx_obj_7opendht_5_core_PrivateKey *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("generate (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("generate", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("generate", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7opendht_5_core_10PrivateKey_10generate();

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

static struct __pyx_obj_7opendht_5_core_PrivateKey *__pyx_pf_7opendht_5_core_10PrivateKey_10generate(void) {
  struct __pyx_obj_7opendht_5_core_PrivateKey *__pyx_v_k = NULL;
  struct __pyx_obj_7opendht_5_core_PrivateKey *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  std::shared_ptr<dht::crypto::PrivateKey>  __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("generate", 0);

  /* "opendht.pyx":431
 *     @staticmethod
 *     def generate() -> PrivateKey:
 *         k = PrivateKey()             # <<<<<<<<<<<<<<
 *         k._key = cpp.make_shared[cpp.PrivateKey](cpp.PrivateKey.generate())
 *         return k
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7opendht_5_core_PrivateKey, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 431, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_k = ((struct __pyx_obj_7opendht_5_core_PrivateKey *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "opendht.pyx":432
 *     def generate() -> PrivateKey:
 *         k = PrivateKey()
 *         k._key = cpp.make_shared[cpp.PrivateKey](cpp.PrivateKey.generate())             # <<<<<<<<<<<<<<
 *         return k
 *     @staticmethod
*/
  try {
    __pyx_t_4 = std::make_shared<dht::crypto::PrivateKey>(dht::crypto::PrivateKey::generate());
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(0, 432, __pyx_L1_error)
  }
  __pyx_v_k->_key = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_4);

  /* "opendht.pyx":433
 *         k = PrivateKey()
 *         k._key = cpp.make_shared[cpp.PrivateKey](cpp.PrivateKey.generate())
 *         return k             # <<<<<<<<<<<<<<
 *     @staticmethod
 *     def generateEC() -> PrivateKey:
*/
  {
    struct __pyx_obj_7opendht_5_core_PrivateKey *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __Pyx_INCREF((PyObject *)__pyx_v_k);
      __pyx_r = __pyx_v_k;
    }
    __Pyx_XDECREF((PyObject *)__pyx_temp);
  }
  goto __pyx_L0;

  /* "opendht.pyx":429
 *         return signature_c_str[:length]
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def generate() -> PrivateKey:
 *         k = PrivateKey()
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("opendht._core.PrivateKey.generate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_k);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":434
 *         k._key = cpp.make_shared[cpp.PrivateKey](cpp.PrivateKey.generate())
 *         return k
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def generateEC() -> PrivateKey:
 *         k = PrivateKey()
*/

/* Python wrapper */
static struct __pyx_obj_7opendht_5_core_PrivateKey *__pyx_pw_7opendht_5_core_10PrivateKey_13generateEC(CYTHON_UNUSED PyObject *__pyx_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_10PrivateKey_13generateEC = {"generateEC", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_10PrivateKey_13generateEC, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static struct __pyx_obj_7opendht_5_core_PrivateKey *__pyx_pw_7opendht_5_core_10PrivateKey_13generateEC(CYTHON_UNUSED PyObject *__pyx_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  struct __pyx_obj_7opendht_5_core_PrivateKey *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("generateEC (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("generateEC", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("generateEC", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7opendht_5_core_10PrivateKey_12generateEC();

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

static struct __pyx_obj_7opendht_5_core_PrivateKey *__pyx_pf_7opendht_5_core_10PrivateKey_12generateEC(void) {
  struct __pyx_obj_7opendht_5_core_PrivateKey *__pyx_v_k = NULL;
  struct __pyx_obj_7opendht_5_core_PrivateKey *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  std::shared_ptr<dht::crypto::PrivateKey>  __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("generateEC", 0);

  /* "opendht.pyx":436
 *     @staticmethod
 *     def generateEC() -> PrivateKey:
 *         k = PrivateKey()             # <<<<<<<<<<<<<<
 *         k._key = cpp.make_shared[cpp.PrivateKey](cpp.PrivateKey.generateEC())
 *         return k
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7opendht_5_core_PrivateKey, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 436, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_k = ((struct __pyx_obj_7opendht_5_core_PrivateKey *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "opendht.pyx":437
 *     def generateEC() -> PrivateKey:
 *         k = PrivateKey()
 *         k._key = cpp.make_shared[cpp.PrivateKey](cpp.PrivateKey.generateEC())             # <<<<<<<<<<<<<<
 *         return k
 * 
*/
  try {
    __pyx_t_4 = std::make_shared<dht::crypto::PrivateKey>(dht::crypto::PrivateKey::generateEC());
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(0, 437, __pyx_L1_error)
  }
  __pyx_v_k->_key = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_4);

  /* "opendht.pyx":438
 *         k = PrivateKey()
 *         k._key = cpp.make_shared[cpp.PrivateKey](cpp.PrivateKey.generateEC())
 *         return k             # <<<<<<<<<<<<<<
 * 
 * cdef class PublicKey(_WithPk):
*/
  {
    struct __pyx_obj_7opendht_5_core_PrivateKey *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __Pyx_INCREF((PyObject *)__pyx_v_k);
      __pyx_r = __pyx_v_k;
    }
    __Pyx_XDECREF((PyObject *)__pyx_temp);
  }
  goto __pyx_L0;

  /* "opendht.pyx":434
 *         k._key = cpp.make_shared[cpp.PrivateKey](cpp.PrivateKey.generate())
 *         return k
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def generateEC() -> PrivateKey:
 *         k = PrivateKey()
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("opendht._core.PrivateKey.generateEC", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_k);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._key cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_10PrivateKey_15__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_10PrivateKey_15__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_10PrivateKey_15__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_10PrivateKey_15__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7opendht_5_core_10PrivateKey_14__reduce_cython__(((struct __pyx_obj_7opendht_5_core_PrivateKey *)__pyx_v_self));

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

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

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "self._key cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._key cannot be converted to a Python object for pickling"
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self__key_cannot_be_converted_to, 0, 0);
  __PYX_ERR(1, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._key cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/

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

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._key cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._key cannot be converted to a Python object for pickling"
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_10PrivateKey_17__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_10PrivateKey_17__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_10PrivateKey_17__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_10PrivateKey_17__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(1, 3, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.PrivateKey.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7opendht_5_core_10PrivateKey_16__setstate_cython__(((struct __pyx_obj_7opendht_5_core_PrivateKey *)__pyx_v_self), __pyx_v___pyx_state);

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

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

  /* "(tree fragment)":4
 *     raise TypeError, "self._key cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._key cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self__key_cannot_be_converted_to, 0, 0);
  __PYX_ERR(1, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._key cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._key cannot be converted to a Python object for pickling"
*/

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

/* "opendht.pyx":442
 * cdef class PublicKey(_WithPk):
 *     cdef cpp.shared_ptr[cpp.PublicKey] _key
 *     def getId(self) -> InfoHash:             # <<<<<<<<<<<<<<
 *         if not self._key:
 *             raise ValueError("PublicKey is not initialized")
*/

/* Python wrapper */
static struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_pw_7opendht_5_core_9PublicKey_1getId(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_9PublicKey_1getId = {"getId", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9PublicKey_1getId, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_pw_7opendht_5_core_9PublicKey_1getId(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getId (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getId", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getId", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7opendht_5_core_9PublicKey_getId(((struct __pyx_obj_7opendht_5_core_PublicKey *)__pyx_v_self));

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

static struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_pf_7opendht_5_core_9PublicKey_getId(struct __pyx_obj_7opendht_5_core_PublicKey *__pyx_v_self) {
  struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_v_h = NULL;
  struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getId", 0);

  /* "opendht.pyx":443
 *     cdef cpp.shared_ptr[cpp.PublicKey] _key
 *     def getId(self) -> InfoHash:
 *         if not self._key:             # <<<<<<<<<<<<<<
 *             raise ValueError("PublicKey is not initialized")
 *         h = InfoHash()
*/
  __pyx_t_1 = ((!__pyx_v_self->_key) != 0);

  if (unlikely(__pyx_t_1)) {


    /* "opendht.pyx":444
 *     def getId(self) -> InfoHash:
 *         if not self._key:
 *             raise ValueError("PublicKey is not initialized")             # <<<<<<<<<<<<<<
 *         h = InfoHash()
 *         h._infohash = self._key.get().getId()
*/
    __pyx_t_3 = NULL;
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_PublicKey_is_not_initialized};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 444, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 444, __pyx_L1_error)

    /* "opendht.pyx":443
 *     cdef cpp.shared_ptr[cpp.PublicKey] _key
 *     def getId(self) -> InfoHash:
 *         if not self._key:             # <<<<<<<<<<<<<<
 *             raise ValueError("PublicKey is not initialized")
 *         h = InfoHash()
*/
  }

  /* "opendht.pyx":445
 *         if not self._key:
 *             raise ValueError("PublicKey is not initialized")
 *         h = InfoHash()             # <<<<<<<<<<<<<<
 *         h._infohash = self._key.get().getId()
 *         return h
*/
  __pyx_t_3 = NULL;
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7opendht_5_core_InfoHash, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 445, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_2);
  }
  __pyx_v_h = ((struct __pyx_obj_7opendht_5_core_InfoHash *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "opendht.pyx":446
 *             raise ValueError("PublicKey is not initialized")
 *         h = InfoHash()
 *         h._infohash = self._key.get().getId()             # <<<<<<<<<<<<<<
 *         return h
 * 
*/
  __pyx_v_h->_infohash = __pyx_v_self->_key.get()->getId();

  /* "opendht.pyx":447
 *         h = InfoHash()
 *         h._infohash = self._key.get().getId()
 *         return h             # <<<<<<<<<<<<<<
 * 
 *     def getLongId(self) -> PkId:
*/
  {
    struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __Pyx_INCREF((PyObject *)__pyx_v_h);
      __pyx_r = __pyx_v_h;
    }
    __Pyx_XDECREF((PyObject *)__pyx_temp);
  }
  goto __pyx_L0;

  /* "opendht.pyx":442
 * cdef class PublicKey(_WithPk):
 *     cdef cpp.shared_ptr[cpp.PublicKey] _key
 *     def getId(self) -> InfoHash:             # <<<<<<<<<<<<<<
 *         if not self._key:
 *             raise ValueError("PublicKey is not initialized")
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("opendht._core.PublicKey.getId", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_h);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":449
 *         return h
 * 
 *     def getLongId(self) -> PkId:             # <<<<<<<<<<<<<<
 *         if not self._key:
 *             raise ValueError("PublicKey is not initialized")
*/

/* Python wrapper */
static struct __pyx_obj_7opendht_5_core_PkId *__pyx_pw_7opendht_5_core_9PublicKey_3getLongId(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_9PublicKey_3getLongId = {"getLongId", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9PublicKey_3getLongId, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static struct __pyx_obj_7opendht_5_core_PkId *__pyx_pw_7opendht_5_core_9PublicKey_3getLongId(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  struct __pyx_obj_7opendht_5_core_PkId *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getLongId (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getLongId", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getLongId", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7opendht_5_core_9PublicKey_2getLongId(((struct __pyx_obj_7opendht_5_core_PublicKey *)__pyx_v_self));

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

static struct __pyx_obj_7opendht_5_core_PkId *__pyx_pf_7opendht_5_core_9PublicKey_2getLongId(struct __pyx_obj_7opendht_5_core_PublicKey *__pyx_v_self) {
  struct __pyx_obj_7opendht_5_core_PkId *__pyx_v_id = NULL;
  struct __pyx_obj_7opendht_5_core_PkId *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getLongId", 0);

  /* "opendht.pyx":450
 * 
 *     def getLongId(self) -> PkId:
 *         if not self._key:             # <<<<<<<<<<<<<<
 *             raise ValueError("PublicKey is not initialized")
 *         id = PkId()
*/
  __pyx_t_1 = ((!__pyx_v_self->_key) != 0);

  if (unlikely(__pyx_t_1)) {


    /* "opendht.pyx":451
 *     def getLongId(self) -> PkId:
 *         if not self._key:
 *             raise ValueError("PublicKey is not initialized")             # <<<<<<<<<<<<<<
 *         id = PkId()
 *         id._pkid = self._key.get().getLongId()
*/
    __pyx_t_3 = NULL;
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_PublicKey_is_not_initialized};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 451, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 451, __pyx_L1_error)

    /* "opendht.pyx":450
 * 
 *     def getLongId(self) -> PkId:
 *         if not self._key:             # <<<<<<<<<<<<<<
 *             raise ValueError("PublicKey is not initialized")
 *         id = PkId()
*/
  }

  /* "opendht.pyx":452
 *         if not self._key:
 *             raise ValueError("PublicKey is not initialized")
 *         id = PkId()             # <<<<<<<<<<<<<<
 *         id._pkid = self._key.get().getLongId()
 *         return id
*/
  __pyx_t_3 = NULL;
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7opendht_5_core_PkId, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 452, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_2);
  }
  __pyx_v_id = ((struct __pyx_obj_7opendht_5_core_PkId *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "opendht.pyx":453
 *             raise ValueError("PublicKey is not initialized")
 *         id = PkId()
 *         id._pkid = self._key.get().getLongId()             # <<<<<<<<<<<<<<
 *         return id
 * 
*/
  __pyx_v_id->_pkid = __pyx_v_self->_key.get()->getLongId();

  /* "opendht.pyx":454
 *         id = PkId()
 *         id._pkid = self._key.get().getLongId()
 *         return id             # <<<<<<<<<<<<<<
 * 
 *     def encrypt(self, bytes dat) -> bytes:
*/
  {
    struct __pyx_obj_7opendht_5_core_PkId *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __Pyx_INCREF((PyObject *)__pyx_v_id);
      __pyx_r = __pyx_v_id;
    }
    __Pyx_XDECREF((PyObject *)__pyx_temp);
  }
  goto __pyx_L0;

  /* "opendht.pyx":449
 *         return h
 * 
 *     def getLongId(self) -> PkId:             # <<<<<<<<<<<<<<
 *         if not self._key:
 *             raise ValueError("PublicKey is not initialized")
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("opendht._core.PublicKey.getLongId", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_id);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":456
 *         return id
 * 
 *     def encrypt(self, bytes dat) -> bytes:             # <<<<<<<<<<<<<<
 *         if not self._key:
 *             raise ValueError("PublicKey is not initialized")
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_9PublicKey_5encrypt(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_9PublicKey_5encrypt = {"encrypt", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9PublicKey_5encrypt, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_9PublicKey_5encrypt(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_dat = 0;
  #if !CYTHON_VECTORCALL
  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("encrypt (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_dat,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 456, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 456, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "encrypt", 0) < (0)) __PYX_ERR(0, 456, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("encrypt", 1, 1, 1, i); __PYX_ERR(0, 456, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 456, __pyx_L3_error)
    }
    __pyx_v_dat = ((PyObject*)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("encrypt", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 456, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.PublicKey.encrypt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dat), (&PyBytes_Type), 1, "dat", 1))) __PYX_ERR(0, 456, __pyx_L1_error)
  __pyx_r = __pyx_pf_7opendht_5_core_9PublicKey_4encrypt(((struct __pyx_obj_7opendht_5_core_PublicKey *)__pyx_v_self), __pyx_v_dat);

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

static PyObject *__pyx_pf_7opendht_5_core_9PublicKey_4encrypt(struct __pyx_obj_7opendht_5_core_PublicKey *__pyx_v_self, PyObject *__pyx_v_dat) {
  size_t __pyx_v_d_len;
  uint8_t *__pyx_v_d_ptr;
  __pyx_t_11opendht_cpp_Blob __pyx_v_indat;
  __pyx_t_11opendht_cpp_Blob __pyx_v_encrypted;
  char *__pyx_v_encrypted_c_str;
  Py_ssize_t __pyx_v_length;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  uint8_t *__pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("encrypt", 0);

  /* "opendht.pyx":457
 * 
 *     def encrypt(self, bytes dat) -> bytes:
 *         if not self._key:             # <<<<<<<<<<<<<<
 *             raise ValueError("PublicKey is not initialized")
 *         cdef size_t d_len = len(dat)
*/
  __pyx_t_1 = ((!__pyx_v_self->_key) != 0);

  if (unlikely(__pyx_t_1)) {


    /* "opendht.pyx":458
 *     def encrypt(self, bytes dat) -> bytes:
 *         if not self._key:
 *             raise ValueError("PublicKey is not initialized")             # <<<<<<<<<<<<<<
 *         cdef size_t d_len = len(dat)
 *         cdef cpp.uint8_t* d_ptr = <cpp.uint8_t*>dat
*/
    __pyx_t_3 = NULL;
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_PublicKey_is_not_initialized};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 458, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 458, __pyx_L1_error)

    /* "opendht.pyx":457
 * 
 *     def encrypt(self, bytes dat) -> bytes:
 *         if not self._key:             # <<<<<<<<<<<<<<
 *             raise ValueError("PublicKey is not initialized")
 *         cdef size_t d_len = len(dat)
*/
  }

  /* "opendht.pyx":459
 *         if not self._key:
 *             raise ValueError("PublicKey is not initialized")
 *         cdef size_t d_len = len(dat)             # <<<<<<<<<<<<<<
 *         cdef cpp.uint8_t* d_ptr = <cpp.uint8_t*>dat
 *         cdef cpp.Blob indat
*/
  if (unlikely(__pyx_v_dat == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type \047NoneType\047 has no len()");
    __PYX_ERR(0, 459, __pyx_L1_error)
  }
  __pyx_t_5 = __Pyx_PyBytes_GET_SIZE(__pyx_v_dat); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 459, __pyx_L1_error)
  __pyx_v_d_len = __pyx_t_5;

  /* "opendht.pyx":460
 *             raise ValueError("PublicKey is not initialized")
 *         cdef size_t d_len = len(dat)
 *         cdef cpp.uint8_t* d_ptr = <cpp.uint8_t*>dat             # <<<<<<<<<<<<<<
 *         cdef cpp.Blob indat
 *         indat.assign(d_ptr, <cpp.uint8_t*>(d_ptr + d_len))
*/
  if (unlikely(__pyx_v_dat == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
    __PYX_ERR(0, 460, __pyx_L1_error)
  }
  __pyx_t_6 = __Pyx_PyBytes_AsWritableUString(__pyx_v_dat); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L1_error)
  __pyx_v_d_ptr = ((uint8_t *)__pyx_t_6);


  /* "opendht.pyx":462
 *         cdef cpp.uint8_t* d_ptr = <cpp.uint8_t*>dat
 *         cdef cpp.Blob indat
 *         indat.assign(d_ptr, <cpp.uint8_t*>(d_ptr + d_len))             # <<<<<<<<<<<<<<
 *         cdef cpp.Blob encrypted = self._key.get().encrypt(indat)
 *         cdef char* encrypted_c_str = <char *>encrypted.data()
*/
  try {
    __pyx_v_indat.assign(__pyx_v_d_ptr, ((uint8_t *)(__pyx_v_d_ptr + __pyx_v_d_len)));
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(0, 462, __pyx_L1_error)
  }

  /* "opendht.pyx":463
 *         cdef cpp.Blob indat
 *         indat.assign(d_ptr, <cpp.uint8_t*>(d_ptr + d_len))
 *         cdef cpp.Blob encrypted = self._key.get().encrypt(indat)             # <<<<<<<<<<<<<<
 *         cdef char* encrypted_c_str = <char *>encrypted.data()
 *         cdef Py_ssize_t length = encrypted.size()
*/
  __pyx_v_encrypted = __pyx_v_self->_key.get()->encrypt(__pyx_v_indat);

  /* "opendht.pyx":464
 *         indat.assign(d_ptr, <cpp.uint8_t*>(d_ptr + d_len))
 *         cdef cpp.Blob encrypted = self._key.get().encrypt(indat)
 *         cdef char* encrypted_c_str = <char *>encrypted.data()             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t length = encrypted.size()
 *         return encrypted_c_str[:length]
*/
  __pyx_v_encrypted_c_str = ((char *)__pyx_v_encrypted.data());

  /* "opendht.pyx":465
 *         cdef cpp.Blob encrypted = self._key.get().encrypt(indat)
 *         cdef char* encrypted_c_str = <char *>encrypted.data()
 *         cdef Py_ssize_t length = encrypted.size()             # <<<<<<<<<<<<<<
 *         return encrypted_c_str[:length]
 * 
*/
  __pyx_v_length = __pyx_v_encrypted.size();

  /* "opendht.pyx":466
 *         cdef char* encrypted_c_str = <char *>encrypted.data()
 *         cdef Py_ssize_t length = encrypted.size()
 *         return encrypted_c_str[:length]             # <<<<<<<<<<<<<<
 * 
 *     def checkSignature(self, bytes dat, bytes signature) -> bool:
*/
  __pyx_t_2 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_encrypted_c_str + 0, __pyx_v_length - 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 466, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = ((PyObject*)__pyx_t_2);
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "opendht.pyx":456
 *         return id
 * 
 *     def encrypt(self, bytes dat) -> bytes:             # <<<<<<<<<<<<<<
 *         if not self._key:
 *             raise ValueError("PublicKey is not initialized")
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("opendht._core.PublicKey.encrypt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;






  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":468
 *         return encrypted_c_str[:length]
 * 
 *     def checkSignature(self, bytes dat, bytes signature) -> bool:             # <<<<<<<<<<<<<<
 *         if not self._key:
 *             raise ValueError("PublicKey is not initialized")
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_9PublicKey_7checkSignature(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_9PublicKey_7checkSignature = {"checkSignature", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9PublicKey_7checkSignature, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_9PublicKey_7checkSignature(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_dat = 0;
  PyObject *__pyx_v_signature = 0;
  #if !CYTHON_VECTORCALL
  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("checkSignature (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_dat,&__pyx_mstate_global->__pyx_n_u_signature,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 468, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 468, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 468, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "checkSignature", 0) < (0)) __PYX_ERR(0, 468, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("checkSignature", 1, 2, 2, i); __PYX_ERR(0, 468, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 468, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 468, __pyx_L3_error)
    }
    __pyx_v_dat = ((PyObject*)values[0]);
    __pyx_v_signature = ((PyObject*)values[1]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("checkSignature", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 468, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.PublicKey.checkSignature", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dat), (&PyBytes_Type), 1, "dat", 1))) __PYX_ERR(0, 468, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_signature), (&PyBytes_Type), 1, "signature", 1))) __PYX_ERR(0, 468, __pyx_L1_error)
  __pyx_r = __pyx_pf_7opendht_5_core_9PublicKey_6checkSignature(((struct __pyx_obj_7opendht_5_core_PublicKey *)__pyx_v_self), __pyx_v_dat, __pyx_v_signature);

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

static PyObject *__pyx_pf_7opendht_5_core_9PublicKey_6checkSignature(struct __pyx_obj_7opendht_5_core_PublicKey *__pyx_v_self, PyObject *__pyx_v_dat, PyObject *__pyx_v_signature) {
  size_t __pyx_v_d_len;
  uint8_t *__pyx_v_d_ptr;
  __pyx_t_11opendht_cpp_Blob __pyx_v_indat;
  size_t __pyx_v_s_len;
  uint8_t *__pyx_v_s_ptr;
  __pyx_t_11opendht_cpp_Blob __pyx_v_sig;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  uint8_t *__pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("checkSignature", 0);

  /* "opendht.pyx":469
 * 
 *     def checkSignature(self, bytes dat, bytes signature) -> bool:
 *         if not self._key:             # <<<<<<<<<<<<<<
 *             raise ValueError("PublicKey is not initialized")
 *         cdef size_t d_len = len(dat)
*/
  __pyx_t_1 = ((!__pyx_v_self->_key) != 0);

  if (unlikely(__pyx_t_1)) {


    /* "opendht.pyx":470
 *     def checkSignature(self, bytes dat, bytes signature) -> bool:
 *         if not self._key:
 *             raise ValueError("PublicKey is not initialized")             # <<<<<<<<<<<<<<
 *         cdef size_t d_len = len(dat)
 *         cdef cpp.uint8_t* d_ptr = <cpp.uint8_t*>dat
*/
    __pyx_t_3 = NULL;
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_PublicKey_is_not_initialized};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 470, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 470, __pyx_L1_error)

    /* "opendht.pyx":469
 * 
 *     def checkSignature(self, bytes dat, bytes signature) -> bool:
 *         if not self._key:             # <<<<<<<<<<<<<<
 *             raise ValueError("PublicKey is not initialized")
 *         cdef size_t d_len = len(dat)
*/
  }

  /* "opendht.pyx":471
 *         if not self._key:
 *             raise ValueError("PublicKey is not initialized")
 *         cdef size_t d_len = len(dat)             # <<<<<<<<<<<<<<
 *         cdef cpp.uint8_t* d_ptr = <cpp.uint8_t*>dat
 *         cdef cpp.Blob indat
*/
  if (unlikely(__pyx_v_dat == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type \047NoneType\047 has no len()");
    __PYX_ERR(0, 471, __pyx_L1_error)
  }
  __pyx_t_5 = __Pyx_PyBytes_GET_SIZE(__pyx_v_dat); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 471, __pyx_L1_error)
  __pyx_v_d_len = __pyx_t_5;

  /* "opendht.pyx":472
 *             raise ValueError("PublicKey is not initialized")
 *         cdef size_t d_len = len(dat)
 *         cdef cpp.uint8_t* d_ptr = <cpp.uint8_t*>dat             # <<<<<<<<<<<<<<
 *         cdef cpp.Blob indat
 *         indat.assign(d_ptr, <cpp.uint8_t*>(d_ptr + d_len))
*/
  if (unlikely(__pyx_v_dat == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
    __PYX_ERR(0, 472, __pyx_L1_error)
  }
  __pyx_t_6 = __Pyx_PyBytes_AsWritableUString(__pyx_v_dat); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 472, __pyx_L1_error)
  __pyx_v_d_ptr = ((uint8_t *)__pyx_t_6);


  /* "opendht.pyx":474
 *         cdef cpp.uint8_t* d_ptr = <cpp.uint8_t*>dat
 *         cdef cpp.Blob indat
 *         indat.assign(d_ptr, <cpp.uint8_t*>(d_ptr + d_len))             # <<<<<<<<<<<<<<
 *         cdef size_t s_len = len(signature)
 *         cdef cpp.uint8_t* s_ptr = <cpp.uint8_t*>signature
*/
  try {
    __pyx_v_indat.assign(__pyx_v_d_ptr, ((uint8_t *)(__pyx_v_d_ptr + __pyx_v_d_len)));
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(0, 474, __pyx_L1_error)
  }

  /* "opendht.pyx":475
 *         cdef cpp.Blob indat
 *         indat.assign(d_ptr, <cpp.uint8_t*>(d_ptr + d_len))
 *         cdef size_t s_len = len(signature)             # <<<<<<<<<<<<<<
 *         cdef cpp.uint8_t* s_ptr = <cpp.uint8_t*>signature
 *         cdef cpp.Blob sig
*/
  if (unlikely(__pyx_v_signature == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type \047NoneType\047 has no len()");
    __PYX_ERR(0, 475, __pyx_L1_error)
  }
  __pyx_t_5 = __Pyx_PyBytes_GET_SIZE(__pyx_v_signature); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 475, __pyx_L1_error)
  __pyx_v_s_len = __pyx_t_5;

  /* "opendht.pyx":476
 *         indat.assign(d_ptr, <cpp.uint8_t*>(d_ptr + d_len))
 *         cdef size_t s_len = len(signature)
 *         cdef cpp.uint8_t* s_ptr = <cpp.uint8_t*>signature             # <<<<<<<<<<<<<<
 *         cdef cpp.Blob sig
 *         sig.assign(s_ptr, <cpp.uint8_t*>(s_ptr + s_len))
*/
  if (unlikely(__pyx_v_signature == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
    __PYX_ERR(0, 476, __pyx_L1_error)
  }
  __pyx_t_6 = __Pyx_PyBytes_AsWritableUString(__pyx_v_signature); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 476, __pyx_L1_error)
  __pyx_v_s_ptr = ((uint8_t *)__pyx_t_6);


  /* "opendht.pyx":478
 *         cdef cpp.uint8_t* s_ptr = <cpp.uint8_t*>signature
 *         cdef cpp.Blob sig
 *         sig.assign(s_ptr, <cpp.uint8_t*>(s_ptr + s_len))             # <<<<<<<<<<<<<<
 *         return self._key.get().checkSignature(indat, sig)
 * 
*/
  try {
    __pyx_v_sig.assign(__pyx_v_s_ptr, ((uint8_t *)(__pyx_v_s_ptr + __pyx_v_s_len)));
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(0, 478, __pyx_L1_error)
  }

  /* "opendht.pyx":479
 *         cdef cpp.Blob sig
 *         sig.assign(s_ptr, <cpp.uint8_t*>(s_ptr + s_len))
 *         return self._key.get().checkSignature(indat, sig)             # <<<<<<<<<<<<<<
 * 
 * cdef class Certificate(_WithPk):
*/
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->_key.get()->checkSignature(__pyx_v_indat, __pyx_v_sig)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 479, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_2;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "opendht.pyx":468
 *         return encrypted_c_str[:length]
 * 
 *     def checkSignature(self, bytes dat, bytes signature) -> bool:             # <<<<<<<<<<<<<<
 *         if not self._key:
 *             raise ValueError("PublicKey is not initialized")
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("opendht._core.PublicKey.checkSignature", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;






  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._key cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_9PublicKey_9__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_9PublicKey_9__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9PublicKey_9__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_9PublicKey_9__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7opendht_5_core_9PublicKey_8__reduce_cython__(((struct __pyx_obj_7opendht_5_core_PublicKey *)__pyx_v_self));

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

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

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "self._key cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._key cannot be converted to a Python object for pickling"
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self__key_cannot_be_converted_to, 0, 0);
  __PYX_ERR(1, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._key cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/

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

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._key cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._key cannot be converted to a Python object for pickling"
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_9PublicKey_11__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_9PublicKey_11__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9PublicKey_11__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_9PublicKey_11__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(1, 3, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.PublicKey.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7opendht_5_core_9PublicKey_10__setstate_cython__(((struct __pyx_obj_7opendht_5_core_PublicKey *)__pyx_v_self), __pyx_v___pyx_state);

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

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

  /* "(tree fragment)":4
 *     raise TypeError, "self._key cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._key cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self__key_cannot_be_converted_to, 0, 0);
  __PYX_ERR(1, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._key cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._key cannot be converted to a Python object for pickling"
*/

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

/* "opendht.pyx":483
 * cdef class Certificate(_WithPk):
 *     cdef shared_ptr[cpp.Certificate] _cert
 *     def __init__(self, bytes dat = None):             # <<<<<<<<<<<<<<
 *         if dat:
 *             self._cert = cpp.make_shared[cpp.Certificate](<cpp.string>dat)
*/

/* Python wrapper */
static int __pyx_pw_7opendht_5_core_11Certificate_1__init__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL_TPNEW
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_pw_7opendht_5_core_11Certificate_1__init__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL_TPNEW
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_dat = 0;
  #if !CYTHON_VECTORCALL_TPNEW
  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;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if !CYTHON_VECTORCALL_TPNEW
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL_TPNEW(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_dat,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL_TPNEW(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 483, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 483, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(0, 483, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject*)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 483, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject*)Py_None));
    }
    __pyx_v_dat = ((PyObject*)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 483, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.Certificate.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dat), (&PyBytes_Type), 1, "dat", 1))) __PYX_ERR(0, 483, __pyx_L1_error)
  __pyx_r = __pyx_pf_7opendht_5_core_11Certificate___init__(((struct __pyx_obj_7opendht_5_core_Certificate *)__pyx_v_self), __pyx_v_dat);

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

static int __pyx_pf_7opendht_5_core_11Certificate___init__(struct __pyx_obj_7opendht_5_core_Certificate *__pyx_v_self, PyObject *__pyx_v_dat) {
  int __pyx_r;
  int __pyx_t_1;
  std::string __pyx_t_2;
  std::shared_ptr<dht::crypto::Certificate>  __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "opendht.pyx":484
 *     cdef shared_ptr[cpp.Certificate] _cert
 *     def __init__(self, bytes dat = None):
 *         if dat:             # <<<<<<<<<<<<<<
 *             self._cert = cpp.make_shared[cpp.Certificate](<cpp.string>dat)
 *     def getId(self) -> InfoHash:
*/
  if (__pyx_v_dat == Py_None) __pyx_t_1 = 0;
  else
  {
    Py_ssize_t __pyx_temp = __Pyx_PyBytes_GET_SIZE(__pyx_v_dat);
    if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(0, 484, __pyx_L1_error)
    __pyx_t_1 = (__pyx_temp != 0);
  }

  if (__pyx_t_1) {


    /* "opendht.pyx":485
 *     def __init__(self, bytes dat = None):
 *         if dat:
 *             self._cert = cpp.make_shared[cpp.Certificate](<cpp.string>dat)             # <<<<<<<<<<<<<<
 *     def getId(self) -> InfoHash:
 *         if not self._cert:
*/
    __pyx_t_2 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_v_dat); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 485, __pyx_L1_error)
    try {
      __pyx_t_3 = std::make_shared<dht::crypto::Certificate>(((std::string)__pyx_t_2));
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(0, 485, __pyx_L1_error)
    }

    __pyx_v_self->_cert = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_3);

    /* "opendht.pyx":484
 *     cdef shared_ptr[cpp.Certificate] _cert
 *     def __init__(self, bytes dat = None):
 *         if dat:             # <<<<<<<<<<<<<<
 *             self._cert = cpp.make_shared[cpp.Certificate](<cpp.string>dat)
 *     def getId(self) -> InfoHash:
*/
  }

  /* "opendht.pyx":483
 * cdef class Certificate(_WithPk):
 *     cdef shared_ptr[cpp.Certificate] _cert
 *     def __init__(self, bytes dat = None):             # <<<<<<<<<<<<<<
 *         if dat:
 *             self._cert = cpp.make_shared[cpp.Certificate](<cpp.string>dat)
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("opendht._core.Certificate.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;

  return __pyx_r;
}

/* "opendht.pyx":486
 *         if dat:
 *             self._cert = cpp.make_shared[cpp.Certificate](<cpp.string>dat)
 *     def getId(self) -> InfoHash:             # <<<<<<<<<<<<<<
 *         if not self._cert:
 *             raise ValueError("Certificate is not initialized")
*/

/* Python wrapper */
static struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_pw_7opendht_5_core_11Certificate_3getId(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_11Certificate_3getId = {"getId", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_11Certificate_3getId, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_pw_7opendht_5_core_11Certificate_3getId(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getId (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getId", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getId", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7opendht_5_core_11Certificate_2getId(((struct __pyx_obj_7opendht_5_core_Certificate *)__pyx_v_self));

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

static struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_pf_7opendht_5_core_11Certificate_2getId(struct __pyx_obj_7opendht_5_core_Certificate *__pyx_v_self) {
  struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_v_h = NULL;
  struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getId", 0);

  /* "opendht.pyx":487
 *             self._cert = cpp.make_shared[cpp.Certificate](<cpp.string>dat)
 *     def getId(self) -> InfoHash:
 *         if not self._cert:             # <<<<<<<<<<<<<<
 *             raise ValueError("Certificate is not initialized")
 *         h = InfoHash()
*/
  __pyx_t_1 = ((!__pyx_v_self->_cert) != 0);

  if (unlikely(__pyx_t_1)) {


    /* "opendht.pyx":488
 *     def getId(self) -> InfoHash:
 *         if not self._cert:
 *             raise ValueError("Certificate is not initialized")             # <<<<<<<<<<<<<<
 *         h = InfoHash()
 *         h._infohash = self._cert.get().getId()
*/
    __pyx_t_3 = NULL;
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Certificate_is_not_initialized};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 488, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 488, __pyx_L1_error)

    /* "opendht.pyx":487
 *             self._cert = cpp.make_shared[cpp.Certificate](<cpp.string>dat)
 *     def getId(self) -> InfoHash:
 *         if not self._cert:             # <<<<<<<<<<<<<<
 *             raise ValueError("Certificate is not initialized")
 *         h = InfoHash()
*/
  }

  /* "opendht.pyx":489
 *         if not self._cert:
 *             raise ValueError("Certificate is not initialized")
 *         h = InfoHash()             # <<<<<<<<<<<<<<
 *         h._infohash = self._cert.get().getId()
 *         return h
*/
  __pyx_t_3 = NULL;
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7opendht_5_core_InfoHash, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 489, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_2);
  }
  __pyx_v_h = ((struct __pyx_obj_7opendht_5_core_InfoHash *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "opendht.pyx":490
 *             raise ValueError("Certificate is not initialized")
 *         h = InfoHash()
 *         h._infohash = self._cert.get().getId()             # <<<<<<<<<<<<<<
 *         return h
 *     def getLongId(self) -> PkId:
*/
  __pyx_v_h->_infohash = __pyx_v_self->_cert.get()->getId();

  /* "opendht.pyx":491
 *         h = InfoHash()
 *         h._infohash = self._cert.get().getId()
 *         return h             # <<<<<<<<<<<<<<
 *     def getLongId(self) -> PkId:
 *         if not self._cert:
*/
  {
    struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __Pyx_INCREF((PyObject *)__pyx_v_h);
      __pyx_r = __pyx_v_h;
    }
    __Pyx_XDECREF((PyObject *)__pyx_temp);
  }
  goto __pyx_L0;

  /* "opendht.pyx":486
 *         if dat:
 *             self._cert = cpp.make_shared[cpp.Certificate](<cpp.string>dat)
 *     def getId(self) -> InfoHash:             # <<<<<<<<<<<<<<
 *         if not self._cert:
 *             raise ValueError("Certificate is not initialized")
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("opendht._core.Certificate.getId", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_h);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":492
 *         h._infohash = self._cert.get().getId()
 *         return h
 *     def getLongId(self) -> PkId:             # <<<<<<<<<<<<<<
 *         if not self._cert:
 *             raise ValueError("Certificate is not initialized")
*/

/* Python wrapper */
static struct __pyx_obj_7opendht_5_core_PkId *__pyx_pw_7opendht_5_core_11Certificate_5getLongId(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_11Certificate_5getLongId = {"getLongId", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_11Certificate_5getLongId, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static struct __pyx_obj_7opendht_5_core_PkId *__pyx_pw_7opendht_5_core_11Certificate_5getLongId(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  struct __pyx_obj_7opendht_5_core_PkId *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getLongId (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getLongId", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getLongId", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7opendht_5_core_11Certificate_4getLongId(((struct __pyx_obj_7opendht_5_core_Certificate *)__pyx_v_self));

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

static struct __pyx_obj_7opendht_5_core_PkId *__pyx_pf_7opendht_5_core_11Certificate_4getLongId(struct __pyx_obj_7opendht_5_core_Certificate *__pyx_v_self) {
  struct __pyx_obj_7opendht_5_core_PkId *__pyx_v_id = NULL;
  struct __pyx_obj_7opendht_5_core_PkId *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getLongId", 0);

  /* "opendht.pyx":493
 *         return h
 *     def getLongId(self) -> PkId:
 *         if not self._cert:             # <<<<<<<<<<<<<<
 *             raise ValueError("Certificate is not initialized")
 *         id = PkId()
*/
  __pyx_t_1 = ((!__pyx_v_self->_cert) != 0);

  if (unlikely(__pyx_t_1)) {


    /* "opendht.pyx":494
 *     def getLongId(self) -> PkId:
 *         if not self._cert:
 *             raise ValueError("Certificate is not initialized")             # <<<<<<<<<<<<<<
 *         id = PkId()
 *         id._pkid = self._cert.get().getLongId()
*/
    __pyx_t_3 = NULL;
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Certificate_is_not_initialized};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 494, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 494, __pyx_L1_error)

    /* "opendht.pyx":493
 *         return h
 *     def getLongId(self) -> PkId:
 *         if not self._cert:             # <<<<<<<<<<<<<<
 *             raise ValueError("Certificate is not initialized")
 *         id = PkId()
*/
  }

  /* "opendht.pyx":495
 *         if not self._cert:
 *             raise ValueError("Certificate is not initialized")
 *         id = PkId()             # <<<<<<<<<<<<<<
 *         id._pkid = self._cert.get().getLongId()
 *         return id
*/
  __pyx_t_3 = NULL;
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7opendht_5_core_PkId, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 495, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_2);
  }
  __pyx_v_id = ((struct __pyx_obj_7opendht_5_core_PkId *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "opendht.pyx":496
 *             raise ValueError("Certificate is not initialized")
 *         id = PkId()
 *         id._pkid = self._cert.get().getLongId()             # <<<<<<<<<<<<<<
 *         return id
 *     def toString(self) -> str:
*/
  __pyx_v_id->_pkid = __pyx_v_self->_cert.get()->getLongId();

  /* "opendht.pyx":497
 *         id = PkId()
 *         id._pkid = self._cert.get().getLongId()
 *         return id             # <<<<<<<<<<<<<<
 *     def toString(self) -> str:
 *         if not self._cert:
*/
  {
    struct __pyx_obj_7opendht_5_core_PkId *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __Pyx_INCREF((PyObject *)__pyx_v_id);
      __pyx_r = __pyx_v_id;
    }
    __Pyx_XDECREF((PyObject *)__pyx_temp);
  }
  goto __pyx_L0;

  /* "opendht.pyx":492
 *         h._infohash = self._cert.get().getId()
 *         return h
 *     def getLongId(self) -> PkId:             # <<<<<<<<<<<<<<
 *         if not self._cert:
 *             raise ValueError("Certificate is not initialized")
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("opendht._core.Certificate.getLongId", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_id);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":498
 *         id._pkid = self._cert.get().getLongId()
 *         return id
 *     def toString(self) -> str:             # <<<<<<<<<<<<<<
 *         if not self._cert:
 *             return ""
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_11Certificate_7toString(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_11Certificate_7toString = {"toString", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_11Certificate_7toString, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_11Certificate_7toString(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("toString (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("toString", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("toString", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7opendht_5_core_11Certificate_6toString(((struct __pyx_obj_7opendht_5_core_Certificate *)__pyx_v_self));

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

static PyObject *__pyx_pf_7opendht_5_core_11Certificate_6toString(struct __pyx_obj_7opendht_5_core_Certificate *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("toString", 0);

  /* "opendht.pyx":499
 *         return id
 *     def toString(self) -> str:
 *         if not self._cert:             # <<<<<<<<<<<<<<
 *             return ""
 *         return self._cert.get().toString().decode()
*/
  __pyx_t_1 = ((!__pyx_v_self->_cert) != 0);

  if (__pyx_t_1) {


    /* "opendht.pyx":500
 *     def toString(self) -> str:
 *         if not self._cert:
 *             return ""             # <<<<<<<<<<<<<<
 *         return self._cert.get().toString().decode()
 *     def getName(self) -> str:
*/
    {
      PyObject *__pyx_temp;
      {
        __pyx_temp = __pyx_r;
        __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__5);
        __pyx_r = __pyx_mstate_global->__pyx_kp_u__5;
      }
      __Pyx_XDECREF(__pyx_temp);
    }
    goto __pyx_L0;

    /* "opendht.pyx":499
 *         return id
 *     def toString(self) -> str:
 *         if not self._cert:             # <<<<<<<<<<<<<<
 *             return ""
 *         return self._cert.get().toString().decode()
*/
  }

  /* "opendht.pyx":501
 *         if not self._cert:
 *             return ""
 *         return self._cert.get().toString().decode()             # <<<<<<<<<<<<<<
 *     def getName(self) -> str:
 *         return self._cert.get().getName().decode()
*/
  __pyx_t_2 = __Pyx_decode_cpp_string(__pyx_v_self->_cert.get()->toString(), 0, PY_SSIZE_T_MAX, NULL, NULL, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 501, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = ((PyObject*)__pyx_t_2);
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "opendht.pyx":498
 *         id._pkid = self._cert.get().getLongId()
 *         return id
 *     def toString(self) -> str:             # <<<<<<<<<<<<<<
 *         if not self._cert:
 *             return ""
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("opendht._core.Certificate.toString", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":502
 *             return ""
 *         return self._cert.get().toString().decode()
 *     def getName(self) -> str:             # <<<<<<<<<<<<<<
 *         return self._cert.get().getName().decode()
 *     def revoke(self, PrivateKey k, Certificate c):
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_11Certificate_9getName(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_11Certificate_9getName = {"getName", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_11Certificate_9getName, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_11Certificate_9getName(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getName (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getName", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getName", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7opendht_5_core_11Certificate_8getName(((struct __pyx_obj_7opendht_5_core_Certificate *)__pyx_v_self));

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

static PyObject *__pyx_pf_7opendht_5_core_11Certificate_8getName(struct __pyx_obj_7opendht_5_core_Certificate *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getName", 0);

  /* "opendht.pyx":503
 *         return self._cert.get().toString().decode()
 *     def getName(self) -> str:
 *         return self._cert.get().getName().decode()             # <<<<<<<<<<<<<<
 *     def revoke(self, PrivateKey k, Certificate c):
 *         self._cert.get().revoke(deref(k._key.get()), deref(c._cert.get()));
*/
  __pyx_t_1 = __Pyx_decode_cpp_string(__pyx_v_self->_cert.get()->getName(), 0, PY_SSIZE_T_MAX, NULL, NULL, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 503, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = ((PyObject*)__pyx_t_1);
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "opendht.pyx":502
 *             return ""
 *         return self._cert.get().toString().decode()
 *     def getName(self) -> str:             # <<<<<<<<<<<<<<
 *         return self._cert.get().getName().decode()
 *     def revoke(self, PrivateKey k, Certificate c):
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("opendht._core.Certificate.getName", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":504
 *     def getName(self) -> str:
 *         return self._cert.get().getName().decode()
 *     def revoke(self, PrivateKey k, Certificate c):             # <<<<<<<<<<<<<<
 *         self._cert.get().revoke(deref(k._key.get()), deref(c._cert.get()));
 *     def __bytes__(self):
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_11Certificate_11revoke(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_11Certificate_11revoke = {"revoke", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_11Certificate_11revoke, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_11Certificate_11revoke(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_7opendht_5_core_PrivateKey *__pyx_v_k = 0;
  struct __pyx_obj_7opendht_5_core_Certificate *__pyx_v_c = 0;
  #if !CYTHON_VECTORCALL
  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("revoke (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_k,&__pyx_mstate_global->__pyx_n_u_c,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 504, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 504, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 504, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "revoke", 0) < (0)) __PYX_ERR(0, 504, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("revoke", 1, 2, 2, i); __PYX_ERR(0, 504, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 504, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 504, __pyx_L3_error)
    }
    __pyx_v_k = ((struct __pyx_obj_7opendht_5_core_PrivateKey *)values[0]);
    __pyx_v_c = ((struct __pyx_obj_7opendht_5_core_Certificate *)values[1]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("revoke", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 504, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.Certificate.revoke", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_k), __pyx_mstate_global->__pyx_ptype_7opendht_5_core_PrivateKey, 1, "k", 0))) __PYX_ERR(0, 504, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_c), __pyx_mstate_global->__pyx_ptype_7opendht_5_core_Certificate, 1, "c", 0))) __PYX_ERR(0, 504, __pyx_L1_error)
  __pyx_r = __pyx_pf_7opendht_5_core_11Certificate_10revoke(((struct __pyx_obj_7opendht_5_core_Certificate *)__pyx_v_self), __pyx_v_k, __pyx_v_c);

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

static PyObject *__pyx_pf_7opendht_5_core_11Certificate_10revoke(struct __pyx_obj_7opendht_5_core_Certificate *__pyx_v_self, struct __pyx_obj_7opendht_5_core_PrivateKey *__pyx_v_k, struct __pyx_obj_7opendht_5_core_Certificate *__pyx_v_c) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("revoke", 0);

  /* "opendht.pyx":505
 *         return self._cert.get().getName().decode()
 *     def revoke(self, PrivateKey k, Certificate c):
 *         self._cert.get().revoke(deref(k._key.get()), deref(c._cert.get()));             # <<<<<<<<<<<<<<
 *     def __bytes__(self):
 *         return self._cert.get().toString().encode() if self._cert else b''
*/
  __pyx_v_self->_cert.get()->revoke((*__pyx_v_k->_key.get()), (*__pyx_v_c->_cert.get()));

  /* "opendht.pyx":504
 *     def getName(self) -> str:
 *         return self._cert.get().getName().decode()
 *     def revoke(self, PrivateKey k, Certificate c):             # <<<<<<<<<<<<<<
 *         self._cert.get().revoke(deref(k._key.get()), deref(c._cert.get()));
 *     def __bytes__(self):
*/

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

/* "opendht.pyx":506
 *     def revoke(self, PrivateKey k, Certificate c):
 *         self._cert.get().revoke(deref(k._key.get()), deref(c._cert.get()));
 *     def __bytes__(self):             # <<<<<<<<<<<<<<
 *         return self._cert.get().toString().encode() if self._cert else b''
 *     @property
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_11Certificate_13__bytes__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_11Certificate_13__bytes__ = {"__bytes__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_11Certificate_13__bytes__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_11Certificate_13__bytes__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__bytes__ (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__bytes__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__bytes__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7opendht_5_core_11Certificate_12__bytes__(((struct __pyx_obj_7opendht_5_core_Certificate *)__pyx_v_self));

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

static PyObject *__pyx_pf_7opendht_5_core_11Certificate_12__bytes__(struct __pyx_obj_7opendht_5_core_Certificate *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  bool __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__bytes__", 0);

  /* "opendht.pyx":507
 *         self._cert.get().revoke(deref(k._key.get()), deref(c._cert.get()));
 *     def __bytes__(self):
 *         return self._cert.get().toString().encode() if self._cert else b''             # <<<<<<<<<<<<<<
 *     @property
 *     def issuer(self) -> Certificate|None:
*/
  __pyx_t_2 = __pyx_v_self->_cert.operator bool();

  if (__pyx_t_2) {
    __pyx_t_5 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(__pyx_v_self->_cert.get()->toString()); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 507, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __pyx_t_5;
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
      __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 507, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
  } else {
    __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_b__5);
    __pyx_t_1 = __pyx_mstate_global->__pyx_kp_b__5;
  }

  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_1;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "opendht.pyx":506
 *     def revoke(self, PrivateKey k, Certificate c):
 *         self._cert.get().revoke(deref(k._key.get()), deref(c._cert.get()));
 *     def __bytes__(self):             # <<<<<<<<<<<<<<
 *         return self._cert.get().toString().encode() if self._cert else b''
 *     @property
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("opendht._core.Certificate.__bytes__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":508
 *     def __bytes__(self):
 *         return self._cert.get().toString().encode() if self._cert else b''
 *     @property             # <<<<<<<<<<<<<<
 *     def issuer(self) -> Certificate|None:
 *         if self._cert and self._cert.get().issuer:
*/

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

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

static PyObject *__pyx_pf_7opendht_5_core_11Certificate_6issuer___get__(struct __pyx_obj_7opendht_5_core_Certificate *__pyx_v_self) {
  struct __pyx_obj_7opendht_5_core_Certificate *__pyx_v_c = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  bool __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  std::shared_ptr<dht::crypto::Certificate>  __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "opendht.pyx":510
 *     @property
 *     def issuer(self) -> Certificate|None:
 *         if self._cert and self._cert.get().issuer:             # <<<<<<<<<<<<<<
 *             c = Certificate()
 *             c._cert = self._cert.get().issuer
*/
  __pyx_t_2 = __pyx_v_self->_cert.operator bool();

  if (__pyx_t_2) {

  } else {

    __pyx_t_1 = __pyx_t_2;

    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = __pyx_v_self->_cert.get()->issuer.operator bool();


  __pyx_t_1 = __pyx_t_2;

  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {


    /* "opendht.pyx":511
 *     def issuer(self) -> Certificate|None:
 *         if self._cert and self._cert.get().issuer:
 *             c = Certificate()             # <<<<<<<<<<<<<<
 *             c._cert = self._cert.get().issuer
 *             return c
*/
    __pyx_t_4 = NULL;
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7opendht_5_core_Certificate, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 511, __pyx_L1_error)
      __Pyx_GOTREF((PyObject *)__pyx_t_3);
    }
    __pyx_v_c = ((struct __pyx_obj_7opendht_5_core_Certificate *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "opendht.pyx":512
 *         if self._cert and self._cert.get().issuer:
 *             c = Certificate()
 *             c._cert = self._cert.get().issuer             # <<<<<<<<<<<<<<
 *             return c
 *         return None
*/
    __pyx_t_6 = __pyx_v_self->_cert.get()->issuer;

    __pyx_v_c->_cert = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_6);

    /* "opendht.pyx":513
 *             c = Certificate()
 *             c._cert = self._cert.get().issuer
 *             return c             # <<<<<<<<<<<<<<
 *         return None
 *     @staticmethod
*/
    {
      PyObject *__pyx_temp;
      {
        __pyx_temp = __pyx_r;
        __Pyx_INCREF((PyObject *)__pyx_v_c);
        __pyx_r = ((PyObject *)__pyx_v_c);
      }
      __Pyx_XDECREF(__pyx_temp);
    }
    goto __pyx_L0;

    /* "opendht.pyx":510
 *     @property
 *     def issuer(self) -> Certificate|None:
 *         if self._cert and self._cert.get().issuer:             # <<<<<<<<<<<<<<
 *             c = Certificate()
 *             c._cert = self._cert.get().issuer
*/
  }

  /* "opendht.pyx":514
 *             c._cert = self._cert.get().issuer
 *             return c
 *         return None             # <<<<<<<<<<<<<<
 *     @staticmethod
 *     def generate(PrivateKey k, str name, Identity i = Identity(), bool is_ca = False):
*/
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  goto __pyx_L0;

  /* "opendht.pyx":508
 *     def __bytes__(self):
 *         return self._cert.get().toString().encode() if self._cert else b''
 *     @property             # <<<<<<<<<<<<<<
 *     def issuer(self) -> Certificate|None:
 *         if self._cert and self._cert.get().issuer:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("opendht._core.Certificate.issuer.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_c);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":515
 *             return c
 *         return None
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def generate(PrivateKey k, str name, Identity i = Identity(), bool is_ca = False):
 *         c = Certificate()
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_11Certificate_15generate(CYTHON_UNUSED PyObject *__pyx_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_11Certificate_15generate = {"generate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_11Certificate_15generate, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_11Certificate_15generate(CYTHON_UNUSED PyObject *__pyx_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_7opendht_5_core_PrivateKey *__pyx_v_k = 0;
  PyObject *__pyx_v_name = 0;
  struct __pyx_obj_7opendht_5_core_Identity *__pyx_v_i = 0;
  bool __pyx_v_is_ca;
  #if !CYTHON_VECTORCALL
  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("generate (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_k,&__pyx_mstate_global->__pyx_n_u_name_2,&__pyx_mstate_global->__pyx_n_u_i,&__pyx_mstate_global->__pyx_n_u_is_ca,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 515, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 515, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 515, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 515, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 515, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "generate", 0) < (0)) __PYX_ERR(0, 515, __pyx_L3_error)
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)__pyx_mstate_global->__pyx_k__8);
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("generate", 0, 2, 4, i); __PYX_ERR(0, 515, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 515, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 515, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 515, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 515, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)__pyx_mstate_global->__pyx_k__8);
    }
    __pyx_v_k = ((struct __pyx_obj_7opendht_5_core_PrivateKey *)values[0]);
    __pyx_v_name = ((PyObject*)values[1]);
    __pyx_v_i = ((struct __pyx_obj_7opendht_5_core_Identity *)values[2]);
    if (values[3]) {
      __pyx_v_is_ca = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_is_ca == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 516, __pyx_L3_error)
    } else {

      /* "opendht.pyx":516
 *         return None
 *     @staticmethod
 *     def generate(PrivateKey k, str name, Identity i = Identity(), bool is_ca = False):             # <<<<<<<<<<<<<<
 *         c = Certificate()
 *         c._cert = cpp.make_shared[cpp.Certificate](cpp.Certificate.generate(deref(k._key.get()), name.encode(), i._id, is_ca))
*/
      __pyx_v_is_ca = ((bool)0);
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("generate", 0, 2, 4, __pyx_nargs); __PYX_ERR(0, 515, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.Certificate.generate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_k), __pyx_mstate_global->__pyx_ptype_7opendht_5_core_PrivateKey, 1, "k", 0))) __PYX_ERR(0, 516, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_name), (&PyUnicode_Type), 1, "name", 1))) __PYX_ERR(0, 516, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_i), __pyx_mstate_global->__pyx_ptype_7opendht_5_core_Identity, 1, "i", 0))) __PYX_ERR(0, 516, __pyx_L1_error)
  __pyx_r = __pyx_pf_7opendht_5_core_11Certificate_14generate(__pyx_v_k, __pyx_v_name, __pyx_v_i, __pyx_v_is_ca);

  /* "opendht.pyx":515
 *             return c
 *         return None
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def generate(PrivateKey k, str name, Identity i = Identity(), bool is_ca = False):
 *         c = Certificate()
*/

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

  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7opendht_5_core_11Certificate_14generate(struct __pyx_obj_7opendht_5_core_PrivateKey *__pyx_v_k, PyObject *__pyx_v_name, struct __pyx_obj_7opendht_5_core_Identity *__pyx_v_i, bool __pyx_v_is_ca) {
  struct __pyx_obj_7opendht_5_core_Certificate *__pyx_v_c = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  std::string __pyx_t_4;
  std::shared_ptr<dht::crypto::Certificate>  __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("generate", 0);

  /* "opendht.pyx":517
 *     @staticmethod
 *     def generate(PrivateKey k, str name, Identity i = Identity(), bool is_ca = False):
 *         c = Certificate()             # <<<<<<<<<<<<<<
 *         c._cert = cpp.make_shared[cpp.Certificate](cpp.Certificate.generate(deref(k._key.get()), name.encode(), i._id, is_ca))
 *         return c
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7opendht_5_core_Certificate, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 517, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_c = ((struct __pyx_obj_7opendht_5_core_Certificate *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "opendht.pyx":518
 *     def generate(PrivateKey k, str name, Identity i = Identity(), bool is_ca = False):
 *         c = Certificate()
 *         c._cert = cpp.make_shared[cpp.Certificate](cpp.Certificate.generate(deref(k._key.get()), name.encode(), i._id, is_ca))             # <<<<<<<<<<<<<<
 *         return c
 * 
*/
  if (unlikely(__pyx_v_name == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "\047NoneType\047 object has no attribute \047%.30s\047", "encode");
    __PYX_ERR(0, 518, __pyx_L1_error)
  }
  __pyx_t_1 = PyUnicode_AsEncodedString(__pyx_v_name, NULL, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 518, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  try {
    __pyx_t_5 = std::make_shared<dht::crypto::Certificate>(dht::crypto::Certificate::generate((*__pyx_v_k->_key.get()), __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_4), __pyx_v_i->_id, __pyx_v_is_ca));
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(0, 518, __pyx_L1_error)
  }

  __pyx_v_c->_cert = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_5);

  /* "opendht.pyx":519
 *         c = Certificate()
 *         c._cert = cpp.make_shared[cpp.Certificate](cpp.Certificate.generate(deref(k._key.get()), name.encode(), i._id, is_ca))
 *         return c             # <<<<<<<<<<<<<<
 * 
 * cdef class VerifyResult(object):
*/
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __Pyx_INCREF((PyObject *)__pyx_v_c);
      __pyx_r = ((PyObject *)__pyx_v_c);
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  goto __pyx_L0;

  /* "opendht.pyx":515
 *             return c
 *         return None
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def generate(PrivateKey k, str name, Identity i = Identity(), bool is_ca = False):
 *         c = Certificate()
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("opendht._core.Certificate.generate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_c);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._cert cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_11Certificate_17__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_11Certificate_17__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_11Certificate_17__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_11Certificate_17__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7opendht_5_core_11Certificate_16__reduce_cython__(((struct __pyx_obj_7opendht_5_core_Certificate *)__pyx_v_self));

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

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

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "self._cert cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._cert cannot be converted to a Python object for pickling"
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self__cert_cannot_be_converted_t, 0, 0);
  __PYX_ERR(1, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._cert cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/

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

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._cert cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._cert cannot be converted to a Python object for pickling"
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_11Certificate_19__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_11Certificate_19__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_11Certificate_19__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_11Certificate_19__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(1, 3, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.Certificate.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7opendht_5_core_11Certificate_18__setstate_cython__(((struct __pyx_obj_7opendht_5_core_Certificate *)__pyx_v_self), __pyx_v___pyx_state);

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

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

  /* "(tree fragment)":4
 *     raise TypeError, "self._cert cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._cert cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self__cert_cannot_be_converted_t, 0, 0);
  __PYX_ERR(1, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._cert cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._cert cannot be converted to a Python object for pickling"
*/

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

/* "opendht.pyx":523
 * cdef class VerifyResult(object):
 *     cdef cpp.TrustListVerifyResult _result
 *     def __bool__(self):             # <<<<<<<<<<<<<<
 *         return self._result.isValid()
 *     def __str(self):
*/

/* Python wrapper */
static int __pyx_pw_7opendht_5_core_12VerifyResult_1__bool__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_7opendht_5_core_12VerifyResult_1__bool__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__bool__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7opendht_5_core_12VerifyResult___bool__(((struct __pyx_obj_7opendht_5_core_VerifyResult *)__pyx_v_self));

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

static int __pyx_pf_7opendht_5_core_12VerifyResult___bool__(struct __pyx_obj_7opendht_5_core_VerifyResult *__pyx_v_self) {
  int __pyx_r;

  /* "opendht.pyx":524
 *     cdef cpp.TrustListVerifyResult _result
 *     def __bool__(self):
 *         return self._result.isValid()             # <<<<<<<<<<<<<<
 *     def __str(self):
 *         return self._result.toString()
*/
  {

    __pyx_r = __pyx_v_self->_result.isValid();
  }
  goto __pyx_L0;

  /* "opendht.pyx":523
 * cdef class VerifyResult(object):
 *     cdef cpp.TrustListVerifyResult _result
 *     def __bool__(self):             # <<<<<<<<<<<<<<
 *         return self._result.isValid()
 *     def __str(self):
*/

  /* function exit code */
  __pyx_L0:;

  return __pyx_r;
}

/* "opendht.pyx":525
 *     def __bool__(self):
 *         return self._result.isValid()
 *     def __str(self):             # <<<<<<<<<<<<<<
 *         return self._result.toString()
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_12VerifyResult_3_VerifyResult__str(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_12VerifyResult_3_VerifyResult__str = {"_VerifyResult__str", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_12VerifyResult_3_VerifyResult__str, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_12VerifyResult_3_VerifyResult__str(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_VerifyResult__str (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("_VerifyResult__str", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("_VerifyResult__str", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7opendht_5_core_12VerifyResult_2__str(((struct __pyx_obj_7opendht_5_core_VerifyResult *)__pyx_v_self));

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

static PyObject *__pyx_pf_7opendht_5_core_12VerifyResult_2__str(struct __pyx_obj_7opendht_5_core_VerifyResult *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_VerifyResult__str", 0);

  /* "opendht.pyx":526
 *         return self._result.isValid()
 *     def __str(self):
 *         return self._result.toString()             # <<<<<<<<<<<<<<
 * 
 * cdef class TrustList(object):
*/
  __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(__pyx_v_self->_result.toString()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 526, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_1;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "opendht.pyx":525
 *     def __bool__(self):
 *         return self._result.isValid()
 *     def __str(self):             # <<<<<<<<<<<<<<
 *         return self._result.toString()
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("opendht._core.VerifyResult._VerifyResult__str", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._result cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_12VerifyResult_5__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_12VerifyResult_5__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_12VerifyResult_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_12VerifyResult_5__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7opendht_5_core_12VerifyResult_4__reduce_cython__(((struct __pyx_obj_7opendht_5_core_VerifyResult *)__pyx_v_self));

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

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

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "self._result cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._result cannot be converted to a Python object for pickling"
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self__result_cannot_be_converted, 0, 0);
  __PYX_ERR(1, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._result cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/

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

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._result cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._result cannot be converted to a Python object for pickling"
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_12VerifyResult_7__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_12VerifyResult_7__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_12VerifyResult_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_12VerifyResult_7__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(1, 3, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.VerifyResult.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7opendht_5_core_12VerifyResult_6__setstate_cython__(((struct __pyx_obj_7opendht_5_core_VerifyResult *)__pyx_v_self), __pyx_v___pyx_state);

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

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

  /* "(tree fragment)":4
 *     raise TypeError, "self._result cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._result cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self__result_cannot_be_converted, 0, 0);
  __PYX_ERR(1, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._result cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._result cannot be converted to a Python object for pickling"
*/

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

/* "opendht.pyx":530
 * cdef class TrustList(object):
 *     cdef cpp.TrustList _trust
 *     def add(self, Certificate cert):             # <<<<<<<<<<<<<<
 *         self._trust.add(deref(cert._cert.get()))
 *     def remove(self, Certificate cert):
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_9TrustList_1add(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_9TrustList_1add = {"add", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9TrustList_1add, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_9TrustList_1add(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_7opendht_5_core_Certificate *__pyx_v_cert = 0;
  #if !CYTHON_VECTORCALL
  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("add (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_cert,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 530, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 530, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "add", 0) < (0)) __PYX_ERR(0, 530, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("add", 1, 1, 1, i); __PYX_ERR(0, 530, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 530, __pyx_L3_error)
    }
    __pyx_v_cert = ((struct __pyx_obj_7opendht_5_core_Certificate *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("add", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 530, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.TrustList.add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cert), __pyx_mstate_global->__pyx_ptype_7opendht_5_core_Certificate, 1, "cert", 0))) __PYX_ERR(0, 530, __pyx_L1_error)
  __pyx_r = __pyx_pf_7opendht_5_core_9TrustList_add(((struct __pyx_obj_7opendht_5_core_TrustList *)__pyx_v_self), __pyx_v_cert);

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

static PyObject *__pyx_pf_7opendht_5_core_9TrustList_add(struct __pyx_obj_7opendht_5_core_TrustList *__pyx_v_self, struct __pyx_obj_7opendht_5_core_Certificate *__pyx_v_cert) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add", 0);

  /* "opendht.pyx":531
 *     cdef cpp.TrustList _trust
 *     def add(self, Certificate cert):
 *         self._trust.add(deref(cert._cert.get()))             # <<<<<<<<<<<<<<
 *     def remove(self, Certificate cert):
 *         self._trust.remove(deref(cert._cert.get()))
*/
  __pyx_v_self->_trust.add((*__pyx_v_cert->_cert.get()));

  /* "opendht.pyx":530
 * cdef class TrustList(object):
 *     cdef cpp.TrustList _trust
 *     def add(self, Certificate cert):             # <<<<<<<<<<<<<<
 *         self._trust.add(deref(cert._cert.get()))
 *     def remove(self, Certificate cert):
*/

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

/* "opendht.pyx":532
 *     def add(self, Certificate cert):
 *         self._trust.add(deref(cert._cert.get()))
 *     def remove(self, Certificate cert):             # <<<<<<<<<<<<<<
 *         self._trust.remove(deref(cert._cert.get()))
 *     def verify(self, Certificate cert):
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_9TrustList_3remove(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_9TrustList_3remove = {"remove", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9TrustList_3remove, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_9TrustList_3remove(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_7opendht_5_core_Certificate *__pyx_v_cert = 0;
  #if !CYTHON_VECTORCALL
  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 (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_cert,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 532, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 532, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "remove", 0) < (0)) __PYX_ERR(0, 532, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("remove", 1, 1, 1, i); __PYX_ERR(0, 532, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 532, __pyx_L3_error)
    }
    __pyx_v_cert = ((struct __pyx_obj_7opendht_5_core_Certificate *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("remove", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 532, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.TrustList.remove", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cert), __pyx_mstate_global->__pyx_ptype_7opendht_5_core_Certificate, 1, "cert", 0))) __PYX_ERR(0, 532, __pyx_L1_error)
  __pyx_r = __pyx_pf_7opendht_5_core_9TrustList_2remove(((struct __pyx_obj_7opendht_5_core_TrustList *)__pyx_v_self), __pyx_v_cert);

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

static PyObject *__pyx_pf_7opendht_5_core_9TrustList_2remove(struct __pyx_obj_7opendht_5_core_TrustList *__pyx_v_self, struct __pyx_obj_7opendht_5_core_Certificate *__pyx_v_cert) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("remove", 0);

  /* "opendht.pyx":533
 *         self._trust.add(deref(cert._cert.get()))
 *     def remove(self, Certificate cert):
 *         self._trust.remove(deref(cert._cert.get()))             # <<<<<<<<<<<<<<
 *     def verify(self, Certificate cert):
 *         r = VerifyResult()
*/
  __pyx_v_self->_trust.remove((*__pyx_v_cert->_cert.get()));

  /* "opendht.pyx":532
 *     def add(self, Certificate cert):
 *         self._trust.add(deref(cert._cert.get()))
 *     def remove(self, Certificate cert):             # <<<<<<<<<<<<<<
 *         self._trust.remove(deref(cert._cert.get()))
 *     def verify(self, Certificate cert):
*/

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

/* "opendht.pyx":534
 *     def remove(self, Certificate cert):
 *         self._trust.remove(deref(cert._cert.get()))
 *     def verify(self, Certificate cert):             # <<<<<<<<<<<<<<
 *         r = VerifyResult()
 *         r._result = self._trust.verify(deref(cert._cert.get()))
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_9TrustList_5verify(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_9TrustList_5verify = {"verify", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9TrustList_5verify, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_9TrustList_5verify(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_7opendht_5_core_Certificate *__pyx_v_cert = 0;
  #if !CYTHON_VECTORCALL
  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("verify (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_cert,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 534, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 534, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "verify", 0) < (0)) __PYX_ERR(0, 534, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("verify", 1, 1, 1, i); __PYX_ERR(0, 534, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 534, __pyx_L3_error)
    }
    __pyx_v_cert = ((struct __pyx_obj_7opendht_5_core_Certificate *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("verify", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 534, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.TrustList.verify", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cert), __pyx_mstate_global->__pyx_ptype_7opendht_5_core_Certificate, 1, "cert", 0))) __PYX_ERR(0, 534, __pyx_L1_error)
  __pyx_r = __pyx_pf_7opendht_5_core_9TrustList_4verify(((struct __pyx_obj_7opendht_5_core_TrustList *)__pyx_v_self), __pyx_v_cert);

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

static PyObject *__pyx_pf_7opendht_5_core_9TrustList_4verify(struct __pyx_obj_7opendht_5_core_TrustList *__pyx_v_self, struct __pyx_obj_7opendht_5_core_Certificate *__pyx_v_cert) {
  struct __pyx_obj_7opendht_5_core_VerifyResult *__pyx_v_r = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("verify", 0);

  /* "opendht.pyx":535
 *         self._trust.remove(deref(cert._cert.get()))
 *     def verify(self, Certificate cert):
 *         r = VerifyResult()             # <<<<<<<<<<<<<<
 *         r._result = self._trust.verify(deref(cert._cert.get()))
 *         return r
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7opendht_5_core_VerifyResult, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 535, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_r = ((struct __pyx_obj_7opendht_5_core_VerifyResult *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "opendht.pyx":536
 *     def verify(self, Certificate cert):
 *         r = VerifyResult()
 *         r._result = self._trust.verify(deref(cert._cert.get()))             # <<<<<<<<<<<<<<
 *         return r
 * 
*/
  __pyx_v_r->_result = __pyx_v_self->_trust.verify((*__pyx_v_cert->_cert.get()));

  /* "opendht.pyx":537
 *         r = VerifyResult()
 *         r._result = self._trust.verify(deref(cert._cert.get()))
 *         return r             # <<<<<<<<<<<<<<
 * 
 * cdef class ListenToken(object):
*/
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __Pyx_INCREF((PyObject *)__pyx_v_r);
      __pyx_r = ((PyObject *)__pyx_v_r);
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  goto __pyx_L0;

  /* "opendht.pyx":534
 *     def remove(self, Certificate cert):
 *         self._trust.remove(deref(cert._cert.get()))
 *     def verify(self, Certificate cert):             # <<<<<<<<<<<<<<
 *         r = VerifyResult()
 *         r._result = self._trust.verify(deref(cert._cert.get()))
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("opendht._core.TrustList.verify", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_r);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._trust cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_9TrustList_7__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_9TrustList_7__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9TrustList_7__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_9TrustList_7__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7opendht_5_core_9TrustList_6__reduce_cython__(((struct __pyx_obj_7opendht_5_core_TrustList *)__pyx_v_self));

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

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

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "self._trust cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._trust cannot be converted to a Python object for pickling"
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self__trust_cannot_be_converted, 0, 0);
  __PYX_ERR(1, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._trust cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/

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

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._trust cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._trust cannot be converted to a Python object for pickling"
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_9TrustList_9__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_9TrustList_9__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9TrustList_9__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_9TrustList_9__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(1, 3, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.TrustList.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7opendht_5_core_9TrustList_8__setstate_cython__(((struct __pyx_obj_7opendht_5_core_TrustList *)__pyx_v_self), __pyx_v___pyx_state);

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

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

  /* "(tree fragment)":4
 *     raise TypeError, "self._trust cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._trust cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self__trust_cannot_be_converted, 0, 0);
  __PYX_ERR(1, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._trust cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._trust cannot be converted to a Python object for pickling"
*/

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

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._h,self._t cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_11ListenToken_1__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_11ListenToken_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_11ListenToken_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_11ListenToken_1__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7opendht_5_core_11ListenToken___reduce_cython__(((struct __pyx_obj_7opendht_5_core_ListenToken *)__pyx_v_self));

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

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

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "self._h,self._t cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._h,self._t cannot be converted to a Python object for pickling"
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self__h_self__t_cannot_be_conver, 0, 0);
  __PYX_ERR(1, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._h,self._t cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/

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

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._h,self._t cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._h,self._t cannot be converted to a Python object for pickling"
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_11ListenToken_3__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_11ListenToken_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_11ListenToken_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_11ListenToken_3__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(1, 3, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.ListenToken.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7opendht_5_core_11ListenToken_2__setstate_cython__(((struct __pyx_obj_7opendht_5_core_ListenToken *)__pyx_v_self), __pyx_v___pyx_state);

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

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

  /* "(tree fragment)":4
 *     raise TypeError, "self._h,self._t cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._h,self._t cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self__h_self__t_cannot_be_conver, 0, 0);
  __PYX_ERR(1, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._h,self._t cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._h,self._t cannot be converted to a Python object for pickling"
*/

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

/* "opendht.pyx":546
 * cdef class Identity(object):
 *     cdef cpp.Identity _id
 *     def __init__(self, PrivateKey k = None, Certificate c = None):             # <<<<<<<<<<<<<<
 *         if k:
 *             self._id.first = k._key
*/

/* Python wrapper */
static int __pyx_pw_7opendht_5_core_8Identity_1__init__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL_TPNEW
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_pw_7opendht_5_core_8Identity_1__init__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL_TPNEW
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_7opendht_5_core_PrivateKey *__pyx_v_k = 0;
  struct __pyx_obj_7opendht_5_core_Certificate *__pyx_v_c = 0;
  #if !CYTHON_VECTORCALL_TPNEW
  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;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if !CYTHON_VECTORCALL_TPNEW
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL_TPNEW(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_k,&__pyx_mstate_global->__pyx_n_u_c,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL_TPNEW(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 546, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 546, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 546, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(0, 546, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7opendht_5_core_PrivateKey *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7opendht_5_core_Certificate *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 546, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 546, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7opendht_5_core_PrivateKey *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7opendht_5_core_Certificate *)Py_None));
    }
    __pyx_v_k = ((struct __pyx_obj_7opendht_5_core_PrivateKey *)values[0]);
    __pyx_v_c = ((struct __pyx_obj_7opendht_5_core_Certificate *)values[1]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 2, __pyx_nargs); __PYX_ERR(0, 546, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.Identity.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_k), __pyx_mstate_global->__pyx_ptype_7opendht_5_core_PrivateKey, 1, "k", 0))) __PYX_ERR(0, 546, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_c), __pyx_mstate_global->__pyx_ptype_7opendht_5_core_Certificate, 1, "c", 0))) __PYX_ERR(0, 546, __pyx_L1_error)
  __pyx_r = __pyx_pf_7opendht_5_core_8Identity___init__(((struct __pyx_obj_7opendht_5_core_Identity *)__pyx_v_self), __pyx_v_k, __pyx_v_c);

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

static int __pyx_pf_7opendht_5_core_8Identity___init__(struct __pyx_obj_7opendht_5_core_Identity *__pyx_v_self, struct __pyx_obj_7opendht_5_core_PrivateKey *__pyx_v_k, struct __pyx_obj_7opendht_5_core_Certificate *__pyx_v_c) {
  int __pyx_r;
  int __pyx_t_1;
  std::shared_ptr<dht::crypto::PrivateKey>  __pyx_t_2;
  std::shared_ptr<dht::crypto::Certificate>  __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "opendht.pyx":547
 *     cdef cpp.Identity _id
 *     def __init__(self, PrivateKey k = None, Certificate c = None):
 *         if k:             # <<<<<<<<<<<<<<
 *             self._id.first = k._key
 *         if c:
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_k)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 547, __pyx_L1_error)
  if (__pyx_t_1) {


    /* "opendht.pyx":548
 *     def __init__(self, PrivateKey k = None, Certificate c = None):
 *         if k:
 *             self._id.first = k._key             # <<<<<<<<<<<<<<
 *         if c:
 *             self._id.second = c._cert
*/
    __pyx_t_2 = __pyx_v_k->_key;

    __pyx_v_self->_id.first = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_2);

    /* "opendht.pyx":547
 *     cdef cpp.Identity _id
 *     def __init__(self, PrivateKey k = None, Certificate c = None):
 *         if k:             # <<<<<<<<<<<<<<
 *             self._id.first = k._key
 *         if c:
*/
  }

  /* "opendht.pyx":549
 *         if k:
 *             self._id.first = k._key
 *         if c:             # <<<<<<<<<<<<<<
 *             self._id.second = c._cert
 *     @staticmethod
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_c)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 549, __pyx_L1_error)
  if (__pyx_t_1) {


    /* "opendht.pyx":550
 *             self._id.first = k._key
 *         if c:
 *             self._id.second = c._cert             # <<<<<<<<<<<<<<
 *     @staticmethod
 *     def generate(str name = "pydht", Identity ca = Identity(), unsigned bits = 4096):
*/
    __pyx_t_3 = __pyx_v_c->_cert;

    __pyx_v_self->_id.second = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_3);

    /* "opendht.pyx":549
 *         if k:
 *             self._id.first = k._key
 *         if c:             # <<<<<<<<<<<<<<
 *             self._id.second = c._cert
 *     @staticmethod
*/
  }

  /* "opendht.pyx":546
 * cdef class Identity(object):
 *     cdef cpp.Identity _id
 *     def __init__(self, PrivateKey k = None, Certificate c = None):             # <<<<<<<<<<<<<<
 *         if k:
 *             self._id.first = k._key
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("opendht._core.Identity.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;

  return __pyx_r;
}

/* "opendht.pyx":551
 *         if c:
 *             self._id.second = c._cert
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def generate(str name = "pydht", Identity ca = Identity(), unsigned bits = 4096):
 *         i = Identity()
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_8Identity_3generate(CYTHON_UNUSED PyObject *__pyx_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_8Identity_3generate = {"generate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_8Identity_3generate, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_8Identity_3generate(CYTHON_UNUSED PyObject *__pyx_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_name = 0;
  struct __pyx_obj_7opendht_5_core_Identity *__pyx_v_ca = 0;
  unsigned int __pyx_v_bits;
  #if !CYTHON_VECTORCALL
  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("generate (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_name_2,&__pyx_mstate_global->__pyx_n_u_ca,&__pyx_mstate_global->__pyx_n_u_bits,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 551, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 551, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 551, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 551, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "generate", 0) < (0)) __PYX_ERR(0, 551, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_n_u_pydht));
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)__pyx_mstate_global->__pyx_k__9);
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 551, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 551, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 551, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_n_u_pydht));
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)__pyx_mstate_global->__pyx_k__9);
    }
    __pyx_v_name = ((PyObject*)values[0]);
    __pyx_v_ca = ((struct __pyx_obj_7opendht_5_core_Identity *)values[1]);
    if (values[2]) {
      __pyx_v_bits = __Pyx_PyLong_As_unsigned_int(values[2]); if (unlikely((__pyx_v_bits == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 552, __pyx_L3_error)
    } else {
      __pyx_v_bits = ((unsigned int)0x1000);
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("generate", 0, 0, 3, __pyx_nargs); __PYX_ERR(0, 551, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.Identity.generate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_name), (&PyUnicode_Type), 1, "name", 1))) __PYX_ERR(0, 552, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ca), __pyx_mstate_global->__pyx_ptype_7opendht_5_core_Identity, 1, "ca", 0))) __PYX_ERR(0, 552, __pyx_L1_error)
  __pyx_r = __pyx_pf_7opendht_5_core_8Identity_2generate(__pyx_v_name, __pyx_v_ca, __pyx_v_bits);

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

  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7opendht_5_core_8Identity_2generate(PyObject *__pyx_v_name, struct __pyx_obj_7opendht_5_core_Identity *__pyx_v_ca, unsigned int __pyx_v_bits) {
  struct __pyx_obj_7opendht_5_core_Identity *__pyx_v_i = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  std::string __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("generate", 0);

  /* "opendht.pyx":553
 *     @staticmethod
 *     def generate(str name = "pydht", Identity ca = Identity(), unsigned bits = 4096):
 *         i = Identity()             # <<<<<<<<<<<<<<
 *         i._id = cpp.generateIdentity(name.encode(), ca._id, bits)
 *         return i
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7opendht_5_core_Identity, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 553, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_i = ((struct __pyx_obj_7opendht_5_core_Identity *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "opendht.pyx":554
 *     def generate(str name = "pydht", Identity ca = Identity(), unsigned bits = 4096):
 *         i = Identity()
 *         i._id = cpp.generateIdentity(name.encode(), ca._id, bits)             # <<<<<<<<<<<<<<
 *         return i
 *     @property
*/
  if (unlikely(__pyx_v_name == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "\047NoneType\047 object has no attribute \047%.30s\047", "encode");
    __PYX_ERR(0, 554, __pyx_L1_error)
  }
  __pyx_t_1 = PyUnicode_AsEncodedString(__pyx_v_name, NULL, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 554, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 554, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_i->_id = dht::crypto::generateIdentity(__PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_4), __pyx_v_ca->_id, __pyx_v_bits);


  /* "opendht.pyx":555
 *         i = Identity()
 *         i._id = cpp.generateIdentity(name.encode(), ca._id, bits)
 *         return i             # <<<<<<<<<<<<<<
 *     @property
 *     def publickey(self) -> PublicKey|None:
*/
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __Pyx_INCREF((PyObject *)__pyx_v_i);
      __pyx_r = ((PyObject *)__pyx_v_i);
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  goto __pyx_L0;

  /* "opendht.pyx":551
 *         if c:
 *             self._id.second = c._cert
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def generate(str name = "pydht", Identity ca = Identity(), unsigned bits = 4096):
 *         i = Identity()
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("opendht._core.Identity.generate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_i);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":556
 *         i._id = cpp.generateIdentity(name.encode(), ca._id, bits)
 *         return i
 *     @property             # <<<<<<<<<<<<<<
 *     def publickey(self) -> PublicKey|None:
 *         if not self._id.first:
*/

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

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

static PyObject *__pyx_pf_7opendht_5_core_8Identity_9publickey___get__(struct __pyx_obj_7opendht_5_core_Identity *__pyx_v_self) {
  struct __pyx_obj_7opendht_5_core_PublicKey *__pyx_v_k = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "opendht.pyx":558
 *     @property
 *     def publickey(self) -> PublicKey|None:
 *         if not self._id.first:             # <<<<<<<<<<<<<<
 *             return None
 *         k = PublicKey()
*/
  __pyx_t_1 = ((!__pyx_v_self->_id.first) != 0);

  if (__pyx_t_1) {


    /* "opendht.pyx":559
 *     def publickey(self) -> PublicKey|None:
 *         if not self._id.first:
 *             return None             # <<<<<<<<<<<<<<
 *         k = PublicKey()
 *         k._key = self._id.first.get().getSharedPublicKey()
*/
    {
      PyObject *__pyx_temp;
      {
        __pyx_temp = __pyx_r;
        __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      }
      __Pyx_XDECREF(__pyx_temp);
    }
    goto __pyx_L0;

    /* "opendht.pyx":558
 *     @property
 *     def publickey(self) -> PublicKey|None:
 *         if not self._id.first:             # <<<<<<<<<<<<<<
 *             return None
 *         k = PublicKey()
*/
  }

  /* "opendht.pyx":560
 *         if not self._id.first:
 *             return None
 *         k = PublicKey()             # <<<<<<<<<<<<<<
 *         k._key = self._id.first.get().getSharedPublicKey()
 *         return k
*/
  __pyx_t_3 = NULL;
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7opendht_5_core_PublicKey, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 560, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_2);
  }
  __pyx_v_k = ((struct __pyx_obj_7opendht_5_core_PublicKey *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "opendht.pyx":561
 *             return None
 *         k = PublicKey()
 *         k._key = self._id.first.get().getSharedPublicKey()             # <<<<<<<<<<<<<<
 *         return k
 *     @property
*/
  __pyx_v_k->_key = __pyx_v_self->_id.first.get()->getSharedPublicKey();

  /* "opendht.pyx":562
 *         k = PublicKey()
 *         k._key = self._id.first.get().getSharedPublicKey()
 *         return k             # <<<<<<<<<<<<<<
 *     @property
 *     def certificate(self) -> Certificate|None:
*/
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __Pyx_INCREF((PyObject *)__pyx_v_k);
      __pyx_r = ((PyObject *)__pyx_v_k);
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  goto __pyx_L0;

  /* "opendht.pyx":556
 *         i._id = cpp.generateIdentity(name.encode(), ca._id, bits)
 *         return i
 *     @property             # <<<<<<<<<<<<<<
 *     def publickey(self) -> PublicKey|None:
 *         if not self._id.first:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("opendht._core.Identity.publickey.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_k);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":563
 *         k._key = self._id.first.get().getSharedPublicKey()
 *         return k
 *     @property             # <<<<<<<<<<<<<<
 *     def certificate(self) -> Certificate|None:
 *         if not self._id.second:
*/

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

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

static PyObject *__pyx_pf_7opendht_5_core_8Identity_11certificate___get__(struct __pyx_obj_7opendht_5_core_Identity *__pyx_v_self) {
  struct __pyx_obj_7opendht_5_core_Certificate *__pyx_v_c = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  std::shared_ptr<dht::crypto::Certificate>  __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "opendht.pyx":565
 *     @property
 *     def certificate(self) -> Certificate|None:
 *         if not self._id.second:             # <<<<<<<<<<<<<<
 *             return None
 *         c = Certificate()
*/
  __pyx_t_1 = ((!__pyx_v_self->_id.second) != 0);

  if (__pyx_t_1) {


    /* "opendht.pyx":566
 *     def certificate(self) -> Certificate|None:
 *         if not self._id.second:
 *             return None             # <<<<<<<<<<<<<<
 *         c = Certificate()
 *         c._cert = self._id.second
*/
    {
      PyObject *__pyx_temp;
      {
        __pyx_temp = __pyx_r;
        __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      }
      __Pyx_XDECREF(__pyx_temp);
    }
    goto __pyx_L0;

    /* "opendht.pyx":565
 *     @property
 *     def certificate(self) -> Certificate|None:
 *         if not self._id.second:             # <<<<<<<<<<<<<<
 *             return None
 *         c = Certificate()
*/
  }

  /* "opendht.pyx":567
 *         if not self._id.second:
 *             return None
 *         c = Certificate()             # <<<<<<<<<<<<<<
 *         c._cert = self._id.second
 *         return c
*/
  __pyx_t_3 = NULL;
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7opendht_5_core_Certificate, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 567, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_2);
  }
  __pyx_v_c = ((struct __pyx_obj_7opendht_5_core_Certificate *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "opendht.pyx":568
 *             return None
 *         c = Certificate()
 *         c._cert = self._id.second             # <<<<<<<<<<<<<<
 *         return c
 *     @property
*/
  __pyx_t_5 = __pyx_v_self->_id.second;

  __pyx_v_c->_cert = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_5);

  /* "opendht.pyx":569
 *         c = Certificate()
 *         c._cert = self._id.second
 *         return c             # <<<<<<<<<<<<<<
 *     @property
 *     def key(self) -> PrivateKey|None:
*/
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __Pyx_INCREF((PyObject *)__pyx_v_c);
      __pyx_r = ((PyObject *)__pyx_v_c);
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  goto __pyx_L0;

  /* "opendht.pyx":563
 *         k._key = self._id.first.get().getSharedPublicKey()
 *         return k
 *     @property             # <<<<<<<<<<<<<<
 *     def certificate(self) -> Certificate|None:
 *         if not self._id.second:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("opendht._core.Identity.certificate.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_c);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":570
 *         c._cert = self._id.second
 *         return c
 *     @property             # <<<<<<<<<<<<<<
 *     def key(self) -> PrivateKey|None:
 *         if not self._id.first:
*/

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

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

static PyObject *__pyx_pf_7opendht_5_core_8Identity_3key___get__(struct __pyx_obj_7opendht_5_core_Identity *__pyx_v_self) {
  struct __pyx_obj_7opendht_5_core_PrivateKey *__pyx_v_k = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  std::shared_ptr<dht::crypto::PrivateKey>  __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "opendht.pyx":572
 *     @property
 *     def key(self) -> PrivateKey|None:
 *         if not self._id.first:             # <<<<<<<<<<<<<<
 *             return None
 *         k = PrivateKey()
*/
  __pyx_t_1 = ((!__pyx_v_self->_id.first) != 0);

  if (__pyx_t_1) {


    /* "opendht.pyx":573
 *     def key(self) -> PrivateKey|None:
 *         if not self._id.first:
 *             return None             # <<<<<<<<<<<<<<
 *         k = PrivateKey()
 *         k._key = self._id.first
*/
    {
      PyObject *__pyx_temp;
      {
        __pyx_temp = __pyx_r;
        __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      }
      __Pyx_XDECREF(__pyx_temp);
    }
    goto __pyx_L0;

    /* "opendht.pyx":572
 *     @property
 *     def key(self) -> PrivateKey|None:
 *         if not self._id.first:             # <<<<<<<<<<<<<<
 *             return None
 *         k = PrivateKey()
*/
  }

  /* "opendht.pyx":574
 *         if not self._id.first:
 *             return None
 *         k = PrivateKey()             # <<<<<<<<<<<<<<
 *         k._key = self._id.first
 *         return k
*/
  __pyx_t_3 = NULL;
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7opendht_5_core_PrivateKey, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 574, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_2);
  }
  __pyx_v_k = ((struct __pyx_obj_7opendht_5_core_PrivateKey *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "opendht.pyx":575
 *             return None
 *         k = PrivateKey()
 *         k._key = self._id.first             # <<<<<<<<<<<<<<
 *         return k
 * 
*/
  __pyx_t_5 = __pyx_v_self->_id.first;

  __pyx_v_k->_key = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_5);

  /* "opendht.pyx":576
 *         k = PrivateKey()
 *         k._key = self._id.first
 *         return k             # <<<<<<<<<<<<<<
 * 
 * def aesEncrypt(bytes data, str password) -> bytes :
*/
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __Pyx_INCREF((PyObject *)__pyx_v_k);
      __pyx_r = ((PyObject *)__pyx_v_k);
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  goto __pyx_L0;

  /* "opendht.pyx":570
 *         c._cert = self._id.second
 *         return c
 *     @property             # <<<<<<<<<<<<<<
 *     def key(self) -> PrivateKey|None:
 *         if not self._id.first:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("opendht._core.Identity.key.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_k);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._id cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_8Identity_5__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_8Identity_5__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_8Identity_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_8Identity_5__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7opendht_5_core_8Identity_4__reduce_cython__(((struct __pyx_obj_7opendht_5_core_Identity *)__pyx_v_self));

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

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

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "self._id cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._id cannot be converted to a Python object for pickling"
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self__id_cannot_be_converted_to, 0, 0);
  __PYX_ERR(1, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._id cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/

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

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._id cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._id cannot be converted to a Python object for pickling"
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_8Identity_7__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_8Identity_7__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_8Identity_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_8Identity_7__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(1, 3, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.Identity.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7opendht_5_core_8Identity_6__setstate_cython__(((struct __pyx_obj_7opendht_5_core_Identity *)__pyx_v_self), __pyx_v___pyx_state);

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

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

  /* "(tree fragment)":4
 *     raise TypeError, "self._id cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._id cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self__id_cannot_be_converted_to, 0, 0);
  __PYX_ERR(1, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._id cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._id cannot be converted to a Python object for pickling"
*/

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

/* "opendht.pyx":578
 *         return k
 * 
 * def aesEncrypt(bytes data, str password) -> bytes :             # <<<<<<<<<<<<<<
 *     cdef size_t d_len = len(data)
 *     cdef cpp.uint8_t* d_ptr = <cpp.uint8_t*>data
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_3aesEncrypt(PyObject *__pyx_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_3aesEncrypt = {"aesEncrypt", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_3aesEncrypt, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_3aesEncrypt(PyObject *__pyx_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_data = 0;
  PyObject *__pyx_v_password = 0;
  #if !CYTHON_VECTORCALL
  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("aesEncrypt (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_data,&__pyx_mstate_global->__pyx_n_u_password,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 578, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 578, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 578, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "aesEncrypt", 0) < (0)) __PYX_ERR(0, 578, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("aesEncrypt", 1, 2, 2, i); __PYX_ERR(0, 578, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 578, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 578, __pyx_L3_error)
    }
    __pyx_v_data = ((PyObject*)values[0]);
    __pyx_v_password = ((PyObject*)values[1]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("aesEncrypt", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 578, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.aesEncrypt", __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), 1, "data", 1))) __PYX_ERR(0, 578, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_password), (&PyUnicode_Type), 1, "password", 1))) __PYX_ERR(0, 578, __pyx_L1_error)
  __pyx_r = __pyx_pf_7opendht_5_core_2aesEncrypt(__pyx_self, __pyx_v_data, __pyx_v_password);

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

static PyObject *__pyx_pf_7opendht_5_core_2aesEncrypt(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_password) {
  size_t __pyx_v_d_len;
  uint8_t *__pyx_v_d_ptr;
  __pyx_t_11opendht_cpp_Blob __pyx_v_indat;
  __pyx_t_11opendht_cpp_Blob __pyx_v_encrypted;
  char *__pyx_v_encrypted_c_str;
  Py_ssize_t __pyx_v_length;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  uint8_t *__pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  std::string __pyx_t_4;
  __pyx_t_11opendht_cpp_Blob __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("aesEncrypt", 0);

  /* "opendht.pyx":579
 * 
 * def aesEncrypt(bytes data, str password) -> bytes :
 *     cdef size_t d_len = len(data)             # <<<<<<<<<<<<<<
 *     cdef cpp.uint8_t* d_ptr = <cpp.uint8_t*>data
 *     cdef cpp.Blob indat
*/
  if (unlikely(__pyx_v_data == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type \047NoneType\047 has no len()");
    __PYX_ERR(0, 579, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_PyBytes_GET_SIZE(__pyx_v_data); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 579, __pyx_L1_error)
  __pyx_v_d_len = __pyx_t_1;

  /* "opendht.pyx":580
 * def aesEncrypt(bytes data, str password) -> bytes :
 *     cdef size_t d_len = len(data)
 *     cdef cpp.uint8_t* d_ptr = <cpp.uint8_t*>data             # <<<<<<<<<<<<<<
 *     cdef cpp.Blob indat
 *     indat.assign(d_ptr, <cpp.uint8_t*>(d_ptr + d_len))
*/
  if (unlikely(__pyx_v_data == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
    __PYX_ERR(0, 580, __pyx_L1_error)
  }
  __pyx_t_2 = __Pyx_PyBytes_AsWritableUString(__pyx_v_data); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 580, __pyx_L1_error)
  __pyx_v_d_ptr = ((uint8_t *)__pyx_t_2);


  /* "opendht.pyx":582
 *     cdef cpp.uint8_t* d_ptr = <cpp.uint8_t*>data
 *     cdef cpp.Blob indat
 *     indat.assign(d_ptr, <cpp.uint8_t*>(d_ptr + d_len))             # <<<<<<<<<<<<<<
 *     cdef cpp.Blob encrypted = cpp.aesEncrypt(indat, password.encode())
 *     cdef char* encrypted_c_str = <char *>encrypted.data()
*/
  try {
    __pyx_v_indat.assign(__pyx_v_d_ptr, ((uint8_t *)(__pyx_v_d_ptr + __pyx_v_d_len)));
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(0, 582, __pyx_L1_error)
  }

  /* "opendht.pyx":583
 *     cdef cpp.Blob indat
 *     indat.assign(d_ptr, <cpp.uint8_t*>(d_ptr + d_len))
 *     cdef cpp.Blob encrypted = cpp.aesEncrypt(indat, password.encode())             # <<<<<<<<<<<<<<
 *     cdef char* encrypted_c_str = <char *>encrypted.data()
 *     cdef Py_ssize_t length = encrypted.size()
*/
  if (unlikely(__pyx_v_password == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "\047NoneType\047 object has no attribute \047%.30s\047", "encode");
    __PYX_ERR(0, 583, __pyx_L1_error)
  }
  __pyx_t_3 = PyUnicode_AsEncodedString(__pyx_v_password, NULL, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 583, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_3); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 583, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  try {
    __pyx_t_5 = dht::crypto::aesEncrypt(__pyx_v_indat, __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_4));
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(0, 583, __pyx_L1_error)
  }

  __pyx_v_encrypted = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_5);

  /* "opendht.pyx":584
 *     indat.assign(d_ptr, <cpp.uint8_t*>(d_ptr + d_len))
 *     cdef cpp.Blob encrypted = cpp.aesEncrypt(indat, password.encode())
 *     cdef char* encrypted_c_str = <char *>encrypted.data()             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t length = encrypted.size()
 *     return encrypted_c_str[:length]
*/
  __pyx_v_encrypted_c_str = ((char *)__pyx_v_encrypted.data());

  /* "opendht.pyx":585
 *     cdef cpp.Blob encrypted = cpp.aesEncrypt(indat, password.encode())
 *     cdef char* encrypted_c_str = <char *>encrypted.data()
 *     cdef Py_ssize_t length = encrypted.size()             # <<<<<<<<<<<<<<
 *     return encrypted_c_str[:length]
 * 
*/
  __pyx_v_length = __pyx_v_encrypted.size();

  /* "opendht.pyx":586
 *     cdef char* encrypted_c_str = <char *>encrypted.data()
 *     cdef Py_ssize_t length = encrypted.size()
 *     return encrypted_c_str[:length]             # <<<<<<<<<<<<<<
 * 
 * def aesDecrypt(bytes data, str password) -> bytes :
*/
  __pyx_t_3 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_encrypted_c_str + 0, __pyx_v_length - 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 586, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = ((PyObject*)__pyx_t_3);
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "opendht.pyx":578
 *         return k
 * 
 * def aesEncrypt(bytes data, str password) -> bytes :             # <<<<<<<<<<<<<<
 *     cdef size_t d_len = len(data)
 *     cdef cpp.uint8_t* d_ptr = <cpp.uint8_t*>data
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("opendht._core.aesEncrypt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;






  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":588
 *     return encrypted_c_str[:length]
 * 
 * def aesDecrypt(bytes data, str password) -> bytes :             # <<<<<<<<<<<<<<
 *     cdef size_t d_len = len(data)
 *     cdef cpp.uint8_t* d_ptr = <cpp.uint8_t*>data
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_5aesDecrypt(PyObject *__pyx_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_5aesDecrypt = {"aesDecrypt", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_5aesDecrypt, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_5aesDecrypt(PyObject *__pyx_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_data = 0;
  PyObject *__pyx_v_password = 0;
  #if !CYTHON_VECTORCALL
  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("aesDecrypt (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_data,&__pyx_mstate_global->__pyx_n_u_password,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 588, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 588, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 588, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "aesDecrypt", 0) < (0)) __PYX_ERR(0, 588, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("aesDecrypt", 1, 2, 2, i); __PYX_ERR(0, 588, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 588, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 588, __pyx_L3_error)
    }
    __pyx_v_data = ((PyObject*)values[0]);
    __pyx_v_password = ((PyObject*)values[1]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("aesDecrypt", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 588, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.aesDecrypt", __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), 1, "data", 1))) __PYX_ERR(0, 588, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_password), (&PyUnicode_Type), 1, "password", 1))) __PYX_ERR(0, 588, __pyx_L1_error)
  __pyx_r = __pyx_pf_7opendht_5_core_4aesDecrypt(__pyx_self, __pyx_v_data, __pyx_v_password);

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

static PyObject *__pyx_pf_7opendht_5_core_4aesDecrypt(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_password) {
  size_t __pyx_v_d_len;
  uint8_t *__pyx_v_d_ptr;
  __pyx_t_11opendht_cpp_Blob __pyx_v_indat;
  __pyx_t_11opendht_cpp_Blob __pyx_v_decrypted;
  char *__pyx_v_decrypted_c_str;
  Py_ssize_t __pyx_v_length;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  uint8_t *__pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  std::string __pyx_t_4;
  __pyx_t_11opendht_cpp_Blob __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("aesDecrypt", 0);

  /* "opendht.pyx":589
 * 
 * def aesDecrypt(bytes data, str password) -> bytes :
 *     cdef size_t d_len = len(data)             # <<<<<<<<<<<<<<
 *     cdef cpp.uint8_t* d_ptr = <cpp.uint8_t*>data
 *     cdef cpp.Blob indat
*/
  if (unlikely(__pyx_v_data == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type \047NoneType\047 has no len()");
    __PYX_ERR(0, 589, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_PyBytes_GET_SIZE(__pyx_v_data); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 589, __pyx_L1_error)
  __pyx_v_d_len = __pyx_t_1;

  /* "opendht.pyx":590
 * def aesDecrypt(bytes data, str password) -> bytes :
 *     cdef size_t d_len = len(data)
 *     cdef cpp.uint8_t* d_ptr = <cpp.uint8_t*>data             # <<<<<<<<<<<<<<
 *     cdef cpp.Blob indat
 *     indat.assign(d_ptr, <cpp.uint8_t*>(d_ptr + d_len))
*/
  if (unlikely(__pyx_v_data == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
    __PYX_ERR(0, 590, __pyx_L1_error)
  }
  __pyx_t_2 = __Pyx_PyBytes_AsWritableUString(__pyx_v_data); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 590, __pyx_L1_error)
  __pyx_v_d_ptr = ((uint8_t *)__pyx_t_2);


  /* "opendht.pyx":592
 *     cdef cpp.uint8_t* d_ptr = <cpp.uint8_t*>data
 *     cdef cpp.Blob indat
 *     indat.assign(d_ptr, <cpp.uint8_t*>(d_ptr + d_len))             # <<<<<<<<<<<<<<
 *     cdef cpp.Blob decrypted = cpp.aesDecrypt(indat, password.encode())
 *     cdef char* decrypted_c_str = <char *>decrypted.data()
*/
  try {
    __pyx_v_indat.assign(__pyx_v_d_ptr, ((uint8_t *)(__pyx_v_d_ptr + __pyx_v_d_len)));
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(0, 592, __pyx_L1_error)
  }

  /* "opendht.pyx":593
 *     cdef cpp.Blob indat
 *     indat.assign(d_ptr, <cpp.uint8_t*>(d_ptr + d_len))
 *     cdef cpp.Blob decrypted = cpp.aesDecrypt(indat, password.encode())             # <<<<<<<<<<<<<<
 *     cdef char* decrypted_c_str = <char *>decrypted.data()
 *     cdef Py_ssize_t length = decrypted.size()
*/
  if (unlikely(__pyx_v_password == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "\047NoneType\047 object has no attribute \047%.30s\047", "encode");
    __PYX_ERR(0, 593, __pyx_L1_error)
  }
  __pyx_t_3 = PyUnicode_AsEncodedString(__pyx_v_password, NULL, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 593, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_3); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 593, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  try {
    __pyx_t_5 = dht::crypto::aesDecrypt(__pyx_v_indat, __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_4));
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(0, 593, __pyx_L1_error)
  }

  __pyx_v_decrypted = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_5);

  /* "opendht.pyx":594
 *     indat.assign(d_ptr, <cpp.uint8_t*>(d_ptr + d_len))
 *     cdef cpp.Blob decrypted = cpp.aesDecrypt(indat, password.encode())
 *     cdef char* decrypted_c_str = <char *>decrypted.data()             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t length = decrypted.size()
 *     return decrypted_c_str[:length]
*/
  __pyx_v_decrypted_c_str = ((char *)__pyx_v_decrypted.data());

  /* "opendht.pyx":595
 *     cdef cpp.Blob decrypted = cpp.aesDecrypt(indat, password.encode())
 *     cdef char* decrypted_c_str = <char *>decrypted.data()
 *     cdef Py_ssize_t length = decrypted.size()             # <<<<<<<<<<<<<<
 *     return decrypted_c_str[:length]
 * 
*/
  __pyx_v_length = __pyx_v_decrypted.size();

  /* "opendht.pyx":596
 *     cdef char* decrypted_c_str = <char *>decrypted.data()
 *     cdef Py_ssize_t length = decrypted.size()
 *     return decrypted_c_str[:length]             # <<<<<<<<<<<<<<
 * 
 * cdef class DhtConfig(object):
*/
  __pyx_t_3 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_decrypted_c_str + 0, __pyx_v_length - 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 596, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = ((PyObject*)__pyx_t_3);
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "opendht.pyx":588
 *     return encrypted_c_str[:length]
 * 
 * def aesDecrypt(bytes data, str password) -> bytes :             # <<<<<<<<<<<<<<
 *     cdef size_t d_len = len(data)
 *     cdef cpp.uint8_t* d_ptr = <cpp.uint8_t*>data
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("opendht._core.aesDecrypt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;






  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":600
 * cdef class DhtConfig(object):
 *     cdef cpp.DhtRunnerConfig _config
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         self._config = cpp.DhtRunnerConfig()
 *         self._config.threaded = True
*/

/* Python wrapper */
static int __pyx_pw_7opendht_5_core_9DhtConfig_1__init__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL_TPNEW
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_pw_7opendht_5_core_9DhtConfig_1__init__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL_TPNEW
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_VECTORCALL_TPNEW
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if !CYTHON_VECTORCALL_TPNEW
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL_TPNEW(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, __pyx_nargs); return -1; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL_TPNEW(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return -1;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__init__", __pyx_kwds); return -1;}
  __pyx_r = __pyx_pf_7opendht_5_core_9DhtConfig___init__(((struct __pyx_obj_7opendht_5_core_DhtConfig *)__pyx_v_self));

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

static int __pyx_pf_7opendht_5_core_9DhtConfig___init__(struct __pyx_obj_7opendht_5_core_DhtConfig *__pyx_v_self) {
  int __pyx_r;
  __pyx_t_11opendht_cpp_DhtRunnerConfig __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "opendht.pyx":601
 *     cdef cpp.DhtRunnerConfig _config
 *     def __init__(self):
 *         self._config = cpp.DhtRunnerConfig()             # <<<<<<<<<<<<<<
 *         self._config.threaded = True
 *     def setIdentity(self, Identity id):
*/
  try {
    __pyx_t_1 = __pyx_t_11opendht_cpp_DhtRunnerConfig();
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(0, 601, __pyx_L1_error)
  }
  __pyx_v_self->_config = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_1);

  /* "opendht.pyx":602
 *     def __init__(self):
 *         self._config = cpp.DhtRunnerConfig()
 *         self._config.threaded = True             # <<<<<<<<<<<<<<
 *     def setIdentity(self, Identity id):
 *         self._config.dht_config.id = id._id
*/
  __pyx_v_self->_config.threaded = 1;

  /* "opendht.pyx":600
 * cdef class DhtConfig(object):
 *     cdef cpp.DhtRunnerConfig _config
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         self._config = cpp.DhtRunnerConfig()
 *         self._config.threaded = True
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("opendht._core.DhtConfig.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;

  return __pyx_r;
}

/* "opendht.pyx":603
 *         self._config = cpp.DhtRunnerConfig()
 *         self._config.threaded = True
 *     def setIdentity(self, Identity id):             # <<<<<<<<<<<<<<
 *         self._config.dht_config.id = id._id
 *     def setBootstrapMode(self, bool bootstrap):
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_9DhtConfig_3setIdentity(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_9DhtConfig_3setIdentity = {"setIdentity", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9DhtConfig_3setIdentity, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_9DhtConfig_3setIdentity(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_7opendht_5_core_Identity *__pyx_v_id = 0;
  #if !CYTHON_VECTORCALL
  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("setIdentity (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_id,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 603, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 603, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setIdentity", 0) < (0)) __PYX_ERR(0, 603, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setIdentity", 1, 1, 1, i); __PYX_ERR(0, 603, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 603, __pyx_L3_error)
    }
    __pyx_v_id = ((struct __pyx_obj_7opendht_5_core_Identity *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setIdentity", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 603, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.DhtConfig.setIdentity", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_id), __pyx_mstate_global->__pyx_ptype_7opendht_5_core_Identity, 1, "id", 0))) __PYX_ERR(0, 603, __pyx_L1_error)
  __pyx_r = __pyx_pf_7opendht_5_core_9DhtConfig_2setIdentity(((struct __pyx_obj_7opendht_5_core_DhtConfig *)__pyx_v_self), __pyx_v_id);

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

static PyObject *__pyx_pf_7opendht_5_core_9DhtConfig_2setIdentity(struct __pyx_obj_7opendht_5_core_DhtConfig *__pyx_v_self, struct __pyx_obj_7opendht_5_core_Identity *__pyx_v_id) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  dht::crypto::Identity __pyx_t_1;
  __Pyx_RefNannySetupContext("setIdentity", 0);

  /* "opendht.pyx":604
 *         self._config.threaded = True
 *     def setIdentity(self, Identity id):
 *         self._config.dht_config.id = id._id             # <<<<<<<<<<<<<<
 *     def setBootstrapMode(self, bool bootstrap):
 *         self._config.dht_config.node_config.is_bootstrap = bootstrap
*/
  __pyx_t_1 = __pyx_v_id->_id;

  __pyx_v_self->_config.dht_config.id = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_1);

  /* "opendht.pyx":603
 *         self._config = cpp.DhtRunnerConfig()
 *         self._config.threaded = True
 *     def setIdentity(self, Identity id):             # <<<<<<<<<<<<<<
 *         self._config.dht_config.id = id._id
 *     def setBootstrapMode(self, bool bootstrap):
*/

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

/* "opendht.pyx":605
 *     def setIdentity(self, Identity id):
 *         self._config.dht_config.id = id._id
 *     def setBootstrapMode(self, bool bootstrap):             # <<<<<<<<<<<<<<
 *         self._config.dht_config.node_config.is_bootstrap = bootstrap
 *     def setNodeId(self, InfoHash id):
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_9DhtConfig_5setBootstrapMode(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_9DhtConfig_5setBootstrapMode = {"setBootstrapMode", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9DhtConfig_5setBootstrapMode, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_9DhtConfig_5setBootstrapMode(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  bool __pyx_v_bootstrap;
  #if !CYTHON_VECTORCALL
  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("setBootstrapMode (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_bootstrap,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 605, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 605, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setBootstrapMode", 0) < (0)) __PYX_ERR(0, 605, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setBootstrapMode", 1, 1, 1, i); __PYX_ERR(0, 605, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 605, __pyx_L3_error)
    }
    __pyx_v_bootstrap = __Pyx_PyObject_IsTrue(values[0]); if (unlikely((__pyx_v_bootstrap == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 605, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setBootstrapMode", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 605, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.DhtConfig.setBootstrapMode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7opendht_5_core_9DhtConfig_4setBootstrapMode(((struct __pyx_obj_7opendht_5_core_DhtConfig *)__pyx_v_self), __pyx_v_bootstrap);

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

  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7opendht_5_core_9DhtConfig_4setBootstrapMode(struct __pyx_obj_7opendht_5_core_DhtConfig *__pyx_v_self, bool __pyx_v_bootstrap) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("setBootstrapMode", 0);

  /* "opendht.pyx":606
 *         self._config.dht_config.id = id._id
 *     def setBootstrapMode(self, bool bootstrap):
 *         self._config.dht_config.node_config.is_bootstrap = bootstrap             # <<<<<<<<<<<<<<
 *     def setNodeId(self, InfoHash id):
 *         self._config.dht_config.node_config.node_id = id._infohash
*/
  __pyx_v_self->_config.dht_config.node_config.is_bootstrap = __pyx_v_bootstrap;

  /* "opendht.pyx":605
 *     def setIdentity(self, Identity id):
 *         self._config.dht_config.id = id._id
 *     def setBootstrapMode(self, bool bootstrap):             # <<<<<<<<<<<<<<
 *         self._config.dht_config.node_config.is_bootstrap = bootstrap
 *     def setNodeId(self, InfoHash id):
*/

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

/* "opendht.pyx":607
 *     def setBootstrapMode(self, bool bootstrap):
 *         self._config.dht_config.node_config.is_bootstrap = bootstrap
 *     def setNodeId(self, InfoHash id):             # <<<<<<<<<<<<<<
 *         self._config.dht_config.node_config.node_id = id._infohash
 *     def setNetwork(self, unsigned netid):
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_9DhtConfig_7setNodeId(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_9DhtConfig_7setNodeId = {"setNodeId", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9DhtConfig_7setNodeId, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_9DhtConfig_7setNodeId(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_v_id = 0;
  #if !CYTHON_VECTORCALL
  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("setNodeId (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_id,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 607, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 607, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setNodeId", 0) < (0)) __PYX_ERR(0, 607, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setNodeId", 1, 1, 1, i); __PYX_ERR(0, 607, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 607, __pyx_L3_error)
    }
    __pyx_v_id = ((struct __pyx_obj_7opendht_5_core_InfoHash *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setNodeId", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 607, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.DhtConfig.setNodeId", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_id), __pyx_mstate_global->__pyx_ptype_7opendht_5_core_InfoHash, 1, "id", 0))) __PYX_ERR(0, 607, __pyx_L1_error)
  __pyx_r = __pyx_pf_7opendht_5_core_9DhtConfig_6setNodeId(((struct __pyx_obj_7opendht_5_core_DhtConfig *)__pyx_v_self), __pyx_v_id);

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

static PyObject *__pyx_pf_7opendht_5_core_9DhtConfig_6setNodeId(struct __pyx_obj_7opendht_5_core_DhtConfig *__pyx_v_self, struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_v_id) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  dht::InfoHash __pyx_t_1;
  __Pyx_RefNannySetupContext("setNodeId", 0);

  /* "opendht.pyx":608
 *         self._config.dht_config.node_config.is_bootstrap = bootstrap
 *     def setNodeId(self, InfoHash id):
 *         self._config.dht_config.node_config.node_id = id._infohash             # <<<<<<<<<<<<<<
 *     def setNetwork(self, unsigned netid):
 *         self._config.dht_config.node_config.network = netid
*/
  __pyx_t_1 = __pyx_v_id->_infohash;

  __pyx_v_self->_config.dht_config.node_config.node_id = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_1);

  /* "opendht.pyx":607
 *     def setBootstrapMode(self, bool bootstrap):
 *         self._config.dht_config.node_config.is_bootstrap = bootstrap
 *     def setNodeId(self, InfoHash id):             # <<<<<<<<<<<<<<
 *         self._config.dht_config.node_config.node_id = id._infohash
 *     def setNetwork(self, unsigned netid):
*/

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

/* "opendht.pyx":609
 *     def setNodeId(self, InfoHash id):
 *         self._config.dht_config.node_config.node_id = id._infohash
 *     def setNetwork(self, unsigned netid):             # <<<<<<<<<<<<<<
 *         self._config.dht_config.node_config.network = netid
 *     def setMaintainStorage(self, bool maintain_storage):
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_9DhtConfig_9setNetwork(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_9DhtConfig_9setNetwork = {"setNetwork", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9DhtConfig_9setNetwork, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_9DhtConfig_9setNetwork(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  unsigned int __pyx_v_netid;
  #if !CYTHON_VECTORCALL
  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("setNetwork (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_netid,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 609, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 609, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setNetwork", 0) < (0)) __PYX_ERR(0, 609, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setNetwork", 1, 1, 1, i); __PYX_ERR(0, 609, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 609, __pyx_L3_error)
    }
    __pyx_v_netid = __Pyx_PyLong_As_unsigned_int(values[0]); if (unlikely((__pyx_v_netid == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 609, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setNetwork", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 609, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.DhtConfig.setNetwork", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7opendht_5_core_9DhtConfig_8setNetwork(((struct __pyx_obj_7opendht_5_core_DhtConfig *)__pyx_v_self), __pyx_v_netid);

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

  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7opendht_5_core_9DhtConfig_8setNetwork(struct __pyx_obj_7opendht_5_core_DhtConfig *__pyx_v_self, unsigned int __pyx_v_netid) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("setNetwork", 0);

  /* "opendht.pyx":610
 *         self._config.dht_config.node_config.node_id = id._infohash
 *     def setNetwork(self, unsigned netid):
 *         self._config.dht_config.node_config.network = netid             # <<<<<<<<<<<<<<
 *     def setMaintainStorage(self, bool maintain_storage):
 *         self._config.dht_config.node_config.maintain_storage = maintain_storage
*/
  __pyx_v_self->_config.dht_config.node_config.network = __pyx_v_netid;

  /* "opendht.pyx":609
 *     def setNodeId(self, InfoHash id):
 *         self._config.dht_config.node_config.node_id = id._infohash
 *     def setNetwork(self, unsigned netid):             # <<<<<<<<<<<<<<
 *         self._config.dht_config.node_config.network = netid
 *     def setMaintainStorage(self, bool maintain_storage):
*/

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

/* "opendht.pyx":611
 *     def setNetwork(self, unsigned netid):
 *         self._config.dht_config.node_config.network = netid
 *     def setMaintainStorage(self, bool maintain_storage):             # <<<<<<<<<<<<<<
 *         self._config.dht_config.node_config.maintain_storage = maintain_storage
 *     def setRateLimit(self, ssize_t max_req_per_sec, ssize_t max_peer_req_per_sec):
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_9DhtConfig_11setMaintainStorage(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_9DhtConfig_11setMaintainStorage = {"setMaintainStorage", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9DhtConfig_11setMaintainStorage, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_9DhtConfig_11setMaintainStorage(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  bool __pyx_v_maintain_storage;
  #if !CYTHON_VECTORCALL
  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("setMaintainStorage (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_maintain_storage,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 611, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 611, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setMaintainStorage", 0) < (0)) __PYX_ERR(0, 611, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setMaintainStorage", 1, 1, 1, i); __PYX_ERR(0, 611, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 611, __pyx_L3_error)
    }
    __pyx_v_maintain_storage = __Pyx_PyObject_IsTrue(values[0]); if (unlikely((__pyx_v_maintain_storage == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 611, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setMaintainStorage", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 611, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.DhtConfig.setMaintainStorage", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7opendht_5_core_9DhtConfig_10setMaintainStorage(((struct __pyx_obj_7opendht_5_core_DhtConfig *)__pyx_v_self), __pyx_v_maintain_storage);

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

  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7opendht_5_core_9DhtConfig_10setMaintainStorage(struct __pyx_obj_7opendht_5_core_DhtConfig *__pyx_v_self, bool __pyx_v_maintain_storage) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("setMaintainStorage", 0);

  /* "opendht.pyx":612
 *         self._config.dht_config.node_config.network = netid
 *     def setMaintainStorage(self, bool maintain_storage):
 *         self._config.dht_config.node_config.maintain_storage = maintain_storage             # <<<<<<<<<<<<<<
 *     def setRateLimit(self, ssize_t max_req_per_sec, ssize_t max_peer_req_per_sec):
 *         self._config.dht_config.node_config.max_req_per_sec = max_req_per_sec
*/
  __pyx_v_self->_config.dht_config.node_config.maintain_storage = __pyx_v_maintain_storage;

  /* "opendht.pyx":611
 *     def setNetwork(self, unsigned netid):
 *         self._config.dht_config.node_config.network = netid
 *     def setMaintainStorage(self, bool maintain_storage):             # <<<<<<<<<<<<<<
 *         self._config.dht_config.node_config.maintain_storage = maintain_storage
 *     def setRateLimit(self, ssize_t max_req_per_sec, ssize_t max_peer_req_per_sec):
*/

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

/* "opendht.pyx":613
 *     def setMaintainStorage(self, bool maintain_storage):
 *         self._config.dht_config.node_config.maintain_storage = maintain_storage
 *     def setRateLimit(self, ssize_t max_req_per_sec, ssize_t max_peer_req_per_sec):             # <<<<<<<<<<<<<<
 *         self._config.dht_config.node_config.max_req_per_sec = max_req_per_sec
 *         self._config.dht_config.node_config.max_peer_req_per_sec = max_peer_req_per_sec
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_9DhtConfig_13setRateLimit(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_9DhtConfig_13setRateLimit = {"setRateLimit", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9DhtConfig_13setRateLimit, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_9DhtConfig_13setRateLimit(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  Py_ssize_t __pyx_v_max_req_per_sec;
  Py_ssize_t __pyx_v_max_peer_req_per_sec;
  #if !CYTHON_VECTORCALL
  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("setRateLimit (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_max_req_per_sec,&__pyx_mstate_global->__pyx_n_u_max_peer_req_per_sec,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 613, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 613, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 613, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setRateLimit", 0) < (0)) __PYX_ERR(0, 613, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setRateLimit", 1, 2, 2, i); __PYX_ERR(0, 613, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 613, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 613, __pyx_L3_error)
    }
    __pyx_v_max_req_per_sec = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_max_req_per_sec == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 613, __pyx_L3_error)
    __pyx_v_max_peer_req_per_sec = PyLong_AsSsize_t(values[1]); if (unlikely((__pyx_v_max_peer_req_per_sec == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 613, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setRateLimit", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 613, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.DhtConfig.setRateLimit", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7opendht_5_core_9DhtConfig_12setRateLimit(((struct __pyx_obj_7opendht_5_core_DhtConfig *)__pyx_v_self), __pyx_v_max_req_per_sec, __pyx_v_max_peer_req_per_sec);

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


  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7opendht_5_core_9DhtConfig_12setRateLimit(struct __pyx_obj_7opendht_5_core_DhtConfig *__pyx_v_self, Py_ssize_t __pyx_v_max_req_per_sec, Py_ssize_t __pyx_v_max_peer_req_per_sec) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("setRateLimit", 0);

  /* "opendht.pyx":614
 *         self._config.dht_config.node_config.maintain_storage = maintain_storage
 *     def setRateLimit(self, ssize_t max_req_per_sec, ssize_t max_peer_req_per_sec):
 *         self._config.dht_config.node_config.max_req_per_sec = max_req_per_sec             # <<<<<<<<<<<<<<
 *         self._config.dht_config.node_config.max_peer_req_per_sec = max_peer_req_per_sec
 *     def setProxyInfo(self, str proxy_server, str push_node_id="", str push_token="", str push_topic="", str push_platform="", str user_agent="", Certificate server_ca = Certificate()):
*/
  __pyx_v_self->_config.dht_config.node_config.max_req_per_sec = __pyx_v_max_req_per_sec;

  /* "opendht.pyx":615
 *     def setRateLimit(self, ssize_t max_req_per_sec, ssize_t max_peer_req_per_sec):
 *         self._config.dht_config.node_config.max_req_per_sec = max_req_per_sec
 *         self._config.dht_config.node_config.max_peer_req_per_sec = max_peer_req_per_sec             # <<<<<<<<<<<<<<
 *     def setProxyInfo(self, str proxy_server, str push_node_id="", str push_token="", str push_topic="", str push_platform="", str user_agent="", Certificate server_ca = Certificate()):
 *         self._config.proxy_server = proxy_server.encode()
*/
  __pyx_v_self->_config.dht_config.node_config.max_peer_req_per_sec = __pyx_v_max_peer_req_per_sec;

  /* "opendht.pyx":613
 *     def setMaintainStorage(self, bool maintain_storage):
 *         self._config.dht_config.node_config.maintain_storage = maintain_storage
 *     def setRateLimit(self, ssize_t max_req_per_sec, ssize_t max_peer_req_per_sec):             # <<<<<<<<<<<<<<
 *         self._config.dht_config.node_config.max_req_per_sec = max_req_per_sec
 *         self._config.dht_config.node_config.max_peer_req_per_sec = max_peer_req_per_sec
*/

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

/* "opendht.pyx":616
 *         self._config.dht_config.node_config.max_req_per_sec = max_req_per_sec
 *         self._config.dht_config.node_config.max_peer_req_per_sec = max_peer_req_per_sec
 *     def setProxyInfo(self, str proxy_server, str push_node_id="", str push_token="", str push_topic="", str push_platform="", str user_agent="", Certificate server_ca = Certificate()):             # <<<<<<<<<<<<<<
 *         self._config.proxy_server = proxy_server.encode()
 *         self._config.push_node_id = push_node_id.encode()
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_9DhtConfig_15setProxyInfo(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_9DhtConfig_15setProxyInfo = {"setProxyInfo", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9DhtConfig_15setProxyInfo, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_9DhtConfig_15setProxyInfo(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_proxy_server = 0;
  PyObject *__pyx_v_push_node_id = 0;
  PyObject *__pyx_v_push_token = 0;
  PyObject *__pyx_v_push_topic = 0;
  PyObject *__pyx_v_push_platform = 0;
  PyObject *__pyx_v_user_agent = 0;
  struct __pyx_obj_7opendht_5_core_Certificate *__pyx_v_server_ca = 0;
  #if !CYTHON_VECTORCALL
  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("setProxyInfo (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_proxy_server,&__pyx_mstate_global->__pyx_n_u_push_node_id,&__pyx_mstate_global->__pyx_n_u_push_token,&__pyx_mstate_global->__pyx_n_u_push_topic,&__pyx_mstate_global->__pyx_n_u_push_platform,&__pyx_mstate_global->__pyx_n_u_user_agent,&__pyx_mstate_global->__pyx_n_u_server_ca,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 616, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 616, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 616, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 616, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 616, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 616, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 616, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 616, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setProxyInfo", 0) < (0)) __PYX_ERR(0, 616, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_kp_u__5));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_kp_u__5));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_kp_u__5));
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_kp_u__5));
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_kp_u__5));
      if (!values[6]) values[6] = __Pyx_NewRef((PyObject *)__pyx_mstate_global->__pyx_k__10);
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setProxyInfo", 0, 1, 7, i); __PYX_ERR(0, 616, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 616, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 616, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 616, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 616, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 616, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 616, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 616, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_kp_u__5));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_kp_u__5));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_kp_u__5));
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_kp_u__5));
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_kp_u__5));
      if (!values[6]) values[6] = __Pyx_NewRef((PyObject *)__pyx_mstate_global->__pyx_k__10);
    }
    __pyx_v_proxy_server = ((PyObject*)values[0]);
    __pyx_v_push_node_id = ((PyObject*)values[1]);
    __pyx_v_push_token = ((PyObject*)values[2]);
    __pyx_v_push_topic = ((PyObject*)values[3]);
    __pyx_v_push_platform = ((PyObject*)values[4]);
    __pyx_v_user_agent = ((PyObject*)values[5]);
    __pyx_v_server_ca = ((struct __pyx_obj_7opendht_5_core_Certificate *)values[6]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setProxyInfo", 0, 1, 7, __pyx_nargs); __PYX_ERR(0, 616, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.DhtConfig.setProxyInfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_proxy_server), (&PyUnicode_Type), 1, "proxy_server", 1))) __PYX_ERR(0, 616, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_push_node_id), (&PyUnicode_Type), 1, "push_node_id", 1))) __PYX_ERR(0, 616, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_push_token), (&PyUnicode_Type), 1, "push_token", 1))) __PYX_ERR(0, 616, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_push_topic), (&PyUnicode_Type), 1, "push_topic", 1))) __PYX_ERR(0, 616, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_push_platform), (&PyUnicode_Type), 1, "push_platform", 1))) __PYX_ERR(0, 616, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_user_agent), (&PyUnicode_Type), 1, "user_agent", 1))) __PYX_ERR(0, 616, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_server_ca), __pyx_mstate_global->__pyx_ptype_7opendht_5_core_Certificate, 1, "server_ca", 0))) __PYX_ERR(0, 616, __pyx_L1_error)
  __pyx_r = __pyx_pf_7opendht_5_core_9DhtConfig_14setProxyInfo(((struct __pyx_obj_7opendht_5_core_DhtConfig *)__pyx_v_self), __pyx_v_proxy_server, __pyx_v_push_node_id, __pyx_v_push_token, __pyx_v_push_topic, __pyx_v_push_platform, __pyx_v_user_agent, __pyx_v_server_ca);

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

static PyObject *__pyx_pf_7opendht_5_core_9DhtConfig_14setProxyInfo(struct __pyx_obj_7opendht_5_core_DhtConfig *__pyx_v_self, PyObject *__pyx_v_proxy_server, PyObject *__pyx_v_push_node_id, PyObject *__pyx_v_push_token, PyObject *__pyx_v_push_topic, PyObject *__pyx_v_push_platform, PyObject *__pyx_v_user_agent, struct __pyx_obj_7opendht_5_core_Certificate *__pyx_v_server_ca) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  std::string __pyx_t_2;
  std::shared_ptr<dht::crypto::Certificate>  __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("setProxyInfo", 0);

  /* "opendht.pyx":617
 *         self._config.dht_config.node_config.max_peer_req_per_sec = max_peer_req_per_sec
 *     def setProxyInfo(self, str proxy_server, str push_node_id="", str push_token="", str push_topic="", str push_platform="", str user_agent="", Certificate server_ca = Certificate()):
 *         self._config.proxy_server = proxy_server.encode()             # <<<<<<<<<<<<<<
 *         self._config.push_node_id = push_node_id.encode()
 *         self._config.push_token = push_token.encode()
*/
  if (unlikely(__pyx_v_proxy_server == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "\047NoneType\047 object has no attribute \047%.30s\047", "encode");
    __PYX_ERR(0, 617, __pyx_L1_error)
  }
  __pyx_t_1 = PyUnicode_AsEncodedString(__pyx_v_proxy_server, NULL, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 617, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_self->_config.proxy_server = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_2);

  /* "opendht.pyx":618
 *     def setProxyInfo(self, str proxy_server, str push_node_id="", str push_token="", str push_topic="", str push_platform="", str user_agent="", Certificate server_ca = Certificate()):
 *         self._config.proxy_server = proxy_server.encode()
 *         self._config.push_node_id = push_node_id.encode()             # <<<<<<<<<<<<<<
 *         self._config.push_token = push_token.encode()
 *         self._config.push_topic = push_topic.encode()
*/
  if (unlikely(__pyx_v_push_node_id == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "\047NoneType\047 object has no attribute \047%.30s\047", "encode");
    __PYX_ERR(0, 618, __pyx_L1_error)
  }
  __pyx_t_1 = PyUnicode_AsEncodedString(__pyx_v_push_node_id, NULL, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 618, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 618, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_self->_config.push_node_id = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_2);

  /* "opendht.pyx":619
 *         self._config.proxy_server = proxy_server.encode()
 *         self._config.push_node_id = push_node_id.encode()
 *         self._config.push_token = push_token.encode()             # <<<<<<<<<<<<<<
 *         self._config.push_topic = push_topic.encode()
 *         self._config.push_platform = push_platform.encode()
*/
  if (unlikely(__pyx_v_push_token == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "\047NoneType\047 object has no attribute \047%.30s\047", "encode");
    __PYX_ERR(0, 619, __pyx_L1_error)
  }
  __pyx_t_1 = PyUnicode_AsEncodedString(__pyx_v_push_token, NULL, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 619, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 619, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_self->_config.push_token = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_2);

  /* "opendht.pyx":620
 *         self._config.push_node_id = push_node_id.encode()
 *         self._config.push_token = push_token.encode()
 *         self._config.push_topic = push_topic.encode()             # <<<<<<<<<<<<<<
 *         self._config.push_platform = push_platform.encode()
 *         self._config.proxy_user_agent = user_agent.encode()
*/
  if (unlikely(__pyx_v_push_topic == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "\047NoneType\047 object has no attribute \047%.30s\047", "encode");
    __PYX_ERR(0, 620, __pyx_L1_error)
  }
  __pyx_t_1 = PyUnicode_AsEncodedString(__pyx_v_push_topic, NULL, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 620, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 620, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_self->_config.push_topic = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_2);

  /* "opendht.pyx":621
 *         self._config.push_token = push_token.encode()
 *         self._config.push_topic = push_topic.encode()
 *         self._config.push_platform = push_platform.encode()             # <<<<<<<<<<<<<<
 *         self._config.proxy_user_agent = user_agent.encode()
 *         self._config.server_ca = server_ca._cert
*/
  if (unlikely(__pyx_v_push_platform == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "\047NoneType\047 object has no attribute \047%.30s\047", "encode");
    __PYX_ERR(0, 621, __pyx_L1_error)
  }
  __pyx_t_1 = PyUnicode_AsEncodedString(__pyx_v_push_platform, NULL, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 621, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 621, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_self->_config.push_platform = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_2);

  /* "opendht.pyx":622
 *         self._config.push_topic = push_topic.encode()
 *         self._config.push_platform = push_platform.encode()
 *         self._config.proxy_user_agent = user_agent.encode()             # <<<<<<<<<<<<<<
 *         self._config.server_ca = server_ca._cert
 *     def setPeerDiscovery(self, bool peer_discovery, bool peer_publish):
*/
  if (unlikely(__pyx_v_user_agent == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "\047NoneType\047 object has no attribute \047%.30s\047", "encode");
    __PYX_ERR(0, 622, __pyx_L1_error)
  }
  __pyx_t_1 = PyUnicode_AsEncodedString(__pyx_v_user_agent, NULL, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 622, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 622, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_self->_config.proxy_user_agent = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_2);

  /* "opendht.pyx":623
 *         self._config.push_platform = push_platform.encode()
 *         self._config.proxy_user_agent = user_agent.encode()
 *         self._config.server_ca = server_ca._cert             # <<<<<<<<<<<<<<
 *     def setPeerDiscovery(self, bool peer_discovery, bool peer_publish):
 *         self._config.peer_discovery = peer_discovery
*/
  __pyx_t_3 = __pyx_v_server_ca->_cert;

  __pyx_v_self->_config.server_ca = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_3);

  /* "opendht.pyx":616
 *         self._config.dht_config.node_config.max_req_per_sec = max_req_per_sec
 *         self._config.dht_config.node_config.max_peer_req_per_sec = max_peer_req_per_sec
 *     def setProxyInfo(self, str proxy_server, str push_node_id="", str push_token="", str push_topic="", str push_platform="", str user_agent="", Certificate server_ca = Certificate()):             # <<<<<<<<<<<<<<
 *         self._config.proxy_server = proxy_server.encode()
 *         self._config.push_node_id = push_node_id.encode()
*/

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

/* "opendht.pyx":624
 *         self._config.proxy_user_agent = user_agent.encode()
 *         self._config.server_ca = server_ca._cert
 *     def setPeerDiscovery(self, bool peer_discovery, bool peer_publish):             # <<<<<<<<<<<<<<
 *         self._config.peer_discovery = peer_discovery
 *         self._config.peer_publish = peer_publish
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_9DhtConfig_17setPeerDiscovery(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_9DhtConfig_17setPeerDiscovery = {"setPeerDiscovery", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9DhtConfig_17setPeerDiscovery, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_9DhtConfig_17setPeerDiscovery(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  bool __pyx_v_peer_discovery;
  bool __pyx_v_peer_publish;
  #if !CYTHON_VECTORCALL
  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("setPeerDiscovery (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_peer_discovery,&__pyx_mstate_global->__pyx_n_u_peer_publish,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 624, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 624, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 624, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setPeerDiscovery", 0) < (0)) __PYX_ERR(0, 624, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setPeerDiscovery", 1, 2, 2, i); __PYX_ERR(0, 624, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 624, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 624, __pyx_L3_error)
    }
    __pyx_v_peer_discovery = __Pyx_PyObject_IsTrue(values[0]); if (unlikely((__pyx_v_peer_discovery == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 624, __pyx_L3_error)
    __pyx_v_peer_publish = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_peer_publish == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 624, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setPeerDiscovery", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 624, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.DhtConfig.setPeerDiscovery", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7opendht_5_core_9DhtConfig_16setPeerDiscovery(((struct __pyx_obj_7opendht_5_core_DhtConfig *)__pyx_v_self), __pyx_v_peer_discovery, __pyx_v_peer_publish);

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


  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7opendht_5_core_9DhtConfig_16setPeerDiscovery(struct __pyx_obj_7opendht_5_core_DhtConfig *__pyx_v_self, bool __pyx_v_peer_discovery, bool __pyx_v_peer_publish) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("setPeerDiscovery", 0);

  /* "opendht.pyx":625
 *         self._config.server_ca = server_ca._cert
 *     def setPeerDiscovery(self, bool peer_discovery, bool peer_publish):
 *         self._config.peer_discovery = peer_discovery             # <<<<<<<<<<<<<<
 *         self._config.peer_publish = peer_publish
 *     def setBound(self, SockAddr bind4, SockAddr bind6):
*/
  __pyx_v_self->_config.peer_discovery = __pyx_v_peer_discovery;

  /* "opendht.pyx":626
 *     def setPeerDiscovery(self, bool peer_discovery, bool peer_publish):
 *         self._config.peer_discovery = peer_discovery
 *         self._config.peer_publish = peer_publish             # <<<<<<<<<<<<<<
 *     def setBound(self, SockAddr bind4, SockAddr bind6):
 *         self._config.bind4 = bind4._addr
*/
  __pyx_v_self->_config.peer_publish = __pyx_v_peer_publish;

  /* "opendht.pyx":624
 *         self._config.proxy_user_agent = user_agent.encode()
 *         self._config.server_ca = server_ca._cert
 *     def setPeerDiscovery(self, bool peer_discovery, bool peer_publish):             # <<<<<<<<<<<<<<
 *         self._config.peer_discovery = peer_discovery
 *         self._config.peer_publish = peer_publish
*/

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

/* "opendht.pyx":627
 *         self._config.peer_discovery = peer_discovery
 *         self._config.peer_publish = peer_publish
 *     def setBound(self, SockAddr bind4, SockAddr bind6):             # <<<<<<<<<<<<<<
 *         self._config.bind4 = bind4._addr
 *         self._config.bind6 = bind6._addr
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_9DhtConfig_19setBound(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_9DhtConfig_19setBound = {"setBound", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9DhtConfig_19setBound, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_9DhtConfig_19setBound(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_7opendht_5_core_SockAddr *__pyx_v_bind4 = 0;
  struct __pyx_obj_7opendht_5_core_SockAddr *__pyx_v_bind6 = 0;
  #if !CYTHON_VECTORCALL
  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("setBound (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_bind4,&__pyx_mstate_global->__pyx_n_u_bind6,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 627, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 627, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 627, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setBound", 0) < (0)) __PYX_ERR(0, 627, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setBound", 1, 2, 2, i); __PYX_ERR(0, 627, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 627, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 627, __pyx_L3_error)
    }
    __pyx_v_bind4 = ((struct __pyx_obj_7opendht_5_core_SockAddr *)values[0]);
    __pyx_v_bind6 = ((struct __pyx_obj_7opendht_5_core_SockAddr *)values[1]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setBound", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 627, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.DhtConfig.setBound", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bind4), __pyx_mstate_global->__pyx_ptype_7opendht_5_core_SockAddr, 1, "bind4", 0))) __PYX_ERR(0, 627, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bind6), __pyx_mstate_global->__pyx_ptype_7opendht_5_core_SockAddr, 1, "bind6", 0))) __PYX_ERR(0, 627, __pyx_L1_error)
  __pyx_r = __pyx_pf_7opendht_5_core_9DhtConfig_18setBound(((struct __pyx_obj_7opendht_5_core_DhtConfig *)__pyx_v_self), __pyx_v_bind4, __pyx_v_bind6);

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

static PyObject *__pyx_pf_7opendht_5_core_9DhtConfig_18setBound(struct __pyx_obj_7opendht_5_core_DhtConfig *__pyx_v_self, struct __pyx_obj_7opendht_5_core_SockAddr *__pyx_v_bind4, struct __pyx_obj_7opendht_5_core_SockAddr *__pyx_v_bind6) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  dht::SockAddr __pyx_t_1;
  __Pyx_RefNannySetupContext("setBound", 0);

  /* "opendht.pyx":628
 *         self._config.peer_publish = peer_publish
 *     def setBound(self, SockAddr bind4, SockAddr bind6):
 *         self._config.bind4 = bind4._addr             # <<<<<<<<<<<<<<
 *         self._config.bind6 = bind6._addr
 * 
*/
  __pyx_t_1 = __pyx_v_bind4->_addr;

  __pyx_v_self->_config.bind4 = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_1);

  /* "opendht.pyx":629
 *     def setBound(self, SockAddr bind4, SockAddr bind6):
 *         self._config.bind4 = bind4._addr
 *         self._config.bind6 = bind6._addr             # <<<<<<<<<<<<<<
 * 
 * cdef class DhtRunner(_WithID):
*/
  __pyx_t_1 = __pyx_v_bind6->_addr;

  __pyx_v_self->_config.bind6 = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_1);

  /* "opendht.pyx":627
 *         self._config.peer_discovery = peer_discovery
 *         self._config.peer_publish = peer_publish
 *     def setBound(self, SockAddr bind4, SockAddr bind6):             # <<<<<<<<<<<<<<
 *         self._config.bind4 = bind4._addr
 *         self._config.bind6 = bind6._addr
*/

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

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._config cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_9DhtConfig_21__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_9DhtConfig_21__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9DhtConfig_21__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_9DhtConfig_21__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7opendht_5_core_9DhtConfig_20__reduce_cython__(((struct __pyx_obj_7opendht_5_core_DhtConfig *)__pyx_v_self));

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

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

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "self._config cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._config cannot be converted to a Python object for pickling"
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self__config_cannot_be_converted, 0, 0);
  __PYX_ERR(1, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._config cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/

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

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._config cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._config cannot be converted to a Python object for pickling"
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_9DhtConfig_23__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_9DhtConfig_23__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9DhtConfig_23__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_9DhtConfig_23__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(1, 3, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.DhtConfig.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7opendht_5_core_9DhtConfig_22__setstate_cython__(((struct __pyx_obj_7opendht_5_core_DhtConfig *)__pyx_v_self), __pyx_v___pyx_state);

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

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

  /* "(tree fragment)":4
 *     raise TypeError, "self._config cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._config cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self__config_cannot_be_converted, 0, 0);
  __PYX_ERR(1, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._config cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._config cannot be converted to a Python object for pickling"
*/

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

/* "opendht.pyx":633
 * cdef class DhtRunner(_WithID):
 *     cdef cpp.shared_ptr[cpp.DhtRunner] thisptr
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.thisptr.reset(new cpp.DhtRunner())
 *     def getId(self) -> InfoHash:
*/

/* Python wrapper */
static int __pyx_pw_7opendht_5_core_9DhtRunner_1__cinit__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL_TPNEW
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_pw_7opendht_5_core_9DhtRunner_1__cinit__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL_TPNEW
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_VECTORCALL_TPNEW
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  #if !CYTHON_VECTORCALL_TPNEW
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL_TPNEW(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL_TPNEW(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return -1;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__cinit__", __pyx_kwds); return -1;}
  __pyx_r = __pyx_pf_7opendht_5_core_9DhtRunner___cinit__(((struct __pyx_obj_7opendht_5_core_DhtRunner *)__pyx_v_self));

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

static int __pyx_pf_7opendht_5_core_9DhtRunner___cinit__(struct __pyx_obj_7opendht_5_core_DhtRunner *__pyx_v_self) {
  int __pyx_r;
  dht::DhtRunner *__pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "opendht.pyx":634
 *     cdef cpp.shared_ptr[cpp.DhtRunner] thisptr
 *     def __cinit__(self):
 *         self.thisptr.reset(new cpp.DhtRunner())             # <<<<<<<<<<<<<<
 *     def getId(self) -> InfoHash:
 *         h = InfoHash()
*/
  try {
    __pyx_t_1 = new dht::DhtRunner();
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(0, 634, __pyx_L1_error)
  }
  __pyx_v_self->thisptr.reset(__pyx_t_1);


  /* "opendht.pyx":633
 * cdef class DhtRunner(_WithID):
 *     cdef cpp.shared_ptr[cpp.DhtRunner] thisptr
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.thisptr.reset(new cpp.DhtRunner())
 *     def getId(self) -> InfoHash:
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("opendht._core.DhtRunner.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;

  return __pyx_r;
}

/* "opendht.pyx":635
 *     def __cinit__(self):
 *         self.thisptr.reset(new cpp.DhtRunner())
 *     def getId(self) -> InfoHash:             # <<<<<<<<<<<<<<
 *         h = InfoHash()
 *         if self.thisptr:
*/

/* Python wrapper */
static struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_pw_7opendht_5_core_9DhtRunner_3getId(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_9DhtRunner_3getId = {"getId", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9DhtRunner_3getId, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_pw_7opendht_5_core_9DhtRunner_3getId(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getId (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getId", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getId", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7opendht_5_core_9DhtRunner_2getId(((struct __pyx_obj_7opendht_5_core_DhtRunner *)__pyx_v_self));

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

static struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_pf_7opendht_5_core_9DhtRunner_2getId(struct __pyx_obj_7opendht_5_core_DhtRunner *__pyx_v_self) {
  struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_v_h = NULL;
  struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  bool __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getId", 0);

  /* "opendht.pyx":636
 *         self.thisptr.reset(new cpp.DhtRunner())
 *     def getId(self) -> InfoHash:
 *         h = InfoHash()             # <<<<<<<<<<<<<<
 *         if self.thisptr:
 *             h._infohash = self.thisptr.get().getId()
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7opendht_5_core_InfoHash, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 636, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_h = ((struct __pyx_obj_7opendht_5_core_InfoHash *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "opendht.pyx":637
 *     def getId(self) -> InfoHash:
 *         h = InfoHash()
 *         if self.thisptr:             # <<<<<<<<<<<<<<
 *             h._infohash = self.thisptr.get().getId()
 *         return h
*/
  __pyx_t_4 = __pyx_v_self->thisptr.operator bool();

  if (__pyx_t_4) {


    /* "opendht.pyx":638
 *         h = InfoHash()
 *         if self.thisptr:
 *             h._infohash = self.thisptr.get().getId()             # <<<<<<<<<<<<<<
 *         return h
 *     def getPublicKey(self) -> PublicKey:
*/
    __pyx_v_h->_infohash = __pyx_v_self->thisptr.get()->getId();

    /* "opendht.pyx":637
 *     def getId(self) -> InfoHash:
 *         h = InfoHash()
 *         if self.thisptr:             # <<<<<<<<<<<<<<
 *             h._infohash = self.thisptr.get().getId()
 *         return h
*/
  }

  /* "opendht.pyx":639
 *         if self.thisptr:
 *             h._infohash = self.thisptr.get().getId()
 *         return h             # <<<<<<<<<<<<<<
 *     def getPublicKey(self) -> PublicKey:
 *         if not self.thisptr:
*/
  {
    struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __Pyx_INCREF((PyObject *)__pyx_v_h);
      __pyx_r = __pyx_v_h;
    }
    __Pyx_XDECREF((PyObject *)__pyx_temp);
  }
  goto __pyx_L0;

  /* "opendht.pyx":635
 *     def __cinit__(self):
 *         self.thisptr.reset(new cpp.DhtRunner())
 *     def getId(self) -> InfoHash:             # <<<<<<<<<<<<<<
 *         h = InfoHash()
 *         if self.thisptr:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("opendht._core.DhtRunner.getId", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_h);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":640
 *             h._infohash = self.thisptr.get().getId()
 *         return h
 *     def getPublicKey(self) -> PublicKey:             # <<<<<<<<<<<<<<
 *         if not self.thisptr:
 *             raise ValueError("DhtRunner is not initialized")
*/

/* Python wrapper */
static struct __pyx_obj_7opendht_5_core_PublicKey *__pyx_pw_7opendht_5_core_9DhtRunner_5getPublicKey(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_9DhtRunner_5getPublicKey = {"getPublicKey", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9DhtRunner_5getPublicKey, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static struct __pyx_obj_7opendht_5_core_PublicKey *__pyx_pw_7opendht_5_core_9DhtRunner_5getPublicKey(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  struct __pyx_obj_7opendht_5_core_PublicKey *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getPublicKey (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getPublicKey", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getPublicKey", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7opendht_5_core_9DhtRunner_4getPublicKey(((struct __pyx_obj_7opendht_5_core_DhtRunner *)__pyx_v_self));

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

static struct __pyx_obj_7opendht_5_core_PublicKey *__pyx_pf_7opendht_5_core_9DhtRunner_4getPublicKey(struct __pyx_obj_7opendht_5_core_DhtRunner *__pyx_v_self) {
  struct __pyx_obj_7opendht_5_core_PublicKey *__pyx_v_pk = NULL;
  struct __pyx_obj_7opendht_5_core_PublicKey *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getPublicKey", 0);

  /* "opendht.pyx":641
 *         return h
 *     def getPublicKey(self) -> PublicKey:
 *         if not self.thisptr:             # <<<<<<<<<<<<<<
 *             raise ValueError("DhtRunner is not initialized")
 *         pk = PublicKey()
*/
  __pyx_t_1 = ((!__pyx_v_self->thisptr) != 0);

  if (unlikely(__pyx_t_1)) {


    /* "opendht.pyx":642
 *     def getPublicKey(self) -> PublicKey:
 *         if not self.thisptr:
 *             raise ValueError("DhtRunner is not initialized")             # <<<<<<<<<<<<<<
 *         pk = PublicKey()
 *         pk._key = self.thisptr.get().getPublicKey()
*/
    __pyx_t_3 = NULL;
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_DhtRunner_is_not_initialized};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 642, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 642, __pyx_L1_error)

    /* "opendht.pyx":641
 *         return h
 *     def getPublicKey(self) -> PublicKey:
 *         if not self.thisptr:             # <<<<<<<<<<<<<<
 *             raise ValueError("DhtRunner is not initialized")
 *         pk = PublicKey()
*/
  }

  /* "opendht.pyx":643
 *         if not self.thisptr:
 *             raise ValueError("DhtRunner is not initialized")
 *         pk = PublicKey()             # <<<<<<<<<<<<<<
 *         pk._key = self.thisptr.get().getPublicKey()
 *         return pk
*/
  __pyx_t_3 = NULL;
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7opendht_5_core_PublicKey, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 643, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_2);
  }
  __pyx_v_pk = ((struct __pyx_obj_7opendht_5_core_PublicKey *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "opendht.pyx":644
 *             raise ValueError("DhtRunner is not initialized")
 *         pk = PublicKey()
 *         pk._key = self.thisptr.get().getPublicKey()             # <<<<<<<<<<<<<<
 *         return pk
 *     def getNodeId(self) -> InfoHash:
*/
  __pyx_v_pk->_key = __pyx_v_self->thisptr.get()->getPublicKey();

  /* "opendht.pyx":645
 *         pk = PublicKey()
 *         pk._key = self.thisptr.get().getPublicKey()
 *         return pk             # <<<<<<<<<<<<<<
 *     def getNodeId(self) -> InfoHash:
 *         h = InfoHash()
*/
  {
    struct __pyx_obj_7opendht_5_core_PublicKey *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __Pyx_INCREF((PyObject *)__pyx_v_pk);
      __pyx_r = __pyx_v_pk;
    }
    __Pyx_XDECREF((PyObject *)__pyx_temp);
  }
  goto __pyx_L0;

  /* "opendht.pyx":640
 *             h._infohash = self.thisptr.get().getId()
 *         return h
 *     def getPublicKey(self) -> PublicKey:             # <<<<<<<<<<<<<<
 *         if not self.thisptr:
 *             raise ValueError("DhtRunner is not initialized")
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("opendht._core.DhtRunner.getPublicKey", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_pk);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":646
 *         pk._key = self.thisptr.get().getPublicKey()
 *         return pk
 *     def getNodeId(self) -> InfoHash:             # <<<<<<<<<<<<<<
 *         h = InfoHash()
 *         if self.thisptr:
*/

/* Python wrapper */
static struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_pw_7opendht_5_core_9DhtRunner_7getNodeId(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_9DhtRunner_7getNodeId = {"getNodeId", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9DhtRunner_7getNodeId, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_pw_7opendht_5_core_9DhtRunner_7getNodeId(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getNodeId (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getNodeId", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getNodeId", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7opendht_5_core_9DhtRunner_6getNodeId(((struct __pyx_obj_7opendht_5_core_DhtRunner *)__pyx_v_self));

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

static struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_pf_7opendht_5_core_9DhtRunner_6getNodeId(struct __pyx_obj_7opendht_5_core_DhtRunner *__pyx_v_self) {
  struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_v_h = NULL;
  struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  bool __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getNodeId", 0);

  /* "opendht.pyx":647
 *         return pk
 *     def getNodeId(self) -> InfoHash:
 *         h = InfoHash()             # <<<<<<<<<<<<<<
 *         if self.thisptr:
 *             h._infohash = self.thisptr.get().getNodeId()
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7opendht_5_core_InfoHash, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 647, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_h = ((struct __pyx_obj_7opendht_5_core_InfoHash *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "opendht.pyx":648
 *     def getNodeId(self) -> InfoHash:
 *         h = InfoHash()
 *         if self.thisptr:             # <<<<<<<<<<<<<<
 *             h._infohash = self.thisptr.get().getNodeId()
 *         return h
*/
  __pyx_t_4 = __pyx_v_self->thisptr.operator bool();

  if (__pyx_t_4) {


    /* "opendht.pyx":649
 *         h = InfoHash()
 *         if self.thisptr:
 *             h._infohash = self.thisptr.get().getNodeId()             # <<<<<<<<<<<<<<
 *         return h
 *     def ping(self, SockAddr addr, done_cb=None):
*/
    __pyx_v_h->_infohash = __pyx_v_self->thisptr.get()->getNodeId();

    /* "opendht.pyx":648
 *     def getNodeId(self) -> InfoHash:
 *         h = InfoHash()
 *         if self.thisptr:             # <<<<<<<<<<<<<<
 *             h._infohash = self.thisptr.get().getNodeId()
 *         return h
*/
  }

  /* "opendht.pyx":650
 *         if self.thisptr:
 *             h._infohash = self.thisptr.get().getNodeId()
 *         return h             # <<<<<<<<<<<<<<
 *     def ping(self, SockAddr addr, done_cb=None):
 *         if done_cb:
*/
  {
    struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __Pyx_INCREF((PyObject *)__pyx_v_h);
      __pyx_r = __pyx_v_h;
    }
    __Pyx_XDECREF((PyObject *)__pyx_temp);
  }
  goto __pyx_L0;

  /* "opendht.pyx":646
 *         pk._key = self.thisptr.get().getPublicKey()
 *         return pk
 *     def getNodeId(self) -> InfoHash:             # <<<<<<<<<<<<<<
 *         h = InfoHash()
 *         if self.thisptr:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("opendht._core.DhtRunner.getNodeId", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_h);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":651
 *             h._infohash = self.thisptr.get().getNodeId()
 *         return h
 *     def ping(self, SockAddr addr, done_cb=None):             # <<<<<<<<<<<<<<
 *         if done_cb:
 *             cb_obj = {'done':done_cb}
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_9DhtRunner_9ping(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_9DhtRunner_9ping = {"ping", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9DhtRunner_9ping, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_9DhtRunner_9ping(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_7opendht_5_core_SockAddr *__pyx_v_addr = 0;
  PyObject *__pyx_v_done_cb = 0;
  #if !CYTHON_VECTORCALL
  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("ping (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_addr,&__pyx_mstate_global->__pyx_n_u_done_cb,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 651, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 651, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 651, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "ping", 0) < (0)) __PYX_ERR(0, 651, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("ping", 0, 1, 2, i); __PYX_ERR(0, 651, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 651, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 651, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_addr = ((struct __pyx_obj_7opendht_5_core_SockAddr *)values[0]);
    __pyx_v_done_cb = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ping", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 651, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.DhtRunner.ping", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_addr), __pyx_mstate_global->__pyx_ptype_7opendht_5_core_SockAddr, 1, "addr", 0))) __PYX_ERR(0, 651, __pyx_L1_error)
  __pyx_r = __pyx_pf_7opendht_5_core_9DhtRunner_8ping(((struct __pyx_obj_7opendht_5_core_DhtRunner *)__pyx_v_self), __pyx_v_addr, __pyx_v_done_cb);

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

/* "opendht.pyx":660
 *             pending = 0
 *             ok = False
 *             def tmp_done(ok_ret):             # <<<<<<<<<<<<<<
 *                 nonlocal pending, ok, lock
 *                 with lock:
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_9DhtRunner_4ping_1tmp_done(PyObject *__pyx_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_9DhtRunner_4ping_1tmp_done = {"tmp_done", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9DhtRunner_4ping_1tmp_done, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_9DhtRunner_4ping_1tmp_done(PyObject *__pyx_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_ok_ret = 0;
  #if !CYTHON_VECTORCALL
  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("tmp_done (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_ok_ret,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 660, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 660, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "tmp_done", 0) < (0)) __PYX_ERR(0, 660, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("tmp_done", 1, 1, 1, i); __PYX_ERR(0, 660, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 660, __pyx_L3_error)
    }
    __pyx_v_ok_ret = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("tmp_done", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 660, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.DhtRunner.ping.tmp_done", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7opendht_5_core_9DhtRunner_4ping_tmp_done(__pyx_self, __pyx_v_ok_ret);

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

static PyObject *__pyx_pf_7opendht_5_core_9DhtRunner_4ping_tmp_done(PyObject *__pyx_self, PyObject *__pyx_v_ok_ret) {
  struct __pyx_obj_7opendht_5_core___pyx_scope_struct__ping *__pyx_cur_scope;
  struct __pyx_obj_7opendht_5_core___pyx_scope_struct__ping *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __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("tmp_done", 0);
  __pyx_outer_scope = (struct __pyx_obj_7opendht_5_core___pyx_scope_struct__ping *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "opendht.pyx":662
 *             def tmp_done(ok_ret):
 *                 nonlocal pending, ok, lock
 *                 with lock:             # <<<<<<<<<<<<<<
 *                     ok = ok_ret
 *                     pending -= 1
*/
  /*with:*/ {
    if (unlikely(!__pyx_cur_scope->__pyx_v_lock)) { __Pyx_RaiseClosureNameError("lock"); __PYX_ERR(0, 662, __pyx_L1_error) }
    __pyx_t_1 = __Pyx_PyObject_LookupSpecial(__pyx_cur_scope->__pyx_v_lock, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 662, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = NULL;
    __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_cur_scope->__pyx_v_lock, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 662, __pyx_L3_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 662, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    /*try:*/ {
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_6);
        __Pyx_XGOTREF(__pyx_t_7);
        __Pyx_XGOTREF(__pyx_t_8);
        /*try:*/ {

          /* "opendht.pyx":663
 *                 nonlocal pending, ok, lock
 *                 with lock:
 *                     ok = ok_ret             # <<<<<<<<<<<<<<
 *                     pending -= 1
 *                     lock.notify()
*/
          __Pyx_INCREF(__pyx_v_ok_ret);
          __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_ok);
          __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_ok, __pyx_v_ok_ret);
          __Pyx_GIVEREF(__pyx_v_ok_ret);

          /* "opendht.pyx":664
 *                 with lock:
 *                     ok = ok_ret
 *                     pending -= 1             # <<<<<<<<<<<<<<
 *                     lock.notify()
 *             with lock:
*/
          if (unlikely(!__pyx_cur_scope->__pyx_v_pending)) { __Pyx_RaiseClosureNameError("pending"); __PYX_ERR(0, 664, __pyx_L7_error) }
          __pyx_t_2 = __Pyx_PyLong_SubtractObjC(__pyx_cur_scope->__pyx_v_pending, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 664, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_pending);
          __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_pending, __pyx_t_2);
          __Pyx_GIVEREF(__pyx_t_2);
          __pyx_t_2 = 0;

          /* "opendht.pyx":665
 *                     ok = ok_ret
 *                     pending -= 1
 *                     lock.notify()             # <<<<<<<<<<<<<<
 *             with lock:
 *                 pending += 1
*/
          if (unlikely(!__pyx_cur_scope->__pyx_v_lock)) { __Pyx_RaiseClosureNameError("lock"); __PYX_ERR(0, 665, __pyx_L7_error) }
          __pyx_t_4 = __pyx_cur_scope->__pyx_v_lock;
          __Pyx_INCREF(__pyx_t_4);
          __pyx_t_5 = 0;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
            __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_notify, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 665, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_2);
          }
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

          /* "opendht.pyx":662
 *             def tmp_done(ok_ret):
 *                 nonlocal pending, ok, lock
 *                 with lock:             # <<<<<<<<<<<<<<
 *                     ok = ok_ret
 *                     pending -= 1
*/
        }
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        goto __pyx_L12_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_4); __pyx_t_4 = 0;
        /*except:*/ {
          __Pyx_AddTraceback("opendht._core.DhtRunner.ping.tmp_done", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_4, &__pyx_t_3) < 0) __PYX_ERR(0, 662, __pyx_L9_except_error)
          __Pyx_XGOTREF(__pyx_t_2);
          __Pyx_XGOTREF(__pyx_t_4);
          __Pyx_XGOTREF(__pyx_t_3);
          {
            PyObject* __pyx_temp[3] = {__pyx_t_2, __pyx_t_4, __pyx_t_3};
            __pyx_t_9 = __Pyx_PyTuple_FromArray(__pyx_temp, 3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 662, __pyx_L9_except_error)
            __Pyx_GOTREF(__pyx_t_9);
          }
          __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 662, __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, 662, __pyx_L9_except_error)
          __pyx_t_12 = (!__pyx_t_11);


          if (unlikely(__pyx_t_12)) {

            __Pyx_GIVEREF(__pyx_t_2);
            __Pyx_GIVEREF(__pyx_t_4);
            __Pyx_XGIVEREF(__pyx_t_3);
            __Pyx_ErrRestoreWithState(__pyx_t_2, __pyx_t_4, __pyx_t_3);
            __pyx_t_2 = 0;  __pyx_t_4 = 0;  __pyx_t_3 = 0; 
            __PYX_ERR(0, 662, __pyx_L9_except_error)
          }
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          goto __pyx_L8_exception_handled;
        }
        __pyx_L9_except_error:;
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
        goto __pyx_L1_error;
        __pyx_L8_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
        __pyx_L12_try_end:;
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_1) {
          __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_mstate_global->__pyx_tuple[0], NULL);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 662, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        }
        goto __pyx_L6;
      }
      __pyx_L6:;
    }
    goto __pyx_L16;
    __pyx_L3_error:;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L1_error;
    __pyx_L16:;
  }

  /* "opendht.pyx":660
 *             pending = 0
 *             ok = False
 *             def tmp_done(ok_ret):             # <<<<<<<<<<<<<<
 *                 nonlocal pending, ok, lock
 *                 with lock:
*/

  /* 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("opendht._core.DhtRunner.ping.tmp_done", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":651
 *             h._infohash = self.thisptr.get().getNodeId()
 *         return h
 *     def ping(self, SockAddr addr, done_cb=None):             # <<<<<<<<<<<<<<
 *         if done_cb:
 *             cb_obj = {'done':done_cb}
*/

static PyObject *__pyx_pf_7opendht_5_core_9DhtRunner_8ping(struct __pyx_obj_7opendht_5_core_DhtRunner *__pyx_v_self, struct __pyx_obj_7opendht_5_core_SockAddr *__pyx_v_addr, PyObject *__pyx_v_done_cb) {
  struct __pyx_obj_7opendht_5_core___pyx_scope_struct__ping *__pyx_cur_scope;
  PyObject *__pyx_v_cb_obj = NULL;
  PyObject *__pyx_v_tmp_done = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __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_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ping", 0);
  __pyx_cur_scope = (struct __pyx_obj_7opendht_5_core___pyx_scope_struct__ping *)__pyx_tp_new_7opendht_5_core___pyx_scope_struct__ping(__pyx_mstate_global->__pyx_ptype_7opendht_5_core___pyx_scope_struct__ping, __pyx_mstate_global->__pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7opendht_5_core___pyx_scope_struct__ping *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 651, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }

  /* "opendht.pyx":652
 *         return h
 *     def ping(self, SockAddr addr, done_cb=None):
 *         if done_cb:             # <<<<<<<<<<<<<<
 *             cb_obj = {'done':done_cb}
 *             ref.Py_INCREF(cb_obj)
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_done_cb); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 652, __pyx_L1_error)
  if (__pyx_t_1) {


    /* "opendht.pyx":653
 *     def ping(self, SockAddr addr, done_cb=None):
 *         if done_cb:
 *             cb_obj = {'done':done_cb}             # <<<<<<<<<<<<<<
 *             ref.Py_INCREF(cb_obj)
 *             self.thisptr.get().bootstrap(addr._addr, cpp.bindDoneCbSimple(done_callback_simple, <void*>cb_obj))
*/
    __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 653, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_done, __pyx_v_done_cb) < (0)) __PYX_ERR(0, 653, __pyx_L1_error)
    __pyx_v_cb_obj = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "opendht.pyx":654
 *         if done_cb:
 *             cb_obj = {'done':done_cb}
 *             ref.Py_INCREF(cb_obj)             # <<<<<<<<<<<<<<
 *             self.thisptr.get().bootstrap(addr._addr, cpp.bindDoneCbSimple(done_callback_simple, <void*>cb_obj))
 *         else:
*/
    Py_INCREF(__pyx_v_cb_obj);

    /* "opendht.pyx":655
 *             cb_obj = {'done':done_cb}
 *             ref.Py_INCREF(cb_obj)
 *             self.thisptr.get().bootstrap(addr._addr, cpp.bindDoneCbSimple(done_callback_simple, <void*>cb_obj))             # <<<<<<<<<<<<<<
 *         else:
 *             lock = threading.Condition()
*/
    __pyx_v_self->thisptr.get()->bootstrap(__pyx_v_addr->_addr, dht::bindDoneCbSimple(__pyx_f_7opendht_5_core_done_callback_simple, ((void *)__pyx_v_cb_obj)));

    /* "opendht.pyx":652
 *         return h
 *     def ping(self, SockAddr addr, done_cb=None):
 *         if done_cb:             # <<<<<<<<<<<<<<
 *             cb_obj = {'done':done_cb}
 *             ref.Py_INCREF(cb_obj)
*/
    goto __pyx_L3;
  }

  /* "opendht.pyx":657
 *             self.thisptr.get().bootstrap(addr._addr, cpp.bindDoneCbSimple(done_callback_simple, <void*>cb_obj))
 *         else:
 *             lock = threading.Condition()             # <<<<<<<<<<<<<<
 *             pending = 0
 *             ok = False
*/
  /*else*/ {
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_threading); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 657, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_Condition); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 657, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 657, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_cur_scope->__pyx_v_lock = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "opendht.pyx":658
 *         else:
 *             lock = threading.Condition()
 *             pending = 0             # <<<<<<<<<<<<<<
 *             ok = False
 *             def tmp_done(ok_ret):
*/
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0);
    __pyx_cur_scope->__pyx_v_pending = __pyx_mstate_global->__pyx_int_0;

    /* "opendht.pyx":659
 *             lock = threading.Condition()
 *             pending = 0
 *             ok = False             # <<<<<<<<<<<<<<
 *             def tmp_done(ok_ret):
 *                 nonlocal pending, ok, lock
*/
    __Pyx_INCREF(Py_False);
    __Pyx_GIVEREF(Py_False);
    __pyx_cur_scope->__pyx_v_ok = Py_False;

    /* "opendht.pyx":660
 *             pending = 0
 *             ok = False
 *             def tmp_done(ok_ret):             # <<<<<<<<<<<<<<
 *                 nonlocal pending, ok, lock
 *                 with lock:
*/
    __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_9DhtRunner_4ping_1tmp_done, 0, __pyx_mstate_global->__pyx_n_u_ping_locals_tmp_done, ((PyObject*)__pyx_cur_scope), __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 660, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_tmp_done = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "opendht.pyx":666
 *                     pending -= 1
 *                     lock.notify()
 *             with lock:             # <<<<<<<<<<<<<<
 *                 pending += 1
 *                 self.ping(addr, done_cb=tmp_done)
*/
    /*with:*/ {
      __pyx_t_7 = __Pyx_PyObject_LookupSpecial(__pyx_cur_scope->__pyx_v_lock, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 666, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_cur_scope->__pyx_v_lock, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 666, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 = 1;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
        assert(__pyx_t_5);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
        __pyx_t_6 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
        __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 666, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __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:*/ {

            /* "opendht.pyx":667
 *                     lock.notify()
 *             with lock:
 *                 pending += 1             # <<<<<<<<<<<<<<
 *                 self.ping(addr, done_cb=tmp_done)
 *                 while pending > 0:
*/
            __pyx_t_2 = __Pyx_PyLong_AddObjC(__pyx_cur_scope->__pyx_v_pending, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 667, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_pending);
            __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_pending, __pyx_t_2);
            __Pyx_GIVEREF(__pyx_t_2);
            __pyx_t_2 = 0;

            /* "opendht.pyx":668
 *             with lock:
 *                 pending += 1
 *                 self.ping(addr, done_cb=tmp_done)             # <<<<<<<<<<<<<<
 *                 while pending > 0:
 *                     lock.wait()
*/
            __pyx_t_3 = ((PyObject *)__pyx_v_self);
            __Pyx_INCREF(__pyx_t_3);
            __pyx_t_6 = 0;
            {
              PyObject *__pyx_callargs[3] = {__pyx_t_3, ((PyObject *)__pyx_v_addr), __pyx_v_tmp_done};
              #if CYTHON_VECTORCALL
              __pyx_t_5 = __pyx_mstate_global->__pyx_tuple[1];
              if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 668, __pyx_L8_error)
              __Pyx_INCREF(__pyx_t_5);
              #else
              {
                PyObject *__pyx_temp[1] = {__pyx_mstate_global->__pyx_n_u_done_cb};
                __pyx_t_5 = __Pyx_MakeKwargDict(__pyx_temp, __pyx_callargs+2, 1);
                if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 668, __pyx_L8_error)
                __Pyx_GOTREF(__pyx_t_5);
              }
              #endif
              __pyx_t_2 = __Pyx_Object_VectorcallMethodKwds((PyObject*)__pyx_mstate_global->__pyx_n_u_ping, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_5);
              __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
              __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
              if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 668, __pyx_L8_error)
              __Pyx_GOTREF(__pyx_t_2);
            }
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

            /* "opendht.pyx":669
 *                 pending += 1
 *                 self.ping(addr, done_cb=tmp_done)
 *                 while pending > 0:             # <<<<<<<<<<<<<<
 *                     lock.wait()
 *             return ok
*/
            while (1) {
              __pyx_t_1 = __Pyx_PyObject_CompareBoolGt_object_int(__pyx_cur_scope->__pyx_v_pending, __pyx_mstate_global->__pyx_int_0, Py_GT); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 669, __pyx_L8_error)

              if (!__pyx_t_1) break;

              /* "opendht.pyx":670
 *                 self.ping(addr, done_cb=tmp_done)
 *                 while pending > 0:
 *                     lock.wait()             # <<<<<<<<<<<<<<
 *             return ok
 *     def bootstrap(self, str host, str port=None):
*/
              __pyx_t_5 = __pyx_cur_scope->__pyx_v_lock;
              __Pyx_INCREF(__pyx_t_5);
              __pyx_t_6 = 0;
              {
                PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
                __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_wait, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
                if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 670, __pyx_L8_error)
                __Pyx_GOTREF(__pyx_t_2);
              }
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            }

            /* "opendht.pyx":666
 *                     pending -= 1
 *                     lock.notify()
 *             with lock:             # <<<<<<<<<<<<<<
 *                 pending += 1
 *                 self.ping(addr, done_cb=tmp_done)
*/
          }
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          goto __pyx_L13_try_end;
          __pyx_L8_error:;
          __Pyx_XDECREF(__pyx_t_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("opendht._core.DhtRunner.ping", __pyx_clineno, __pyx_lineno, __pyx_filename);
            if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_5, &__pyx_t_3) < 0) __PYX_ERR(0, 666, __pyx_L10_except_error)
            __Pyx_XGOTREF(__pyx_t_2);
            __Pyx_XGOTREF(__pyx_t_5);
            __Pyx_XGOTREF(__pyx_t_3);
            {
              PyObject* __pyx_temp[3] = {__pyx_t_2, __pyx_t_5, __pyx_t_3};
              __pyx_t_4 = __Pyx_PyTuple_FromArray(__pyx_temp, 3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 666, __pyx_L10_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, 666, __pyx_L10_except_error)
            __Pyx_GOTREF(__pyx_t_11);
            __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_11);
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            if (__pyx_t_1 < (0)) __PYX_ERR(0, 666, __pyx_L10_except_error)
            __pyx_t_12 = (!__pyx_t_1);


            if (unlikely(__pyx_t_12)) {

              __Pyx_GIVEREF(__pyx_t_2);
              __Pyx_GIVEREF(__pyx_t_5);
              __Pyx_XGIVEREF(__pyx_t_3);
              __Pyx_ErrRestoreWithState(__pyx_t_2, __pyx_t_5, __pyx_t_3);
              __pyx_t_2 = 0;  __pyx_t_5 = 0;  __pyx_t_3 = 0; 
              __PYX_ERR(0, 666, __pyx_L10_except_error)
            }
            __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
            goto __pyx_L9_exception_handled;
          }
          __pyx_L10_except_error:;
          __Pyx_XGIVEREF(__pyx_t_8);
          __Pyx_XGIVEREF(__pyx_t_9);
          __Pyx_XGIVEREF(__pyx_t_10);
          __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
          goto __pyx_L1_error;
          __pyx_L9_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_L13_try_end:;
        }
      }
      /*finally:*/ {
        /*normal exit:*/{
          if (__pyx_t_7) {
            __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_mstate_global->__pyx_tuple[0], NULL);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 666, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_10);
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          }
          goto __pyx_L7;
        }
        __pyx_L7:;
      }
      goto __pyx_L19;
      __pyx_L4_error:;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L1_error;
      __pyx_L19:;
    }

    /* "opendht.pyx":671
 *                 while pending > 0:
 *                     lock.wait()
 *             return ok             # <<<<<<<<<<<<<<
 *     def bootstrap(self, str host, str port=None):
 *         host_bytes = host.encode()
*/
    {
      PyObject *__pyx_temp;
      {
        __pyx_temp = __pyx_r;
        __Pyx_INCREF(__pyx_cur_scope->__pyx_v_ok);
        __pyx_r = __pyx_cur_scope->__pyx_v_ok;
      }
      __Pyx_XDECREF(__pyx_temp);
    }
    goto __pyx_L0;
  }
  __pyx_L3:;

  /* "opendht.pyx":651
 *             h._infohash = self.thisptr.get().getNodeId()
 *         return h
 *     def ping(self, SockAddr addr, done_cb=None):             # <<<<<<<<<<<<<<
 *         if done_cb:
 *             cb_obj = {'done':done_cb}
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("opendht._core.DhtRunner.ping", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_cb_obj);
  __Pyx_XDECREF(__pyx_v_tmp_done);
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":672
 *                     lock.wait()
 *             return ok
 *     def bootstrap(self, str host, str port=None):             # <<<<<<<<<<<<<<
 *         host_bytes = host.encode()
 *         port_bytes = port.encode() if port else b'4222'
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_9DhtRunner_11bootstrap(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_9DhtRunner_11bootstrap = {"bootstrap", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9DhtRunner_11bootstrap, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_9DhtRunner_11bootstrap(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_host = 0;
  PyObject *__pyx_v_port = 0;
  #if !CYTHON_VECTORCALL
  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("bootstrap (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_host,&__pyx_mstate_global->__pyx_n_u_port,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 672, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 672, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 672, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "bootstrap", 0) < (0)) __PYX_ERR(0, 672, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject*)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("bootstrap", 0, 1, 2, i); __PYX_ERR(0, 672, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 672, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 672, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject*)Py_None));
    }
    __pyx_v_host = ((PyObject*)values[0]);
    __pyx_v_port = ((PyObject*)values[1]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("bootstrap", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 672, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.DhtRunner.bootstrap", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_host), (&PyUnicode_Type), 1, "host", 1))) __PYX_ERR(0, 672, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_port), (&PyUnicode_Type), 1, "port", 1))) __PYX_ERR(0, 672, __pyx_L1_error)
  __pyx_r = __pyx_pf_7opendht_5_core_9DhtRunner_10bootstrap(((struct __pyx_obj_7opendht_5_core_DhtRunner *)__pyx_v_self), __pyx_v_host, __pyx_v_port);

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

static PyObject *__pyx_pf_7opendht_5_core_9DhtRunner_10bootstrap(struct __pyx_obj_7opendht_5_core_DhtRunner *__pyx_v_self, PyObject *__pyx_v_host, PyObject *__pyx_v_port) {
  PyObject *__pyx_v_host_bytes = NULL;
  PyObject *__pyx_v_port_bytes = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  const char *__pyx_t_4;
  const char *__pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("bootstrap", 0);

  /* "opendht.pyx":673
 *             return ok
 *     def bootstrap(self, str host, str port=None):
 *         host_bytes = host.encode()             # <<<<<<<<<<<<<<
 *         port_bytes = port.encode() if port else b'4222'
 *         self.thisptr.get().bootstrap(<cpp.const_char*>host_bytes, <cpp.const_char*>port_bytes)
*/
  if (unlikely(__pyx_v_host == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "\047NoneType\047 object has no attribute \047%.30s\047", "encode");
    __PYX_ERR(0, 673, __pyx_L1_error)
  }
  __pyx_t_1 = PyUnicode_AsEncodedString(__pyx_v_host, NULL, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 673, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_host_bytes = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "opendht.pyx":674
 *     def bootstrap(self, str host, str port=None):
 *         host_bytes = host.encode()
 *         port_bytes = port.encode() if port else b'4222'             # <<<<<<<<<<<<<<
 *         self.thisptr.get().bootstrap(<cpp.const_char*>host_bytes, <cpp.const_char*>port_bytes)
 *     def run(self, Identity id=None, is_bootstrap=False, cpp.in_port_t port=0, str ipv4="", str ipv6="", DhtConfig config=DhtConfig()):
*/
  if (__pyx_v_port == Py_None) __pyx_t_2 = 0;
  else
  {
    Py_ssize_t __pyx_temp = __Pyx_PyUnicode_IS_TRUE(__pyx_v_port);
    if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(0, 674, __pyx_L1_error)
    __pyx_t_2 = (__pyx_temp != 0);
  }

  if (__pyx_t_2) {
    if (unlikely(__pyx_v_port == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "\047NoneType\047 object has no attribute \047%.30s\047", "encode");
      __PYX_ERR(0, 674, __pyx_L1_error)
    }
    __pyx_t_3 = PyUnicode_AsEncodedString(__pyx_v_port, NULL, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 674, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
  } else {
    __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_b_4222);
    __pyx_t_1 = __pyx_mstate_global->__pyx_kp_b_4222;
  }

  __pyx_v_port_bytes = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "opendht.pyx":675
 *         host_bytes = host.encode()
 *         port_bytes = port.encode() if port else b'4222'
 *         self.thisptr.get().bootstrap(<cpp.const_char*>host_bytes, <cpp.const_char*>port_bytes)             # <<<<<<<<<<<<<<
 *     def run(self, Identity id=None, is_bootstrap=False, cpp.in_port_t port=0, str ipv4="", str ipv6="", DhtConfig config=DhtConfig()):
 *         if id:
*/
  __pyx_t_4 = __Pyx_PyBytes_AsString(__pyx_v_host_bytes); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 675, __pyx_L1_error)
  if (unlikely(__pyx_v_port_bytes == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
    __PYX_ERR(0, 675, __pyx_L1_error)
  }
  __pyx_t_5 = __Pyx_PyBytes_AsString(__pyx_v_port_bytes); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(0, 675, __pyx_L1_error)
  __pyx_v_self->thisptr.get()->bootstrap(((const char *)__pyx_t_4), ((const char *)__pyx_t_5));



  /* "opendht.pyx":672
 *                     lock.wait()
 *             return ok
 *     def bootstrap(self, str host, str port=None):             # <<<<<<<<<<<<<<
 *         host_bytes = host.encode()
 *         port_bytes = port.encode() if port else b'4222'
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("opendht._core.DhtRunner.bootstrap", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_host_bytes);
  __Pyx_XDECREF(__pyx_v_port_bytes);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":676
 *         port_bytes = port.encode() if port else b'4222'
 *         self.thisptr.get().bootstrap(<cpp.const_char*>host_bytes, <cpp.const_char*>port_bytes)
 *     def run(self, Identity id=None, is_bootstrap=False, cpp.in_port_t port=0, str ipv4="", str ipv6="", DhtConfig config=DhtConfig()):             # <<<<<<<<<<<<<<
 *         if id:
 *             config.setIdentity(id)
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_9DhtRunner_13run(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_9DhtRunner_13run = {"run", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9DhtRunner_13run, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_9DhtRunner_13run(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_7opendht_5_core_Identity *__pyx_v_id = 0;
  CYTHON_UNUSED PyObject *__pyx_v_is_bootstrap = 0;
  __pyx_t_11opendht_cpp_in_port_t __pyx_v_port;
  PyObject *__pyx_v_ipv4 = 0;
  PyObject *__pyx_v_ipv6 = 0;
  struct __pyx_obj_7opendht_5_core_DhtConfig *__pyx_v_config = 0;
  #if !CYTHON_VECTORCALL
  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("run (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_id,&__pyx_mstate_global->__pyx_n_u_is_bootstrap,&__pyx_mstate_global->__pyx_n_u_port,&__pyx_mstate_global->__pyx_n_u_ipv4,&__pyx_mstate_global->__pyx_n_u_ipv6,&__pyx_mstate_global->__pyx_n_u_config,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 676, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 676, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 676, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 676, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 676, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 676, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 676, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "run", 0) < (0)) __PYX_ERR(0, 676, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7opendht_5_core_Identity *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_False));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_kp_u__5));
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_kp_u__5));
      if (!values[5]) values[5] = __Pyx_NewRef((PyObject *)__pyx_mstate_global->__pyx_k__11);
    } else {
      switch (__pyx_nargs) {
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 676, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 676, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 676, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 676, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 676, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 676, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7opendht_5_core_Identity *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_False));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_kp_u__5));
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_kp_u__5));
      if (!values[5]) values[5] = __Pyx_NewRef((PyObject *)__pyx_mstate_global->__pyx_k__11);
    }
    __pyx_v_id = ((struct __pyx_obj_7opendht_5_core_Identity *)values[0]);
    __pyx_v_is_bootstrap = values[1];
    if (values[2]) {
      __pyx_v_port = __Pyx_PyLong_As_uint16_t(values[2]); if (unlikely((__pyx_v_port == ((uint16_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 676, __pyx_L3_error)
    } else {
      __pyx_v_port = ((__pyx_t_11opendht_cpp_in_port_t)0);
    }
    __pyx_v_ipv4 = ((PyObject*)values[3]);
    __pyx_v_ipv6 = ((PyObject*)values[4]);
    __pyx_v_config = ((struct __pyx_obj_7opendht_5_core_DhtConfig *)values[5]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("run", 0, 0, 6, __pyx_nargs); __PYX_ERR(0, 676, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.DhtRunner.run", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_id), __pyx_mstate_global->__pyx_ptype_7opendht_5_core_Identity, 1, "id", 0))) __PYX_ERR(0, 676, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ipv4), (&PyUnicode_Type), 1, "ipv4", 1))) __PYX_ERR(0, 676, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ipv6), (&PyUnicode_Type), 1, "ipv6", 1))) __PYX_ERR(0, 676, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_config), __pyx_mstate_global->__pyx_ptype_7opendht_5_core_DhtConfig, 1, "config", 0))) __PYX_ERR(0, 676, __pyx_L1_error)
  __pyx_r = __pyx_pf_7opendht_5_core_9DhtRunner_12run(((struct __pyx_obj_7opendht_5_core_DhtRunner *)__pyx_v_self), __pyx_v_id, __pyx_v_is_bootstrap, __pyx_v_port, __pyx_v_ipv4, __pyx_v_ipv6, __pyx_v_config);

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

  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7opendht_5_core_9DhtRunner_12run(struct __pyx_obj_7opendht_5_core_DhtRunner *__pyx_v_self, struct __pyx_obj_7opendht_5_core_Identity *__pyx_v_id, CYTHON_UNUSED PyObject *__pyx_v_is_bootstrap, __pyx_t_11opendht_cpp_in_port_t __pyx_v_port, PyObject *__pyx_v_ipv4, PyObject *__pyx_v_ipv6, struct __pyx_obj_7opendht_5_core_DhtConfig *__pyx_v_config) {
  PyObject *__pyx_v_bind4 = NULL;
  PyObject *__pyx_v_bind6 = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_t_5;
  const char *__pyx_t_6;
  const char *__pyx_t_7;
  const char *__pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("run", 0);

  /* "opendht.pyx":677
 *         self.thisptr.get().bootstrap(<cpp.const_char*>host_bytes, <cpp.const_char*>port_bytes)
 *     def run(self, Identity id=None, is_bootstrap=False, cpp.in_port_t port=0, str ipv4="", str ipv6="", DhtConfig config=DhtConfig()):
 *         if id:             # <<<<<<<<<<<<<<
 *             config.setIdentity(id)
 *         if ipv4 or ipv6:
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_id)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 677, __pyx_L1_error)
  if (__pyx_t_1) {


    /* "opendht.pyx":678
 *     def run(self, Identity id=None, is_bootstrap=False, cpp.in_port_t port=0, str ipv4="", str ipv6="", DhtConfig config=DhtConfig()):
 *         if id:
 *             config.setIdentity(id)             # <<<<<<<<<<<<<<
 *         if ipv4 or ipv6:
 *             bind4 = ipv4.encode() if ipv4 else b''
*/
    __pyx_t_3 = ((PyObject *)__pyx_v_config);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, ((PyObject *)__pyx_v_id)};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_setIdentity, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 678, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "opendht.pyx":677
 *         self.thisptr.get().bootstrap(<cpp.const_char*>host_bytes, <cpp.const_char*>port_bytes)
 *     def run(self, Identity id=None, is_bootstrap=False, cpp.in_port_t port=0, str ipv4="", str ipv6="", DhtConfig config=DhtConfig()):
 *         if id:             # <<<<<<<<<<<<<<
 *             config.setIdentity(id)
 *         if ipv4 or ipv6:
*/
  }

  /* "opendht.pyx":679
 *         if id:
 *             config.setIdentity(id)
 *         if ipv4 or ipv6:             # <<<<<<<<<<<<<<
 *             bind4 = ipv4.encode() if ipv4 else b''
 *             bind6 = ipv6.encode() if ipv6 else b''
*/
  if (__pyx_v_ipv4 == Py_None) __pyx_t_5 = 0;
  else
  {
    Py_ssize_t __pyx_temp = __Pyx_PyUnicode_IS_TRUE(__pyx_v_ipv4);
    if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(0, 679, __pyx_L1_error)
    __pyx_t_5 = (__pyx_temp != 0);
  }

  if (!__pyx_t_5) {

  } else {

    __pyx_t_1 = __pyx_t_5;

    goto __pyx_L5_bool_binop_done;
  }
  if (__pyx_v_ipv6 == Py_None) __pyx_t_5 = 0;
  else
  {
    Py_ssize_t __pyx_temp = __Pyx_PyUnicode_IS_TRUE(__pyx_v_ipv6);
    if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(0, 679, __pyx_L1_error)
    __pyx_t_5 = (__pyx_temp != 0);
  }


  __pyx_t_1 = __pyx_t_5;

  __pyx_L5_bool_binop_done:;
  if (__pyx_t_1) {


    /* "opendht.pyx":680
 *             config.setIdentity(id)
 *         if ipv4 or ipv6:
 *             bind4 = ipv4.encode() if ipv4 else b''             # <<<<<<<<<<<<<<
 *             bind6 = ipv6.encode() if ipv6 else b''
 *             self.thisptr.get().run(bind4, bind6, str(port).encode(), config._config)
*/
    if (__pyx_v_ipv4 == Py_None) __pyx_t_1 = 0;
    else
    {
      Py_ssize_t __pyx_temp = __Pyx_PyUnicode_IS_TRUE(__pyx_v_ipv4);
      if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(0, 680, __pyx_L1_error)
      __pyx_t_1 = (__pyx_temp != 0);
    }

    if (__pyx_t_1) {
      if (unlikely(__pyx_v_ipv4 == Py_None)) {
        PyErr_Format(PyExc_AttributeError, "\047NoneType\047 object has no attribute \047%.30s\047", "encode");
        __PYX_ERR(0, 680, __pyx_L1_error)
      }
      __pyx_t_3 = PyUnicode_AsEncodedString(__pyx_v_ipv4, NULL, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 680, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = __pyx_t_3;
      __pyx_t_3 = 0;
    } else {
      __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_b__5);
      __pyx_t_2 = __pyx_mstate_global->__pyx_kp_b__5;
    }

    __pyx_v_bind4 = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "opendht.pyx":681
 *         if ipv4 or ipv6:
 *             bind4 = ipv4.encode() if ipv4 else b''
 *             bind6 = ipv6.encode() if ipv6 else b''             # <<<<<<<<<<<<<<
 *             self.thisptr.get().run(bind4, bind6, str(port).encode(), config._config)
 *         else:
*/
    if (__pyx_v_ipv6 == Py_None) __pyx_t_1 = 0;
    else
    {
      Py_ssize_t __pyx_temp = __Pyx_PyUnicode_IS_TRUE(__pyx_v_ipv6);
      if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(0, 681, __pyx_L1_error)
      __pyx_t_1 = (__pyx_temp != 0);
    }

    if (__pyx_t_1) {
      if (unlikely(__pyx_v_ipv6 == Py_None)) {
        PyErr_Format(PyExc_AttributeError, "\047NoneType\047 object has no attribute \047%.30s\047", "encode");
        __PYX_ERR(0, 681, __pyx_L1_error)
      }
      __pyx_t_3 = PyUnicode_AsEncodedString(__pyx_v_ipv6, NULL, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 681, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = __pyx_t_3;
      __pyx_t_3 = 0;
    } else {
      __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_b__5);
      __pyx_t_2 = __pyx_mstate_global->__pyx_kp_b__5;
    }

    __pyx_v_bind6 = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "opendht.pyx":682
 *             bind4 = ipv4.encode() if ipv4 else b''
 *             bind6 = ipv6.encode() if ipv6 else b''
 *             self.thisptr.get().run(bind4, bind6, str(port).encode(), config._config)             # <<<<<<<<<<<<<<
 *         else:
 *             self.thisptr.get().run(port, config._config)
*/
    if (unlikely(__pyx_v_bind4 == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
      __PYX_ERR(0, 682, __pyx_L1_error)
    }
    __pyx_t_6 = __Pyx_PyBytes_AsString(__pyx_v_bind4); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 682, __pyx_L1_error)
    if (unlikely(__pyx_v_bind6 == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
      __PYX_ERR(0, 682, __pyx_L1_error)
    }
    __pyx_t_7 = __Pyx_PyBytes_AsString(__pyx_v_bind6); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(0, 682, __pyx_L1_error)
    __pyx_t_2 = __Pyx_PyLong_From_uint16_t(__pyx_v_port); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 682, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_Unicode(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 682, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyUnicode_AsEncodedString(((PyObject*)__pyx_t_3), NULL, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 682, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_8 = __Pyx_PyBytes_AsString(__pyx_t_2); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 682, __pyx_L1_error)
    __pyx_v_self->thisptr.get()->run(__pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_v_config->_config);


    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;


    /* "opendht.pyx":679
 *         if id:
 *             config.setIdentity(id)
 *         if ipv4 or ipv6:             # <<<<<<<<<<<<<<
 *             bind4 = ipv4.encode() if ipv4 else b''
 *             bind6 = ipv6.encode() if ipv6 else b''
*/
    goto __pyx_L4;
  }

  /* "opendht.pyx":684
 *             self.thisptr.get().run(bind4, bind6, str(port).encode(), config._config)
 *         else:
 *             self.thisptr.get().run(port, config._config)             # <<<<<<<<<<<<<<
 *     def join(self):
 *         self.thisptr.get().join()
*/
  /*else*/ {
    __pyx_v_self->thisptr.get()->run(__pyx_v_port, __pyx_v_config->_config);
  }
  __pyx_L4:;

  /* "opendht.pyx":676
 *         port_bytes = port.encode() if port else b'4222'
 *         self.thisptr.get().bootstrap(<cpp.const_char*>host_bytes, <cpp.const_char*>port_bytes)
 *     def run(self, Identity id=None, is_bootstrap=False, cpp.in_port_t port=0, str ipv4="", str ipv6="", DhtConfig config=DhtConfig()):             # <<<<<<<<<<<<<<
 *         if id:
 *             config.setIdentity(id)
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("opendht._core.DhtRunner.run", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_bind4);
  __Pyx_XDECREF(__pyx_v_bind6);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":685
 *         else:
 *             self.thisptr.get().run(port, config._config)
 *     def join(self):             # <<<<<<<<<<<<<<
 *         self.thisptr.get().join()
 *     def shutdown(self, shutdown_cb=None):
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_9DhtRunner_15join(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_9DhtRunner_15join = {"join", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9DhtRunner_15join, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_9DhtRunner_15join(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("join (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("join", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("join", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7opendht_5_core_9DhtRunner_14join(((struct __pyx_obj_7opendht_5_core_DhtRunner *)__pyx_v_self));

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

static PyObject *__pyx_pf_7opendht_5_core_9DhtRunner_14join(struct __pyx_obj_7opendht_5_core_DhtRunner *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("join", 0);

  /* "opendht.pyx":686
 *             self.thisptr.get().run(port, config._config)
 *     def join(self):
 *         self.thisptr.get().join()             # <<<<<<<<<<<<<<
 *     def shutdown(self, shutdown_cb=None):
 *         cb_obj = {'shutdown':shutdown_cb}
*/
  __pyx_v_self->thisptr.get()->join();

  /* "opendht.pyx":685
 *         else:
 *             self.thisptr.get().run(port, config._config)
 *     def join(self):             # <<<<<<<<<<<<<<
 *         self.thisptr.get().join()
 *     def shutdown(self, shutdown_cb=None):
*/

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

/* "opendht.pyx":687
 *     def join(self):
 *         self.thisptr.get().join()
 *     def shutdown(self, shutdown_cb=None):             # <<<<<<<<<<<<<<
 *         cb_obj = {'shutdown':shutdown_cb}
 *         ref.Py_INCREF(cb_obj)
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_9DhtRunner_17shutdown(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_9DhtRunner_17shutdown = {"shutdown", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9DhtRunner_17shutdown, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_9DhtRunner_17shutdown(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_shutdown_cb = 0;
  #if !CYTHON_VECTORCALL
  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("shutdown (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_shutdown_cb,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 687, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 687, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "shutdown", 0) < (0)) __PYX_ERR(0, 687, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 687, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_shutdown_cb = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("shutdown", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 687, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.DhtRunner.shutdown", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7opendht_5_core_9DhtRunner_16shutdown(((struct __pyx_obj_7opendht_5_core_DhtRunner *)__pyx_v_self), __pyx_v_shutdown_cb);

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

static PyObject *__pyx_pf_7opendht_5_core_9DhtRunner_16shutdown(struct __pyx_obj_7opendht_5_core_DhtRunner *__pyx_v_self, PyObject *__pyx_v_shutdown_cb) {
  PyObject *__pyx_v_cb_obj = NULL;
  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("shutdown", 0);

  /* "opendht.pyx":688
 *         self.thisptr.get().join()
 *     def shutdown(self, shutdown_cb=None):
 *         cb_obj = {'shutdown':shutdown_cb}             # <<<<<<<<<<<<<<
 *         ref.Py_INCREF(cb_obj)
 *         self.thisptr.get().shutdown(cpp.bindShutdownCb(shutdown_callback, <void*>cb_obj))
*/
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 688, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_shutdown, __pyx_v_shutdown_cb) < (0)) __PYX_ERR(0, 688, __pyx_L1_error)
  __pyx_v_cb_obj = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "opendht.pyx":689
 *     def shutdown(self, shutdown_cb=None):
 *         cb_obj = {'shutdown':shutdown_cb}
 *         ref.Py_INCREF(cb_obj)             # <<<<<<<<<<<<<<
 *         self.thisptr.get().shutdown(cpp.bindShutdownCb(shutdown_callback, <void*>cb_obj))
 *     def registerType(self, ValueType type):
*/
  Py_INCREF(__pyx_v_cb_obj);

  /* "opendht.pyx":690
 *         cb_obj = {'shutdown':shutdown_cb}
 *         ref.Py_INCREF(cb_obj)
 *         self.thisptr.get().shutdown(cpp.bindShutdownCb(shutdown_callback, <void*>cb_obj))             # <<<<<<<<<<<<<<
 *     def registerType(self, ValueType type):
 *         self.thisptr.get().registerType(deref(type._value))
*/
  __pyx_v_self->thisptr.get()->shutdown(dht::bindShutdownCb(__pyx_f_7opendht_5_core_shutdown_callback, ((void *)__pyx_v_cb_obj)));

  /* "opendht.pyx":687
 *     def join(self):
 *         self.thisptr.get().join()
 *     def shutdown(self, shutdown_cb=None):             # <<<<<<<<<<<<<<
 *         cb_obj = {'shutdown':shutdown_cb}
 *         ref.Py_INCREF(cb_obj)
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("opendht._core.DhtRunner.shutdown", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_cb_obj);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":691
 *         ref.Py_INCREF(cb_obj)
 *         self.thisptr.get().shutdown(cpp.bindShutdownCb(shutdown_callback, <void*>cb_obj))
 *     def registerType(self, ValueType type):             # <<<<<<<<<<<<<<
 *         self.thisptr.get().registerType(deref(type._value))
 *     def enableLogging(self):
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_9DhtRunner_19registerType(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_9DhtRunner_19registerType = {"registerType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9DhtRunner_19registerType, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_9DhtRunner_19registerType(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_7opendht_5_core_ValueType *__pyx_v_type = 0;
  #if !CYTHON_VECTORCALL
  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("registerType (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 691, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 691, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "registerType", 0) < (0)) __PYX_ERR(0, 691, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("registerType", 1, 1, 1, i); __PYX_ERR(0, 691, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 691, __pyx_L3_error)
    }
    __pyx_v_type = ((struct __pyx_obj_7opendht_5_core_ValueType *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("registerType", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 691, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.DhtRunner.registerType", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_type), __pyx_mstate_global->__pyx_ptype_7opendht_5_core_ValueType, 1, "type", 0))) __PYX_ERR(0, 691, __pyx_L1_error)
  __pyx_r = __pyx_pf_7opendht_5_core_9DhtRunner_18registerType(((struct __pyx_obj_7opendht_5_core_DhtRunner *)__pyx_v_self), __pyx_v_type);

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

static PyObject *__pyx_pf_7opendht_5_core_9DhtRunner_18registerType(struct __pyx_obj_7opendht_5_core_DhtRunner *__pyx_v_self, struct __pyx_obj_7opendht_5_core_ValueType *__pyx_v_type) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("registerType", 0);

  /* "opendht.pyx":692
 *         self.thisptr.get().shutdown(cpp.bindShutdownCb(shutdown_callback, <void*>cb_obj))
 *     def registerType(self, ValueType type):
 *         self.thisptr.get().registerType(deref(type._value))             # <<<<<<<<<<<<<<
 *     def enableLogging(self):
 *         cpp.enableLogging(self.thisptr.get()[0])
*/
  __pyx_v_self->thisptr.get()->registerType((*__pyx_v_type->_value));

  /* "opendht.pyx":691
 *         ref.Py_INCREF(cb_obj)
 *         self.thisptr.get().shutdown(cpp.bindShutdownCb(shutdown_callback, <void*>cb_obj))
 *     def registerType(self, ValueType type):             # <<<<<<<<<<<<<<
 *         self.thisptr.get().registerType(deref(type._value))
 *     def enableLogging(self):
*/

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

/* "opendht.pyx":693
 *     def registerType(self, ValueType type):
 *         self.thisptr.get().registerType(deref(type._value))
 *     def enableLogging(self):             # <<<<<<<<<<<<<<
 *         cpp.enableLogging(self.thisptr.get()[0])
 *     def disableLogging(self):
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_9DhtRunner_21enableLogging(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_9DhtRunner_21enableLogging = {"enableLogging", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9DhtRunner_21enableLogging, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_9DhtRunner_21enableLogging(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("enableLogging (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("enableLogging", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("enableLogging", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7opendht_5_core_9DhtRunner_20enableLogging(((struct __pyx_obj_7opendht_5_core_DhtRunner *)__pyx_v_self));

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

static PyObject *__pyx_pf_7opendht_5_core_9DhtRunner_20enableLogging(struct __pyx_obj_7opendht_5_core_DhtRunner *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("enableLogging", 0);

  /* "opendht.pyx":694
 *         self.thisptr.get().registerType(deref(type._value))
 *     def enableLogging(self):
 *         cpp.enableLogging(self.thisptr.get()[0])             # <<<<<<<<<<<<<<
 *     def disableLogging(self):
 *         cpp.disableLogging(self.thisptr.get()[0])
*/
  dht::log::enableLogging((__pyx_v_self->thisptr.get()[0]));

  /* "opendht.pyx":693
 *     def registerType(self, ValueType type):
 *         self.thisptr.get().registerType(deref(type._value))
 *     def enableLogging(self):             # <<<<<<<<<<<<<<
 *         cpp.enableLogging(self.thisptr.get()[0])
 *     def disableLogging(self):
*/

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

/* "opendht.pyx":695
 *     def enableLogging(self):
 *         cpp.enableLogging(self.thisptr.get()[0])
 *     def disableLogging(self):             # <<<<<<<<<<<<<<
 *         cpp.disableLogging(self.thisptr.get()[0])
 *     def enableFileLogging(self, str path):
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_9DhtRunner_23disableLogging(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_9DhtRunner_23disableLogging = {"disableLogging", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9DhtRunner_23disableLogging, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_9DhtRunner_23disableLogging(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("disableLogging (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("disableLogging", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("disableLogging", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7opendht_5_core_9DhtRunner_22disableLogging(((struct __pyx_obj_7opendht_5_core_DhtRunner *)__pyx_v_self));

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

static PyObject *__pyx_pf_7opendht_5_core_9DhtRunner_22disableLogging(struct __pyx_obj_7opendht_5_core_DhtRunner *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("disableLogging", 0);

  /* "opendht.pyx":696
 *         cpp.enableLogging(self.thisptr.get()[0])
 *     def disableLogging(self):
 *         cpp.disableLogging(self.thisptr.get()[0])             # <<<<<<<<<<<<<<
 *     def enableFileLogging(self, str path):
 *         cpp.enableFileLogging(self.thisptr.get()[0], path.encode())
*/
  dht::log::disableLogging((__pyx_v_self->thisptr.get()[0]));

  /* "opendht.pyx":695
 *     def enableLogging(self):
 *         cpp.enableLogging(self.thisptr.get()[0])
 *     def disableLogging(self):             # <<<<<<<<<<<<<<
 *         cpp.disableLogging(self.thisptr.get()[0])
 *     def enableFileLogging(self, str path):
*/

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

/* "opendht.pyx":697
 *     def disableLogging(self):
 *         cpp.disableLogging(self.thisptr.get()[0])
 *     def enableFileLogging(self, str path):             # <<<<<<<<<<<<<<
 *         cpp.enableFileLogging(self.thisptr.get()[0], path.encode())
 *     def isRunning(self):
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_9DhtRunner_25enableFileLogging(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_9DhtRunner_25enableFileLogging = {"enableFileLogging", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9DhtRunner_25enableFileLogging, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_9DhtRunner_25enableFileLogging(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_path = 0;
  #if !CYTHON_VECTORCALL
  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("enableFileLogging (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_path,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 697, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 697, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "enableFileLogging", 0) < (0)) __PYX_ERR(0, 697, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("enableFileLogging", 1, 1, 1, i); __PYX_ERR(0, 697, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 697, __pyx_L3_error)
    }
    __pyx_v_path = ((PyObject*)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("enableFileLogging", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 697, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.DhtRunner.enableFileLogging", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_path), (&PyUnicode_Type), 1, "path", 1))) __PYX_ERR(0, 697, __pyx_L1_error)
  __pyx_r = __pyx_pf_7opendht_5_core_9DhtRunner_24enableFileLogging(((struct __pyx_obj_7opendht_5_core_DhtRunner *)__pyx_v_self), __pyx_v_path);

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

static PyObject *__pyx_pf_7opendht_5_core_9DhtRunner_24enableFileLogging(struct __pyx_obj_7opendht_5_core_DhtRunner *__pyx_v_self, PyObject *__pyx_v_path) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  std::string __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("enableFileLogging", 0);

  /* "opendht.pyx":698
 *         cpp.disableLogging(self.thisptr.get()[0])
 *     def enableFileLogging(self, str path):
 *         cpp.enableFileLogging(self.thisptr.get()[0], path.encode())             # <<<<<<<<<<<<<<
 *     def isRunning(self):
 *         return self.thisptr.get().isRunning()
*/
  if (unlikely(__pyx_v_path == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "\047NoneType\047 object has no attribute \047%.30s\047", "encode");
    __PYX_ERR(0, 698, __pyx_L1_error)
  }
  __pyx_t_1 = PyUnicode_AsEncodedString(__pyx_v_path, NULL, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 698, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 698, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  dht::log::enableFileLogging((__pyx_v_self->thisptr.get()[0]), __pyx_t_2);


  /* "opendht.pyx":697
 *     def disableLogging(self):
 *         cpp.disableLogging(self.thisptr.get()[0])
 *     def enableFileLogging(self, str path):             # <<<<<<<<<<<<<<
 *         cpp.enableFileLogging(self.thisptr.get()[0], path.encode())
 *     def isRunning(self):
*/

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

/* "opendht.pyx":699
 *     def enableFileLogging(self, str path):
 *         cpp.enableFileLogging(self.thisptr.get()[0], path.encode())
 *     def isRunning(self):             # <<<<<<<<<<<<<<
 *         return self.thisptr.get().isRunning()
 *     def getBound(self, cpp.sa_family_t af = 0):
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_9DhtRunner_27isRunning(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_9DhtRunner_27isRunning = {"isRunning", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9DhtRunner_27isRunning, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_9DhtRunner_27isRunning(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("isRunning (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("isRunning", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("isRunning", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7opendht_5_core_9DhtRunner_26isRunning(((struct __pyx_obj_7opendht_5_core_DhtRunner *)__pyx_v_self));

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

static PyObject *__pyx_pf_7opendht_5_core_9DhtRunner_26isRunning(struct __pyx_obj_7opendht_5_core_DhtRunner *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("isRunning", 0);

  /* "opendht.pyx":700
 *         cpp.enableFileLogging(self.thisptr.get()[0], path.encode())
 *     def isRunning(self):
 *         return self.thisptr.get().isRunning()             # <<<<<<<<<<<<<<
 *     def getBound(self, cpp.sa_family_t af = 0):
 *         s = SockAddr()
*/
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->thisptr.get()->isRunning()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 700, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_1;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "opendht.pyx":699
 *     def enableFileLogging(self, str path):
 *         cpp.enableFileLogging(self.thisptr.get()[0], path.encode())
 *     def isRunning(self):             # <<<<<<<<<<<<<<
 *         return self.thisptr.get().isRunning()
 *     def getBound(self, cpp.sa_family_t af = 0):
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("opendht._core.DhtRunner.isRunning", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":701
 *     def isRunning(self):
 *         return self.thisptr.get().isRunning()
 *     def getBound(self, cpp.sa_family_t af = 0):             # <<<<<<<<<<<<<<
 *         s = SockAddr()
 *         s._addr = self.thisptr.get().getBound(af)
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_9DhtRunner_29getBound(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_9DhtRunner_29getBound = {"getBound", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9DhtRunner_29getBound, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_9DhtRunner_29getBound(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  __pyx_t_11opendht_cpp_sa_family_t __pyx_v_af;
  #if !CYTHON_VECTORCALL
  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("getBound (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_af,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 701, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 701, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getBound", 0) < (0)) __PYX_ERR(0, 701, __pyx_L3_error)
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 701, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    if (values[0]) {
      __pyx_v_af = __Pyx_PyLong_As_unsigned_short(values[0]); if (unlikely((__pyx_v_af == (unsigned short)-1) && PyErr_Occurred())) __PYX_ERR(0, 701, __pyx_L3_error)
    } else {
      __pyx_v_af = ((__pyx_t_11opendht_cpp_sa_family_t)0);
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getBound", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 701, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.DhtRunner.getBound", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7opendht_5_core_9DhtRunner_28getBound(((struct __pyx_obj_7opendht_5_core_DhtRunner *)__pyx_v_self), __pyx_v_af);

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

  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7opendht_5_core_9DhtRunner_28getBound(struct __pyx_obj_7opendht_5_core_DhtRunner *__pyx_v_self, __pyx_t_11opendht_cpp_sa_family_t __pyx_v_af) {
  struct __pyx_obj_7opendht_5_core_SockAddr *__pyx_v_s = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getBound", 0);

  /* "opendht.pyx":702
 *         return self.thisptr.get().isRunning()
 *     def getBound(self, cpp.sa_family_t af = 0):
 *         s = SockAddr()             # <<<<<<<<<<<<<<
 *         s._addr = self.thisptr.get().getBound(af)
 *         return s
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7opendht_5_core_SockAddr, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 702, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_s = ((struct __pyx_obj_7opendht_5_core_SockAddr *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "opendht.pyx":703
 *     def getBound(self, cpp.sa_family_t af = 0):
 *         s = SockAddr()
 *         s._addr = self.thisptr.get().getBound(af)             # <<<<<<<<<<<<<<
 *         return s
 *     def getStorageLog(self):
*/
  __pyx_v_s->_addr = __pyx_v_self->thisptr.get()->getBound(__pyx_v_af);

  /* "opendht.pyx":704
 *         s = SockAddr()
 *         s._addr = self.thisptr.get().getBound(af)
 *         return s             # <<<<<<<<<<<<<<
 *     def getStorageLog(self):
 *         return self.thisptr.get().getStorageLog().decode()
*/
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __Pyx_INCREF((PyObject *)__pyx_v_s);
      __pyx_r = ((PyObject *)__pyx_v_s);
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  goto __pyx_L0;

  /* "opendht.pyx":701
 *     def isRunning(self):
 *         return self.thisptr.get().isRunning()
 *     def getBound(self, cpp.sa_family_t af = 0):             # <<<<<<<<<<<<<<
 *         s = SockAddr()
 *         s._addr = self.thisptr.get().getBound(af)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("opendht._core.DhtRunner.getBound", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_s);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":705
 *         s._addr = self.thisptr.get().getBound(af)
 *         return s
 *     def getStorageLog(self):             # <<<<<<<<<<<<<<
 *         return self.thisptr.get().getStorageLog().decode()
 *     def getRoutingTablesLog(self, cpp.sa_family_t af):
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_9DhtRunner_31getStorageLog(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_9DhtRunner_31getStorageLog = {"getStorageLog", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9DhtRunner_31getStorageLog, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_9DhtRunner_31getStorageLog(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getStorageLog (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getStorageLog", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getStorageLog", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7opendht_5_core_9DhtRunner_30getStorageLog(((struct __pyx_obj_7opendht_5_core_DhtRunner *)__pyx_v_self));

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

static PyObject *__pyx_pf_7opendht_5_core_9DhtRunner_30getStorageLog(struct __pyx_obj_7opendht_5_core_DhtRunner *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getStorageLog", 0);

  /* "opendht.pyx":706
 *         return s
 *     def getStorageLog(self):
 *         return self.thisptr.get().getStorageLog().decode()             # <<<<<<<<<<<<<<
 *     def getRoutingTablesLog(self, cpp.sa_family_t af):
 *         return self.thisptr.get().getRoutingTablesLog(af).decode()
*/
  __pyx_t_1 = __Pyx_decode_cpp_string(__pyx_v_self->thisptr.get()->getStorageLog(), 0, PY_SSIZE_T_MAX, NULL, NULL, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 706, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_1;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "opendht.pyx":705
 *         s._addr = self.thisptr.get().getBound(af)
 *         return s
 *     def getStorageLog(self):             # <<<<<<<<<<<<<<
 *         return self.thisptr.get().getStorageLog().decode()
 *     def getRoutingTablesLog(self, cpp.sa_family_t af):
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("opendht._core.DhtRunner.getStorageLog", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":707
 *     def getStorageLog(self):
 *         return self.thisptr.get().getStorageLog().decode()
 *     def getRoutingTablesLog(self, cpp.sa_family_t af):             # <<<<<<<<<<<<<<
 *         return self.thisptr.get().getRoutingTablesLog(af).decode()
 *     def getSearchesLog(self, cpp.sa_family_t af):
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_9DhtRunner_33getRoutingTablesLog(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_9DhtRunner_33getRoutingTablesLog = {"getRoutingTablesLog", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9DhtRunner_33getRoutingTablesLog, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_9DhtRunner_33getRoutingTablesLog(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  __pyx_t_11opendht_cpp_sa_family_t __pyx_v_af;
  #if !CYTHON_VECTORCALL
  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("getRoutingTablesLog (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_af,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 707, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 707, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getRoutingTablesLog", 0) < (0)) __PYX_ERR(0, 707, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getRoutingTablesLog", 1, 1, 1, i); __PYX_ERR(0, 707, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 707, __pyx_L3_error)
    }
    __pyx_v_af = __Pyx_PyLong_As_unsigned_short(values[0]); if (unlikely((__pyx_v_af == (unsigned short)-1) && PyErr_Occurred())) __PYX_ERR(0, 707, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getRoutingTablesLog", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 707, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.DhtRunner.getRoutingTablesLog", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7opendht_5_core_9DhtRunner_32getRoutingTablesLog(((struct __pyx_obj_7opendht_5_core_DhtRunner *)__pyx_v_self), __pyx_v_af);

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

  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7opendht_5_core_9DhtRunner_32getRoutingTablesLog(struct __pyx_obj_7opendht_5_core_DhtRunner *__pyx_v_self, __pyx_t_11opendht_cpp_sa_family_t __pyx_v_af) {
  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("getRoutingTablesLog", 0);

  /* "opendht.pyx":708
 *         return self.thisptr.get().getStorageLog().decode()
 *     def getRoutingTablesLog(self, cpp.sa_family_t af):
 *         return self.thisptr.get().getRoutingTablesLog(af).decode()             # <<<<<<<<<<<<<<
 *     def getSearchesLog(self, cpp.sa_family_t af):
 *         return self.thisptr.get().getSearchesLog(af).decode()
*/
  __pyx_t_1 = __Pyx_decode_cpp_string(__pyx_v_self->thisptr.get()->getRoutingTablesLog(__pyx_v_af), 0, PY_SSIZE_T_MAX, NULL, NULL, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 708, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_1;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "opendht.pyx":707
 *     def getStorageLog(self):
 *         return self.thisptr.get().getStorageLog().decode()
 *     def getRoutingTablesLog(self, cpp.sa_family_t af):             # <<<<<<<<<<<<<<
 *         return self.thisptr.get().getRoutingTablesLog(af).decode()
 *     def getSearchesLog(self, cpp.sa_family_t af):
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("opendht._core.DhtRunner.getRoutingTablesLog", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":709
 *     def getRoutingTablesLog(self, cpp.sa_family_t af):
 *         return self.thisptr.get().getRoutingTablesLog(af).decode()
 *     def getSearchesLog(self, cpp.sa_family_t af):             # <<<<<<<<<<<<<<
 *         return self.thisptr.get().getSearchesLog(af).decode()
 *     def getNodeMessageStats(self):
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_9DhtRunner_35getSearchesLog(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_9DhtRunner_35getSearchesLog = {"getSearchesLog", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9DhtRunner_35getSearchesLog, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_9DhtRunner_35getSearchesLog(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  __pyx_t_11opendht_cpp_sa_family_t __pyx_v_af;
  #if !CYTHON_VECTORCALL
  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("getSearchesLog (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_af,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 709, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 709, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getSearchesLog", 0) < (0)) __PYX_ERR(0, 709, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getSearchesLog", 1, 1, 1, i); __PYX_ERR(0, 709, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 709, __pyx_L3_error)
    }
    __pyx_v_af = __Pyx_PyLong_As_unsigned_short(values[0]); if (unlikely((__pyx_v_af == (unsigned short)-1) && PyErr_Occurred())) __PYX_ERR(0, 709, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getSearchesLog", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 709, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.DhtRunner.getSearchesLog", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7opendht_5_core_9DhtRunner_34getSearchesLog(((struct __pyx_obj_7opendht_5_core_DhtRunner *)__pyx_v_self), __pyx_v_af);

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

  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7opendht_5_core_9DhtRunner_34getSearchesLog(struct __pyx_obj_7opendht_5_core_DhtRunner *__pyx_v_self, __pyx_t_11opendht_cpp_sa_family_t __pyx_v_af) {
  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("getSearchesLog", 0);

  /* "opendht.pyx":710
 *         return self.thisptr.get().getRoutingTablesLog(af).decode()
 *     def getSearchesLog(self, cpp.sa_family_t af):
 *         return self.thisptr.get().getSearchesLog(af).decode()             # <<<<<<<<<<<<<<
 *     def getNodeMessageStats(self):
 *         stats = []
*/
  __pyx_t_1 = __Pyx_decode_cpp_string(__pyx_v_self->thisptr.get()->getSearchesLog(__pyx_v_af), 0, PY_SSIZE_T_MAX, NULL, NULL, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 710, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_1;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "opendht.pyx":709
 *     def getRoutingTablesLog(self, cpp.sa_family_t af):
 *         return self.thisptr.get().getRoutingTablesLog(af).decode()
 *     def getSearchesLog(self, cpp.sa_family_t af):             # <<<<<<<<<<<<<<
 *         return self.thisptr.get().getSearchesLog(af).decode()
 *     def getNodeMessageStats(self):
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("opendht._core.DhtRunner.getSearchesLog", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":711
 *     def getSearchesLog(self, cpp.sa_family_t af):
 *         return self.thisptr.get().getSearchesLog(af).decode()
 *     def getNodeMessageStats(self):             # <<<<<<<<<<<<<<
 *         stats = []
 *         cdef cpp.vector[unsigned] res = self.thisptr.get().getNodeMessageStats(False)
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_9DhtRunner_37getNodeMessageStats(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_9DhtRunner_37getNodeMessageStats = {"getNodeMessageStats", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9DhtRunner_37getNodeMessageStats, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_9DhtRunner_37getNodeMessageStats(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getNodeMessageStats (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getNodeMessageStats", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getNodeMessageStats", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7opendht_5_core_9DhtRunner_36getNodeMessageStats(((struct __pyx_obj_7opendht_5_core_DhtRunner *)__pyx_v_self));

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

static PyObject *__pyx_pf_7opendht_5_core_9DhtRunner_36getNodeMessageStats(struct __pyx_obj_7opendht_5_core_DhtRunner *__pyx_v_self) {
  PyObject *__pyx_v_stats = NULL;
  std::vector<unsigned int>  __pyx_v_res;
  unsigned int __pyx_v_n;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  std::vector<unsigned int> ::iterator __pyx_t_2;
  unsigned int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getNodeMessageStats", 0);

  /* "opendht.pyx":712
 *         return self.thisptr.get().getSearchesLog(af).decode()
 *     def getNodeMessageStats(self):
 *         stats = []             # <<<<<<<<<<<<<<
 *         cdef cpp.vector[unsigned] res = self.thisptr.get().getNodeMessageStats(False)
 *         for n in res:
*/
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 712, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_stats = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "opendht.pyx":713
 *     def getNodeMessageStats(self):
 *         stats = []
 *         cdef cpp.vector[unsigned] res = self.thisptr.get().getNodeMessageStats(False)             # <<<<<<<<<<<<<<
 *         for n in res:
 *             stats.append(n)
*/
  __pyx_v_res = __pyx_v_self->thisptr.get()->getNodeMessageStats(0);

  /* "opendht.pyx":714
 *         stats = []
 *         cdef cpp.vector[unsigned] res = self.thisptr.get().getNodeMessageStats(False)
 *         for n in res:             # <<<<<<<<<<<<<<
 *             stats.append(n)
 *         return stats
*/
  __pyx_t_2 = __pyx_v_res.begin();
  for (; __pyx_t_2 != __pyx_v_res.end(); ++__pyx_t_2) {
    __pyx_t_3 = *__pyx_t_2;
    __pyx_v_n = __pyx_t_3;

    /* "opendht.pyx":715
 *         cdef cpp.vector[unsigned] res = self.thisptr.get().getNodeMessageStats(False)
 *         for n in res:
 *             stats.append(n)             # <<<<<<<<<<<<<<
 *         return stats
 * 
*/
    __pyx_t_1 = __Pyx_PyLong_From_unsigned_int(__pyx_v_n); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 715, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_stats, __pyx_t_1); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 715, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;


    /* "opendht.pyx":714
 *         stats = []
 *         cdef cpp.vector[unsigned] res = self.thisptr.get().getNodeMessageStats(False)
 *         for n in res:             # <<<<<<<<<<<<<<
 *             stats.append(n)
 *         return stats
*/
  }


  /* "opendht.pyx":716
 *         for n in res:
 *             stats.append(n)
 *         return stats             # <<<<<<<<<<<<<<
 * 
 *     def get(self, InfoHash key, get_cb=None, done_cb=None, filter=None, Where where=None):
*/
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __Pyx_INCREF(__pyx_v_stats);
      __pyx_r = __pyx_v_stats;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  goto __pyx_L0;

  /* "opendht.pyx":711
 *     def getSearchesLog(self, cpp.sa_family_t af):
 *         return self.thisptr.get().getSearchesLog(af).decode()
 *     def getNodeMessageStats(self):             # <<<<<<<<<<<<<<
 *         stats = []
 *         cdef cpp.vector[unsigned] res = self.thisptr.get().getNodeMessageStats(False)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("opendht._core.DhtRunner.getNodeMessageStats", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_stats);


  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":718
 *         return stats
 * 
 *     def get(self, InfoHash key, get_cb=None, done_cb=None, filter=None, Where where=None):             # <<<<<<<<<<<<<<
 *         """Retreive values associated with a key on the DHT.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_9DhtRunner_39get(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_9DhtRunner_38get, "Retreive values associated with a key on the DHT.\n\n        key     -- the key for which to search\n        get_cb  -- is set, makes the operation non-blocking. Called when a value\n                   is found on the DHT.\n        done_cb -- optional callback used when get_cb is set. Called when the\n                   operation is completed.\n        ");
static PyMethodDef __pyx_mdef_7opendht_5_core_9DhtRunner_39get = {"get", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9DhtRunner_39get, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7opendht_5_core_9DhtRunner_38get};
static PyObject *__pyx_pw_7opendht_5_core_9DhtRunner_39get(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_v_key = 0;
  PyObject *__pyx_v_get_cb = 0;
  PyObject *__pyx_v_done_cb = 0;
  PyObject *__pyx_v_filter = 0;
  struct __pyx_obj_7opendht_5_core_Where *__pyx_v_where = 0;
  #if !CYTHON_VECTORCALL
  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("get (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_key,&__pyx_mstate_global->__pyx_n_u_get_cb,&__pyx_mstate_global->__pyx_n_u_done_cb,&__pyx_mstate_global->__pyx_n_u_filter,&__pyx_mstate_global->__pyx_n_u_where,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 718, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 718, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 718, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 718, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 718, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 718, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "get", 0) < (0)) __PYX_ERR(0, 718, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[4]) values[4] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7opendht_5_core_Where *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("get", 0, 1, 5, i); __PYX_ERR(0, 718, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 718, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 718, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 718, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 718, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 718, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[4]) values[4] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7opendht_5_core_Where *)Py_None));
    }
    __pyx_v_key = ((struct __pyx_obj_7opendht_5_core_InfoHash *)values[0]);
    __pyx_v_get_cb = values[1];
    __pyx_v_done_cb = values[2];
    __pyx_v_filter = values[3];
    __pyx_v_where = ((struct __pyx_obj_7opendht_5_core_Where *)values[4]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get", 0, 1, 5, __pyx_nargs); __PYX_ERR(0, 718, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.DhtRunner.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_key), __pyx_mstate_global->__pyx_ptype_7opendht_5_core_InfoHash, 1, "key", 0))) __PYX_ERR(0, 718, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_where), __pyx_mstate_global->__pyx_ptype_7opendht_5_core_Where, 1, "where", 0))) __PYX_ERR(0, 718, __pyx_L1_error)
  __pyx_r = __pyx_pf_7opendht_5_core_9DhtRunner_38get(((struct __pyx_obj_7opendht_5_core_DhtRunner *)__pyx_v_self), __pyx_v_key, __pyx_v_get_cb, __pyx_v_done_cb, __pyx_v_filter, __pyx_v_where);

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

/* "opendht.pyx":740
 *             pending = 0
 *             res = []
 *             def tmp_get(v):             # <<<<<<<<<<<<<<
 *                 nonlocal res
 *                 res.append(v)
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_9DhtRunner_3get_1tmp_get(PyObject *__pyx_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_9DhtRunner_3get_1tmp_get = {"tmp_get", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9DhtRunner_3get_1tmp_get, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_9DhtRunner_3get_1tmp_get(PyObject *__pyx_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_v = 0;
  #if !CYTHON_VECTORCALL
  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("tmp_get (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_v,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 740, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 740, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "tmp_get", 0) < (0)) __PYX_ERR(0, 740, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("tmp_get", 1, 1, 1, i); __PYX_ERR(0, 740, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 740, __pyx_L3_error)
    }
    __pyx_v_v = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("tmp_get", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 740, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.DhtRunner.get.tmp_get", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7opendht_5_core_9DhtRunner_3get_tmp_get(__pyx_self, __pyx_v_v);

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

static PyObject *__pyx_pf_7opendht_5_core_9DhtRunner_3get_tmp_get(PyObject *__pyx_self, PyObject *__pyx_v_v) {
  struct __pyx_obj_7opendht_5_core___pyx_scope_struct_1_get *__pyx_cur_scope;
  struct __pyx_obj_7opendht_5_core___pyx_scope_struct_1_get *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("tmp_get", 0);
  __pyx_outer_scope = (struct __pyx_obj_7opendht_5_core___pyx_scope_struct_1_get *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "opendht.pyx":742
 *             def tmp_get(v):
 *                 nonlocal res
 *                 res.append(v)             # <<<<<<<<<<<<<<
 *                 return True
 *             def tmp_done(ok, nodes):
*/
  if (unlikely(!__pyx_cur_scope->__pyx_v_res)) { __Pyx_RaiseClosureNameError("res"); __PYX_ERR(0, 742, __pyx_L1_error) }
  if (unlikely(__pyx_cur_scope->__pyx_v_res == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "\047NoneType\047 object has no attribute \047%.30s\047", "append");
    __PYX_ERR(0, 742, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_res, __pyx_v_v); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 742, __pyx_L1_error)


  /* "opendht.pyx":743
 *                 nonlocal res
 *                 res.append(v)
 *                 return True             # <<<<<<<<<<<<<<
 *             def tmp_done(ok, nodes):
 *                 nonlocal pending, lock
*/
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __Pyx_INCREF(Py_True);
      __pyx_r = Py_True;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  goto __pyx_L0;

  /* "opendht.pyx":740
 *             pending = 0
 *             res = []
 *             def tmp_get(v):             # <<<<<<<<<<<<<<
 *                 nonlocal res
 *                 res.append(v)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("opendht._core.DhtRunner.get.tmp_get", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":744
 *                 res.append(v)
 *                 return True
 *             def tmp_done(ok, nodes):             # <<<<<<<<<<<<<<
 *                 nonlocal pending, lock
 *                 with lock:
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_9DhtRunner_3get_3tmp_done(PyObject *__pyx_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_9DhtRunner_3get_3tmp_done = {"tmp_done", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9DhtRunner_3get_3tmp_done, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_9DhtRunner_3get_3tmp_done(PyObject *__pyx_self, 
#if CYTHON_VECTORCALL
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_ok = 0;
  CYTHON_UNUSED PyObject *__pyx_v_nodes = 0;
  #if !CYTHON_VECTORCALL
  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("tmp_done (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_ok,&__pyx_mstate_global->__pyx_n_u_nodes,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 744, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 744, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 744, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "tmp_done", 0) < (0)) __PYX_ERR(0, 744, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("tmp_done", 1, 2, 2, i); __PYX_ERR(0, 744, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 744, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 744, __pyx_L3_error)
    }
    __pyx_v_ok = values[0];
    __pyx_v_nodes = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("tmp_done", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 744, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.DhtRunner.get.tmp_done", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7opendht_5_core_9DhtRunner_3get_2tmp_done(__pyx_self, __pyx_v_ok, __pyx_v_nodes);

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

static PyObject *__pyx_pf_7opendht_5_core_9DhtRunner_3get_2tmp_done(PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_ok, CYTHON_UNUSED PyObject *__pyx_v_nodes) {
  struct __pyx_obj_7opendht_5_core___pyx_scope_struct_1_get *__pyx_cur_scope;
  struct __pyx_obj_7opendht_5_core___pyx_scope_struct_1_get *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __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("tmp_done", 0);
  __pyx_outer_scope = (struct __pyx_obj_7opendht_5_core___pyx_scope_struct_1_get *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "opendht.pyx":746
 *             def tmp_done(ok, nodes):
 *                 nonlocal pending, lock
 *                 with lock:             # <<<<<<<<<<<<<<
 *                     pending -= 1
 *                     lock.notify()
*/
  /*with:*/ {
    if (unlikely(!__pyx_cur_scope->__pyx_v_lock)) { __Pyx_RaiseClosureNameError("lock"); __PYX_ERR(0, 746, __pyx_L1_error) }
    __pyx_t_1 = __Pyx_PyObject_LookupSpecial(__pyx_cur_scope->__pyx_v_lock, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 746, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = NULL;
    __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_cur_scope->__pyx_v_lock, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 746, __pyx_L3_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 746, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    /*try:*/ {
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_6);
        __Pyx_XGOTREF(__pyx_t_7);
        __Pyx_XGOTREF(__pyx_t_8);
        /*try:*/ {

          /* "opendht.pyx":747
 *                 nonlocal pending, lock
 *                 with lock:
 *                     pending -= 1             # <<<<<<<<<<<<<<
 *                     lock.notify()
 *             with lock:
*/
          if (unlikely(!__pyx_cur_scope->__pyx_v_pending)) { __Pyx_RaiseClosureNameError("pending"); __PYX_ERR(0, 747, __pyx_L7_error) }
          __pyx_t_2 = __Pyx_PyLong_SubtractObjC(__pyx_cur_scope->__pyx_v_pending, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 747, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_pending);
          __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_pending, __pyx_t_2);
          __Pyx_GIVEREF(__pyx_t_2);
          __pyx_t_2 = 0;

          /* "opendht.pyx":748
 *                 with lock:
 *                     pending -= 1
 *                     lock.notify()             # <<<<<<<<<<<<<<
 *             with lock:
 *                 pending += 1
*/
          if (unlikely(!__pyx_cur_scope->__pyx_v_lock)) { __Pyx_RaiseClosureNameError("lock"); __PYX_ERR(0, 748, __pyx_L7_error) }
          __pyx_t_4 = __pyx_cur_scope->__pyx_v_lock;
          __Pyx_INCREF(__pyx_t_4);
          __pyx_t_5 = 0;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
            __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_notify, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 748, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_2);
          }
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

          /* "opendht.pyx":746
 *             def tmp_done(ok, nodes):
 *                 nonlocal pending, lock
 *                 with lock:             # <<<<<<<<<<<<<<
 *                     pending -= 1
 *                     lock.notify()
*/
        }
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        goto __pyx_L12_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_4); __pyx_t_4 = 0;
        /*except:*/ {
          __Pyx_AddTraceback("opendht._core.DhtRunner.get.tmp_done", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_4, &__pyx_t_3) < 0) __PYX_ERR(0, 746, __pyx_L9_except_error)
          __Pyx_XGOTREF(__pyx_t_2);
          __Pyx_XGOTREF(__pyx_t_4);
          __Pyx_XGOTREF(__pyx_t_3);
          {
            PyObject* __pyx_temp[3] = {__pyx_t_2, __pyx_t_4, __pyx_t_3};
            __pyx_t_9 = __Pyx_PyTuple_FromArray(__pyx_temp, 3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 746, __pyx_L9_except_error)
            __Pyx_GOTREF(__pyx_t_9);
          }
          __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 746, __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, 746, __pyx_L9_except_error)
          __pyx_t_12 = (!__pyx_t_11);


          if (unlikely(__pyx_t_12)) {

            __Pyx_GIVEREF(__pyx_t_2);
            __Pyx_GIVEREF(__pyx_t_4);
            __Pyx_XGIVEREF(__pyx_t_3);
            __Pyx_ErrRestoreWithState(__pyx_t_2, __pyx_t_4, __pyx_t_3);
            __pyx_t_2 = 0;  __pyx_t_4 = 0;  __pyx_t_3 = 0; 
            __PYX_ERR(0, 746, __pyx_L9_except_error)
          }
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          goto __pyx_L8_exception_handled;
        }
        __pyx_L9_except_error:;
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
        goto __pyx_L1_error;
        __pyx_L8_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
        __pyx_L12_try_end:;
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_1) {
          __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_mstate_global->__pyx_tuple[0], NULL);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 746, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        }
        goto __pyx_L6;
      }
      __pyx_L6:;
    }
    goto __pyx_L16;
    __pyx_L3_error:;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L1_error;
    __pyx_L16:;
  }

  /* "opendht.pyx":744
 *                 res.append(v)
 *                 return True
 *             def tmp_done(ok, nodes):             # <<<<<<<<<<<<<<
 *                 nonlocal pending, lock
 *                 with lock:
*/

  /* 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("opendht._core.DhtRunner.get.tmp_done", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":718
 *         return stats
 * 
 *     def get(self, InfoHash key, get_cb=None, done_cb=None, filter=None, Where where=None):             # <<<<<<<<<<<<<<
 *         """Retreive values associated with a key on the DHT.
 * 
*/

static PyObject *__pyx_pf_7opendht_5_core_9DhtRunner_38get(struct __pyx_obj_7opendht_5_core_DhtRunner *__pyx_v_self, struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_v_key, PyObject *__pyx_v_get_cb, PyObject *__pyx_v_done_cb, PyObject *__pyx_v_filter, struct __pyx_obj_7opendht_5_core_Where *__pyx_v_where) {
  struct __pyx_obj_7opendht_5_core___pyx_scope_struct_1_get *__pyx_cur_scope;
  PyObject *__pyx_v_cb_obj = NULL;
  PyObject *__pyx_v_tmp_get = 0;
  PyObject *__pyx_v_tmp_done = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __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;
  int __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get", 0);
  __pyx_cur_scope = (struct __pyx_obj_7opendht_5_core___pyx_scope_struct_1_get *)__pyx_tp_new_7opendht_5_core___pyx_scope_struct_1_get(__pyx_mstate_global->__pyx_ptype_7opendht_5_core___pyx_scope_struct_1_get, __pyx_mstate_global->__pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7opendht_5_core___pyx_scope_struct_1_get *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 718, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __Pyx_INCREF((PyObject *)__pyx_v_where);

  /* "opendht.pyx":727
 *                    operation is completed.
 *         """
 *         if get_cb:             # <<<<<<<<<<<<<<
 *             cb_obj = {'get':get_cb, 'done':done_cb, 'filter':filter}
 *             ref.Py_INCREF(cb_obj)
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_get_cb); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 727, __pyx_L1_error)
  if (__pyx_t_1) {


    /* "opendht.pyx":728
 *         """
 *         if get_cb:
 *             cb_obj = {'get':get_cb, 'done':done_cb, 'filter':filter}             # <<<<<<<<<<<<<<
 *             ref.Py_INCREF(cb_obj)
 *             if where is None:
*/
    __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 728, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_get, __pyx_v_get_cb) < (0)) __PYX_ERR(0, 728, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_done, __pyx_v_done_cb) < (0)) __PYX_ERR(0, 728, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_filter, __pyx_v_filter) < (0)) __PYX_ERR(0, 728, __pyx_L1_error)
    __pyx_v_cb_obj = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "opendht.pyx":729
 *         if get_cb:
 *             cb_obj = {'get':get_cb, 'done':done_cb, 'filter':filter}
 *             ref.Py_INCREF(cb_obj)             # <<<<<<<<<<<<<<
 *             if where is None:
 *                 where = Where()
*/
    Py_INCREF(__pyx_v_cb_obj);

    /* "opendht.pyx":730
 *             cb_obj = {'get':get_cb, 'done':done_cb, 'filter':filter}
 *             ref.Py_INCREF(cb_obj)
 *             if where is None:             # <<<<<<<<<<<<<<
 *                 where = Where()
 *             self.thisptr.get().get(key._infohash, cpp.bindGetCb(get_callback, <void*>cb_obj),
*/
    __pyx_t_1 = (((PyObject *)__pyx_v_where) == Py_None);
    if (__pyx_t_1) {


      /* "opendht.pyx":731
 *             ref.Py_INCREF(cb_obj)
 *             if where is None:
 *                 where = Where()             # <<<<<<<<<<<<<<
 *             self.thisptr.get().get(key._infohash, cpp.bindGetCb(get_callback, <void*>cb_obj),
 *                     cpp.bindDoneCb(done_callback, <void*>cb_obj),
*/
      __pyx_t_3 = NULL;
      __pyx_t_4 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
        __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7opendht_5_core_Where, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 731, __pyx_L1_error)
        __Pyx_GOTREF((PyObject *)__pyx_t_2);
      }
      __Pyx_DECREF_SET(__pyx_v_where, ((struct __pyx_obj_7opendht_5_core_Where *)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "opendht.pyx":730
 *             cb_obj = {'get':get_cb, 'done':done_cb, 'filter':filter}
 *             ref.Py_INCREF(cb_obj)
 *             if where is None:             # <<<<<<<<<<<<<<
 *                 where = Where()
 *             self.thisptr.get().get(key._infohash, cpp.bindGetCb(get_callback, <void*>cb_obj),
*/
    }

    /* "opendht.pyx":732
 *             if where is None:
 *                 where = Where()
 *             self.thisptr.get().get(key._infohash, cpp.bindGetCb(get_callback, <void*>cb_obj),             # <<<<<<<<<<<<<<
 *                     cpp.bindDoneCb(done_callback, <void*>cb_obj),
 *                     cpp.nullptr, #filter implemented in the get_callback
*/
    __pyx_v_self->thisptr.get()->get(__pyx_v_key->_infohash, dht::bindGetCb(__pyx_f_7opendht_5_core_get_callback, ((void *)__pyx_v_cb_obj)), dht::bindDoneCb(__pyx_f_7opendht_5_core_done_callback, ((void *)__pyx_v_cb_obj)), nullptr, __pyx_v_where->_where);

    /* "opendht.pyx":727
 *                    operation is completed.
 *         """
 *         if get_cb:             # <<<<<<<<<<<<<<
 *             cb_obj = {'get':get_cb, 'done':done_cb, 'filter':filter}
 *             ref.Py_INCREF(cb_obj)
*/
    goto __pyx_L3;
  }

  /* "opendht.pyx":737
 *                     where._where)
 *         else:
 *             lock = threading.Condition()             # <<<<<<<<<<<<<<
 *             pending = 0
 *             res = []
*/
  /*else*/ {
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_threading); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 737, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_Condition); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 737, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_4 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
      __pyx_t_4 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 737, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_cur_scope->__pyx_v_lock = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "opendht.pyx":738
 *         else:
 *             lock = threading.Condition()
 *             pending = 0             # <<<<<<<<<<<<<<
 *             res = []
 *             def tmp_get(v):
*/
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0);
    __pyx_cur_scope->__pyx_v_pending = __pyx_mstate_global->__pyx_int_0;

    /* "opendht.pyx":739
 *             lock = threading.Condition()
 *             pending = 0
 *             res = []             # <<<<<<<<<<<<<<
 *             def tmp_get(v):
 *                 nonlocal res
*/
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 739, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_cur_scope->__pyx_v_res = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "opendht.pyx":740
 *             pending = 0
 *             res = []
 *             def tmp_get(v):             # <<<<<<<<<<<<<<
 *                 nonlocal res
 *                 res.append(v)
*/
    __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_9DhtRunner_3get_1tmp_get, 0, __pyx_mstate_global->__pyx_n_u_get_locals_tmp_get, ((PyObject*)__pyx_cur_scope), __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 740, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_tmp_get = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "opendht.pyx":744
 *                 res.append(v)
 *                 return True
 *             def tmp_done(ok, nodes):             # <<<<<<<<<<<<<<
 *                 nonlocal pending, lock
 *                 with lock:
*/
    __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_9DhtRunner_3get_3tmp_done, 0, __pyx_mstate_global->__pyx_n_u_get_locals_tmp_done, ((PyObject*)__pyx_cur_scope), __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[3])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 744, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_tmp_done = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "opendht.pyx":749
 *                     pending -= 1
 *                     lock.notify()
 *             with lock:             # <<<<<<<<<<<<<<
 *                 pending += 1
 *                 self.get(key, get_cb=tmp_get, done_cb=tmp_done, filter=filter, where=where)
*/
    /*with:*/ {
      __pyx_t_7 = __Pyx_PyObject_LookupSpecial(__pyx_cur_scope->__pyx_v_lock, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 749, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_6 = NULL;
      __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_cur_scope->__pyx_v_lock, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 749, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = 1;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
        assert(__pyx_t_6);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
        __pyx_t_4 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
        __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __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, 749, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __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:*/ {

            /* "opendht.pyx":750
 *                     lock.notify()
 *             with lock:
 *                 pending += 1             # <<<<<<<<<<<<<<
 *                 self.get(key, get_cb=tmp_get, done_cb=tmp_done, filter=filter, where=where)
 *                 while pending > 0:
*/
            __pyx_t_2 = __Pyx_PyLong_AddObjC(__pyx_cur_scope->__pyx_v_pending, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 750, __pyx_L9_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_pending);
            __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_pending, __pyx_t_2);
            __Pyx_GIVEREF(__pyx_t_2);
            __pyx_t_2 = 0;

            /* "opendht.pyx":751
 *             with lock:
 *                 pending += 1
 *                 self.get(key, get_cb=tmp_get, done_cb=tmp_done, filter=filter, where=where)             # <<<<<<<<<<<<<<
 *                 while pending > 0:
 *                     lock.wait()
*/
            __pyx_t_3 = ((PyObject *)__pyx_v_self);
            __Pyx_INCREF(__pyx_t_3);
            __pyx_t_4 = 0;
            {
              PyObject *__pyx_callargs[6] = {__pyx_t_3, ((PyObject *)__pyx_v_key), __pyx_v_tmp_get, __pyx_v_tmp_done, __pyx_v_filter, ((PyObject *)__pyx_v_where)};
              #if CYTHON_VECTORCALL
              __pyx_t_6 = __pyx_mstate_global->__pyx_tuple[2];
              if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 751, __pyx_L9_error)
              __Pyx_INCREF(__pyx_t_6);
              #else
              {
                PyObject *__pyx_temp[4] = {__pyx_mstate_global->__pyx_n_u_get_cb, __pyx_mstate_global->__pyx_n_u_done_cb, __pyx_mstate_global->__pyx_n_u_filter, __pyx_mstate_global->__pyx_n_u_where};
                __pyx_t_6 = __Pyx_MakeKwargDict(__pyx_temp, __pyx_callargs+2, 4);
                if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 751, __pyx_L9_error)
                __Pyx_GOTREF(__pyx_t_6);
              }
              #endif
              __pyx_t_2 = __Pyx_Object_VectorcallMethodKwds((PyObject*)__pyx_mstate_global->__pyx_n_u_get, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6);
              __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
              __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
              if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 751, __pyx_L9_error)
              __Pyx_GOTREF(__pyx_t_2);
            }
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

            /* "opendht.pyx":752
 *                 pending += 1
 *                 self.get(key, get_cb=tmp_get, done_cb=tmp_done, filter=filter, where=where)
 *                 while pending > 0:             # <<<<<<<<<<<<<<
 *                     lock.wait()
 *             return res
*/
            while (1) {
              __pyx_t_1 = __Pyx_PyObject_CompareBoolGt_object_int(__pyx_cur_scope->__pyx_v_pending, __pyx_mstate_global->__pyx_int_0, Py_GT); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 752, __pyx_L9_error)

              if (!__pyx_t_1) break;

              /* "opendht.pyx":753
 *                 self.get(key, get_cb=tmp_get, done_cb=tmp_done, filter=filter, where=where)
 *                 while pending > 0:
 *                     lock.wait()             # <<<<<<<<<<<<<<
 *             return res
 * 
*/
              __pyx_t_6 = __pyx_cur_scope->__pyx_v_lock;
              __Pyx_INCREF(__pyx_t_6);
              __pyx_t_4 = 0;
              {
                PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
                __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_wait, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
                if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 753, __pyx_L9_error)
                __Pyx_GOTREF(__pyx_t_2);
              }
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            }

            /* "opendht.pyx":749
 *                     pending -= 1
 *                     lock.notify()
 *             with lock:             # <<<<<<<<<<<<<<
 *                 pending += 1
 *                 self.get(key, get_cb=tmp_get, done_cb=tmp_done, filter=filter, where=where)
*/
          }
          __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_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_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          /*except:*/ {
            __Pyx_AddTraceback("opendht._core.DhtRunner.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
            if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_6, &__pyx_t_3) < 0) __PYX_ERR(0, 749, __pyx_L11_except_error)
            __Pyx_XGOTREF(__pyx_t_2);
            __Pyx_XGOTREF(__pyx_t_6);
            __Pyx_XGOTREF(__pyx_t_3);
            {
              PyObject* __pyx_temp[3] = {__pyx_t_2, __pyx_t_6, __pyx_t_3};
              __pyx_t_5 = __Pyx_PyTuple_FromArray(__pyx_temp, 3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 749, __pyx_L11_except_error)
              __Pyx_GOTREF(__pyx_t_5);
            }
            __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, NULL);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 749, __pyx_L11_except_error)
            __Pyx_GOTREF(__pyx_t_11);
            __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_11);
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            if (__pyx_t_1 < (0)) __PYX_ERR(0, 749, __pyx_L11_except_error)
            __pyx_t_12 = (!__pyx_t_1);


            if (unlikely(__pyx_t_12)) {

              __Pyx_GIVEREF(__pyx_t_2);
              __Pyx_GIVEREF(__pyx_t_6);
              __Pyx_XGIVEREF(__pyx_t_3);
              __Pyx_ErrRestoreWithState(__pyx_t_2, __pyx_t_6, __pyx_t_3);
              __pyx_t_2 = 0;  __pyx_t_6 = 0;  __pyx_t_3 = 0; 
              __PYX_ERR(0, 749, __pyx_L11_except_error)
            }
            __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
            goto __pyx_L10_exception_handled;
          }
          __pyx_L11_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_L10_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_L14_try_end:;
        }
      }
      /*finally:*/ {
        /*normal exit:*/{
          if (__pyx_t_7) {
            __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_mstate_global->__pyx_tuple[0], NULL);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 749, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_10);
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          }
          goto __pyx_L8;
        }
        __pyx_L8:;
      }
      goto __pyx_L20;
      __pyx_L5_error:;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L1_error;
      __pyx_L20:;
    }

    /* "opendht.pyx":754
 *                 while pending > 0:
 *                     lock.wait()
 *             return res             # <<<<<<<<<<<<<<
 * 
 *     def put(self, InfoHash key, Value val, done_cb=None, permanent=False):
*/
    {
      PyObject *__pyx_temp;
      {
        __pyx_temp = __pyx_r;
        __Pyx_INCREF(__pyx_cur_scope->__pyx_v_res);
        __pyx_r = __pyx_cur_scope->__pyx_v_res;
      }
      __Pyx_XDECREF(__pyx_temp);
    }
    goto __pyx_L0;
  }
  __pyx_L3:;

  /* "opendht.pyx":718
 *         return stats
 * 
 *     def get(self, InfoHash key, get_cb=None, done_cb=None, filter=None, Where where=None):             # <<<<<<<<<<<<<<
 *         """Retreive values associated with a key on the DHT.
 * 
*/

  /* 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_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("opendht._core.DhtRunner.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_cb_obj);
  __Pyx_XDECREF(__pyx_v_tmp_get);
  __Pyx_XDECREF(__pyx_v_tmp_done);
  __Pyx_XDECREF((PyObject *)__pyx_v_where);
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":756
 *             return res
 * 
 *     def put(self, InfoHash key, Value val, done_cb=None, permanent=False):             # <<<<<<<<<<<<<<
 *         """Publish a new value on the DHT at key.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_9DhtRunner_41put(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_9DhtRunner_40put, "Publish a new value on the DHT at key.\n\n        key     -- the DHT key where to put the value\n        val     -- the value to put on the DHT\n        done_cb -- optional callback called when the operation is completed.\n        ");
static PyMethodDef __pyx_mdef_7opendht_5_core_9DhtRunner_41put = {"put", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9DhtRunner_41put, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7opendht_5_core_9DhtRunner_40put};
static PyObject *__pyx_pw_7opendht_5_core_9DhtRunner_41put(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_v_key = 0;
  struct __pyx_obj_7opendht_5_core_Value *__pyx_v_val = 0;
  PyObject *__pyx_v_done_cb = 0;
  PyObject *__pyx_v_permanent = 0;
  #if !CYTHON_VECTORCALL
  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("put (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_key,&__pyx_mstate_global->__pyx_n_u_val,&__pyx_mstate_global->__pyx_n_u_done_cb,&__pyx_mstate_global->__pyx_n_u_permanent,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 756, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 756, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 756, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 756, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 756, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "put", 0) < (0)) __PYX_ERR(0, 756, __pyx_L3_error)
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_False));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("put", 0, 2, 4, i); __PYX_ERR(0, 756, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 756, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 756, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 756, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 756, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_False));
    }
    __pyx_v_key = ((struct __pyx_obj_7opendht_5_core_InfoHash *)values[0]);
    __pyx_v_val = ((struct __pyx_obj_7opendht_5_core_Value *)values[1]);
    __pyx_v_done_cb = values[2];
    __pyx_v_permanent = values[3];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("put", 0, 2, 4, __pyx_nargs); __PYX_ERR(0, 756, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.DhtRunner.put", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_key), __pyx_mstate_global->__pyx_ptype_7opendht_5_core_InfoHash, 1, "key", 0))) __PYX_ERR(0, 756, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_val), __pyx_mstate_global->__pyx_ptype_7opendht_5_core_Value, 1, "val", 0))) __PYX_ERR(0, 756, __pyx_L1_error)
  __pyx_r = __pyx_pf_7opendht_5_core_9DhtRunner_40put(((struct __pyx_obj_7opendht_5_core_DhtRunner *)__pyx_v_self), __pyx_v_key, __pyx_v_val, __pyx_v_done_cb, __pyx_v_permanent);

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

/* "opendht.pyx":771
 *             pending = 0
 *             ok = False
 *             def tmp_done(ok_ret, nodes):             # <<<<<<<<<<<<<<
 *                 nonlocal pending, ok, lock
 *                 with lock:
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_9DhtRunner_3put_1tmp_done(PyObject *__pyx_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_9DhtRunner_3put_1tmp_done = {"tmp_done", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9DhtRunner_3put_1tmp_done, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_9DhtRunner_3put_1tmp_done(PyObject *__pyx_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_ok_ret = 0;
  CYTHON_UNUSED PyObject *__pyx_v_nodes = 0;
  #if !CYTHON_VECTORCALL
  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("tmp_done (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_ok_ret,&__pyx_mstate_global->__pyx_n_u_nodes,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 771, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 771, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 771, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "tmp_done", 0) < (0)) __PYX_ERR(0, 771, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("tmp_done", 1, 2, 2, i); __PYX_ERR(0, 771, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 771, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 771, __pyx_L3_error)
    }
    __pyx_v_ok_ret = values[0];
    __pyx_v_nodes = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("tmp_done", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 771, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.DhtRunner.put.tmp_done", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7opendht_5_core_9DhtRunner_3put_tmp_done(__pyx_self, __pyx_v_ok_ret, __pyx_v_nodes);

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

static PyObject *__pyx_pf_7opendht_5_core_9DhtRunner_3put_tmp_done(PyObject *__pyx_self, PyObject *__pyx_v_ok_ret, CYTHON_UNUSED PyObject *__pyx_v_nodes) {
  struct __pyx_obj_7opendht_5_core___pyx_scope_struct_2_put *__pyx_cur_scope;
  struct __pyx_obj_7opendht_5_core___pyx_scope_struct_2_put *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __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("tmp_done", 0);
  __pyx_outer_scope = (struct __pyx_obj_7opendht_5_core___pyx_scope_struct_2_put *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "opendht.pyx":773
 *             def tmp_done(ok_ret, nodes):
 *                 nonlocal pending, ok, lock
 *                 with lock:             # <<<<<<<<<<<<<<
 *                     ok = ok_ret
 *                     pending -= 1
*/
  /*with:*/ {
    if (unlikely(!__pyx_cur_scope->__pyx_v_lock)) { __Pyx_RaiseClosureNameError("lock"); __PYX_ERR(0, 773, __pyx_L1_error) }
    __pyx_t_1 = __Pyx_PyObject_LookupSpecial(__pyx_cur_scope->__pyx_v_lock, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 773, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = NULL;
    __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_cur_scope->__pyx_v_lock, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 773, __pyx_L3_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 773, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    /*try:*/ {
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_6);
        __Pyx_XGOTREF(__pyx_t_7);
        __Pyx_XGOTREF(__pyx_t_8);
        /*try:*/ {

          /* "opendht.pyx":774
 *                 nonlocal pending, ok, lock
 *                 with lock:
 *                     ok = ok_ret             # <<<<<<<<<<<<<<
 *                     pending -= 1
 *                     lock.notify()
*/
          __Pyx_INCREF(__pyx_v_ok_ret);
          __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_ok);
          __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_ok, __pyx_v_ok_ret);
          __Pyx_GIVEREF(__pyx_v_ok_ret);

          /* "opendht.pyx":775
 *                 with lock:
 *                     ok = ok_ret
 *                     pending -= 1             # <<<<<<<<<<<<<<
 *                     lock.notify()
 *             with lock:
*/
          if (unlikely(!__pyx_cur_scope->__pyx_v_pending)) { __Pyx_RaiseClosureNameError("pending"); __PYX_ERR(0, 775, __pyx_L7_error) }
          __pyx_t_2 = __Pyx_PyLong_SubtractObjC(__pyx_cur_scope->__pyx_v_pending, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 775, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_pending);
          __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_pending, __pyx_t_2);
          __Pyx_GIVEREF(__pyx_t_2);
          __pyx_t_2 = 0;

          /* "opendht.pyx":776
 *                     ok = ok_ret
 *                     pending -= 1
 *                     lock.notify()             # <<<<<<<<<<<<<<
 *             with lock:
 *                 pending += 1
*/
          if (unlikely(!__pyx_cur_scope->__pyx_v_lock)) { __Pyx_RaiseClosureNameError("lock"); __PYX_ERR(0, 776, __pyx_L7_error) }
          __pyx_t_4 = __pyx_cur_scope->__pyx_v_lock;
          __Pyx_INCREF(__pyx_t_4);
          __pyx_t_5 = 0;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
            __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_notify, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 776, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_2);
          }
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

          /* "opendht.pyx":773
 *             def tmp_done(ok_ret, nodes):
 *                 nonlocal pending, ok, lock
 *                 with lock:             # <<<<<<<<<<<<<<
 *                     ok = ok_ret
 *                     pending -= 1
*/
        }
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        goto __pyx_L12_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_4); __pyx_t_4 = 0;
        /*except:*/ {
          __Pyx_AddTraceback("opendht._core.DhtRunner.put.tmp_done", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_4, &__pyx_t_3) < 0) __PYX_ERR(0, 773, __pyx_L9_except_error)
          __Pyx_XGOTREF(__pyx_t_2);
          __Pyx_XGOTREF(__pyx_t_4);
          __Pyx_XGOTREF(__pyx_t_3);
          {
            PyObject* __pyx_temp[3] = {__pyx_t_2, __pyx_t_4, __pyx_t_3};
            __pyx_t_9 = __Pyx_PyTuple_FromArray(__pyx_temp, 3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 773, __pyx_L9_except_error)
            __Pyx_GOTREF(__pyx_t_9);
          }
          __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 773, __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, 773, __pyx_L9_except_error)
          __pyx_t_12 = (!__pyx_t_11);


          if (unlikely(__pyx_t_12)) {

            __Pyx_GIVEREF(__pyx_t_2);
            __Pyx_GIVEREF(__pyx_t_4);
            __Pyx_XGIVEREF(__pyx_t_3);
            __Pyx_ErrRestoreWithState(__pyx_t_2, __pyx_t_4, __pyx_t_3);
            __pyx_t_2 = 0;  __pyx_t_4 = 0;  __pyx_t_3 = 0; 
            __PYX_ERR(0, 773, __pyx_L9_except_error)
          }
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          goto __pyx_L8_exception_handled;
        }
        __pyx_L9_except_error:;
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
        goto __pyx_L1_error;
        __pyx_L8_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
        __pyx_L12_try_end:;
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_1) {
          __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_mstate_global->__pyx_tuple[0], NULL);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 773, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        }
        goto __pyx_L6;
      }
      __pyx_L6:;
    }
    goto __pyx_L16;
    __pyx_L3_error:;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L1_error;
    __pyx_L16:;
  }

  /* "opendht.pyx":771
 *             pending = 0
 *             ok = False
 *             def tmp_done(ok_ret, nodes):             # <<<<<<<<<<<<<<
 *                 nonlocal pending, ok, lock
 *                 with lock:
*/

  /* 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("opendht._core.DhtRunner.put.tmp_done", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":756
 *             return res
 * 
 *     def put(self, InfoHash key, Value val, done_cb=None, permanent=False):             # <<<<<<<<<<<<<<
 *         """Publish a new value on the DHT at key.
 * 
*/

static PyObject *__pyx_pf_7opendht_5_core_9DhtRunner_40put(struct __pyx_obj_7opendht_5_core_DhtRunner *__pyx_v_self, struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_v_key, struct __pyx_obj_7opendht_5_core_Value *__pyx_v_val, PyObject *__pyx_v_done_cb, PyObject *__pyx_v_permanent) {
  struct __pyx_obj_7opendht_5_core___pyx_scope_struct_2_put *__pyx_cur_scope;
  PyObject *__pyx_v_cb_obj = NULL;
  PyObject *__pyx_v_tmp_done = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  bool __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("put", 0);
  __pyx_cur_scope = (struct __pyx_obj_7opendht_5_core___pyx_scope_struct_2_put *)__pyx_tp_new_7opendht_5_core___pyx_scope_struct_2_put(__pyx_mstate_global->__pyx_ptype_7opendht_5_core___pyx_scope_struct_2_put, __pyx_mstate_global->__pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7opendht_5_core___pyx_scope_struct_2_put *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 756, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }

  /* "opendht.pyx":763
 *         done_cb -- optional callback called when the operation is completed.
 *         """
 *         if done_cb:             # <<<<<<<<<<<<<<
 *             cb_obj = {'done':done_cb}
 *             ref.Py_INCREF(cb_obj)
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_done_cb); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 763, __pyx_L1_error)
  if (__pyx_t_1) {


    /* "opendht.pyx":764
 *         """
 *         if done_cb:
 *             cb_obj = {'done':done_cb}             # <<<<<<<<<<<<<<
 *             ref.Py_INCREF(cb_obj)
 *             self.thisptr.get().put(key._infohash, val._value, cpp.bindDoneCb(done_callback, <void*>cb_obj), cpp.time_point.max(), permanent)
*/
    __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 764, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_done, __pyx_v_done_cb) < (0)) __PYX_ERR(0, 764, __pyx_L1_error)
    __pyx_v_cb_obj = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "opendht.pyx":765
 *         if done_cb:
 *             cb_obj = {'done':done_cb}
 *             ref.Py_INCREF(cb_obj)             # <<<<<<<<<<<<<<
 *             self.thisptr.get().put(key._infohash, val._value, cpp.bindDoneCb(done_callback, <void*>cb_obj), cpp.time_point.max(), permanent)
 *         else:
*/
    Py_INCREF(__pyx_v_cb_obj);

    /* "opendht.pyx":766
 *             cb_obj = {'done':done_cb}
 *             ref.Py_INCREF(cb_obj)
 *             self.thisptr.get().put(key._infohash, val._value, cpp.bindDoneCb(done_callback, <void*>cb_obj), cpp.time_point.max(), permanent)             # <<<<<<<<<<<<<<
 *         else:
 *             lock = threading.Condition()
*/
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_permanent); if (unlikely((__pyx_t_3 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 766, __pyx_L1_error)
    __pyx_v_self->thisptr.get()->put(__pyx_v_key->_infohash, __pyx_v_val->_value, dht::bindDoneCb(__pyx_f_7opendht_5_core_done_callback, ((void *)__pyx_v_cb_obj)), dht::time_point::max(), __pyx_t_3);


    /* "opendht.pyx":763
 *         done_cb -- optional callback called when the operation is completed.
 *         """
 *         if done_cb:             # <<<<<<<<<<<<<<
 *             cb_obj = {'done':done_cb}
 *             ref.Py_INCREF(cb_obj)
*/
    goto __pyx_L3;
  }

  /* "opendht.pyx":768
 *             self.thisptr.get().put(key._infohash, val._value, cpp.bindDoneCb(done_callback, <void*>cb_obj), cpp.time_point.max(), permanent)
 *         else:
 *             lock = threading.Condition()             # <<<<<<<<<<<<<<
 *             pending = 0
 *             ok = False
*/
  /*else*/ {
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_threading); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 768, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_Condition); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 768, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_7 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
      __pyx_t_7 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 768, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_cur_scope->__pyx_v_lock = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "opendht.pyx":769
 *         else:
 *             lock = threading.Condition()
 *             pending = 0             # <<<<<<<<<<<<<<
 *             ok = False
 *             def tmp_done(ok_ret, nodes):
*/
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0);
    __pyx_cur_scope->__pyx_v_pending = __pyx_mstate_global->__pyx_int_0;

    /* "opendht.pyx":770
 *             lock = threading.Condition()
 *             pending = 0
 *             ok = False             # <<<<<<<<<<<<<<
 *             def tmp_done(ok_ret, nodes):
 *                 nonlocal pending, ok, lock
*/
    __Pyx_INCREF(Py_False);
    __Pyx_GIVEREF(Py_False);
    __pyx_cur_scope->__pyx_v_ok = Py_False;

    /* "opendht.pyx":771
 *             pending = 0
 *             ok = False
 *             def tmp_done(ok_ret, nodes):             # <<<<<<<<<<<<<<
 *                 nonlocal pending, ok, lock
 *                 with lock:
*/
    __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_9DhtRunner_3put_1tmp_done, 0, __pyx_mstate_global->__pyx_n_u_put_locals_tmp_done, ((PyObject*)__pyx_cur_scope), __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[4])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 771, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_tmp_done = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "opendht.pyx":777
 *                     pending -= 1
 *                     lock.notify()
 *             with lock:             # <<<<<<<<<<<<<<
 *                 pending += 1
 *                 self.put(key, val, done_cb=tmp_done)
*/
    /*with:*/ {
      __pyx_t_8 = __Pyx_PyObject_LookupSpecial(__pyx_cur_scope->__pyx_v_lock, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 777, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_6 = NULL;
      __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_cur_scope->__pyx_v_lock, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 777, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_7 = 1;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
        assert(__pyx_t_6);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
        __pyx_t_7 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
        __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 777, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      /*try:*/ {
        {
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
          __Pyx_XGOTREF(__pyx_t_9);
          __Pyx_XGOTREF(__pyx_t_10);
          __Pyx_XGOTREF(__pyx_t_11);
          /*try:*/ {

            /* "opendht.pyx":778
 *                     lock.notify()
 *             with lock:
 *                 pending += 1             # <<<<<<<<<<<<<<
 *                 self.put(key, val, done_cb=tmp_done)
 *                 while pending > 0:
*/
            __pyx_t_2 = __Pyx_PyLong_AddObjC(__pyx_cur_scope->__pyx_v_pending, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 778, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_pending);
            __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_pending, __pyx_t_2);
            __Pyx_GIVEREF(__pyx_t_2);
            __pyx_t_2 = 0;

            /* "opendht.pyx":779
 *             with lock:
 *                 pending += 1
 *                 self.put(key, val, done_cb=tmp_done)             # <<<<<<<<<<<<<<
 *                 while pending > 0:
 *                     lock.wait()
*/
            __pyx_t_4 = ((PyObject *)__pyx_v_self);
            __Pyx_INCREF(__pyx_t_4);
            __pyx_t_7 = 0;
            {
              PyObject *__pyx_callargs[4] = {__pyx_t_4, ((PyObject *)__pyx_v_key), ((PyObject *)__pyx_v_val), __pyx_v_tmp_done};
              #if CYTHON_VECTORCALL
              __pyx_t_6 = __pyx_mstate_global->__pyx_tuple[1];
              if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 779, __pyx_L8_error)
              __Pyx_INCREF(__pyx_t_6);
              #else
              {
                PyObject *__pyx_temp[1] = {__pyx_mstate_global->__pyx_n_u_done_cb};
                __pyx_t_6 = __Pyx_MakeKwargDict(__pyx_temp, __pyx_callargs+3, 1);
                if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 779, __pyx_L8_error)
                __Pyx_GOTREF(__pyx_t_6);
              }
              #endif
              __pyx_t_2 = __Pyx_Object_VectorcallMethodKwds((PyObject*)__pyx_mstate_global->__pyx_n_u_put, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6);
              __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
              __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
              if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 779, __pyx_L8_error)
              __Pyx_GOTREF(__pyx_t_2);
            }
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

            /* "opendht.pyx":780
 *                 pending += 1
 *                 self.put(key, val, done_cb=tmp_done)
 *                 while pending > 0:             # <<<<<<<<<<<<<<
 *                     lock.wait()
 *             return ok
*/
            while (1) {
              __pyx_t_1 = __Pyx_PyObject_CompareBoolGt_object_int(__pyx_cur_scope->__pyx_v_pending, __pyx_mstate_global->__pyx_int_0, Py_GT); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 780, __pyx_L8_error)

              if (!__pyx_t_1) break;

              /* "opendht.pyx":781
 *                 self.put(key, val, done_cb=tmp_done)
 *                 while pending > 0:
 *                     lock.wait()             # <<<<<<<<<<<<<<
 *             return ok
 * 
*/
              __pyx_t_6 = __pyx_cur_scope->__pyx_v_lock;
              __Pyx_INCREF(__pyx_t_6);
              __pyx_t_7 = 0;
              {
                PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
                __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_wait, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
                if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 781, __pyx_L8_error)
                __Pyx_GOTREF(__pyx_t_2);
              }
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            }

            /* "opendht.pyx":777
 *                     pending -= 1
 *                     lock.notify()
 *             with lock:             # <<<<<<<<<<<<<<
 *                 pending += 1
 *                 self.put(key, val, done_cb=tmp_done)
*/
          }
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          goto __pyx_L13_try_end;
          __pyx_L8_error:;
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          /*except:*/ {
            __Pyx_AddTraceback("opendht._core.DhtRunner.put", __pyx_clineno, __pyx_lineno, __pyx_filename);
            if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_6, &__pyx_t_4) < 0) __PYX_ERR(0, 777, __pyx_L10_except_error)
            __Pyx_XGOTREF(__pyx_t_2);
            __Pyx_XGOTREF(__pyx_t_6);
            __Pyx_XGOTREF(__pyx_t_4);
            {
              PyObject* __pyx_temp[3] = {__pyx_t_2, __pyx_t_6, __pyx_t_4};
              __pyx_t_5 = __Pyx_PyTuple_FromArray(__pyx_temp, 3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 777, __pyx_L10_except_error)
              __Pyx_GOTREF(__pyx_t_5);
            }
            __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_5, NULL);
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 777, __pyx_L10_except_error)
            __Pyx_GOTREF(__pyx_t_12);
            __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_12);
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            if (__pyx_t_1 < (0)) __PYX_ERR(0, 777, __pyx_L10_except_error)
            __pyx_t_13 = (!__pyx_t_1);


            if (unlikely(__pyx_t_13)) {

              __Pyx_GIVEREF(__pyx_t_2);
              __Pyx_GIVEREF(__pyx_t_6);
              __Pyx_XGIVEREF(__pyx_t_4);
              __Pyx_ErrRestoreWithState(__pyx_t_2, __pyx_t_6, __pyx_t_4);
              __pyx_t_2 = 0;  __pyx_t_6 = 0;  __pyx_t_4 = 0; 
              __PYX_ERR(0, 777, __pyx_L10_except_error)
            }
            __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            goto __pyx_L9_exception_handled;
          }
          __pyx_L10_except_error:;
          __Pyx_XGIVEREF(__pyx_t_9);
          __Pyx_XGIVEREF(__pyx_t_10);
          __Pyx_XGIVEREF(__pyx_t_11);
          __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
          goto __pyx_L1_error;
          __pyx_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_L13_try_end:;
        }
      }
      /*finally:*/ {
        /*normal exit:*/{
          if (__pyx_t_8) {
            __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_mstate_global->__pyx_tuple[0], NULL);
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 777, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_11);
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          }
          goto __pyx_L7;
        }
        __pyx_L7:;
      }
      goto __pyx_L19;
      __pyx_L4_error:;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L1_error;
      __pyx_L19:;
    }

    /* "opendht.pyx":782
 *                 while pending > 0:
 *                     lock.wait()
 *             return ok             # <<<<<<<<<<<<<<
 * 
 *     def putSigned(self, InfoHash key, Value val, done_cb=None, permanent=False):
*/
    {
      PyObject *__pyx_temp;
      {
        __pyx_temp = __pyx_r;
        __Pyx_INCREF(__pyx_cur_scope->__pyx_v_ok);
        __pyx_r = __pyx_cur_scope->__pyx_v_ok;
      }
      __Pyx_XDECREF(__pyx_temp);
    }
    goto __pyx_L0;
  }
  __pyx_L3:;

  /* "opendht.pyx":756
 *             return res
 * 
 *     def put(self, InfoHash key, Value val, done_cb=None, permanent=False):             # <<<<<<<<<<<<<<
 *         """Publish a new value on the DHT at key.
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("opendht._core.DhtRunner.put", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_cb_obj);
  __Pyx_XDECREF(__pyx_v_tmp_done);
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":784
 *             return ok
 * 
 *     def putSigned(self, InfoHash key, Value val, done_cb=None, permanent=False):             # <<<<<<<<<<<<<<
 *         if done_cb:
 *             cb_obj = {'done':done_cb}
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_9DhtRunner_43putSigned(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_9DhtRunner_43putSigned = {"putSigned", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9DhtRunner_43putSigned, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_9DhtRunner_43putSigned(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_v_key = 0;
  struct __pyx_obj_7opendht_5_core_Value *__pyx_v_val = 0;
  PyObject *__pyx_v_done_cb = 0;
  PyObject *__pyx_v_permanent = 0;
  #if !CYTHON_VECTORCALL
  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("putSigned (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_key,&__pyx_mstate_global->__pyx_n_u_val,&__pyx_mstate_global->__pyx_n_u_done_cb,&__pyx_mstate_global->__pyx_n_u_permanent,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 784, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 784, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 784, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 784, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 784, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "putSigned", 0) < (0)) __PYX_ERR(0, 784, __pyx_L3_error)
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_False));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("putSigned", 0, 2, 4, i); __PYX_ERR(0, 784, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 784, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 784, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 784, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 784, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_False));
    }
    __pyx_v_key = ((struct __pyx_obj_7opendht_5_core_InfoHash *)values[0]);
    __pyx_v_val = ((struct __pyx_obj_7opendht_5_core_Value *)values[1]);
    __pyx_v_done_cb = values[2];
    __pyx_v_permanent = values[3];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("putSigned", 0, 2, 4, __pyx_nargs); __PYX_ERR(0, 784, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.DhtRunner.putSigned", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_key), __pyx_mstate_global->__pyx_ptype_7opendht_5_core_InfoHash, 1, "key", 0))) __PYX_ERR(0, 784, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_val), __pyx_mstate_global->__pyx_ptype_7opendht_5_core_Value, 1, "val", 0))) __PYX_ERR(0, 784, __pyx_L1_error)
  __pyx_r = __pyx_pf_7opendht_5_core_9DhtRunner_42putSigned(((struct __pyx_obj_7opendht_5_core_DhtRunner *)__pyx_v_self), __pyx_v_key, __pyx_v_val, __pyx_v_done_cb, __pyx_v_permanent);

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

/* "opendht.pyx":793
 *             pending = 0
 *             ok = False
 *             def tmp_done(ok_ret, nodes):             # <<<<<<<<<<<<<<
 *                 nonlocal pending, ok, lock
 *                 with lock:
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_9DhtRunner_9putSigned_1tmp_done(PyObject *__pyx_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_9DhtRunner_9putSigned_1tmp_done = {"tmp_done", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9DhtRunner_9putSigned_1tmp_done, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_9DhtRunner_9putSigned_1tmp_done(PyObject *__pyx_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_ok_ret = 0;
  CYTHON_UNUSED PyObject *__pyx_v_nodes = 0;
  #if !CYTHON_VECTORCALL
  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("tmp_done (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_ok_ret,&__pyx_mstate_global->__pyx_n_u_nodes,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 793, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 793, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 793, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "tmp_done", 0) < (0)) __PYX_ERR(0, 793, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("tmp_done", 1, 2, 2, i); __PYX_ERR(0, 793, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 793, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 793, __pyx_L3_error)
    }
    __pyx_v_ok_ret = values[0];
    __pyx_v_nodes = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("tmp_done", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 793, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.DhtRunner.putSigned.tmp_done", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7opendht_5_core_9DhtRunner_9putSigned_tmp_done(__pyx_self, __pyx_v_ok_ret, __pyx_v_nodes);

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

static PyObject *__pyx_pf_7opendht_5_core_9DhtRunner_9putSigned_tmp_done(PyObject *__pyx_self, PyObject *__pyx_v_ok_ret, CYTHON_UNUSED PyObject *__pyx_v_nodes) {
  struct __pyx_obj_7opendht_5_core___pyx_scope_struct_3_putSigned *__pyx_cur_scope;
  struct __pyx_obj_7opendht_5_core___pyx_scope_struct_3_putSigned *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __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("tmp_done", 0);
  __pyx_outer_scope = (struct __pyx_obj_7opendht_5_core___pyx_scope_struct_3_putSigned *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "opendht.pyx":795
 *             def tmp_done(ok_ret, nodes):
 *                 nonlocal pending, ok, lock
 *                 with lock:             # <<<<<<<<<<<<<<
 *                     ok = ok_ret
 *                     pending -= 1
*/
  /*with:*/ {
    if (unlikely(!__pyx_cur_scope->__pyx_v_lock)) { __Pyx_RaiseClosureNameError("lock"); __PYX_ERR(0, 795, __pyx_L1_error) }
    __pyx_t_1 = __Pyx_PyObject_LookupSpecial(__pyx_cur_scope->__pyx_v_lock, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 795, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = NULL;
    __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_cur_scope->__pyx_v_lock, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 795, __pyx_L3_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 795, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    /*try:*/ {
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_6);
        __Pyx_XGOTREF(__pyx_t_7);
        __Pyx_XGOTREF(__pyx_t_8);
        /*try:*/ {

          /* "opendht.pyx":796
 *                 nonlocal pending, ok, lock
 *                 with lock:
 *                     ok = ok_ret             # <<<<<<<<<<<<<<
 *                     pending -= 1
 *                     lock.notify()
*/
          __Pyx_INCREF(__pyx_v_ok_ret);
          __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_ok);
          __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_ok, __pyx_v_ok_ret);
          __Pyx_GIVEREF(__pyx_v_ok_ret);

          /* "opendht.pyx":797
 *                 with lock:
 *                     ok = ok_ret
 *                     pending -= 1             # <<<<<<<<<<<<<<
 *                     lock.notify()
 *             with lock:
*/
          if (unlikely(!__pyx_cur_scope->__pyx_v_pending)) { __Pyx_RaiseClosureNameError("pending"); __PYX_ERR(0, 797, __pyx_L7_error) }
          __pyx_t_2 = __Pyx_PyLong_SubtractObjC(__pyx_cur_scope->__pyx_v_pending, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 797, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_pending);
          __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_pending, __pyx_t_2);
          __Pyx_GIVEREF(__pyx_t_2);
          __pyx_t_2 = 0;

          /* "opendht.pyx":798
 *                     ok = ok_ret
 *                     pending -= 1
 *                     lock.notify()             # <<<<<<<<<<<<<<
 *             with lock:
 *                 pending += 1
*/
          if (unlikely(!__pyx_cur_scope->__pyx_v_lock)) { __Pyx_RaiseClosureNameError("lock"); __PYX_ERR(0, 798, __pyx_L7_error) }
          __pyx_t_4 = __pyx_cur_scope->__pyx_v_lock;
          __Pyx_INCREF(__pyx_t_4);
          __pyx_t_5 = 0;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
            __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_notify, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 798, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_2);
          }
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

          /* "opendht.pyx":795
 *             def tmp_done(ok_ret, nodes):
 *                 nonlocal pending, ok, lock
 *                 with lock:             # <<<<<<<<<<<<<<
 *                     ok = ok_ret
 *                     pending -= 1
*/
        }
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        goto __pyx_L12_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_4); __pyx_t_4 = 0;
        /*except:*/ {
          __Pyx_AddTraceback("opendht._core.DhtRunner.putSigned.tmp_done", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_4, &__pyx_t_3) < 0) __PYX_ERR(0, 795, __pyx_L9_except_error)
          __Pyx_XGOTREF(__pyx_t_2);
          __Pyx_XGOTREF(__pyx_t_4);
          __Pyx_XGOTREF(__pyx_t_3);
          {
            PyObject* __pyx_temp[3] = {__pyx_t_2, __pyx_t_4, __pyx_t_3};
            __pyx_t_9 = __Pyx_PyTuple_FromArray(__pyx_temp, 3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 795, __pyx_L9_except_error)
            __Pyx_GOTREF(__pyx_t_9);
          }
          __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 795, __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, 795, __pyx_L9_except_error)
          __pyx_t_12 = (!__pyx_t_11);


          if (unlikely(__pyx_t_12)) {

            __Pyx_GIVEREF(__pyx_t_2);
            __Pyx_GIVEREF(__pyx_t_4);
            __Pyx_XGIVEREF(__pyx_t_3);
            __Pyx_ErrRestoreWithState(__pyx_t_2, __pyx_t_4, __pyx_t_3);
            __pyx_t_2 = 0;  __pyx_t_4 = 0;  __pyx_t_3 = 0; 
            __PYX_ERR(0, 795, __pyx_L9_except_error)
          }
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          goto __pyx_L8_exception_handled;
        }
        __pyx_L9_except_error:;
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
        goto __pyx_L1_error;
        __pyx_L8_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
        __pyx_L12_try_end:;
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_1) {
          __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_mstate_global->__pyx_tuple[0], NULL);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 795, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        }
        goto __pyx_L6;
      }
      __pyx_L6:;
    }
    goto __pyx_L16;
    __pyx_L3_error:;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L1_error;
    __pyx_L16:;
  }

  /* "opendht.pyx":793
 *             pending = 0
 *             ok = False
 *             def tmp_done(ok_ret, nodes):             # <<<<<<<<<<<<<<
 *                 nonlocal pending, ok, lock
 *                 with lock:
*/

  /* 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("opendht._core.DhtRunner.putSigned.tmp_done", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":784
 *             return ok
 * 
 *     def putSigned(self, InfoHash key, Value val, done_cb=None, permanent=False):             # <<<<<<<<<<<<<<
 *         if done_cb:
 *             cb_obj = {'done':done_cb}
*/

static PyObject *__pyx_pf_7opendht_5_core_9DhtRunner_42putSigned(struct __pyx_obj_7opendht_5_core_DhtRunner *__pyx_v_self, struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_v_key, struct __pyx_obj_7opendht_5_core_Value *__pyx_v_val, PyObject *__pyx_v_done_cb, PyObject *__pyx_v_permanent) {
  struct __pyx_obj_7opendht_5_core___pyx_scope_struct_3_putSigned *__pyx_cur_scope;
  PyObject *__pyx_v_cb_obj = NULL;
  PyObject *__pyx_v_tmp_done = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  bool __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("putSigned", 0);
  __pyx_cur_scope = (struct __pyx_obj_7opendht_5_core___pyx_scope_struct_3_putSigned *)__pyx_tp_new_7opendht_5_core___pyx_scope_struct_3_putSigned(__pyx_mstate_global->__pyx_ptype_7opendht_5_core___pyx_scope_struct_3_putSigned, __pyx_mstate_global->__pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7opendht_5_core___pyx_scope_struct_3_putSigned *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 784, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }

  /* "opendht.pyx":785
 * 
 *     def putSigned(self, InfoHash key, Value val, done_cb=None, permanent=False):
 *         if done_cb:             # <<<<<<<<<<<<<<
 *             cb_obj = {'done':done_cb}
 *             ref.Py_INCREF(cb_obj)
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_done_cb); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 785, __pyx_L1_error)
  if (__pyx_t_1) {


    /* "opendht.pyx":786
 *     def putSigned(self, InfoHash key, Value val, done_cb=None, permanent=False):
 *         if done_cb:
 *             cb_obj = {'done':done_cb}             # <<<<<<<<<<<<<<
 *             ref.Py_INCREF(cb_obj)
 *             self.thisptr.get().putSigned(key._infohash, val._value, cpp.bindDoneCb(done_callback, <void*>cb_obj), permanent)
*/
    __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 786, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_done, __pyx_v_done_cb) < (0)) __PYX_ERR(0, 786, __pyx_L1_error)
    __pyx_v_cb_obj = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "opendht.pyx":787
 *         if done_cb:
 *             cb_obj = {'done':done_cb}
 *             ref.Py_INCREF(cb_obj)             # <<<<<<<<<<<<<<
 *             self.thisptr.get().putSigned(key._infohash, val._value, cpp.bindDoneCb(done_callback, <void*>cb_obj), permanent)
 *         else:
*/
    Py_INCREF(__pyx_v_cb_obj);

    /* "opendht.pyx":788
 *             cb_obj = {'done':done_cb}
 *             ref.Py_INCREF(cb_obj)
 *             self.thisptr.get().putSigned(key._infohash, val._value, cpp.bindDoneCb(done_callback, <void*>cb_obj), permanent)             # <<<<<<<<<<<<<<
 *         else:
 *             lock = threading.Condition()
*/
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_permanent); if (unlikely((__pyx_t_3 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 788, __pyx_L1_error)
    __pyx_v_self->thisptr.get()->putSigned(__pyx_v_key->_infohash, __pyx_v_val->_value, dht::bindDoneCb(__pyx_f_7opendht_5_core_done_callback, ((void *)__pyx_v_cb_obj)), __pyx_t_3);


    /* "opendht.pyx":785
 * 
 *     def putSigned(self, InfoHash key, Value val, done_cb=None, permanent=False):
 *         if done_cb:             # <<<<<<<<<<<<<<
 *             cb_obj = {'done':done_cb}
 *             ref.Py_INCREF(cb_obj)
*/
    goto __pyx_L3;
  }

  /* "opendht.pyx":790
 *             self.thisptr.get().putSigned(key._infohash, val._value, cpp.bindDoneCb(done_callback, <void*>cb_obj), permanent)
 *         else:
 *             lock = threading.Condition()             # <<<<<<<<<<<<<<
 *             pending = 0
 *             ok = False
*/
  /*else*/ {
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_threading); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 790, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_Condition); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 790, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_7 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
      __pyx_t_7 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 790, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_cur_scope->__pyx_v_lock = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "opendht.pyx":791
 *         else:
 *             lock = threading.Condition()
 *             pending = 0             # <<<<<<<<<<<<<<
 *             ok = False
 *             def tmp_done(ok_ret, nodes):
*/
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0);
    __pyx_cur_scope->__pyx_v_pending = __pyx_mstate_global->__pyx_int_0;

    /* "opendht.pyx":792
 *             lock = threading.Condition()
 *             pending = 0
 *             ok = False             # <<<<<<<<<<<<<<
 *             def tmp_done(ok_ret, nodes):
 *                 nonlocal pending, ok, lock
*/
    __Pyx_INCREF(Py_False);
    __Pyx_GIVEREF(Py_False);
    __pyx_cur_scope->__pyx_v_ok = Py_False;

    /* "opendht.pyx":793
 *             pending = 0
 *             ok = False
 *             def tmp_done(ok_ret, nodes):             # <<<<<<<<<<<<<<
 *                 nonlocal pending, ok, lock
 *                 with lock:
*/
    __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_9DhtRunner_9putSigned_1tmp_done, 0, __pyx_mstate_global->__pyx_n_u_putSigned_locals_tmp_done, ((PyObject*)__pyx_cur_scope), __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[5])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 793, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_tmp_done = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "opendht.pyx":799
 *                     pending -= 1
 *                     lock.notify()
 *             with lock:             # <<<<<<<<<<<<<<
 *                 pending += 1
 *                 self.putSigned(key, val, done_cb=tmp_done)
*/
    /*with:*/ {
      __pyx_t_8 = __Pyx_PyObject_LookupSpecial(__pyx_cur_scope->__pyx_v_lock, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 799, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_6 = NULL;
      __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_cur_scope->__pyx_v_lock, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 799, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_7 = 1;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
        assert(__pyx_t_6);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
        __pyx_t_7 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
        __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 799, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      /*try:*/ {
        {
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
          __Pyx_XGOTREF(__pyx_t_9);
          __Pyx_XGOTREF(__pyx_t_10);
          __Pyx_XGOTREF(__pyx_t_11);
          /*try:*/ {

            /* "opendht.pyx":800
 *                     lock.notify()
 *             with lock:
 *                 pending += 1             # <<<<<<<<<<<<<<
 *                 self.putSigned(key, val, done_cb=tmp_done)
 *                 while pending > 0:
*/
            __pyx_t_2 = __Pyx_PyLong_AddObjC(__pyx_cur_scope->__pyx_v_pending, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 800, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_pending);
            __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_pending, __pyx_t_2);
            __Pyx_GIVEREF(__pyx_t_2);
            __pyx_t_2 = 0;

            /* "opendht.pyx":801
 *             with lock:
 *                 pending += 1
 *                 self.putSigned(key, val, done_cb=tmp_done)             # <<<<<<<<<<<<<<
 *                 while pending > 0:
 *                     lock.wait()
*/
            __pyx_t_4 = ((PyObject *)__pyx_v_self);
            __Pyx_INCREF(__pyx_t_4);
            __pyx_t_7 = 0;
            {
              PyObject *__pyx_callargs[4] = {__pyx_t_4, ((PyObject *)__pyx_v_key), ((PyObject *)__pyx_v_val), __pyx_v_tmp_done};
              #if CYTHON_VECTORCALL
              __pyx_t_6 = __pyx_mstate_global->__pyx_tuple[1];
              if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 801, __pyx_L8_error)
              __Pyx_INCREF(__pyx_t_6);
              #else
              {
                PyObject *__pyx_temp[1] = {__pyx_mstate_global->__pyx_n_u_done_cb};
                __pyx_t_6 = __Pyx_MakeKwargDict(__pyx_temp, __pyx_callargs+3, 1);
                if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 801, __pyx_L8_error)
                __Pyx_GOTREF(__pyx_t_6);
              }
              #endif
              __pyx_t_2 = __Pyx_Object_VectorcallMethodKwds((PyObject*)__pyx_mstate_global->__pyx_n_u_putSigned, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6);
              __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
              __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
              if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 801, __pyx_L8_error)
              __Pyx_GOTREF(__pyx_t_2);
            }
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

            /* "opendht.pyx":802
 *                 pending += 1
 *                 self.putSigned(key, val, done_cb=tmp_done)
 *                 while pending > 0:             # <<<<<<<<<<<<<<
 *                     lock.wait()
 *             return ok
*/
            while (1) {
              __pyx_t_1 = __Pyx_PyObject_CompareBoolGt_object_int(__pyx_cur_scope->__pyx_v_pending, __pyx_mstate_global->__pyx_int_0, Py_GT); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 802, __pyx_L8_error)

              if (!__pyx_t_1) break;

              /* "opendht.pyx":803
 *                 self.putSigned(key, val, done_cb=tmp_done)
 *                 while pending > 0:
 *                     lock.wait()             # <<<<<<<<<<<<<<
 *             return ok
 * 
*/
              __pyx_t_6 = __pyx_cur_scope->__pyx_v_lock;
              __Pyx_INCREF(__pyx_t_6);
              __pyx_t_7 = 0;
              {
                PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
                __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_wait, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
                if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 803, __pyx_L8_error)
                __Pyx_GOTREF(__pyx_t_2);
              }
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            }

            /* "opendht.pyx":799
 *                     pending -= 1
 *                     lock.notify()
 *             with lock:             # <<<<<<<<<<<<<<
 *                 pending += 1
 *                 self.putSigned(key, val, done_cb=tmp_done)
*/
          }
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          goto __pyx_L13_try_end;
          __pyx_L8_error:;
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          /*except:*/ {
            __Pyx_AddTraceback("opendht._core.DhtRunner.putSigned", __pyx_clineno, __pyx_lineno, __pyx_filename);
            if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_6, &__pyx_t_4) < 0) __PYX_ERR(0, 799, __pyx_L10_except_error)
            __Pyx_XGOTREF(__pyx_t_2);
            __Pyx_XGOTREF(__pyx_t_6);
            __Pyx_XGOTREF(__pyx_t_4);
            {
              PyObject* __pyx_temp[3] = {__pyx_t_2, __pyx_t_6, __pyx_t_4};
              __pyx_t_5 = __Pyx_PyTuple_FromArray(__pyx_temp, 3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 799, __pyx_L10_except_error)
              __Pyx_GOTREF(__pyx_t_5);
            }
            __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_5, NULL);
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 799, __pyx_L10_except_error)
            __Pyx_GOTREF(__pyx_t_12);
            __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_12);
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            if (__pyx_t_1 < (0)) __PYX_ERR(0, 799, __pyx_L10_except_error)
            __pyx_t_13 = (!__pyx_t_1);


            if (unlikely(__pyx_t_13)) {

              __Pyx_GIVEREF(__pyx_t_2);
              __Pyx_GIVEREF(__pyx_t_6);
              __Pyx_XGIVEREF(__pyx_t_4);
              __Pyx_ErrRestoreWithState(__pyx_t_2, __pyx_t_6, __pyx_t_4);
              __pyx_t_2 = 0;  __pyx_t_6 = 0;  __pyx_t_4 = 0; 
              __PYX_ERR(0, 799, __pyx_L10_except_error)
            }
            __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            goto __pyx_L9_exception_handled;
          }
          __pyx_L10_except_error:;
          __Pyx_XGIVEREF(__pyx_t_9);
          __Pyx_XGIVEREF(__pyx_t_10);
          __Pyx_XGIVEREF(__pyx_t_11);
          __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
          goto __pyx_L1_error;
          __pyx_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_L13_try_end:;
        }
      }
      /*finally:*/ {
        /*normal exit:*/{
          if (__pyx_t_8) {
            __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_mstate_global->__pyx_tuple[0], NULL);
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 799, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_11);
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          }
          goto __pyx_L7;
        }
        __pyx_L7:;
      }
      goto __pyx_L19;
      __pyx_L4_error:;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L1_error;
      __pyx_L19:;
    }

    /* "opendht.pyx":804
 *                 while pending > 0:
 *                     lock.wait()
 *             return ok             # <<<<<<<<<<<<<<
 * 
 *     def putEncrypted(self, InfoHash key, Value val, to, done_cb=None, bool permanent=False):
*/
    {
      PyObject *__pyx_temp;
      {
        __pyx_temp = __pyx_r;
        __Pyx_INCREF(__pyx_cur_scope->__pyx_v_ok);
        __pyx_r = __pyx_cur_scope->__pyx_v_ok;
      }
      __Pyx_XDECREF(__pyx_temp);
    }
    goto __pyx_L0;
  }
  __pyx_L3:;

  /* "opendht.pyx":784
 *             return ok
 * 
 *     def putSigned(self, InfoHash key, Value val, done_cb=None, permanent=False):             # <<<<<<<<<<<<<<
 *         if done_cb:
 *             cb_obj = {'done':done_cb}
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("opendht._core.DhtRunner.putSigned", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_cb_obj);
  __Pyx_XDECREF(__pyx_v_tmp_done);
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":806
 *             return ok
 * 
 *     def putEncrypted(self, InfoHash key, Value val, to, done_cb=None, bool permanent=False):             # <<<<<<<<<<<<<<
 *         if to is None:
 *             raise ValueError("'to' must be provided")
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_9DhtRunner_45putEncrypted(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_9DhtRunner_45putEncrypted = {"putEncrypted", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9DhtRunner_45putEncrypted, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_9DhtRunner_45putEncrypted(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_v_key = 0;
  struct __pyx_obj_7opendht_5_core_Value *__pyx_v_val = 0;
  PyObject *__pyx_v_to = 0;
  PyObject *__pyx_v_done_cb = 0;
  bool __pyx_v_permanent;
  #if !CYTHON_VECTORCALL
  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("putEncrypted (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_key,&__pyx_mstate_global->__pyx_n_u_val,&__pyx_mstate_global->__pyx_n_u_to,&__pyx_mstate_global->__pyx_n_u_done_cb,&__pyx_mstate_global->__pyx_n_u_permanent,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 806, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 806, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 806, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 806, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 806, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 806, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "putEncrypted", 0) < (0)) __PYX_ERR(0, 806, __pyx_L3_error)
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("putEncrypted", 0, 3, 5, i); __PYX_ERR(0, 806, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 806, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 806, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 806, __pyx_L3_error)
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 806, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 806, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_key = ((struct __pyx_obj_7opendht_5_core_InfoHash *)values[0]);
    __pyx_v_val = ((struct __pyx_obj_7opendht_5_core_Value *)values[1]);
    __pyx_v_to = values[2];
    __pyx_v_done_cb = values[3];
    if (values[4]) {
      __pyx_v_permanent = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_permanent == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 806, __pyx_L3_error)
    } else {
      __pyx_v_permanent = ((bool)0);
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("putEncrypted", 0, 3, 5, __pyx_nargs); __PYX_ERR(0, 806, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.DhtRunner.putEncrypted", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_key), __pyx_mstate_global->__pyx_ptype_7opendht_5_core_InfoHash, 1, "key", 0))) __PYX_ERR(0, 806, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_val), __pyx_mstate_global->__pyx_ptype_7opendht_5_core_Value, 1, "val", 0))) __PYX_ERR(0, 806, __pyx_L1_error)
  __pyx_r = __pyx_pf_7opendht_5_core_9DhtRunner_44putEncrypted(((struct __pyx_obj_7opendht_5_core_DhtRunner *)__pyx_v_self), __pyx_v_key, __pyx_v_val, __pyx_v_to, __pyx_v_done_cb, __pyx_v_permanent);

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

  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":832
 *             pending = 0
 *             ok = False
 *             def tmp_done(ok_ret, nodes):             # <<<<<<<<<<<<<<
 *                 nonlocal pending, ok, lock
 *                 with lock:
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_9DhtRunner_12putEncrypted_1tmp_done(PyObject *__pyx_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_9DhtRunner_12putEncrypted_1tmp_done = {"tmp_done", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9DhtRunner_12putEncrypted_1tmp_done, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_9DhtRunner_12putEncrypted_1tmp_done(PyObject *__pyx_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_ok_ret = 0;
  CYTHON_UNUSED PyObject *__pyx_v_nodes = 0;
  #if !CYTHON_VECTORCALL
  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("tmp_done (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_ok_ret,&__pyx_mstate_global->__pyx_n_u_nodes,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 832, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 832, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 832, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "tmp_done", 0) < (0)) __PYX_ERR(0, 832, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("tmp_done", 1, 2, 2, i); __PYX_ERR(0, 832, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 832, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 832, __pyx_L3_error)
    }
    __pyx_v_ok_ret = values[0];
    __pyx_v_nodes = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("tmp_done", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 832, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.DhtRunner.putEncrypted.tmp_done", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7opendht_5_core_9DhtRunner_12putEncrypted_tmp_done(__pyx_self, __pyx_v_ok_ret, __pyx_v_nodes);

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

static PyObject *__pyx_pf_7opendht_5_core_9DhtRunner_12putEncrypted_tmp_done(PyObject *__pyx_self, PyObject *__pyx_v_ok_ret, CYTHON_UNUSED PyObject *__pyx_v_nodes) {
  struct __pyx_obj_7opendht_5_core___pyx_scope_struct_4_putEncrypted *__pyx_cur_scope;
  struct __pyx_obj_7opendht_5_core___pyx_scope_struct_4_putEncrypted *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __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("tmp_done", 0);
  __pyx_outer_scope = (struct __pyx_obj_7opendht_5_core___pyx_scope_struct_4_putEncrypted *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "opendht.pyx":834
 *             def tmp_done(ok_ret, nodes):
 *                 nonlocal pending, ok, lock
 *                 with lock:             # <<<<<<<<<<<<<<
 *                     ok = ok_ret
 *                     pending -= 1
*/
  /*with:*/ {
    if (unlikely(!__pyx_cur_scope->__pyx_v_lock)) { __Pyx_RaiseClosureNameError("lock"); __PYX_ERR(0, 834, __pyx_L1_error) }
    __pyx_t_1 = __Pyx_PyObject_LookupSpecial(__pyx_cur_scope->__pyx_v_lock, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 834, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = NULL;
    __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_cur_scope->__pyx_v_lock, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 834, __pyx_L3_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 834, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    /*try:*/ {
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_6);
        __Pyx_XGOTREF(__pyx_t_7);
        __Pyx_XGOTREF(__pyx_t_8);
        /*try:*/ {

          /* "opendht.pyx":835
 *                 nonlocal pending, ok, lock
 *                 with lock:
 *                     ok = ok_ret             # <<<<<<<<<<<<<<
 *                     pending -= 1
 *                     lock.notify()
*/
          __Pyx_INCREF(__pyx_v_ok_ret);
          __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_ok);
          __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_ok, __pyx_v_ok_ret);
          __Pyx_GIVEREF(__pyx_v_ok_ret);

          /* "opendht.pyx":836
 *                 with lock:
 *                     ok = ok_ret
 *                     pending -= 1             # <<<<<<<<<<<<<<
 *                     lock.notify()
 *             with lock:
*/
          if (unlikely(!__pyx_cur_scope->__pyx_v_pending)) { __Pyx_RaiseClosureNameError("pending"); __PYX_ERR(0, 836, __pyx_L7_error) }
          __pyx_t_2 = __Pyx_PyLong_SubtractObjC(__pyx_cur_scope->__pyx_v_pending, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 836, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_pending);
          __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_pending, __pyx_t_2);
          __Pyx_GIVEREF(__pyx_t_2);
          __pyx_t_2 = 0;

          /* "opendht.pyx":837
 *                     ok = ok_ret
 *                     pending -= 1
 *                     lock.notify()             # <<<<<<<<<<<<<<
 *             with lock:
 *                 pending += 1
*/
          if (unlikely(!__pyx_cur_scope->__pyx_v_lock)) { __Pyx_RaiseClosureNameError("lock"); __PYX_ERR(0, 837, __pyx_L7_error) }
          __pyx_t_4 = __pyx_cur_scope->__pyx_v_lock;
          __Pyx_INCREF(__pyx_t_4);
          __pyx_t_5 = 0;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
            __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_notify, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 837, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_2);
          }
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

          /* "opendht.pyx":834
 *             def tmp_done(ok_ret, nodes):
 *                 nonlocal pending, ok, lock
 *                 with lock:             # <<<<<<<<<<<<<<
 *                     ok = ok_ret
 *                     pending -= 1
*/
        }
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        goto __pyx_L12_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_4); __pyx_t_4 = 0;
        /*except:*/ {
          __Pyx_AddTraceback("opendht._core.DhtRunner.putEncrypted.tmp_done", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_4, &__pyx_t_3) < 0) __PYX_ERR(0, 834, __pyx_L9_except_error)
          __Pyx_XGOTREF(__pyx_t_2);
          __Pyx_XGOTREF(__pyx_t_4);
          __Pyx_XGOTREF(__pyx_t_3);
          {
            PyObject* __pyx_temp[3] = {__pyx_t_2, __pyx_t_4, __pyx_t_3};
            __pyx_t_9 = __Pyx_PyTuple_FromArray(__pyx_temp, 3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 834, __pyx_L9_except_error)
            __Pyx_GOTREF(__pyx_t_9);
          }
          __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 834, __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, 834, __pyx_L9_except_error)
          __pyx_t_12 = (!__pyx_t_11);


          if (unlikely(__pyx_t_12)) {

            __Pyx_GIVEREF(__pyx_t_2);
            __Pyx_GIVEREF(__pyx_t_4);
            __Pyx_XGIVEREF(__pyx_t_3);
            __Pyx_ErrRestoreWithState(__pyx_t_2, __pyx_t_4, __pyx_t_3);
            __pyx_t_2 = 0;  __pyx_t_4 = 0;  __pyx_t_3 = 0; 
            __PYX_ERR(0, 834, __pyx_L9_except_error)
          }
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          goto __pyx_L8_exception_handled;
        }
        __pyx_L9_except_error:;
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
        goto __pyx_L1_error;
        __pyx_L8_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
        __pyx_L12_try_end:;
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_1) {
          __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_mstate_global->__pyx_tuple[0], NULL);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 834, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        }
        goto __pyx_L6;
      }
      __pyx_L6:;
    }
    goto __pyx_L16;
    __pyx_L3_error:;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L1_error;
    __pyx_L16:;
  }

  /* "opendht.pyx":832
 *             pending = 0
 *             ok = False
 *             def tmp_done(ok_ret, nodes):             # <<<<<<<<<<<<<<
 *                 nonlocal pending, ok, lock
 *                 with lock:
*/

  /* 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("opendht._core.DhtRunner.putEncrypted.tmp_done", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":806
 *             return ok
 * 
 *     def putEncrypted(self, InfoHash key, Value val, to, done_cb=None, bool permanent=False):             # <<<<<<<<<<<<<<
 *         if to is None:
 *             raise ValueError("'to' must be provided")
*/

static PyObject *__pyx_pf_7opendht_5_core_9DhtRunner_44putEncrypted(struct __pyx_obj_7opendht_5_core_DhtRunner *__pyx_v_self, struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_v_key, struct __pyx_obj_7opendht_5_core_Value *__pyx_v_val, PyObject *__pyx_v_to, PyObject *__pyx_v_done_cb, bool __pyx_v_permanent) {
  struct __pyx_obj_7opendht_5_core___pyx_scope_struct_4_putEncrypted *__pyx_cur_scope;
  PyObject *__pyx_v_cb_obj = NULL;
  PyObject *__pyx_v_tmp_done = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __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;
  int __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("putEncrypted", 0);
  __pyx_cur_scope = (struct __pyx_obj_7opendht_5_core___pyx_scope_struct_4_putEncrypted *)__pyx_tp_new_7opendht_5_core___pyx_scope_struct_4_putEncrypted(__pyx_mstate_global->__pyx_ptype_7opendht_5_core___pyx_scope_struct_4_putEncrypted, __pyx_mstate_global->__pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7opendht_5_core___pyx_scope_struct_4_putEncrypted *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 806, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }

  /* "opendht.pyx":807
 * 
 *     def putEncrypted(self, InfoHash key, Value val, to, done_cb=None, bool permanent=False):
 *         if to is None:             # <<<<<<<<<<<<<<
 *             raise ValueError("'to' must be provided")
 *         if done_cb:
*/
  __pyx_t_1 = (__pyx_v_to == Py_None);
  if (unlikely(__pyx_t_1)) {


    /* "opendht.pyx":808
 *     def putEncrypted(self, InfoHash key, Value val, to, done_cb=None, bool permanent=False):
 *         if to is None:
 *             raise ValueError("'to' must be provided")             # <<<<<<<<<<<<<<
 *         if done_cb:
 *             cb_obj = {'done':done_cb}
*/
    __pyx_t_3 = NULL;
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_to_must_be_provided};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 808, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 808, __pyx_L1_error)

    /* "opendht.pyx":807
 * 
 *     def putEncrypted(self, InfoHash key, Value val, to, done_cb=None, bool permanent=False):
 *         if to is None:             # <<<<<<<<<<<<<<
 *             raise ValueError("'to' must be provided")
 *         if done_cb:
*/
  }

  /* "opendht.pyx":809
 *         if to is None:
 *             raise ValueError("'to' must be provided")
 *         if done_cb:             # <<<<<<<<<<<<<<
 *             cb_obj = {'done':done_cb}
 *             ref.Py_INCREF(cb_obj)
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_done_cb); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 809, __pyx_L1_error)
  if (__pyx_t_1) {


    /* "opendht.pyx":810
 *             raise ValueError("'to' must be provided")
 *         if done_cb:
 *             cb_obj = {'done':done_cb}             # <<<<<<<<<<<<<<
 *             ref.Py_INCREF(cb_obj)
 *             try:
*/
    __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 810, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_done, __pyx_v_done_cb) < (0)) __PYX_ERR(0, 810, __pyx_L1_error)
    __pyx_v_cb_obj = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "opendht.pyx":811
 *         if done_cb:
 *             cb_obj = {'done':done_cb}
 *             ref.Py_INCREF(cb_obj)             # <<<<<<<<<<<<<<
 *             try:
 *                 if isinstance(to, PublicKey):
*/
    Py_INCREF(__pyx_v_cb_obj);

    /* "opendht.pyx":812
 *             cb_obj = {'done':done_cb}
 *             ref.Py_INCREF(cb_obj)
 *             try:             # <<<<<<<<<<<<<<
 *                 if isinstance(to, PublicKey):
 *                     self.thisptr.get().putEncrypted(
*/
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);
      /*try:*/ {

        /* "opendht.pyx":813
 *             ref.Py_INCREF(cb_obj)
 *             try:
 *                 if isinstance(to, PublicKey):             # <<<<<<<<<<<<<<
 *                     self.thisptr.get().putEncrypted(
 *                         key._infohash, (<PublicKey>to)._key, val._value,
*/
        __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_to, __pyx_mstate_global->__pyx_ptype_7opendht_5_core_PublicKey); 
        if (__pyx_t_1) {


          /* "opendht.pyx":814
 *             try:
 *                 if isinstance(to, PublicKey):
 *                     self.thisptr.get().putEncrypted(             # <<<<<<<<<<<<<<
 *                         key._infohash, (<PublicKey>to)._key, val._value,
 *                         cpp.bindDoneCb(done_callback, <void*>cb_obj), permanent
*/
          __pyx_v_self->thisptr.get()->putEncrypted(__pyx_v_key->_infohash, ((struct __pyx_obj_7opendht_5_core_PublicKey *)__pyx_v_to)->_key, __pyx_v_val->_value, dht::bindDoneCb(__pyx_f_7opendht_5_core_done_callback, ((void *)__pyx_v_cb_obj)), __pyx_v_permanent);

          /* "opendht.pyx":813
 *             ref.Py_INCREF(cb_obj)
 *             try:
 *                 if isinstance(to, PublicKey):             # <<<<<<<<<<<<<<
 *                     self.thisptr.get().putEncrypted(
 *                         key._infohash, (<PublicKey>to)._key, val._value,
*/
          goto __pyx_L11;
        }

        /* "opendht.pyx":818
 *                         cpp.bindDoneCb(done_callback, <void*>cb_obj), permanent
 *                     )
 *                 elif isinstance(to, PkId):             # <<<<<<<<<<<<<<
 *                     self.thisptr.get().putEncrypted(
 *                         key._infohash, (<PkId>to)._pkid, val._value,
*/
        __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_to, __pyx_mstate_global->__pyx_ptype_7opendht_5_core_PkId); 
        if (likely(__pyx_t_1)) {


          /* "opendht.pyx":819
 *                     )
 *                 elif isinstance(to, PkId):
 *                     self.thisptr.get().putEncrypted(             # <<<<<<<<<<<<<<
 *                         key._infohash, (<PkId>to)._pkid, val._value,
 *                         cpp.bindDoneCb(done_callback, <void*>cb_obj), permanent
*/
          __pyx_v_self->thisptr.get()->putEncrypted(__pyx_v_key->_infohash, ((struct __pyx_obj_7opendht_5_core_PkId *)__pyx_v_to)->_pkid, __pyx_v_val->_value, dht::bindDoneCb(__pyx_f_7opendht_5_core_done_callback, ((void *)__pyx_v_cb_obj)), __pyx_v_permanent);

          /* "opendht.pyx":818
 *                         cpp.bindDoneCb(done_callback, <void*>cb_obj), permanent
 *                     )
 *                 elif isinstance(to, PkId):             # <<<<<<<<<<<<<<
 *                     self.thisptr.get().putEncrypted(
 *                         key._infohash, (<PkId>to)._pkid, val._value,
*/
          goto __pyx_L11;
        }

        /* "opendht.pyx":824
 *                     )
 *                 else:
 *                     raise TypeError("'to' must be PublicKey or PkId")             # <<<<<<<<<<<<<<
 *             except:
 *                 ref.Py_DECREF(cb_obj)
*/
        /*else*/ {
          __pyx_t_3 = NULL;
          __pyx_t_4 = 1;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_to_must_be_PublicKey_or_PkId};
            __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
            if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 824, __pyx_L5_error)
            __Pyx_GOTREF(__pyx_t_2);
          }
          __Pyx_Raise(__pyx_t_2, 0, 0, 0);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __PYX_ERR(0, 824, __pyx_L5_error)
        }
        __pyx_L11:;

        /* "opendht.pyx":812
 *             cb_obj = {'done':done_cb}
 *             ref.Py_INCREF(cb_obj)
 *             try:             # <<<<<<<<<<<<<<
 *                 if isinstance(to, PublicKey):
 *                     self.thisptr.get().putEncrypted(
*/
      }
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L10_try_end;
      __pyx_L5_error:;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "opendht.pyx":825
 *                 else:
 *                     raise TypeError("'to' must be PublicKey or PkId")
 *             except:             # <<<<<<<<<<<<<<
 *                 ref.Py_DECREF(cb_obj)
 *                 raise
*/
      /*except:*/ {
        __Pyx_AddTraceback("opendht._core.DhtRunner.putEncrypted", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_3, &__pyx_t_8) < 0) __PYX_ERR(0, 825, __pyx_L7_except_error)
        __Pyx_XGOTREF(__pyx_t_2);
        __Pyx_XGOTREF(__pyx_t_3);
        __Pyx_XGOTREF(__pyx_t_8);

        /* "opendht.pyx":826
 *                     raise TypeError("'to' must be PublicKey or PkId")
 *             except:
 *                 ref.Py_DECREF(cb_obj)             # <<<<<<<<<<<<<<
 *                 raise
 *         else:
*/
        Py_DECREF(__pyx_v_cb_obj);

        /* "opendht.pyx":827
 *             except:
 *                 ref.Py_DECREF(cb_obj)
 *                 raise             # <<<<<<<<<<<<<<
 *         else:
 *             lock = threading.Condition()
*/
        __Pyx_GIVEREF(__pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_3);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_ErrRestoreWithState(__pyx_t_2, __pyx_t_3, __pyx_t_8);
        __pyx_t_2 = 0;  __pyx_t_3 = 0;  __pyx_t_8 = 0; 
        __PYX_ERR(0, 827, __pyx_L7_except_error)
      }

      /* "opendht.pyx":812
 *             cb_obj = {'done':done_cb}
 *             ref.Py_INCREF(cb_obj)
 *             try:             # <<<<<<<<<<<<<<
 *                 if isinstance(to, PublicKey):
 *                     self.thisptr.get().putEncrypted(
*/
      __pyx_L7_except_error:;
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
      goto __pyx_L1_error;
      __pyx_L10_try_end:;
    }

    /* "opendht.pyx":809
 *         if to is None:
 *             raise ValueError("'to' must be provided")
 *         if done_cb:             # <<<<<<<<<<<<<<
 *             cb_obj = {'done':done_cb}
 *             ref.Py_INCREF(cb_obj)
*/
    goto __pyx_L4;
  }

  /* "opendht.pyx":829
 *                 raise
 *         else:
 *             lock = threading.Condition()             # <<<<<<<<<<<<<<
 *             pending = 0
 *             ok = False
*/
  /*else*/ {
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_threading); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 829, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Condition); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 829, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_4 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_9))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_9, __pyx__function);
      __pyx_t_4 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_9, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 829, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
    }
    __Pyx_GIVEREF(__pyx_t_8);
    __pyx_cur_scope->__pyx_v_lock = __pyx_t_8;
    __pyx_t_8 = 0;

    /* "opendht.pyx":830
 *         else:
 *             lock = threading.Condition()
 *             pending = 0             # <<<<<<<<<<<<<<
 *             ok = False
 *             def tmp_done(ok_ret, nodes):
*/
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0);
    __pyx_cur_scope->__pyx_v_pending = __pyx_mstate_global->__pyx_int_0;

    /* "opendht.pyx":831
 *             lock = threading.Condition()
 *             pending = 0
 *             ok = False             # <<<<<<<<<<<<<<
 *             def tmp_done(ok_ret, nodes):
 *                 nonlocal pending, ok, lock
*/
    __Pyx_INCREF(Py_False);
    __Pyx_GIVEREF(Py_False);
    __pyx_cur_scope->__pyx_v_ok = Py_False;

    /* "opendht.pyx":832
 *             pending = 0
 *             ok = False
 *             def tmp_done(ok_ret, nodes):             # <<<<<<<<<<<<<<
 *                 nonlocal pending, ok, lock
 *                 with lock:
*/
    __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_9DhtRunner_12putEncrypted_1tmp_done, 0, __pyx_mstate_global->__pyx_n_u_putEncrypted_locals_tmp_done, ((PyObject*)__pyx_cur_scope), __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[6])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 832, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_v_tmp_done = __pyx_t_8;
    __pyx_t_8 = 0;

    /* "opendht.pyx":838
 *                     pending -= 1
 *                     lock.notify()
 *             with lock:             # <<<<<<<<<<<<<<
 *                 pending += 1
 *                 self.putEncrypted(key, val, to=to, done_cb=tmp_done, permanent=permanent)
*/
    /*with:*/ {
      __pyx_t_7 = __Pyx_PyObject_LookupSpecial(__pyx_cur_scope->__pyx_v_lock, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 838, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_9 = NULL;
      __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_cur_scope->__pyx_v_lock, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 838, __pyx_L14_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = 1;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3);
        assert(__pyx_t_9);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
        __pyx_t_4 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_9, NULL};
        __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 838, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_8);
      }
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      /*try:*/ {
        {
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_5, &__pyx_t_10);
          __Pyx_XGOTREF(__pyx_t_6);
          __Pyx_XGOTREF(__pyx_t_5);
          __Pyx_XGOTREF(__pyx_t_10);
          /*try:*/ {

            /* "opendht.pyx":839
 *                     lock.notify()
 *             with lock:
 *                 pending += 1             # <<<<<<<<<<<<<<
 *                 self.putEncrypted(key, val, to=to, done_cb=tmp_done, permanent=permanent)
 *                 while pending > 0:
*/
            __pyx_t_8 = __Pyx_PyLong_AddObjC(__pyx_cur_scope->__pyx_v_pending, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 839, __pyx_L18_error)
            __Pyx_GOTREF(__pyx_t_8);
            __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_pending);
            __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_pending, __pyx_t_8);
            __Pyx_GIVEREF(__pyx_t_8);
            __pyx_t_8 = 0;

            /* "opendht.pyx":840
 *             with lock:
 *                 pending += 1
 *                 self.putEncrypted(key, val, to=to, done_cb=tmp_done, permanent=permanent)             # <<<<<<<<<<<<<<
 *                 while pending > 0:
 *                     lock.wait()
*/
            __pyx_t_3 = ((PyObject *)__pyx_v_self);
            __Pyx_INCREF(__pyx_t_3);
            __pyx_t_9 = __Pyx_PyBool_FromLong(__pyx_v_permanent); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 840, __pyx_L18_error)
            __Pyx_GOTREF(__pyx_t_9);
            __pyx_t_4 = 0;
            {
              PyObject *__pyx_callargs[6] = {__pyx_t_3, ((PyObject *)__pyx_v_key), ((PyObject *)__pyx_v_val), __pyx_v_to, __pyx_v_tmp_done, __pyx_t_9};
              #if CYTHON_VECTORCALL
              __pyx_t_2 = __pyx_mstate_global->__pyx_tuple[3];
              if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 840, __pyx_L18_error)
              __Pyx_INCREF(__pyx_t_2);
              #else
              {
                PyObject *__pyx_temp[3] = {__pyx_mstate_global->__pyx_n_u_to, __pyx_mstate_global->__pyx_n_u_done_cb, __pyx_mstate_global->__pyx_n_u_permanent};
                __pyx_t_2 = __Pyx_MakeKwargDict(__pyx_temp, __pyx_callargs+3, 3);
                if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 840, __pyx_L18_error)
                __Pyx_GOTREF(__pyx_t_2);
              }
              #endif
              __pyx_t_8 = __Pyx_Object_VectorcallMethodKwds((PyObject*)__pyx_mstate_global->__pyx_n_u_putEncrypted, __pyx_callargs+__pyx_t_4, (3-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_2);
              __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 840, __pyx_L18_error)
              __Pyx_GOTREF(__pyx_t_8);
            }
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

            /* "opendht.pyx":841
 *                 pending += 1
 *                 self.putEncrypted(key, val, to=to, done_cb=tmp_done, permanent=permanent)
 *                 while pending > 0:             # <<<<<<<<<<<<<<
 *                     lock.wait()
 *             return ok
*/
            while (1) {
              __pyx_t_1 = __Pyx_PyObject_CompareBoolGt_object_int(__pyx_cur_scope->__pyx_v_pending, __pyx_mstate_global->__pyx_int_0, Py_GT); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 841, __pyx_L18_error)

              if (!__pyx_t_1) break;

              /* "opendht.pyx":842
 *                 self.putEncrypted(key, val, to=to, done_cb=tmp_done, permanent=permanent)
 *                 while pending > 0:
 *                     lock.wait()             # <<<<<<<<<<<<<<
 *             return ok
 * 
*/
              __pyx_t_2 = __pyx_cur_scope->__pyx_v_lock;
              __Pyx_INCREF(__pyx_t_2);
              __pyx_t_4 = 0;
              {
                PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
                __pyx_t_8 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_wait, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
                if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 842, __pyx_L18_error)
                __Pyx_GOTREF(__pyx_t_8);
              }
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            }

            /* "opendht.pyx":838
 *                     pending -= 1
 *                     lock.notify()
 *             with lock:             # <<<<<<<<<<<<<<
 *                 pending += 1
 *                 self.putEncrypted(key, val, to=to, done_cb=tmp_done, permanent=permanent)
*/
          }
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          goto __pyx_L23_try_end;
          __pyx_L18_error:;
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          /*except:*/ {
            __Pyx_AddTraceback("opendht._core.DhtRunner.putEncrypted", __pyx_clineno, __pyx_lineno, __pyx_filename);
            if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_2, &__pyx_t_9) < 0) __PYX_ERR(0, 838, __pyx_L20_except_error)
            __Pyx_XGOTREF(__pyx_t_8);
            __Pyx_XGOTREF(__pyx_t_2);
            __Pyx_XGOTREF(__pyx_t_9);
            {
              PyObject* __pyx_temp[3] = {__pyx_t_8, __pyx_t_2, __pyx_t_9};
              __pyx_t_3 = __Pyx_PyTuple_FromArray(__pyx_temp, 3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 838, __pyx_L20_except_error)
              __Pyx_GOTREF(__pyx_t_3);
            }
            __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_3, NULL);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 838, __pyx_L20_except_error)
            __Pyx_GOTREF(__pyx_t_11);
            __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_11);
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            if (__pyx_t_1 < (0)) __PYX_ERR(0, 838, __pyx_L20_except_error)
            __pyx_t_12 = (!__pyx_t_1);


            if (unlikely(__pyx_t_12)) {

              __Pyx_GIVEREF(__pyx_t_8);
              __Pyx_GIVEREF(__pyx_t_2);
              __Pyx_XGIVEREF(__pyx_t_9);
              __Pyx_ErrRestoreWithState(__pyx_t_8, __pyx_t_2, __pyx_t_9);
              __pyx_t_8 = 0;  __pyx_t_2 = 0;  __pyx_t_9 = 0; 
              __PYX_ERR(0, 838, __pyx_L20_except_error)
            }
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
            goto __pyx_L19_exception_handled;
          }
          __pyx_L20_except_error:;
          __Pyx_XGIVEREF(__pyx_t_6);
          __Pyx_XGIVEREF(__pyx_t_5);
          __Pyx_XGIVEREF(__pyx_t_10);
          __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_5, __pyx_t_10);
          goto __pyx_L1_error;
          __pyx_L19_exception_handled:;
          __Pyx_XGIVEREF(__pyx_t_6);
          __Pyx_XGIVEREF(__pyx_t_5);
          __Pyx_XGIVEREF(__pyx_t_10);
          __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_5, __pyx_t_10);
          __pyx_L23_try_end:;
        }
      }
      /*finally:*/ {
        /*normal exit:*/{
          if (__pyx_t_7) {
            __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_mstate_global->__pyx_tuple[0], NULL);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 838, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_10);
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          }
          goto __pyx_L17;
        }
        __pyx_L17:;
      }
      goto __pyx_L29;
      __pyx_L14_error:;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L1_error;
      __pyx_L29:;
    }

    /* "opendht.pyx":843
 *                 while pending > 0:
 *                     lock.wait()
 *             return ok             # <<<<<<<<<<<<<<
 * 
 *     def cancelPut(self, InfoHash key, Value val):
*/
    {
      PyObject *__pyx_temp;
      {
        __pyx_temp = __pyx_r;
        __Pyx_INCREF(__pyx_cur_scope->__pyx_v_ok);
        __pyx_r = __pyx_cur_scope->__pyx_v_ok;
      }
      __Pyx_XDECREF(__pyx_temp);
    }
    goto __pyx_L0;
  }
  __pyx_L4:;

  /* "opendht.pyx":806
 *             return ok
 * 
 *     def putEncrypted(self, InfoHash key, Value val, to, done_cb=None, bool permanent=False):             # <<<<<<<<<<<<<<
 *         if to is None:
 *             raise ValueError("'to' must be provided")
*/

  /* 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_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("opendht._core.DhtRunner.putEncrypted", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_cb_obj);
  __Pyx_XDECREF(__pyx_v_tmp_done);
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":845
 *             return ok
 * 
 *     def cancelPut(self, InfoHash key, Value val):             # <<<<<<<<<<<<<<
 *         self.thisptr.get().cancelPut(key._infohash, val._value)
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_9DhtRunner_47cancelPut(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_9DhtRunner_47cancelPut = {"cancelPut", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9DhtRunner_47cancelPut, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_9DhtRunner_47cancelPut(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_v_key = 0;
  struct __pyx_obj_7opendht_5_core_Value *__pyx_v_val = 0;
  #if !CYTHON_VECTORCALL
  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("cancelPut (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_key,&__pyx_mstate_global->__pyx_n_u_val,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 845, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 845, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 845, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "cancelPut", 0) < (0)) __PYX_ERR(0, 845, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("cancelPut", 1, 2, 2, i); __PYX_ERR(0, 845, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 845, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 845, __pyx_L3_error)
    }
    __pyx_v_key = ((struct __pyx_obj_7opendht_5_core_InfoHash *)values[0]);
    __pyx_v_val = ((struct __pyx_obj_7opendht_5_core_Value *)values[1]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cancelPut", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 845, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.DhtRunner.cancelPut", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_key), __pyx_mstate_global->__pyx_ptype_7opendht_5_core_InfoHash, 1, "key", 0))) __PYX_ERR(0, 845, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_val), __pyx_mstate_global->__pyx_ptype_7opendht_5_core_Value, 1, "val", 0))) __PYX_ERR(0, 845, __pyx_L1_error)
  __pyx_r = __pyx_pf_7opendht_5_core_9DhtRunner_46cancelPut(((struct __pyx_obj_7opendht_5_core_DhtRunner *)__pyx_v_self), __pyx_v_key, __pyx_v_val);

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

static PyObject *__pyx_pf_7opendht_5_core_9DhtRunner_46cancelPut(struct __pyx_obj_7opendht_5_core_DhtRunner *__pyx_v_self, struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_v_key, struct __pyx_obj_7opendht_5_core_Value *__pyx_v_val) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cancelPut", 0);

  /* "opendht.pyx":846
 * 
 *     def cancelPut(self, InfoHash key, Value val):
 *         self.thisptr.get().cancelPut(key._infohash, val._value)             # <<<<<<<<<<<<<<
 * 
 *     def listen(self, InfoHash key, value_cb):
*/
  __pyx_v_self->thisptr.get()->cancelPut(__pyx_v_key->_infohash, __pyx_v_val->_value);

  /* "opendht.pyx":845
 *             return ok
 * 
 *     def cancelPut(self, InfoHash key, Value val):             # <<<<<<<<<<<<<<
 *         self.thisptr.get().cancelPut(key._infohash, val._value)
 * 
*/

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

/* "opendht.pyx":848
 *         self.thisptr.get().cancelPut(key._infohash, val._value)
 * 
 *     def listen(self, InfoHash key, value_cb):             # <<<<<<<<<<<<<<
 *         t = ListenToken()
 *         t._h = key._infohash
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_9DhtRunner_49listen(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_9DhtRunner_49listen = {"listen", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9DhtRunner_49listen, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_9DhtRunner_49listen(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_v_key = 0;
  PyObject *__pyx_v_value_cb = 0;
  #if !CYTHON_VECTORCALL
  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("listen (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_key,&__pyx_mstate_global->__pyx_n_u_value_cb,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 848, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 848, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 848, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "listen", 0) < (0)) __PYX_ERR(0, 848, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("listen", 1, 2, 2, i); __PYX_ERR(0, 848, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 848, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 848, __pyx_L3_error)
    }
    __pyx_v_key = ((struct __pyx_obj_7opendht_5_core_InfoHash *)values[0]);
    __pyx_v_value_cb = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("listen", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 848, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.DhtRunner.listen", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_key), __pyx_mstate_global->__pyx_ptype_7opendht_5_core_InfoHash, 1, "key", 0))) __PYX_ERR(0, 848, __pyx_L1_error)
  __pyx_r = __pyx_pf_7opendht_5_core_9DhtRunner_48listen(((struct __pyx_obj_7opendht_5_core_DhtRunner *)__pyx_v_self), __pyx_v_key, __pyx_v_value_cb);

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

static PyObject *__pyx_pf_7opendht_5_core_9DhtRunner_48listen(struct __pyx_obj_7opendht_5_core_DhtRunner *__pyx_v_self, struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_v_key, PyObject *__pyx_v_value_cb) {
  struct __pyx_obj_7opendht_5_core_ListenToken *__pyx_v_t = NULL;
  PyObject *__pyx_v_cb_obj = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  dht::InfoHash __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("listen", 0);

  /* "opendht.pyx":849
 * 
 *     def listen(self, InfoHash key, value_cb):
 *         t = ListenToken()             # <<<<<<<<<<<<<<
 *         t._h = key._infohash
 *         cb_obj = {'valcb':value_cb}
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7opendht_5_core_ListenToken, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 849, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_t = ((struct __pyx_obj_7opendht_5_core_ListenToken *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "opendht.pyx":850
 *     def listen(self, InfoHash key, value_cb):
 *         t = ListenToken()
 *         t._h = key._infohash             # <<<<<<<<<<<<<<
 *         cb_obj = {'valcb':value_cb}
 *         t._cb['cb'] = cb_obj
*/
  __pyx_t_4 = __pyx_v_key->_infohash;

  __pyx_v_t->_h = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_4);

  /* "opendht.pyx":851
 *         t = ListenToken()
 *         t._h = key._infohash
 *         cb_obj = {'valcb':value_cb}             # <<<<<<<<<<<<<<
 *         t._cb['cb'] = cb_obj
 *         # avoid the callback being destructed if the token is destroyed
*/
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 851, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_valcb, __pyx_v_value_cb) < (0)) __PYX_ERR(0, 851, __pyx_L1_error)
  __pyx_v_cb_obj = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "opendht.pyx":852
 *         t._h = key._infohash
 *         cb_obj = {'valcb':value_cb}
 *         t._cb['cb'] = cb_obj             # <<<<<<<<<<<<<<
 *         # avoid the callback being destructed if the token is destroyed
 *         ref.Py_INCREF(cb_obj)
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_t), __pyx_mstate_global->__pyx_n_u_cb); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 852, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely((PyObject_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_cb_2, __pyx_v_cb_obj) < 0))) __PYX_ERR(0, 852, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opendht.pyx":854
 *         t._cb['cb'] = cb_obj
 *         # avoid the callback being destructed if the token is destroyed
 *         ref.Py_INCREF(cb_obj)             # <<<<<<<<<<<<<<
 *         t._t = self.thisptr.get().listen(t._h, cpp.bindValueCb(value_callback, <void*>cb_obj)).share()
 *         return t
*/
  Py_INCREF(__pyx_v_cb_obj);

  /* "opendht.pyx":855
 *         # avoid the callback being destructed if the token is destroyed
 *         ref.Py_INCREF(cb_obj)
 *         t._t = self.thisptr.get().listen(t._h, cpp.bindValueCb(value_callback, <void*>cb_obj)).share()             # <<<<<<<<<<<<<<
 *         return t
 *     def cancelListen(self, ListenToken token):
*/
  __pyx_v_t->_t = __pyx_v_self->thisptr.get()->listen(__pyx_v_t->_h, dht::bindValueCb(__pyx_f_7opendht_5_core_value_callback, ((void *)__pyx_v_cb_obj))).share();

  /* "opendht.pyx":856
 *         ref.Py_INCREF(cb_obj)
 *         t._t = self.thisptr.get().listen(t._h, cpp.bindValueCb(value_callback, <void*>cb_obj)).share()
 *         return t             # <<<<<<<<<<<<<<
 *     def cancelListen(self, ListenToken token):
 *         self.thisptr.get().cancelListen(token._h, token._t)
*/
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __Pyx_INCREF((PyObject *)__pyx_v_t);
      __pyx_r = ((PyObject *)__pyx_v_t);
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  goto __pyx_L0;

  /* "opendht.pyx":848
 *         self.thisptr.get().cancelPut(key._infohash, val._value)
 * 
 *     def listen(self, InfoHash key, value_cb):             # <<<<<<<<<<<<<<
 *         t = ListenToken()
 *         t._h = key._infohash
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("opendht._core.DhtRunner.listen", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_t);
  __Pyx_XDECREF(__pyx_v_cb_obj);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":857
 *         t._t = self.thisptr.get().listen(t._h, cpp.bindValueCb(value_callback, <void*>cb_obj)).share()
 *         return t
 *     def cancelListen(self, ListenToken token):             # <<<<<<<<<<<<<<
 *         self.thisptr.get().cancelListen(token._h, token._t)
 *         ref.Py_DECREF(<object>token._cb['cb'])
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_9DhtRunner_51cancelListen(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_9DhtRunner_51cancelListen = {"cancelListen", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9DhtRunner_51cancelListen, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_9DhtRunner_51cancelListen(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_7opendht_5_core_ListenToken *__pyx_v_token = 0;
  #if !CYTHON_VECTORCALL
  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("cancelListen (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_token,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 857, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 857, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "cancelListen", 0) < (0)) __PYX_ERR(0, 857, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("cancelListen", 1, 1, 1, i); __PYX_ERR(0, 857, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 857, __pyx_L3_error)
    }
    __pyx_v_token = ((struct __pyx_obj_7opendht_5_core_ListenToken *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cancelListen", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 857, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.DhtRunner.cancelListen", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_token), __pyx_mstate_global->__pyx_ptype_7opendht_5_core_ListenToken, 1, "token", 0))) __PYX_ERR(0, 857, __pyx_L1_error)
  __pyx_r = __pyx_pf_7opendht_5_core_9DhtRunner_50cancelListen(((struct __pyx_obj_7opendht_5_core_DhtRunner *)__pyx_v_self), __pyx_v_token);

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

static PyObject *__pyx_pf_7opendht_5_core_9DhtRunner_50cancelListen(struct __pyx_obj_7opendht_5_core_DhtRunner *__pyx_v_self, struct __pyx_obj_7opendht_5_core_ListenToken *__pyx_v_token) {
  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("cancelListen", 0);

  /* "opendht.pyx":858
 *         return t
 *     def cancelListen(self, ListenToken token):
 *         self.thisptr.get().cancelListen(token._h, token._t)             # <<<<<<<<<<<<<<
 *         ref.Py_DECREF(<object>token._cb['cb'])
 *         # fixme: not thread safe
*/
  __pyx_v_self->thisptr.get()->cancelListen(__pyx_v_token->_h, __pyx_v_token->_t);

  /* "opendht.pyx":859
 *     def cancelListen(self, ListenToken token):
 *         self.thisptr.get().cancelListen(token._h, token._t)
 *         ref.Py_DECREF(<object>token._cb['cb'])             # <<<<<<<<<<<<<<
 *         # fixme: not thread safe
 * 
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_token), __pyx_mstate_global->__pyx_n_u_cb); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 859, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_cb_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 859, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  Py_DECREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opendht.pyx":857
 *         t._t = self.thisptr.get().listen(t._h, cpp.bindValueCb(value_callback, <void*>cb_obj)).share()
 *         return t
 *     def cancelListen(self, ListenToken token):             # <<<<<<<<<<<<<<
 *         self.thisptr.get().cancelListen(token._h, token._t)
 *         ref.Py_DECREF(<object>token._cb['cb'])
*/

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

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

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_9DhtRunner_53__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_9DhtRunner_53__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9DhtRunner_53__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_9DhtRunner_53__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7opendht_5_core_9DhtRunner_52__reduce_cython__(((struct __pyx_obj_7opendht_5_core_DhtRunner *)__pyx_v_self));

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

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

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(1, 2, __pyx_L1_error)

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

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

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

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_9DhtRunner_55__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_9DhtRunner_55__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9DhtRunner_55__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_9DhtRunner_55__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(1, 3, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.DhtRunner.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7opendht_5_core_9DhtRunner_54__setstate_cython__(((struct __pyx_obj_7opendht_5_core_DhtRunner *)__pyx_v_self), __pyx_v___pyx_state);

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

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

  /* "(tree fragment)":4
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(1, 4, __pyx_L1_error)

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

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

/* "opendht.pyx":864
 * cdef class IndexValue(object):
 *     cdef cpp.shared_ptr[cpp.IndexValue] _value
 *     def __init__(self, InfoHash h=None, cpp.uint64_t vid=0):             # <<<<<<<<<<<<<<
 *        cdef cpp.InfoHash hh = h._infohash
 *        self._value.reset(new cpp.IndexValue(hh, vid))
*/

/* Python wrapper */
static int __pyx_pw_7opendht_5_core_10IndexValue_1__init__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL_TPNEW
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_pw_7opendht_5_core_10IndexValue_1__init__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL_TPNEW
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_v_h = 0;
  uint64_t __pyx_v_vid;
  #if !CYTHON_VECTORCALL_TPNEW
  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;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if !CYTHON_VECTORCALL_TPNEW
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL_TPNEW(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_h,&__pyx_mstate_global->__pyx_n_u_vid,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL_TPNEW(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 864, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 864, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 864, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(0, 864, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7opendht_5_core_InfoHash *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 864, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 864, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7opendht_5_core_InfoHash *)Py_None));
    }
    __pyx_v_h = ((struct __pyx_obj_7opendht_5_core_InfoHash *)values[0]);
    if (values[1]) {
      __pyx_v_vid = __Pyx_PyLong_As_uint64_t(values[1]); if (unlikely((__pyx_v_vid == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 864, __pyx_L3_error)
    } else {
      __pyx_v_vid = ((uint64_t)0);
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 2, __pyx_nargs); __PYX_ERR(0, 864, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.IndexValue.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_h), __pyx_mstate_global->__pyx_ptype_7opendht_5_core_InfoHash, 1, "h", 0))) __PYX_ERR(0, 864, __pyx_L1_error)
  __pyx_r = __pyx_pf_7opendht_5_core_10IndexValue___init__(((struct __pyx_obj_7opendht_5_core_IndexValue *)__pyx_v_self), __pyx_v_h, __pyx_v_vid);

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

  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7opendht_5_core_10IndexValue___init__(struct __pyx_obj_7opendht_5_core_IndexValue *__pyx_v_self, struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_v_h, uint64_t __pyx_v_vid) {
  dht::InfoHash __pyx_v_hh;
  int __pyx_r;
  dht::InfoHash __pyx_t_1;
  dht::indexation::Value *__pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "opendht.pyx":865
 *     cdef cpp.shared_ptr[cpp.IndexValue] _value
 *     def __init__(self, InfoHash h=None, cpp.uint64_t vid=0):
 *        cdef cpp.InfoHash hh = h._infohash             # <<<<<<<<<<<<<<
 *        self._value.reset(new cpp.IndexValue(hh, vid))
 *     def __str__(self):
*/
  __pyx_t_1 = __pyx_v_h->_infohash;

  __pyx_v_hh = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_1);

  /* "opendht.pyx":866
 *     def __init__(self, InfoHash h=None, cpp.uint64_t vid=0):
 *        cdef cpp.InfoHash hh = h._infohash
 *        self._value.reset(new cpp.IndexValue(hh, vid))             # <<<<<<<<<<<<<<
 *     def __str__(self):
 *         return "(" + self.getKey().toString().decode() +", "+ str(self.getValueId()) +")"
*/
  try {
    __pyx_t_2 = new dht::indexation::Value(__pyx_v_hh, __pyx_v_vid);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(0, 866, __pyx_L1_error)
  }
  __pyx_v_self->_value.reset(__pyx_t_2);


  /* "opendht.pyx":864
 * cdef class IndexValue(object):
 *     cdef cpp.shared_ptr[cpp.IndexValue] _value
 *     def __init__(self, InfoHash h=None, cpp.uint64_t vid=0):             # <<<<<<<<<<<<<<
 *        cdef cpp.InfoHash hh = h._infohash
 *        self._value.reset(new cpp.IndexValue(hh, vid))
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("opendht._core.IndexValue.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;


  return __pyx_r;
}

/* "opendht.pyx":867
 *        cdef cpp.InfoHash hh = h._infohash
 *        self._value.reset(new cpp.IndexValue(hh, vid))
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return "(" + self.getKey().toString().decode() +", "+ str(self.getValueId()) +")"
 *     def getKey(self):
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_10IndexValue_3__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7opendht_5_core_10IndexValue_3__str__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7opendht_5_core_10IndexValue_2__str__(((struct __pyx_obj_7opendht_5_core_IndexValue *)__pyx_v_self));

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

static PyObject *__pyx_pf_7opendht_5_core_10IndexValue_2__str__(struct __pyx_obj_7opendht_5_core_IndexValue *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__str__", 0);

  /* "opendht.pyx":868
 *        self._value.reset(new cpp.IndexValue(hh, vid))
 *     def __str__(self):
 *         return "(" + self.getKey().toString().decode() +", "+ str(self.getValueId()) +")"             # <<<<<<<<<<<<<<
 *     def getKey(self):
 *         h = InfoHash()
*/
  __pyx_t_6 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_6);
  __pyx_t_7 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
    __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getKey, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 868, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
  }
  __pyx_t_4 = __pyx_t_5;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_7 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
    __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_toString, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 868, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_2 = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_7 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_decode, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 868, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_3 = PyNumber_Add(__pyx_mstate_global->__pyx_kp_u__12, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 868, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_mstate_global->__pyx_kp_u__13); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 868, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_7 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getValueId, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 868, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_2 = __Pyx_PyObject_Unicode(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 868, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 868, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_mstate_global->__pyx_kp_u__14); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 868, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_2;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "opendht.pyx":867
 *        cdef cpp.InfoHash hh = h._infohash
 *        self._value.reset(new cpp.IndexValue(hh, vid))
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return "(" + self.getKey().toString().decode() +", "+ str(self.getValueId()) +")"
 *     def getKey(self):
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("opendht._core.IndexValue.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":869
 *     def __str__(self):
 *         return "(" + self.getKey().toString().decode() +", "+ str(self.getValueId()) +")"
 *     def getKey(self):             # <<<<<<<<<<<<<<
 *         h = InfoHash()
 *         h._infohash = self._value.get().first
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_10IndexValue_5getKey(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_10IndexValue_5getKey = {"getKey", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_10IndexValue_5getKey, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_10IndexValue_5getKey(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getKey (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getKey", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getKey", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7opendht_5_core_10IndexValue_4getKey(((struct __pyx_obj_7opendht_5_core_IndexValue *)__pyx_v_self));

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

static PyObject *__pyx_pf_7opendht_5_core_10IndexValue_4getKey(struct __pyx_obj_7opendht_5_core_IndexValue *__pyx_v_self) {
  struct __pyx_obj_7opendht_5_core_InfoHash *__pyx_v_h = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  dht::InfoHash __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getKey", 0);

  /* "opendht.pyx":870
 *         return "(" + self.getKey().toString().decode() +", "+ str(self.getValueId()) +")"
 *     def getKey(self):
 *         h = InfoHash()             # <<<<<<<<<<<<<<
 *         h._infohash = self._value.get().first
 *         return h
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7opendht_5_core_InfoHash, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 870, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_h = ((struct __pyx_obj_7opendht_5_core_InfoHash *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "opendht.pyx":871
 *     def getKey(self):
 *         h = InfoHash()
 *         h._infohash = self._value.get().first             # <<<<<<<<<<<<<<
 *         return h
 *     def getValueId(self):
*/
  __pyx_t_4 = __pyx_v_self->_value.get()->first;

  __pyx_v_h->_infohash = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_4);

  /* "opendht.pyx":872
 *         h = InfoHash()
 *         h._infohash = self._value.get().first
 *         return h             # <<<<<<<<<<<<<<
 *     def getValueId(self):
 *         return self._value.get().second
*/
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __Pyx_INCREF((PyObject *)__pyx_v_h);
      __pyx_r = ((PyObject *)__pyx_v_h);
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  goto __pyx_L0;

  /* "opendht.pyx":869
 *     def __str__(self):
 *         return "(" + self.getKey().toString().decode() +", "+ str(self.getValueId()) +")"
 *     def getKey(self):             # <<<<<<<<<<<<<<
 *         h = InfoHash()
 *         h._infohash = self._value.get().first
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("opendht._core.IndexValue.getKey", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_h);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":873
 *         h._infohash = self._value.get().first
 *         return h
 *     def getValueId(self):             # <<<<<<<<<<<<<<
 *         return self._value.get().second
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_10IndexValue_7getValueId(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_10IndexValue_7getValueId = {"getValueId", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_10IndexValue_7getValueId, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_10IndexValue_7getValueId(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getValueId (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getValueId", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getValueId", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7opendht_5_core_10IndexValue_6getValueId(((struct __pyx_obj_7opendht_5_core_IndexValue *)__pyx_v_self));

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

static PyObject *__pyx_pf_7opendht_5_core_10IndexValue_6getValueId(struct __pyx_obj_7opendht_5_core_IndexValue *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getValueId", 0);

  /* "opendht.pyx":874
 *         return h
 *     def getValueId(self):
 *         return self._value.get().second             # <<<<<<<<<<<<<<
 * 
 * cdef class Pht(object):
*/
  __pyx_t_1 = __Pyx_PyLong_From_uint64_t(__pyx_v_self->_value.get()->second); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 874, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_1;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "opendht.pyx":873
 *         h._infohash = self._value.get().first
 *         return h
 *     def getValueId(self):             # <<<<<<<<<<<<<<
 *         return self._value.get().second
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("opendht._core.IndexValue.getValueId", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._value cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_10IndexValue_9__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_10IndexValue_9__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_10IndexValue_9__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_10IndexValue_9__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7opendht_5_core_10IndexValue_8__reduce_cython__(((struct __pyx_obj_7opendht_5_core_IndexValue *)__pyx_v_self));

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

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

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "self._value cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._value cannot be converted to a Python object for pickling"
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self__value_cannot_be_converted, 0, 0);
  __PYX_ERR(1, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._value cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/

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

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._value cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._value cannot be converted to a Python object for pickling"
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_10IndexValue_11__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_10IndexValue_11__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_10IndexValue_11__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_10IndexValue_11__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(1, 3, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.IndexValue.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7opendht_5_core_10IndexValue_10__setstate_cython__(((struct __pyx_obj_7opendht_5_core_IndexValue *)__pyx_v_self), __pyx_v___pyx_state);

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

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

  /* "(tree fragment)":4
 *     raise TypeError, "self._value cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._value cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self__value_cannot_be_converted, 0, 0);
  __PYX_ERR(1, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._value cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._value cannot be converted to a Python object for pickling"
*/

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

/* "opendht.pyx":878
 * cdef class Pht(object):
 *     cdef cpp.Pht* thisptr
 *     def __cinit__(self, bytes name, key_spec, DhtRunner dht):             # <<<<<<<<<<<<<<
 *         cdef cpp.IndexKeySpec cpp_key_spec
 *         for kk, size in key_spec.items():
*/

/* Python wrapper */
static int __pyx_pw_7opendht_5_core_3Pht_1__cinit__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL_TPNEW
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_pw_7opendht_5_core_3Pht_1__cinit__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL_TPNEW
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_key_spec = 0;
  struct __pyx_obj_7opendht_5_core_DhtRunner *__pyx_v_dht = 0;
  #if !CYTHON_VECTORCALL_TPNEW
  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;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  #if !CYTHON_VECTORCALL_TPNEW
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL_TPNEW(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_name_2,&__pyx_mstate_global->__pyx_n_u_key_spec,&__pyx_mstate_global->__pyx_n_u_dht,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL_TPNEW(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 878, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 878, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 878, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 878, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__cinit__", 0) < (0)) __PYX_ERR(0, 878, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, i); __PYX_ERR(0, 878, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 878, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 878, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 878, __pyx_L3_error)
    }
    __pyx_v_name = ((PyObject*)values[0]);
    __pyx_v_key_spec = values[1];
    __pyx_v_dht = ((struct __pyx_obj_7opendht_5_core_DhtRunner *)values[2]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 878, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.Pht.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_name), (&PyBytes_Type), 1, "name", 1))) __PYX_ERR(0, 878, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dht), __pyx_mstate_global->__pyx_ptype_7opendht_5_core_DhtRunner, 1, "dht", 0))) __PYX_ERR(0, 878, __pyx_L1_error)
  __pyx_r = __pyx_pf_7opendht_5_core_3Pht___cinit__(((struct __pyx_obj_7opendht_5_core_Pht *)__pyx_v_self), __pyx_v_name, __pyx_v_key_spec, __pyx_v_dht);

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

static int __pyx_pf_7opendht_5_core_3Pht___cinit__(struct __pyx_obj_7opendht_5_core_Pht *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_key_spec, struct __pyx_obj_7opendht_5_core_DhtRunner *__pyx_v_dht) {
  dht::indexation::Pht::KeySpec __pyx_v_cpp_key_spec;
  PyObject *__pyx_v_kk = NULL;
  PyObject *__pyx_v_size = NULL;
  int __pyx_r;
  __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;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  uint32_t __pyx_t_8;
  size_t __pyx_t_9;
  std::string __pyx_t_10;
  dht::indexation::Pht *__pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "opendht.pyx":880
 *     def __cinit__(self, bytes name, key_spec, DhtRunner dht):
 *         cdef cpp.IndexKeySpec cpp_key_spec
 *         for kk, size in key_spec.items():             # <<<<<<<<<<<<<<
 *             cpp_key_spec[bytes(kk, 'utf-8')] = size
 *         self.thisptr = new cpp.Pht(name, cpp_key_spec, dht.thisptr)
*/
  __pyx_t_2 = 0;
  if (unlikely(__pyx_v_key_spec == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "\047NoneType\047 object has no attribute \047%.30s\047", "items");
    __PYX_ERR(0, 880, __pyx_L1_error)
  }
  __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_key_spec, 0, __pyx_mstate_global->__pyx_n_u_items, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 880, __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_7 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, &__pyx_t_5, &__pyx_t_6, NULL, __pyx_t_4);
    if (unlikely(__pyx_t_7 == 0)) break;
    if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 880, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_XDECREF_SET(__pyx_v_kk, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_XDECREF_SET(__pyx_v_size, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "opendht.pyx":881
 *         cdef cpp.IndexKeySpec cpp_key_spec
 *         for kk, size in key_spec.items():
 *             cpp_key_spec[bytes(kk, 'utf-8')] = size             # <<<<<<<<<<<<<<
 *         self.thisptr = new cpp.Pht(name, cpp_key_spec, dht.thisptr)
 *     @property
*/
    __pyx_t_8 = __Pyx_PyLong_As_uint32_t(__pyx_v_size); if (unlikely((__pyx_t_8 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 881, __pyx_L1_error)
    __pyx_t_5 = NULL;
    __pyx_t_9 = 1;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_v_kk, __pyx_mstate_global->__pyx_kp_u_utf_8};
      __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)(&PyBytes_Type), __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 881, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
    }
    __pyx_t_10 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_6); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 881, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    (__pyx_v_cpp_key_spec[__pyx_t_10]) = __pyx_t_8;


  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opendht.pyx":882
 *         for kk, size in key_spec.items():
 *             cpp_key_spec[bytes(kk, 'utf-8')] = size
 *         self.thisptr = new cpp.Pht(name, cpp_key_spec, dht.thisptr)             # <<<<<<<<<<<<<<
 *     @property
 *     def MAX_NODE_ENTRY_COUNT(self):
*/
  __pyx_t_10 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_v_name); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 882, __pyx_L1_error)
  try {
    __pyx_t_11 = new dht::indexation::Pht(__pyx_t_10, __pyx_v_cpp_key_spec, __pyx_v_dht->thisptr);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(0, 882, __pyx_L1_error)
  }

  __pyx_v_self->thisptr = __pyx_t_11;

  /* "opendht.pyx":878
 * cdef class Pht(object):
 *     cdef cpp.Pht* thisptr
 *     def __cinit__(self, bytes name, key_spec, DhtRunner dht):             # <<<<<<<<<<<<<<
 *         cdef cpp.IndexKeySpec cpp_key_spec
 *         for kk, size in key_spec.items():
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("opendht._core.Pht.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;

  __Pyx_XDECREF(__pyx_v_kk);
  __Pyx_XDECREF(__pyx_v_size);

  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":883
 *             cpp_key_spec[bytes(kk, 'utf-8')] = size
 *         self.thisptr = new cpp.Pht(name, cpp_key_spec, dht.thisptr)
 *     @property             # <<<<<<<<<<<<<<
 *     def MAX_NODE_ENTRY_COUNT(self):
 *         return cpp.PHT_MAX_NODE_ENTRY_COUNT
*/

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

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

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

  /* "opendht.pyx":885
 *     @property
 *     def MAX_NODE_ENTRY_COUNT(self):
 *         return cpp.PHT_MAX_NODE_ENTRY_COUNT             # <<<<<<<<<<<<<<
 *     def lookup(self, key, lookup_cb=None, done_cb=None):
 *         """Query the Index with a specified key.
*/
  __pyx_t_1 = __Pyx_PyLong_FromSize_t(dht::indexation::Pht::MAX_NODE_ENTRY_COUNT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 885, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_1;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "opendht.pyx":883
 *             cpp_key_spec[bytes(kk, 'utf-8')] = size
 *         self.thisptr = new cpp.Pht(name, cpp_key_spec, dht.thisptr)
 *     @property             # <<<<<<<<<<<<<<
 *     def MAX_NODE_ENTRY_COUNT(self):
 *         return cpp.PHT_MAX_NODE_ENTRY_COUNT
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("opendht._core.Pht.MAX_NODE_ENTRY_COUNT.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":886
 *     def MAX_NODE_ENTRY_COUNT(self):
 *         return cpp.PHT_MAX_NODE_ENTRY_COUNT
 *     def lookup(self, key, lookup_cb=None, done_cb=None):             # <<<<<<<<<<<<<<
 *         """Query the Index with a specified key.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_3Pht_3lookup(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_3Pht_2lookup, "Query the Index with a specified key.\n\n        key       -- the key for to the entry in the index.\n        lookup_cb -- function called when the operation is completed. This\n                     function takes a list of IndexValue objects and a string\n                     representation of the prefix where the value was indexed in\n                     the PHT.\n        ");
static PyMethodDef __pyx_mdef_7opendht_5_core_3Pht_3lookup = {"lookup", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_3Pht_3lookup, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7opendht_5_core_3Pht_2lookup};
static PyObject *__pyx_pw_7opendht_5_core_3Pht_3lookup(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_key = 0;
  PyObject *__pyx_v_lookup_cb = 0;
  PyObject *__pyx_v_done_cb = 0;
  #if !CYTHON_VECTORCALL
  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("lookup (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_key,&__pyx_mstate_global->__pyx_n_u_lookup_cb,&__pyx_mstate_global->__pyx_n_u_done_cb,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 886, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 886, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 886, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 886, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "lookup", 0) < (0)) __PYX_ERR(0, 886, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("lookup", 0, 1, 3, i); __PYX_ERR(0, 886, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 886, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 886, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 886, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_key = values[0];
    __pyx_v_lookup_cb = values[1];
    __pyx_v_done_cb = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("lookup", 0, 1, 3, __pyx_nargs); __PYX_ERR(0, 886, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.Pht.lookup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7opendht_5_core_3Pht_2lookup(((struct __pyx_obj_7opendht_5_core_Pht *)__pyx_v_self), __pyx_v_key, __pyx_v_lookup_cb, __pyx_v_done_cb);

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

static PyObject *__pyx_pf_7opendht_5_core_3Pht_2lookup(struct __pyx_obj_7opendht_5_core_Pht *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_lookup_cb, PyObject *__pyx_v_done_cb) {
  PyObject *__pyx_v_cb_obj = NULL;
  dht::indexation::Pht::Key __pyx_v_cppk;
  PyObject *__pyx_v_kk = NULL;
  PyObject *__pyx_v_v = 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;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  size_t __pyx_t_8;
  std::vector<uint8_t>  __pyx_t_9;
  std::string __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("lookup", 0);

  /* "opendht.pyx":895
 *                      the PHT.
 *         """
 *         cb_obj = {'lookup':lookup_cb, 'done':done_cb} # TODO: donecallback is to be removed             # <<<<<<<<<<<<<<
 *         ref.Py_INCREF(cb_obj)
 *         cdef cpp.IndexKey cppk
*/
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 895, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_lookup, __pyx_v_lookup_cb) < (0)) __PYX_ERR(0, 895, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_done, __pyx_v_done_cb) < (0)) __PYX_ERR(0, 895, __pyx_L1_error)
  __pyx_v_cb_obj = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "opendht.pyx":896
 *         """
 *         cb_obj = {'lookup':lookup_cb, 'done':done_cb} # TODO: donecallback is to be removed
 *         ref.Py_INCREF(cb_obj)             # <<<<<<<<<<<<<<
 *         cdef cpp.IndexKey cppk
 *         for kk, v in key.items():
*/
  Py_INCREF(__pyx_v_cb_obj);

  /* "opendht.pyx":898
 *         ref.Py_INCREF(cb_obj)
 *         cdef cpp.IndexKey cppk
 *         for kk, v in key.items():             # <<<<<<<<<<<<<<
 *             cppk[bytes(kk, 'utf-8')] = bytes(v)
 *         self.thisptr.lookup(
*/
  __pyx_t_2 = 0;
  if (unlikely(__pyx_v_key == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "\047NoneType\047 object has no attribute \047%.30s\047", "items");
    __PYX_ERR(0, 898, __pyx_L1_error)
  }
  __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_key, 0, __pyx_mstate_global->__pyx_n_u_items, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 898, __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_7 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, &__pyx_t_5, &__pyx_t_6, NULL, __pyx_t_4);
    if (unlikely(__pyx_t_7 == 0)) break;
    if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 898, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_XDECREF_SET(__pyx_v_kk, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "opendht.pyx":899
 *         cdef cpp.IndexKey cppk
 *         for kk, v in key.items():
 *             cppk[bytes(kk, 'utf-8')] = bytes(v)             # <<<<<<<<<<<<<<
 *         self.thisptr.lookup(
 *                 cppk,
*/
    __pyx_t_5 = NULL;
    __pyx_t_8 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_v};
      __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)(&PyBytes_Type), __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 899, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
    }
    __pyx_t_9 = __pyx_convert_vector_from_py_uint8_t(__pyx_t_6); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 899, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_5 = NULL;
    __pyx_t_8 = 1;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_v_kk, __pyx_mstate_global->__pyx_kp_u_utf_8};
      __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)(&PyBytes_Type), __pyx_callargs+__pyx_t_8, (3-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 899, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
    }
    __pyx_t_10 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_6); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 899, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    (__pyx_v_cppk[__pyx_t_10]) = __pyx_t_9;


  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opendht.pyx":900
 *         for kk, v in key.items():
 *             cppk[bytes(kk, 'utf-8')] = bytes(v)
 *         self.thisptr.lookup(             # <<<<<<<<<<<<<<
 *                 cppk,
 *                 cpp.Pht.bindLookupCb(lookup_callback, <void*>cb_obj),
*/
  __pyx_v_self->thisptr->lookup(__pyx_v_cppk, dht::indexation::Pht::bindLookupCb(__pyx_f_7opendht_5_core_lookup_callback, ((void *)__pyx_v_cb_obj)), dht::bindDoneCbSimple(__pyx_f_7opendht_5_core_done_callback_simple, ((void *)__pyx_v_cb_obj)));

  /* "opendht.pyx":886
 *     def MAX_NODE_ENTRY_COUNT(self):
 *         return cpp.PHT_MAX_NODE_ENTRY_COUNT
 *     def lookup(self, key, lookup_cb=None, done_cb=None):             # <<<<<<<<<<<<<<
 *         """Query the Index with a specified 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_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("opendht._core.Pht.lookup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_cb_obj);

  __Pyx_XDECREF(__pyx_v_kk);
  __Pyx_XDECREF(__pyx_v_v);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opendht.pyx":905
 *                 cpp.bindDoneCbSimple(done_callback_simple, <void*>cb_obj)
 *         )
 *     def insert(self, key, IndexValue value, done_cb=None):             # <<<<<<<<<<<<<<
 *         """Add an index entry to the Index.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_3Pht_5insert(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_3Pht_4insert, "Add an index entry to the Index.\n\n        key     -- the key for to the entry in the index.\n        value   -- an IndexValue object describing the indexed value.\n        done_cb -- Called when the operation is completed.\n        ");
static PyMethodDef __pyx_mdef_7opendht_5_core_3Pht_5insert = {"insert", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_3Pht_5insert, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7opendht_5_core_3Pht_4insert};
static PyObject *__pyx_pw_7opendht_5_core_3Pht_5insert(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_key = 0;
  struct __pyx_obj_7opendht_5_core_IndexValue *__pyx_v_value = 0;
  PyObject *__pyx_v_done_cb = 0;
  #if !CYTHON_VECTORCALL
  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("insert (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_key,&__pyx_mstate_global->__pyx_n_u_value,&__pyx_mstate_global->__pyx_n_u_done_cb,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 905, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 905, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 905, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 905, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "insert", 0) < (0)) __PYX_ERR(0, 905, __pyx_L3_error)
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("insert", 0, 2, 3, i); __PYX_ERR(0, 905, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 905, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 905, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 905, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_key = values[0];
    __pyx_v_value = ((struct __pyx_obj_7opendht_5_core_IndexValue *)values[1]);
    __pyx_v_done_cb = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("insert", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 905, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.Pht.insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), __pyx_mstate_global->__pyx_ptype_7opendht_5_core_IndexValue, 1, "value", 0))) __PYX_ERR(0, 905, __pyx_L1_error)
  __pyx_r = __pyx_pf_7opendht_5_core_3Pht_4insert(((struct __pyx_obj_7opendht_5_core_Pht *)__pyx_v_self), __pyx_v_key, __pyx_v_value, __pyx_v_done_cb);

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

static PyObject *__pyx_pf_7opendht_5_core_3Pht_4insert(struct __pyx_obj_7opendht_5_core_Pht *__pyx_v_self, PyObject *__pyx_v_key, struct __pyx_obj_7opendht_5_core_IndexValue *__pyx_v_value, PyObject *__pyx_v_done_cb) {
  PyObject *__pyx_v_cb_obj = NULL;
  dht::indexation::Pht::Key __pyx_v_cppk;
  PyObject *__pyx_v_kk = NULL;
  PyObject *__pyx_v_v = NULL;
  dht::indexation::Value __pyx_v_val;
  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;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  size_t __pyx_t_8;
  std::vector<uint8_t>  __pyx_t_9;
  std::string __pyx_t_10;
  dht::InfoHash __pyx_t_11;
  uint64_t __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("insert", 0);

  /* "opendht.pyx":912
 *         done_cb -- Called when the operation is completed.
 *         """
 *         cb_obj = {'done':done_cb}             # <<<<<<<<<<<<<<
 *         ref.Py_INCREF(cb_obj)
 *         cdef cpp.IndexKey cppk
*/
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 912, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_done, __pyx_v_done_cb) < (0)) __PYX_ERR(0, 912, __pyx_L1_error)
  __pyx_v_cb_obj = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "opendht.pyx":913
 *         """
 *         cb_obj = {'done':done_cb}
 *         ref.Py_INCREF(cb_obj)             # <<<<<<<<<<<<<<
 *         cdef cpp.IndexKey cppk
 *         for kk, v in key.items():
*/
  Py_INCREF(__pyx_v_cb_obj);

  /* "opendht.pyx":915
 *         ref.Py_INCREF(cb_obj)
 *         cdef cpp.IndexKey cppk
 *         for kk, v in key.items():             # <<<<<<<<<<<<<<
 *             cppk[bytes(kk, 'utf-8')] = bytes(v)
 *         cdef cpp.IndexValue val
*/
  __pyx_t_2 = 0;
  if (unlikely(__pyx_v_key == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "\047NoneType\047 object has no attribute \047%.30s\047", "items");
    __PYX_ERR(0, 915, __pyx_L1_error)
  }
  __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_key, 0, __pyx_mstate_global->__pyx_n_u_items, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 915, __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_7 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, &__pyx_t_5, &__pyx_t_6, NULL, __pyx_t_4);
    if (unlikely(__pyx_t_7 == 0)) break;
    if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 915, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_XDECREF_SET(__pyx_v_kk, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "opendht.pyx":916
 *         cdef cpp.IndexKey cppk
 *         for kk, v in key.items():
 *             cppk[bytes(kk, 'utf-8')] = bytes(v)             # <<<<<<<<<<<<<<
 *         cdef cpp.IndexValue val
 *         val.first = (<InfoHash>value.getKey())._infohash
*/
    __pyx_t_5 = NULL;
    __pyx_t_8 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_v};
      __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)(&PyBytes_Type), __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 916, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
    }
    __pyx_t_9 = __pyx_convert_vector_from_py_uint8_t(__pyx_t_6); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 916, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_5 = NULL;
    __pyx_t_8 = 1;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_v_kk, __pyx_mstate_global->__pyx_kp_u_utf_8};
      __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)(&PyBytes_Type), __pyx_callargs+__pyx_t_8, (3-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 916, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
    }
    __pyx_t_10 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_6); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 916, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    (__pyx_v_cppk[__pyx_t_10]) = __pyx_t_9;


  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opendht.pyx":918
 *             cppk[bytes(kk, 'utf-8')] = bytes(v)
 *         cdef cpp.IndexValue val
 *         val.first = (<InfoHash>value.getKey())._infohash             # <<<<<<<<<<<<<<
 *         val.second = value.getValueId()
 *         self.thisptr.insert(
*/
  __pyx_t_6 = ((PyObject *)__pyx_v_value);
  __Pyx_INCREF(__pyx_t_6);
  __pyx_t_8 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getKey, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 918, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_11 = ((struct __pyx_obj_7opendht_5_core_InfoHash *)__pyx_t_1)->_infohash;

  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_val.first = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_11);

  /* "opendht.pyx":919
 *         cdef cpp.IndexValue val
 *         val.first = (<InfoHash>value.getKey())._infohash
 *         val.second = value.getValueId()             # <<<<<<<<<<<<<<
 *         self.thisptr.insert(
 *                 cppk,
*/
  __pyx_t_6 = ((PyObject *)__pyx_v_value);
  __Pyx_INCREF(__pyx_t_6);
  __pyx_t_8 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getValueId, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 919, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_12 = __Pyx_PyLong_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_12 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 919, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_val.second = __pyx_t_12;

  /* "opendht.pyx":920
 *         val.first = (<InfoHash>value.getKey())._infohash
 *         val.second = value.getValueId()
 *         self.thisptr.insert(             # <<<<<<<<<<<<<<
 *                 cppk,
 *                 val,
*/
  __pyx_v_self->thisptr->insert(__pyx_v_cppk, __pyx_v_val, dht::bindDoneCbSimple(__pyx_f_7opendht_5_core_done_callback_simple, ((void *)__pyx_v_cb_obj)));

  /* "opendht.pyx":905
 *                 cpp.bindDoneCbSimple(done_callback_simple, <void*>cb_obj)
 *         )
 *     def insert(self, key, IndexValue value, done_cb=None):             # <<<<<<<<<<<<<<
 *         """Add an index entry to the Index.
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("opendht._core.Pht.insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_cb_obj);

  __Pyx_XDECREF(__pyx_v_kk);
  __Pyx_XDECREF(__pyx_v_v);

  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_3Pht_7__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_3Pht_7__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_3Pht_7__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_3Pht_7__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7opendht_5_core_3Pht_6__reduce_cython__(((struct __pyx_obj_7opendht_5_core_Pht *)__pyx_v_self));

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

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

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(1, 2, __pyx_L1_error)

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

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

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

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_3Pht_9__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_3Pht_9__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_3Pht_9__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_3Pht_9__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(1, 3, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.Pht.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7opendht_5_core_3Pht_8__setstate_cython__(((struct __pyx_obj_7opendht_5_core_Pht *)__pyx_v_self), __pyx_v___pyx_state);

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

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

  /* "(tree fragment)":4
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(1, 4, __pyx_L1_error)

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

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

/* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle__WithID(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_7__pyx_unpickle__WithID(PyObject *__pyx_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_7__pyx_unpickle__WithID = {"__pyx_unpickle__WithID", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_7__pyx_unpickle__WithID, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_7__pyx_unpickle__WithID(PyObject *__pyx_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle__WithID (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_type,&__pyx_mstate_global->__pyx_n_u_pyx_checksum,&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 4, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 4, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 4, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 4, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__pyx_unpickle__WithID", 0) < (0)) __PYX_ERR(1, 4, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle__WithID", 1, 3, 3, i); __PYX_ERR(1, 4, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 4, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 4, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 4, __pyx_L3_error)
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyLong_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 4, __pyx_L3_error)
    __pyx_v___pyx_state = ((PyObject*)values[2]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle__WithID", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 4, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.__pyx_unpickle__WithID", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v___pyx_state), (&PyTuple_Type), 1, "__pyx_state", 1))) __PYX_ERR(1, 4, __pyx_L1_error)
  __pyx_r = __pyx_pf_7opendht_5_core_6__pyx_unpickle__WithID(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

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

  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7opendht_5_core_6__pyx_unpickle__WithID(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_v___pyx_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle__WithID", 0);

  /* "(tree fragment)":6
 * def __pyx_unpickle__WithID(__pyx_type, long __pyx_checksum, tuple __pyx_state):
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')             # <<<<<<<<<<<<<<
 *     __pyx_result = _WithID.__new__(__pyx_type)
 *     if __pyx_state is not None:
*/
  __pyx_t_1 = __Pyx_CheckUnpickleChecksum(__pyx_v___pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, __pyx_k__5); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 6, __pyx_L1_error)


  /* "(tree fragment)":7
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
 *     __pyx_result = _WithID.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle__WithID__set_state(<_WithID> __pyx_result, __pyx_state)
*/
  __pyx_t_3 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_7opendht_5_core__WithID);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v___pyx_type};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_new, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v___pyx_result = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "(tree fragment)":8
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
 *     __pyx_result = _WithID.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle__WithID__set_state(<_WithID> __pyx_result, __pyx_state)
 *     return __pyx_result
*/
  __pyx_t_5 = (__pyx_v___pyx_state != ((PyObject*)Py_None));
  if (__pyx_t_5) {


    /* "(tree fragment)":9
 *     __pyx_result = _WithID.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle__WithID__set_state(<_WithID> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle__WithID__set_state(_WithID __pyx_result, __pyx_state: tuple):
*/
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared \047not None\047");
      __PYX_ERR(1, 9, __pyx_L1_error)
    }
    __pyx_t_2 = __pyx_f_7opendht_5_core___pyx_unpickle__WithID__set_state(((struct __pyx_obj_7opendht_5_core__WithID *)__pyx_v___pyx_result), __pyx_v___pyx_state); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "(tree fragment)":8
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
 *     __pyx_result = _WithID.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle__WithID__set_state(<_WithID> __pyx_result, __pyx_state)
 *     return __pyx_result
*/
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle__WithID__set_state(<_WithID> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle__WithID__set_state(_WithID __pyx_result, __pyx_state: tuple):
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 0)
*/
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __Pyx_INCREF(__pyx_v___pyx_result);
      __pyx_r = __pyx_v___pyx_result;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  goto __pyx_L0;

  /* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle__WithID(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
*/

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

/* "(tree fragment)":11
 *         __pyx_unpickle__WithID__set_state(<_WithID> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle__WithID__set_state(_WithID __pyx_result, __pyx_state: tuple):             # <<<<<<<<<<<<<<
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 0)
*/

static PyObject *__pyx_f_7opendht_5_core___pyx_unpickle__WithID__set_state(struct __pyx_obj_7opendht_5_core__WithID *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle__WithID__set_state", 0);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle__WithID__set_state(_WithID __pyx_result, __pyx_state: tuple):
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 0)             # <<<<<<<<<<<<<<
*/
  __pyx_t_1 = __Pyx_UpdateUnpickledDict(((PyObject *)__pyx_v___pyx_result), __pyx_v___pyx_state, 0); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 12, __pyx_L1_error)


  /* "(tree fragment)":11
 *         __pyx_unpickle__WithID__set_state(<_WithID> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle__WithID__set_state(_WithID __pyx_result, __pyx_state: tuple):             # <<<<<<<<<<<<<<
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 0)
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("opendht._core.__pyx_unpickle__WithID__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle__WithPk(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
*/

/* Python wrapper */
static PyObject *__pyx_pw_7opendht_5_core_9__pyx_unpickle__WithPk(PyObject *__pyx_self, 
#if CYTHON_VECTORCALL
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_7opendht_5_core_9__pyx_unpickle__WithPk = {"__pyx_unpickle__WithPk", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9__pyx_unpickle__WithPk, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7opendht_5_core_9__pyx_unpickle__WithPk(PyObject *__pyx_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_VECTORCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle__WithPk (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_type,&__pyx_mstate_global->__pyx_n_u_pyx_checksum,&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 4, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 4, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 4, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 4, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__pyx_unpickle__WithPk", 0) < (0)) __PYX_ERR(1, 4, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle__WithPk", 1, 3, 3, i); __PYX_ERR(1, 4, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 4, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 4, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 4, __pyx_L3_error)
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyLong_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 4, __pyx_L3_error)
    __pyx_v___pyx_state = ((PyObject*)values[2]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle__WithPk", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 4, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("opendht._core.__pyx_unpickle__WithPk", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v___pyx_state), (&PyTuple_Type), 1, "__pyx_state", 1))) __PYX_ERR(1, 4, __pyx_L1_error)
  __pyx_r = __pyx_pf_7opendht_5_core_8__pyx_unpickle__WithPk(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

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

  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7opendht_5_core_8__pyx_unpickle__WithPk(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_v___pyx_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle__WithPk", 0);

  /* "(tree fragment)":6
 * def __pyx_unpickle__WithPk(__pyx_type, long __pyx_checksum, tuple __pyx_state):
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')             # <<<<<<<<<<<<<<
 *     __pyx_result = _WithPk.__new__(__pyx_type)
 *     if __pyx_state is not None:
*/
  __pyx_t_1 = __Pyx_CheckUnpickleChecksum(__pyx_v___pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, __pyx_k__5); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 6, __pyx_L1_error)


  /* "(tree fragment)":7
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
 *     __pyx_result = _WithPk.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle__WithPk__set_state(<_WithPk> __pyx_result, __pyx_state)
*/
  __pyx_t_3 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_7opendht_5_core__WithPk);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v___pyx_type};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_new, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v___pyx_result = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "(tree fragment)":8
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
 *     __pyx_result = _WithPk.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle__WithPk__set_state(<_WithPk> __pyx_result, __pyx_state)
 *     return __pyx_result
*/
  __pyx_t_5 = (__pyx_v___pyx_state != ((PyObject*)Py_None));
  if (__pyx_t_5) {


    /* "(tree fragment)":9
 *     __pyx_result = _WithPk.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle__WithPk__set_state(<_WithPk> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle__WithPk__set_state(_WithPk __pyx_result, __pyx_state: tuple):
*/
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared \047not None\047");
      __PYX_ERR(1, 9, __pyx_L1_error)
    }
    __pyx_t_2 = __pyx_f_7opendht_5_core___pyx_unpickle__WithPk__set_state(((struct __pyx_obj_7opendht_5_core__WithPk *)__pyx_v___pyx_result), __pyx_v___pyx_state); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "(tree fragment)":8
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
 *     __pyx_result = _WithPk.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle__WithPk__set_state(<_WithPk> __pyx_result, __pyx_state)
 *     return __pyx_result
*/
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle__WithPk__set_state(<_WithPk> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle__WithPk__set_state(_WithPk __pyx_result, __pyx_state: tuple):
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 0)
*/
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __Pyx_INCREF(__pyx_v___pyx_result);
      __pyx_r = __pyx_v___pyx_result;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  goto __pyx_L0;

  /* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle__WithPk(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
*/

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

/* "(tree fragment)":11
 *         __pyx_unpickle__WithPk__set_state(<_WithPk> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle__WithPk__set_state(_WithPk __pyx_result, __pyx_state: tuple):             # <<<<<<<<<<<<<<
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 0)
*/

static PyObject *__pyx_f_7opendht_5_core___pyx_unpickle__WithPk__set_state(struct __pyx_obj_7opendht_5_core__WithPk *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle__WithPk__set_state", 0);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle__WithPk__set_state(_WithPk __pyx_result, __pyx_state: tuple):
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 0)             # <<<<<<<<<<<<<<
*/
  __pyx_t_1 = __Pyx_UpdateUnpickledDict(((PyObject *)__pyx_v___pyx_result), __pyx_v___pyx_state, 0); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 12, __pyx_L1_error)


  /* "(tree fragment)":11
 *         __pyx_unpickle__WithPk__set_state(<_WithPk> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle__WithPk__set_state(_WithPk __pyx_result, __pyx_state: tuple):             # <<<<<<<<<<<<<<
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 0)
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("opendht._core.__pyx_unpickle__WithPk__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* #### Code section: module_exttypes ### */

static PyObject *__pyx_tp_new__initialisation_7opendht_5_core__WithID(PyObject *o, 
#if CYTHON_VECTORCALL_TPNEW
    CYTHON_UNUSED PyObject *const *args, CYTHON_UNUSED Py_ssize_t nargs, CYTHON_UNUSED PyObject *kwnames
#else
    CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k
#endif
) {
  return o;
}

static PyObject *__pyx_tp_new_vectorcall_7opendht_5_core__WithID(PyTypeObject *t, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
) {
  PyObject *o;
  o = __Pyx_AllocateExtensionType(t, 0);
  if (unlikely(!o)) return 0;
  return __pyx_tp_new__initialisation_7opendht_5_core__WithID(o, 
#if CYTHON_VECTORCALL_TPNEW
    args, nargs, kwnames
#else
    a, k
#endif
);
}

#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_new_7opendht_5_core__WithID(PyTypeObject *t, PyObject *a, PyObject *k) {
  return __Pyx_CallTpnewAsVectorcall(__pyx_tp_new_vectorcall_7opendht_5_core__WithID, t, a, k);
}
#endif

#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_vectorcall_7opendht_5_core__WithID(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
  if (unlikely((PyTypeObject*)t != __pyx_mstate_global->__pyx_ptype_7opendht_5_core__WithID || __Pyx_PyType_HasFeature((PyTypeObject*)t, Py_TPFLAGS_IS_ABSTRACT))) {
    return __Pyx_CallNewInitFromVectorcall((PyTypeObject*)t, args, nargsf, kwnames);
  }
  Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
  PyObject *o = __pyx_tp_new_vectorcall_7opendht_5_core__WithID((PyTypeObject*)t, args, nargs, kwnames);
  return o;
}
#endif

static void __pyx_tp_dealloc_7opendht_5_core__WithID(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7opendht_5_core__WithID) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyTypeObject *tp = Py_TYPE(o);
  #if CYTHON_USE_TYPE_SLOTS
  (*tp->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  Py_DECREF(tp);
  #endif
}

static PyMethodDef __pyx_methods_7opendht_5_core__WithID[] = {
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_7_WithID_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_7_WithID_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7opendht_5_core__WithID_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7opendht_5_core__WithID},
  {Py_tp_repr, (void *)__pyx_pw_7opendht_5_core_7_WithID_1__repr__},
  {Py_tp_str, (void *)__pyx_pw_7opendht_5_core_7_WithID_3__str__},
  {Py_tp_methods, (void *)__pyx_methods_7opendht_5_core__WithID},
  {Py_tp_new, (void *)__pyx_tp_new_7opendht_5_core__WithID},
  #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
  #if CYTHON_VECTORCALL_TPNEW
  {Py_tp_vectorcall, (void *)__pyx_tp_vectorcall_7opendht_5_core__WithID},
  #endif
  #endif
  {0, 0},
};
static PyType_Spec __pyx_type_7opendht_5_core__WithID_spec = {
  "opendht._core._WithID",
  sizeof(struct __pyx_obj_7opendht_5_core__WithID),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE,
  __pyx_type_7opendht_5_core__WithID_slots,
};
#else

static PyTypeObject __pyx_type_7opendht_5_core__WithID = {
  PyVarObject_HEAD_INIT(0, 0)
  "opendht._core.""_WithID", /*tp_name*/
  sizeof(struct __pyx_obj_7opendht_5_core__WithID), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7opendht_5_core__WithID, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  __pyx_pw_7opendht_5_core_7_WithID_1__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pw_7opendht_5_core_7_WithID_3__str__, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7opendht_5_core__WithID, /*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_7opendht_5_core__WithID, /*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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
  #if CYTHON_VECTORCALL_TPNEW
  __pyx_tp_vectorcall_7opendht_5_core__WithID, /*tp_vectorcall*/
  #else
  NULL, /*tp_vectorcall*/
  #endif
  #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 < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new__initialisation_7opendht_5_core__WithPk(PyObject *o, 
#if CYTHON_VECTORCALL_TPNEW
    CYTHON_UNUSED PyObject *const *args, CYTHON_UNUSED Py_ssize_t nargs, CYTHON_UNUSED PyObject *kwnames
#else
    CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k
#endif
) {
  return o;
}

static PyObject *__pyx_tp_new_vectorcall_7opendht_5_core__WithPk(PyTypeObject *t, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
) {
  PyObject *o;
  o = __Pyx_AllocateExtensionType(t, 0);
  if (unlikely(!o)) return 0;
  return __pyx_tp_new__initialisation_7opendht_5_core__WithPk(o, 
#if CYTHON_VECTORCALL_TPNEW
    args, nargs, kwnames
#else
    a, k
#endif
);
}

#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_new_7opendht_5_core__WithPk(PyTypeObject *t, PyObject *a, PyObject *k) {
  return __Pyx_CallTpnewAsVectorcall(__pyx_tp_new_vectorcall_7opendht_5_core__WithPk, t, a, k);
}
#endif

#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_vectorcall_7opendht_5_core__WithPk(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
  if (unlikely((PyTypeObject*)t != __pyx_mstate_global->__pyx_ptype_7opendht_5_core__WithPk || __Pyx_PyType_HasFeature((PyTypeObject*)t, Py_TPFLAGS_IS_ABSTRACT))) {
    return __Pyx_CallNewInitFromVectorcall((PyTypeObject*)t, args, nargsf, kwnames);
  }
  Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
  PyObject *o = __pyx_tp_new_vectorcall_7opendht_5_core__WithPk((PyTypeObject*)t, args, nargs, kwnames);
  return o;
}
#endif

static void __pyx_tp_dealloc_7opendht_5_core__WithPk(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7opendht_5_core__WithPk) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyTypeObject *tp = Py_TYPE(o);
  #if CYTHON_USE_TYPE_SLOTS
  (*tp->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  Py_DECREF(tp);
  #endif
}

static PyMethodDef __pyx_methods_7opendht_5_core__WithPk[] = {
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_7_WithPk_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_7_WithPk_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7opendht_5_core__WithPk_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7opendht_5_core__WithPk},
  {Py_tp_repr, (void *)__pyx_pw_7opendht_5_core_7_WithPk_1__repr__},
  {Py_tp_str, (void *)__pyx_pw_7opendht_5_core_7_WithPk_3__str__},
  {Py_tp_methods, (void *)__pyx_methods_7opendht_5_core__WithPk},
  {Py_tp_new, (void *)__pyx_tp_new_7opendht_5_core__WithPk},
  #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
  #if CYTHON_VECTORCALL_TPNEW
  {Py_tp_vectorcall, (void *)__pyx_tp_vectorcall_7opendht_5_core__WithPk},
  #endif
  #endif
  {0, 0},
};
static PyType_Spec __pyx_type_7opendht_5_core__WithPk_spec = {
  "opendht._core._WithPk",
  sizeof(struct __pyx_obj_7opendht_5_core__WithPk),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE,
  __pyx_type_7opendht_5_core__WithPk_slots,
};
#else

static PyTypeObject __pyx_type_7opendht_5_core__WithPk = {
  PyVarObject_HEAD_INIT(0, 0)
  "opendht._core.""_WithPk", /*tp_name*/
  sizeof(struct __pyx_obj_7opendht_5_core__WithPk), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7opendht_5_core__WithPk, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  __pyx_pw_7opendht_5_core_7_WithPk_1__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pw_7opendht_5_core_7_WithPk_3__str__, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7opendht_5_core__WithPk, /*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_7opendht_5_core__WithPk, /*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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
  #if CYTHON_VECTORCALL_TPNEW
  __pyx_tp_vectorcall_7opendht_5_core__WithPk, /*tp_vectorcall*/
  #else
  NULL, /*tp_vectorcall*/
  #endif
  #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 < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new__initialisation_7opendht_5_core_InfoHash(PyObject *o, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
) {
  struct __pyx_obj_7opendht_5_core_InfoHash *p = ((struct __pyx_obj_7opendht_5_core_InfoHash *)o);
  __Pyx_default_placement_construct(&(p->_infohash));
  {
    int cinit_result = __pyx_pw_7opendht_5_core_8InfoHash_1__cinit__(o, 
#if CYTHON_VECTORCALL_TPNEW
    args, nargs, kwnames
#else
    a, k
#endif
);
    if (unlikely(cinit_result)) goto bad;
  }
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static PyObject *__pyx_tp_new_vectorcall_7opendht_5_core_InfoHash(PyTypeObject *t, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
) {
  PyObject *o;
  o = __pyx_tp_new_vectorcall_7opendht_5_core__WithID(t, 
#if CYTHON_VECTORCALL_TPNEW
    args, nargs, kwnames
#else
    a, k
#endif
);
  if (unlikely(!o)) return 0;
  return __pyx_tp_new__initialisation_7opendht_5_core_InfoHash(o, 
#if CYTHON_VECTORCALL_TPNEW
    args, nargs, kwnames
#else
    a, k
#endif
);
}

#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_new_7opendht_5_core_InfoHash(PyTypeObject *t, PyObject *a, PyObject *k) {
  return __Pyx_CallTpnewAsVectorcall(__pyx_tp_new_vectorcall_7opendht_5_core_InfoHash, t, a, k);
}
#endif

#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_vectorcall_7opendht_5_core_InfoHash(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
  if (unlikely((PyTypeObject*)t != __pyx_mstate_global->__pyx_ptype_7opendht_5_core_InfoHash || __Pyx_PyType_HasFeature((PyTypeObject*)t, Py_TPFLAGS_IS_ABSTRACT))) {
    return __Pyx_CallNewInitFromVectorcall((PyTypeObject*)t, args, nargsf, kwnames);
  }
  Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
  PyObject *o = __pyx_tp_new_vectorcall_7opendht_5_core_InfoHash((PyTypeObject*)t, args, nargs, kwnames);
  return o;
}
#endif

static void __pyx_tp_dealloc_7opendht_5_core_InfoHash(PyObject *o) {
  struct __pyx_obj_7opendht_5_core_InfoHash *p = (struct __pyx_obj_7opendht_5_core_InfoHash *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7opendht_5_core_InfoHash) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  __Pyx_call_destructor(p->_infohash);
  __pyx_tp_dealloc_7opendht_5_core__WithID(o);
}

static PyMethodDef __pyx_methods_7opendht_5_core_InfoHash[] = {
  {"getBit", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_8InfoHash_7getBit, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"setBit", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_8InfoHash_9setBit, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"getId", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_8InfoHash_11getId, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"toString", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_8InfoHash_13toString, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"toFloat", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_8InfoHash_15toFloat, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"commonBits", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_8InfoHash_17commonBits, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"get", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_8InfoHash_19get, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"getRandom", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_8InfoHash_21getRandom, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_8InfoHash_23__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_8InfoHash_25__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7opendht_5_core_InfoHash_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7opendht_5_core_InfoHash},
  {Py_nb_bool, (void *)__pyx_pw_7opendht_5_core_8InfoHash_3__bool__},
  {Py_tp_richcompare, (void *)__pyx_pw_7opendht_5_core_8InfoHash_5__richcmp__},
  {Py_tp_methods, (void *)__pyx_methods_7opendht_5_core_InfoHash},
  {Py_tp_new, (void *)__pyx_tp_new_7opendht_5_core_InfoHash},
  #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
  #if CYTHON_VECTORCALL_TPNEW
  {Py_tp_vectorcall, (void *)__pyx_tp_vectorcall_7opendht_5_core_InfoHash},
  #endif
  #endif
  {0, 0},
};
static PyType_Spec __pyx_type_7opendht_5_core_InfoHash_spec = {
  "opendht._core.InfoHash",
  sizeof(struct __pyx_obj_7opendht_5_core_InfoHash),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE,
  __pyx_type_7opendht_5_core_InfoHash_slots,
};
#else

static PyNumberMethods __pyx_tp_as_number_InfoHash = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  __pyx_pw_7opendht_5_core_8InfoHash_3__bool__, /*nb_bool*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  0, /*nb_int*/
  0, /*nb_long (reserved)*/
  0, /*nb_float*/
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  0, /*nb_index*/
  0, /*nb_matrix_multiply*/
  0, /*nb_inplace_matrix_multiply*/
};

static PyTypeObject __pyx_type_7opendht_5_core_InfoHash = {
  PyVarObject_HEAD_INIT(0, 0)
  "opendht._core.""InfoHash", /*tp_name*/
  sizeof(struct __pyx_obj_7opendht_5_core_InfoHash), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7opendht_5_core_InfoHash, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_pw_7opendht_5_core_7_WithID_1__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  &__pyx_tp_as_number_InfoHash, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_pw_7opendht_5_core_7_WithID_3__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  __pyx_pw_7opendht_5_core_8InfoHash_5__richcmp__, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7opendht_5_core_InfoHash, /*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_7opendht_5_core_InfoHash, /*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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
  #if CYTHON_VECTORCALL_TPNEW
  __pyx_tp_vectorcall_7opendht_5_core_InfoHash, /*tp_vectorcall*/
  #else
  NULL, /*tp_vectorcall*/
  #endif
  #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 < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new__initialisation_7opendht_5_core_PkId(PyObject *o, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
) {
  struct __pyx_obj_7opendht_5_core_PkId *p = ((struct __pyx_obj_7opendht_5_core_PkId *)o);
  __Pyx_default_placement_construct(&(p->_pkid));
  {
    int cinit_result = __pyx_pw_7opendht_5_core_4PkId_1__cinit__(o, 
#if CYTHON_VECTORCALL_TPNEW
    args, nargs, kwnames
#else
    a, k
#endif
);
    if (unlikely(cinit_result)) goto bad;
  }
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static PyObject *__pyx_tp_new_vectorcall_7opendht_5_core_PkId(PyTypeObject *t, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
) {
  PyObject *o;
  o = __pyx_tp_new_vectorcall_7opendht_5_core__WithPk(t, 
#if CYTHON_VECTORCALL_TPNEW
    args, nargs, kwnames
#else
    a, k
#endif
);
  if (unlikely(!o)) return 0;
  return __pyx_tp_new__initialisation_7opendht_5_core_PkId(o, 
#if CYTHON_VECTORCALL_TPNEW
    args, nargs, kwnames
#else
    a, k
#endif
);
}

#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_new_7opendht_5_core_PkId(PyTypeObject *t, PyObject *a, PyObject *k) {
  return __Pyx_CallTpnewAsVectorcall(__pyx_tp_new_vectorcall_7opendht_5_core_PkId, t, a, k);
}
#endif

#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_vectorcall_7opendht_5_core_PkId(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
  if (unlikely((PyTypeObject*)t != __pyx_mstate_global->__pyx_ptype_7opendht_5_core_PkId || __Pyx_PyType_HasFeature((PyTypeObject*)t, Py_TPFLAGS_IS_ABSTRACT))) {
    return __Pyx_CallNewInitFromVectorcall((PyTypeObject*)t, args, nargsf, kwnames);
  }
  Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
  PyObject *o = __pyx_tp_new_vectorcall_7opendht_5_core_PkId((PyTypeObject*)t, args, nargs, kwnames);
  return o;
}
#endif

static void __pyx_tp_dealloc_7opendht_5_core_PkId(PyObject *o) {
  struct __pyx_obj_7opendht_5_core_PkId *p = (struct __pyx_obj_7opendht_5_core_PkId *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7opendht_5_core_PkId) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  __Pyx_call_destructor(p->_pkid);
  __pyx_tp_dealloc_7opendht_5_core__WithPk(o);
}

static PyMethodDef __pyx_methods_7opendht_5_core_PkId[] = {
  {"getBit", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_4PkId_7getBit, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"setBit", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_4PkId_9setBit, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"getLongId", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_4PkId_11getLongId, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"toString", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_4PkId_13toString, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"toFloat", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_4PkId_15toFloat, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"commonBits", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_4PkId_17commonBits, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"get", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_4PkId_19get, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"getRandom", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_4PkId_21getRandom, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_4PkId_23__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_4PkId_25__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7opendht_5_core_PkId_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7opendht_5_core_PkId},
  {Py_nb_bool, (void *)__pyx_pw_7opendht_5_core_4PkId_3__bool__},
  {Py_tp_richcompare, (void *)__pyx_pw_7opendht_5_core_4PkId_5__richcmp__},
  {Py_tp_methods, (void *)__pyx_methods_7opendht_5_core_PkId},
  {Py_tp_new, (void *)__pyx_tp_new_7opendht_5_core_PkId},
  #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
  #if CYTHON_VECTORCALL_TPNEW
  {Py_tp_vectorcall, (void *)__pyx_tp_vectorcall_7opendht_5_core_PkId},
  #endif
  #endif
  {0, 0},
};
static PyType_Spec __pyx_type_7opendht_5_core_PkId_spec = {
  "opendht._core.PkId",
  sizeof(struct __pyx_obj_7opendht_5_core_PkId),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE,
  __pyx_type_7opendht_5_core_PkId_slots,
};
#else

static PyNumberMethods __pyx_tp_as_number_PkId = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  __pyx_pw_7opendht_5_core_4PkId_3__bool__, /*nb_bool*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  0, /*nb_int*/
  0, /*nb_long (reserved)*/
  0, /*nb_float*/
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  0, /*nb_index*/
  0, /*nb_matrix_multiply*/
  0, /*nb_inplace_matrix_multiply*/
};

static PyTypeObject __pyx_type_7opendht_5_core_PkId = {
  PyVarObject_HEAD_INIT(0, 0)
  "opendht._core.""PkId", /*tp_name*/
  sizeof(struct __pyx_obj_7opendht_5_core_PkId), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7opendht_5_core_PkId, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_pw_7opendht_5_core_7_WithPk_1__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  &__pyx_tp_as_number_PkId, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_pw_7opendht_5_core_7_WithPk_3__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  __pyx_pw_7opendht_5_core_4PkId_5__richcmp__, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7opendht_5_core_PkId, /*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_7opendht_5_core_PkId, /*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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
  #if CYTHON_VECTORCALL_TPNEW
  __pyx_tp_vectorcall_7opendht_5_core_PkId, /*tp_vectorcall*/
  #else
  NULL, /*tp_vectorcall*/
  #endif
  #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 < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new__initialisation_7opendht_5_core_SockAddr(PyObject *o, 
#if CYTHON_VECTORCALL_TPNEW
    CYTHON_UNUSED PyObject *const *args, CYTHON_UNUSED Py_ssize_t nargs, CYTHON_UNUSED PyObject *kwnames
#else
    CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k
#endif
) {
  struct __pyx_obj_7opendht_5_core_SockAddr *p = ((struct __pyx_obj_7opendht_5_core_SockAddr *)o);
  __Pyx_default_placement_construct(&(p->_addr));
  return o;
}

static PyObject *__pyx_tp_new_vectorcall_7opendht_5_core_SockAddr(PyTypeObject *t, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
) {
  PyObject *o;
  o = __Pyx_AllocateExtensionType(t, 0);
  if (unlikely(!o)) return 0;
  return __pyx_tp_new__initialisation_7opendht_5_core_SockAddr(o, 
#if CYTHON_VECTORCALL_TPNEW
    args, nargs, kwnames
#else
    a, k
#endif
);
}

#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_new_7opendht_5_core_SockAddr(PyTypeObject *t, PyObject *a, PyObject *k) {
  return __Pyx_CallTpnewAsVectorcall(__pyx_tp_new_vectorcall_7opendht_5_core_SockAddr, t, a, k);
}
#endif

#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_vectorcall_7opendht_5_core_SockAddr(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
  if (unlikely((PyTypeObject*)t != __pyx_mstate_global->__pyx_ptype_7opendht_5_core_SockAddr || __Pyx_PyType_HasFeature((PyTypeObject*)t, Py_TPFLAGS_IS_ABSTRACT))) {
    return __Pyx_CallNewInitFromVectorcall((PyTypeObject*)t, args, nargsf, kwnames);
  }
  Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
  PyObject *o = __pyx_tp_new_vectorcall_7opendht_5_core_SockAddr((PyTypeObject*)t, args, nargs, kwnames);
  return o;
}
#endif

static void __pyx_tp_dealloc_7opendht_5_core_SockAddr(PyObject *o) {
  struct __pyx_obj_7opendht_5_core_SockAddr *p = (struct __pyx_obj_7opendht_5_core_SockAddr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7opendht_5_core_SockAddr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  __Pyx_call_destructor(p->_addr);
  PyTypeObject *tp = Py_TYPE(o);
  #if CYTHON_USE_TYPE_SLOTS
  (*tp->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  Py_DECREF(tp);
  #endif
}

static PyMethodDef __pyx_methods_7opendht_5_core_SockAddr[] = {
  {"toString", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_8SockAddr_1toString, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"getPort", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_8SockAddr_3getPort, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"getFamily", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_8SockAddr_5getFamily, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"setPort", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_8SockAddr_7setPort, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"setFamily", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_8SockAddr_9setFamily, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"isLoopback", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_8SockAddr_11isLoopback, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"isPrivate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_8SockAddr_13isPrivate, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"isUnspecified", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_8SockAddr_15isUnspecified, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"resolve", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_8SockAddr_21resolve, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_8SockAddr_23__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_8SockAddr_25__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7opendht_5_core_SockAddr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7opendht_5_core_SockAddr},
  {Py_tp_repr, (void *)__pyx_pw_7opendht_5_core_8SockAddr_19__repr__},
  {Py_tp_str, (void *)__pyx_pw_7opendht_5_core_8SockAddr_17__str__},
  {Py_tp_methods, (void *)__pyx_methods_7opendht_5_core_SockAddr},
  {Py_tp_new, (void *)__pyx_tp_new_7opendht_5_core_SockAddr},
  #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
  #if CYTHON_VECTORCALL_TPNEW
  {Py_tp_vectorcall, (void *)__pyx_tp_vectorcall_7opendht_5_core_SockAddr},
  #endif
  #endif
  {0, 0},
};
static PyType_Spec __pyx_type_7opendht_5_core_SockAddr_spec = {
  "opendht._core.SockAddr",
  sizeof(struct __pyx_obj_7opendht_5_core_SockAddr),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE,
  __pyx_type_7opendht_5_core_SockAddr_slots,
};
#else

static PyTypeObject __pyx_type_7opendht_5_core_SockAddr = {
  PyVarObject_HEAD_INIT(0, 0)
  "opendht._core.""SockAddr", /*tp_name*/
  sizeof(struct __pyx_obj_7opendht_5_core_SockAddr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7opendht_5_core_SockAddr, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  __pyx_pw_7opendht_5_core_8SockAddr_19__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pw_7opendht_5_core_8SockAddr_17__str__, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7opendht_5_core_SockAddr, /*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_7opendht_5_core_SockAddr, /*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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
  #if CYTHON_VECTORCALL_TPNEW
  __pyx_tp_vectorcall_7opendht_5_core_SockAddr, /*tp_vectorcall*/
  #else
  NULL, /*tp_vectorcall*/
  #endif
  #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 < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new__initialisation_7opendht_5_core_Node(PyObject *o, 
#if CYTHON_VECTORCALL_TPNEW
    CYTHON_UNUSED PyObject *const *args, CYTHON_UNUSED Py_ssize_t nargs, CYTHON_UNUSED PyObject *kwnames
#else
    CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k
#endif
) {
  struct __pyx_obj_7opendht_5_core_Node *p = ((struct __pyx_obj_7opendht_5_core_Node *)o);
  __Pyx_default_placement_construct(&(p->_node));
  return o;
}

static PyObject *__pyx_tp_new_vectorcall_7opendht_5_core_Node(PyTypeObject *t, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
) {
  PyObject *o;
  o = __pyx_tp_new_vectorcall_7opendht_5_core__WithID(t, 
#if CYTHON_VECTORCALL_TPNEW
    args, nargs, kwnames
#else
    a, k
#endif
);
  if (unlikely(!o)) return 0;
  return __pyx_tp_new__initialisation_7opendht_5_core_Node(o, 
#if CYTHON_VECTORCALL_TPNEW
    args, nargs, kwnames
#else
    a, k
#endif
);
}

#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_new_7opendht_5_core_Node(PyTypeObject *t, PyObject *a, PyObject *k) {
  return __Pyx_CallTpnewAsVectorcall(__pyx_tp_new_vectorcall_7opendht_5_core_Node, t, a, k);
}
#endif

#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_vectorcall_7opendht_5_core_Node(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
  if (unlikely((PyTypeObject*)t != __pyx_mstate_global->__pyx_ptype_7opendht_5_core_Node || __Pyx_PyType_HasFeature((PyTypeObject*)t, Py_TPFLAGS_IS_ABSTRACT))) {
    return __Pyx_CallNewInitFromVectorcall((PyTypeObject*)t, args, nargsf, kwnames);
  }
  Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
  PyObject *o = __pyx_tp_new_vectorcall_7opendht_5_core_Node((PyTypeObject*)t, args, nargs, kwnames);
  return o;
}
#endif

static void __pyx_tp_dealloc_7opendht_5_core_Node(PyObject *o) {
  struct __pyx_obj_7opendht_5_core_Node *p = (struct __pyx_obj_7opendht_5_core_Node *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7opendht_5_core_Node) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  __Pyx_call_destructor(p->_node);
  __pyx_tp_dealloc_7opendht_5_core__WithID(o);
}

static PyMethodDef __pyx_methods_7opendht_5_core_Node[] = {
  {"getId", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_4Node_1getId, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"getAddr", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_4Node_3getAddr, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"isExpired", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_4Node_5isExpired, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_4Node_7__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_4Node_9__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7opendht_5_core_Node_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7opendht_5_core_Node},
  {Py_tp_methods, (void *)__pyx_methods_7opendht_5_core_Node},
  {Py_tp_new, (void *)__pyx_tp_new_7opendht_5_core_Node},
  #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
  #if CYTHON_VECTORCALL_TPNEW
  {Py_tp_vectorcall, (void *)__pyx_tp_vectorcall_7opendht_5_core_Node},
  #endif
  #endif
  {0, 0},
};
static PyType_Spec __pyx_type_7opendht_5_core_Node_spec = {
  "opendht._core.Node",
  sizeof(struct __pyx_obj_7opendht_5_core_Node),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE,
  __pyx_type_7opendht_5_core_Node_slots,
};
#else

static PyTypeObject __pyx_type_7opendht_5_core_Node = {
  PyVarObject_HEAD_INIT(0, 0)
  "opendht._core.""Node", /*tp_name*/
  sizeof(struct __pyx_obj_7opendht_5_core_Node), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7opendht_5_core_Node, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_pw_7opendht_5_core_7_WithID_1__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_pw_7opendht_5_core_7_WithID_3__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7opendht_5_core_Node, /*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_7opendht_5_core_Node, /*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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
  #if CYTHON_VECTORCALL_TPNEW
  __pyx_tp_vectorcall_7opendht_5_core_Node, /*tp_vectorcall*/
  #else
  NULL, /*tp_vectorcall*/
  #endif
  #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 < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new__initialisation_7opendht_5_core_NodeEntry(PyObject *o, 
#if CYTHON_VECTORCALL_TPNEW
    CYTHON_UNUSED PyObject *const *args, CYTHON_UNUSED Py_ssize_t nargs, CYTHON_UNUSED PyObject *kwnames
#else
    CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k
#endif
) {
  struct __pyx_obj_7opendht_5_core_NodeEntry *p = ((struct __pyx_obj_7opendht_5_core_NodeEntry *)o);
  __Pyx_default_placement_construct(&(p->_v));
  return o;
}

static PyObject *__pyx_tp_new_vectorcall_7opendht_5_core_NodeEntry(PyTypeObject *t, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
) {
  PyObject *o;
  o = __pyx_tp_new_vectorcall_7opendht_5_core__WithID(t, 
#if CYTHON_VECTORCALL_TPNEW
    args, nargs, kwnames
#else
    a, k
#endif
);
  if (unlikely(!o)) return 0;
  return __pyx_tp_new__initialisation_7opendht_5_core_NodeEntry(o, 
#if CYTHON_VECTORCALL_TPNEW
    args, nargs, kwnames
#else
    a, k
#endif
);
}

#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_new_7opendht_5_core_NodeEntry(PyTypeObject *t, PyObject *a, PyObject *k) {
  return __Pyx_CallTpnewAsVectorcall(__pyx_tp_new_vectorcall_7opendht_5_core_NodeEntry, t, a, k);
}
#endif

#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_vectorcall_7opendht_5_core_NodeEntry(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
  if (unlikely((PyTypeObject*)t != __pyx_mstate_global->__pyx_ptype_7opendht_5_core_NodeEntry || __Pyx_PyType_HasFeature((PyTypeObject*)t, Py_TPFLAGS_IS_ABSTRACT))) {
    return __Pyx_CallNewInitFromVectorcall((PyTypeObject*)t, args, nargsf, kwnames);
  }
  Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
  PyObject *o = __pyx_tp_new_vectorcall_7opendht_5_core_NodeEntry((PyTypeObject*)t, args, nargs, kwnames);
  return o;
}
#endif

static void __pyx_tp_dealloc_7opendht_5_core_NodeEntry(PyObject *o) {
  struct __pyx_obj_7opendht_5_core_NodeEntry *p = (struct __pyx_obj_7opendht_5_core_NodeEntry *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7opendht_5_core_NodeEntry) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  __Pyx_call_destructor(p->_v);
  __pyx_tp_dealloc_7opendht_5_core__WithID(o);
}

static PyMethodDef __pyx_methods_7opendht_5_core_NodeEntry[] = {
  {"getId", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9NodeEntry_1getId, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"getNode", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9NodeEntry_3getNode, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9NodeEntry_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9NodeEntry_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7opendht_5_core_NodeEntry_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7opendht_5_core_NodeEntry},
  {Py_tp_methods, (void *)__pyx_methods_7opendht_5_core_NodeEntry},
  {Py_tp_new, (void *)__pyx_tp_new_7opendht_5_core_NodeEntry},
  #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
  #if CYTHON_VECTORCALL_TPNEW
  {Py_tp_vectorcall, (void *)__pyx_tp_vectorcall_7opendht_5_core_NodeEntry},
  #endif
  #endif
  {0, 0},
};
static PyType_Spec __pyx_type_7opendht_5_core_NodeEntry_spec = {
  "opendht._core.NodeEntry",
  sizeof(struct __pyx_obj_7opendht_5_core_NodeEntry),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE,
  __pyx_type_7opendht_5_core_NodeEntry_slots,
};
#else

static PyTypeObject __pyx_type_7opendht_5_core_NodeEntry = {
  PyVarObject_HEAD_INIT(0, 0)
  "opendht._core.""NodeEntry", /*tp_name*/
  sizeof(struct __pyx_obj_7opendht_5_core_NodeEntry), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7opendht_5_core_NodeEntry, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_pw_7opendht_5_core_7_WithID_1__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_pw_7opendht_5_core_7_WithID_3__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7opendht_5_core_NodeEntry, /*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_7opendht_5_core_NodeEntry, /*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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
  #if CYTHON_VECTORCALL_TPNEW
  __pyx_tp_vectorcall_7opendht_5_core_NodeEntry, /*tp_vectorcall*/
  #else
  NULL, /*tp_vectorcall*/
  #endif
  #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 < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new__initialisation_7opendht_5_core_Query(PyObject *o, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
) {
  struct __pyx_obj_7opendht_5_core_Query *p = ((struct __pyx_obj_7opendht_5_core_Query *)o);
  __Pyx_default_placement_construct(&(p->_query));
  {
    int cinit_result = __pyx_pw_7opendht_5_core_5Query_1__cinit__(o, 
#if CYTHON_VECTORCALL_TPNEW
    args, nargs, kwnames
#else
    a, k
#endif
);
    if (unlikely(cinit_result)) goto bad;
  }
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static PyObject *__pyx_tp_new_vectorcall_7opendht_5_core_Query(PyTypeObject *t, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
) {
  PyObject *o;
  o = __Pyx_AllocateExtensionType(t, 0);
  if (unlikely(!o)) return 0;
  return __pyx_tp_new__initialisation_7opendht_5_core_Query(o, 
#if CYTHON_VECTORCALL_TPNEW
    args, nargs, kwnames
#else
    a, k
#endif
);
}

#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_new_7opendht_5_core_Query(PyTypeObject *t, PyObject *a, PyObject *k) {
  return __Pyx_CallTpnewAsVectorcall(__pyx_tp_new_vectorcall_7opendht_5_core_Query, t, a, k);
}
#endif

#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_vectorcall_7opendht_5_core_Query(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
  if (unlikely((PyTypeObject*)t != __pyx_mstate_global->__pyx_ptype_7opendht_5_core_Query || __Pyx_PyType_HasFeature((PyTypeObject*)t, Py_TPFLAGS_IS_ABSTRACT))) {
    return __Pyx_CallNewInitFromVectorcall((PyTypeObject*)t, args, nargsf, kwnames);
  }
  Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
  PyObject *o = __pyx_tp_new_vectorcall_7opendht_5_core_Query((PyTypeObject*)t, args, nargs, kwnames);
  return o;
}
#endif

static void __pyx_tp_dealloc_7opendht_5_core_Query(PyObject *o) {
  struct __pyx_obj_7opendht_5_core_Query *p = (struct __pyx_obj_7opendht_5_core_Query *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7opendht_5_core_Query) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  __Pyx_call_destructor(p->_query);
  PyTypeObject *tp = Py_TYPE(o);
  #if CYTHON_USE_TYPE_SLOTS
  (*tp->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  Py_DECREF(tp);
  #endif
}

static PyMethodDef __pyx_methods_7opendht_5_core_Query[] = {
  {"buildFrom", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_5Query_5buildFrom, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"isSatisfiedBy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_5Query_7isSatisfiedBy, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_5Query_9__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_5Query_11__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7opendht_5_core_Query_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7opendht_5_core_Query},
  {Py_tp_str, (void *)__pyx_pw_7opendht_5_core_5Query_3__str__},
  {Py_tp_methods, (void *)__pyx_methods_7opendht_5_core_Query},
  {Py_tp_new, (void *)__pyx_tp_new_7opendht_5_core_Query},
  #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
  #if CYTHON_VECTORCALL_TPNEW
  {Py_tp_vectorcall, (void *)__pyx_tp_vectorcall_7opendht_5_core_Query},
  #endif
  #endif
  {0, 0},
};
static PyType_Spec __pyx_type_7opendht_5_core_Query_spec = {
  "opendht._core.Query",
  sizeof(struct __pyx_obj_7opendht_5_core_Query),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE,
  __pyx_type_7opendht_5_core_Query_slots,
};
#else

static PyTypeObject __pyx_type_7opendht_5_core_Query = {
  PyVarObject_HEAD_INIT(0, 0)
  "opendht._core.""Query", /*tp_name*/
  sizeof(struct __pyx_obj_7opendht_5_core_Query), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7opendht_5_core_Query, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pw_7opendht_5_core_5Query_3__str__, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7opendht_5_core_Query, /*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_7opendht_5_core_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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
  #if CYTHON_VECTORCALL_TPNEW
  __pyx_tp_vectorcall_7opendht_5_core_Query, /*tp_vectorcall*/
  #else
  NULL, /*tp_vectorcall*/
  #endif
  #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 < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new__initialisation_7opendht_5_core_Select(PyObject *o, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
) {
  struct __pyx_obj_7opendht_5_core_Select *p = ((struct __pyx_obj_7opendht_5_core_Select *)o);
  __Pyx_default_placement_construct(&(p->_select));
  {
    int cinit_result = __pyx_pw_7opendht_5_core_6Select_1__cinit__(o, 
#if CYTHON_VECTORCALL_TPNEW
    args, nargs, kwnames
#else
    a, k
#endif
);
    if (unlikely(cinit_result)) goto bad;
  }
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static PyObject *__pyx_tp_new_vectorcall_7opendht_5_core_Select(PyTypeObject *t, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
) {
  PyObject *o;
  o = __Pyx_AllocateExtensionType(t, 0);
  if (unlikely(!o)) return 0;
  return __pyx_tp_new__initialisation_7opendht_5_core_Select(o, 
#if CYTHON_VECTORCALL_TPNEW
    args, nargs, kwnames
#else
    a, k
#endif
);
}

#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_new_7opendht_5_core_Select(PyTypeObject *t, PyObject *a, PyObject *k) {
  return __Pyx_CallTpnewAsVectorcall(__pyx_tp_new_vectorcall_7opendht_5_core_Select, t, a, k);
}
#endif

#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_vectorcall_7opendht_5_core_Select(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
  if (unlikely((PyTypeObject*)t != __pyx_mstate_global->__pyx_ptype_7opendht_5_core_Select || __Pyx_PyType_HasFeature((PyTypeObject*)t, Py_TPFLAGS_IS_ABSTRACT))) {
    return __Pyx_CallNewInitFromVectorcall((PyTypeObject*)t, args, nargsf, kwnames);
  }
  Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
  PyObject *o = __pyx_tp_new_vectorcall_7opendht_5_core_Select((PyTypeObject*)t, args, nargs, kwnames);
  return o;
}
#endif

static void __pyx_tp_dealloc_7opendht_5_core_Select(PyObject *o) {
  struct __pyx_obj_7opendht_5_core_Select *p = (struct __pyx_obj_7opendht_5_core_Select *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7opendht_5_core_Select) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  __Pyx_call_destructor(p->_select);
  PyTypeObject *tp = Py_TYPE(o);
  #if CYTHON_USE_TYPE_SLOTS
  (*tp->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  Py_DECREF(tp);
  #endif
}

static PyMethodDef __pyx_methods_7opendht_5_core_Select[] = {
  {"isSatisfiedBy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_6Select_5isSatisfiedBy, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"field", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_6Select_7field, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_6Select_9__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_6Select_11__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7opendht_5_core_Select_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7opendht_5_core_Select},
  {Py_tp_str, (void *)__pyx_pw_7opendht_5_core_6Select_3__str__},
  {Py_tp_methods, (void *)__pyx_methods_7opendht_5_core_Select},
  {Py_tp_new, (void *)__pyx_tp_new_7opendht_5_core_Select},
  #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
  #if CYTHON_VECTORCALL_TPNEW
  {Py_tp_vectorcall, (void *)__pyx_tp_vectorcall_7opendht_5_core_Select},
  #endif
  #endif
  {0, 0},
};
static PyType_Spec __pyx_type_7opendht_5_core_Select_spec = {
  "opendht._core.Select",
  sizeof(struct __pyx_obj_7opendht_5_core_Select),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE,
  __pyx_type_7opendht_5_core_Select_slots,
};
#else

static PyTypeObject __pyx_type_7opendht_5_core_Select = {
  PyVarObject_HEAD_INIT(0, 0)
  "opendht._core.""Select", /*tp_name*/
  sizeof(struct __pyx_obj_7opendht_5_core_Select), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7opendht_5_core_Select, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pw_7opendht_5_core_6Select_3__str__, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7opendht_5_core_Select, /*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_7opendht_5_core_Select, /*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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
  #if CYTHON_VECTORCALL_TPNEW
  __pyx_tp_vectorcall_7opendht_5_core_Select, /*tp_vectorcall*/
  #else
  NULL, /*tp_vectorcall*/
  #endif
  #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 < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new__initialisation_7opendht_5_core_Where(PyObject *o, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
) {
  struct __pyx_obj_7opendht_5_core_Where *p = ((struct __pyx_obj_7opendht_5_core_Where *)o);
  __Pyx_default_placement_construct(&(p->_where));
  {
    int cinit_result = __pyx_pw_7opendht_5_core_5Where_1__cinit__(o, 
#if CYTHON_VECTORCALL_TPNEW
    args, nargs, kwnames
#else
    a, k
#endif
);
    if (unlikely(cinit_result)) goto bad;
  }
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static PyObject *__pyx_tp_new_vectorcall_7opendht_5_core_Where(PyTypeObject *t, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
) {
  PyObject *o;
  o = __Pyx_AllocateExtensionType(t, 0);
  if (unlikely(!o)) return 0;
  return __pyx_tp_new__initialisation_7opendht_5_core_Where(o, 
#if CYTHON_VECTORCALL_TPNEW
    args, nargs, kwnames
#else
    a, k
#endif
);
}

#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_new_7opendht_5_core_Where(PyTypeObject *t, PyObject *a, PyObject *k) {
  return __Pyx_CallTpnewAsVectorcall(__pyx_tp_new_vectorcall_7opendht_5_core_Where, t, a, k);
}
#endif

#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_vectorcall_7opendht_5_core_Where(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
  if (unlikely((PyTypeObject*)t != __pyx_mstate_global->__pyx_ptype_7opendht_5_core_Where || __Pyx_PyType_HasFeature((PyTypeObject*)t, Py_TPFLAGS_IS_ABSTRACT))) {
    return __Pyx_CallNewInitFromVectorcall((PyTypeObject*)t, args, nargsf, kwnames);
  }
  Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
  PyObject *o = __pyx_tp_new_vectorcall_7opendht_5_core_Where((PyTypeObject*)t, args, nargs, kwnames);
  return o;
}
#endif

static void __pyx_tp_dealloc_7opendht_5_core_Where(PyObject *o) {
  struct __pyx_obj_7opendht_5_core_Where *p = (struct __pyx_obj_7opendht_5_core_Where *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7opendht_5_core_Where) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  __Pyx_call_destructor(p->_where);
  PyTypeObject *tp = Py_TYPE(o);
  #if CYTHON_USE_TYPE_SLOTS
  (*tp->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  Py_DECREF(tp);
  #endif
}

static PyMethodDef __pyx_methods_7opendht_5_core_Where[] = {
  {"isSatisfiedBy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_5Where_5isSatisfiedBy, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"id", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_5Where_7id, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"valueType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_5Where_9valueType, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"owner", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_5Where_11owner, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"seq", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_5Where_13seq, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"userType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_5Where_15userType, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_5Where_17__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_5Where_19__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7opendht_5_core_Where_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7opendht_5_core_Where},
  {Py_tp_str, (void *)__pyx_pw_7opendht_5_core_5Where_3__str__},
  {Py_tp_methods, (void *)__pyx_methods_7opendht_5_core_Where},
  {Py_tp_new, (void *)__pyx_tp_new_7opendht_5_core_Where},
  #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
  #if CYTHON_VECTORCALL_TPNEW
  {Py_tp_vectorcall, (void *)__pyx_tp_vectorcall_7opendht_5_core_Where},
  #endif
  #endif
  {0, 0},
};
static PyType_Spec __pyx_type_7opendht_5_core_Where_spec = {
  "opendht._core.Where",
  sizeof(struct __pyx_obj_7opendht_5_core_Where),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE,
  __pyx_type_7opendht_5_core_Where_slots,
};
#else

static PyTypeObject __pyx_type_7opendht_5_core_Where = {
  PyVarObject_HEAD_INIT(0, 0)
  "opendht._core.""Where", /*tp_name*/
  sizeof(struct __pyx_obj_7opendht_5_core_Where), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7opendht_5_core_Where, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pw_7opendht_5_core_5Where_3__str__, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7opendht_5_core_Where, /*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_7opendht_5_core_Where, /*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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
  #if CYTHON_VECTORCALL_TPNEW
  __pyx_tp_vectorcall_7opendht_5_core_Where, /*tp_vectorcall*/
  #else
  NULL, /*tp_vectorcall*/
  #endif
  #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 < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new__initialisation_7opendht_5_core_Value(PyObject *o, 
#if CYTHON_VECTORCALL_TPNEW
    CYTHON_UNUSED PyObject *const *args, CYTHON_UNUSED Py_ssize_t nargs, CYTHON_UNUSED PyObject *kwnames
#else
    CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k
#endif
) {
  struct __pyx_obj_7opendht_5_core_Value *p = ((struct __pyx_obj_7opendht_5_core_Value *)o);
  __Pyx_default_placement_construct(&(p->_value));
  return o;
}

static PyObject *__pyx_tp_new_vectorcall_7opendht_5_core_Value(PyTypeObject *t, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
) {
  PyObject *o;
  o = __Pyx_AllocateExtensionType(t, 0);
  if (unlikely(!o)) return 0;
  return __pyx_tp_new__initialisation_7opendht_5_core_Value(o, 
#if CYTHON_VECTORCALL_TPNEW
    args, nargs, kwnames
#else
    a, k
#endif
);
}

#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_new_7opendht_5_core_Value(PyTypeObject *t, PyObject *a, PyObject *k) {
  return __Pyx_CallTpnewAsVectorcall(__pyx_tp_new_vectorcall_7opendht_5_core_Value, t, a, k);
}
#endif

#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_vectorcall_7opendht_5_core_Value(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
  if (unlikely((PyTypeObject*)t != __pyx_mstate_global->__pyx_ptype_7opendht_5_core_Value || __Pyx_PyType_HasFeature((PyTypeObject*)t, Py_TPFLAGS_IS_ABSTRACT))) {
    return __Pyx_CallNewInitFromVectorcall((PyTypeObject*)t, args, nargsf, kwnames);
  }
  Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
  PyObject *o = __pyx_tp_new_vectorcall_7opendht_5_core_Value((PyTypeObject*)t, args, nargs, kwnames);
  if (likely(o)) {
    assert(Py_TYPE(o) == (PyTypeObject*)t);
    if (unlikely(__pyx_pw_7opendht_5_core_5Value_1__init__(o, args, nargs, kwnames) < 0)) {
      Py_CLEAR(o);
    }
  }
  return o;
}
#endif

#if CYTHON_VECTORCALL_TPNEW
static int __pyx_tp_init_7opendht_5_core_Value(PyObject *o, PyObject *args, PyObject *kwds) {
  return __Pyx_CallTpinitAsVectorcall(__pyx_pw_7opendht_5_core_5Value_1__init__, o, args, kwds);
}
#endif

static void __pyx_tp_dealloc_7opendht_5_core_Value(PyObject *o) {
  struct __pyx_obj_7opendht_5_core_Value *p = (struct __pyx_obj_7opendht_5_core_Value *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7opendht_5_core_Value) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  __Pyx_call_destructor(p->_value);
  PyTypeObject *tp = Py_TYPE(o);
  #if CYTHON_USE_TYPE_SLOTS
  (*tp->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  Py_DECREF(tp);
  #endif
}

static PyObject *__pyx_getprop_7opendht_5_core_5Value_owner(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7opendht_5_core_5Value_5owner_1__get__(o);
}

static PyObject *__pyx_getprop_7opendht_5_core_5Value_recipient(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7opendht_5_core_5Value_9recipient_1__get__(o);
}

static int __pyx_setprop_7opendht_5_core_5Value_recipient(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_7opendht_5_core_5Value_9recipient_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_7opendht_5_core_5Value_data(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7opendht_5_core_5Value_4data_1__get__(o);
}

static int __pyx_setprop_7opendht_5_core_5Value_data(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_7opendht_5_core_5Value_4data_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_7opendht_5_core_5Value_user_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7opendht_5_core_5Value_9user_type_1__get__(o);
}

static int __pyx_setprop_7opendht_5_core_5Value_user_type(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_7opendht_5_core_5Value_9user_type_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_7opendht_5_core_5Value_id(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7opendht_5_core_5Value_2id_1__get__(o);
}

static int __pyx_setprop_7opendht_5_core_5Value_id(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_7opendht_5_core_5Value_2id_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_7opendht_5_core_5Value_size(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7opendht_5_core_5Value_4size_1__get__(o);
}

static PyMethodDef __pyx_methods_7opendht_5_core_Value[] = {
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_5Value_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_5Value_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7opendht_5_core_Value[] = {
  {"owner", __pyx_getprop_7opendht_5_core_5Value_owner, 0, 0, 0},
  {"recipient", __pyx_getprop_7opendht_5_core_5Value_recipient, __pyx_setprop_7opendht_5_core_5Value_recipient, 0, 0},
  {"data", __pyx_getprop_7opendht_5_core_5Value_data, __pyx_setprop_7opendht_5_core_5Value_data, 0, 0},
  {"user_type", __pyx_getprop_7opendht_5_core_5Value_user_type, __pyx_setprop_7opendht_5_core_5Value_user_type, 0, 0},
  {"id", __pyx_getprop_7opendht_5_core_5Value_id, __pyx_setprop_7opendht_5_core_5Value_id, 0, 0},
  {"size", __pyx_getprop_7opendht_5_core_5Value_size, 0, 0, 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7opendht_5_core_Value_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7opendht_5_core_Value},
  {Py_tp_str, (void *)__pyx_pw_7opendht_5_core_5Value_3__str__},
  {Py_tp_methods, (void *)__pyx_methods_7opendht_5_core_Value},
  {Py_tp_getset, (void *)__pyx_getsets_7opendht_5_core_Value},
  {Py_tp_init, (void *)__pyx_tp_init_7opendht_5_core_Value},
  {Py_tp_new, (void *)__pyx_tp_new_7opendht_5_core_Value},
  #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
  #if CYTHON_VECTORCALL_TPNEW
  {Py_tp_vectorcall, (void *)__pyx_tp_vectorcall_7opendht_5_core_Value},
  #endif
  #endif
  {0, 0},
};
static PyType_Spec __pyx_type_7opendht_5_core_Value_spec = {
  "opendht._core.Value",
  sizeof(struct __pyx_obj_7opendht_5_core_Value),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE,
  __pyx_type_7opendht_5_core_Value_slots,
};
#else

static PyTypeObject __pyx_type_7opendht_5_core_Value = {
  PyVarObject_HEAD_INIT(0, 0)
  "opendht._core.""Value", /*tp_name*/
  sizeof(struct __pyx_obj_7opendht_5_core_Value), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7opendht_5_core_Value, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pw_7opendht_5_core_5Value_3__str__, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7opendht_5_core_Value, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7opendht_5_core_Value, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_tp_init_7opendht_5_core_Value, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7opendht_5_core_Value, /*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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
  #if CYTHON_VECTORCALL_TPNEW
  __pyx_tp_vectorcall_7opendht_5_core_Value, /*tp_vectorcall*/
  #else
  NULL, /*tp_vectorcall*/
  #endif
  #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 < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new__initialisation_7opendht_5_core_ValueType(PyObject *o, 
#if CYTHON_VECTORCALL_TPNEW
    CYTHON_UNUSED PyObject *const *args, CYTHON_UNUSED Py_ssize_t nargs, CYTHON_UNUSED PyObject *kwnames
#else
    CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k
#endif
) {
  return o;
}

static PyObject *__pyx_tp_new_vectorcall_7opendht_5_core_ValueType(PyTypeObject *t, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
) {
  PyObject *o;
  o = __Pyx_AllocateExtensionType(t, 0);
  if (unlikely(!o)) return 0;
  return __pyx_tp_new__initialisation_7opendht_5_core_ValueType(o, 
#if CYTHON_VECTORCALL_TPNEW
    args, nargs, kwnames
#else
    a, k
#endif
);
}

#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_new_7opendht_5_core_ValueType(PyTypeObject *t, PyObject *a, PyObject *k) {
  return __Pyx_CallTpnewAsVectorcall(__pyx_tp_new_vectorcall_7opendht_5_core_ValueType, t, a, k);
}
#endif

#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_vectorcall_7opendht_5_core_ValueType(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
  if (unlikely((PyTypeObject*)t != __pyx_mstate_global->__pyx_ptype_7opendht_5_core_ValueType || __Pyx_PyType_HasFeature((PyTypeObject*)t, Py_TPFLAGS_IS_ABSTRACT))) {
    return __Pyx_CallNewInitFromVectorcall((PyTypeObject*)t, args, nargsf, kwnames);
  }
  Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
  PyObject *o = __pyx_tp_new_vectorcall_7opendht_5_core_ValueType((PyTypeObject*)t, args, nargs, kwnames);
  if (likely(o)) {
    assert(Py_TYPE(o) == (PyTypeObject*)t);
    if (unlikely(__pyx_pw_7opendht_5_core_9ValueType_1__init__(o, args, nargs, kwnames) < 0)) {
      Py_CLEAR(o);
    }
  }
  return o;
}
#endif

#if CYTHON_VECTORCALL_TPNEW
static int __pyx_tp_init_7opendht_5_core_ValueType(PyObject *o, PyObject *args, PyObject *kwds) {
  return __Pyx_CallTpinitAsVectorcall(__pyx_pw_7opendht_5_core_9ValueType_1__init__, o, args, kwds);
}
#endif

static void __pyx_tp_dealloc_7opendht_5_core_ValueType(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7opendht_5_core_ValueType) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyTypeObject *tp = Py_TYPE(o);
  #if CYTHON_USE_TYPE_SLOTS
  (*tp->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  Py_DECREF(tp);
  #endif
}

static PyMethodDef __pyx_methods_7opendht_5_core_ValueType[] = {
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9ValueType_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9ValueType_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7opendht_5_core_ValueType_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7opendht_5_core_ValueType},
  {Py_tp_methods, (void *)__pyx_methods_7opendht_5_core_ValueType},
  {Py_tp_init, (void *)__pyx_tp_init_7opendht_5_core_ValueType},
  {Py_tp_new, (void *)__pyx_tp_new_7opendht_5_core_ValueType},
  #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
  #if CYTHON_VECTORCALL_TPNEW
  {Py_tp_vectorcall, (void *)__pyx_tp_vectorcall_7opendht_5_core_ValueType},
  #endif
  #endif
  {0, 0},
};
static PyType_Spec __pyx_type_7opendht_5_core_ValueType_spec = {
  "opendht._core.ValueType",
  sizeof(struct __pyx_obj_7opendht_5_core_ValueType),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE,
  __pyx_type_7opendht_5_core_ValueType_slots,
};
#else

static PyTypeObject __pyx_type_7opendht_5_core_ValueType = {
  PyVarObject_HEAD_INIT(0, 0)
  "opendht._core.""ValueType", /*tp_name*/
  sizeof(struct __pyx_obj_7opendht_5_core_ValueType), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7opendht_5_core_ValueType, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7opendht_5_core_ValueType, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_tp_init_7opendht_5_core_ValueType, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7opendht_5_core_ValueType, /*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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
  #if CYTHON_VECTORCALL_TPNEW
  __pyx_tp_vectorcall_7opendht_5_core_ValueType, /*tp_vectorcall*/
  #else
  NULL, /*tp_vectorcall*/
  #endif
  #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 < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new__initialisation_7opendht_5_core_NodeSetIter(PyObject *o, 
#if CYTHON_VECTORCALL_TPNEW
    CYTHON_UNUSED PyObject *const *args, CYTHON_UNUSED Py_ssize_t nargs, CYTHON_UNUSED PyObject *kwnames
#else
    CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k
#endif
) {
  struct __pyx_obj_7opendht_5_core_NodeSetIter *p = ((struct __pyx_obj_7opendht_5_core_NodeSetIter *)o);
  __Pyx_default_placement_construct(&(p->_curIter));
  return o;
}

static PyObject *__pyx_tp_new_vectorcall_7opendht_5_core_NodeSetIter(PyTypeObject *t, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
) {
  PyObject *o;
  o = __Pyx_AllocateExtensionType(t, 0);
  if (unlikely(!o)) return 0;
  return __pyx_tp_new__initialisation_7opendht_5_core_NodeSetIter(o, 
#if CYTHON_VECTORCALL_TPNEW
    args, nargs, kwnames
#else
    a, k
#endif
);
}

#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_new_7opendht_5_core_NodeSetIter(PyTypeObject *t, PyObject *a, PyObject *k) {
  return __Pyx_CallTpnewAsVectorcall(__pyx_tp_new_vectorcall_7opendht_5_core_NodeSetIter, t, a, k);
}
#endif

#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_vectorcall_7opendht_5_core_NodeSetIter(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
  if (unlikely((PyTypeObject*)t != __pyx_mstate_global->__pyx_ptype_7opendht_5_core_NodeSetIter || __Pyx_PyType_HasFeature((PyTypeObject*)t, Py_TPFLAGS_IS_ABSTRACT))) {
    return __Pyx_CallNewInitFromVectorcall((PyTypeObject*)t, args, nargsf, kwnames);
  }
  Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
  PyObject *o = __pyx_tp_new_vectorcall_7opendht_5_core_NodeSetIter((PyTypeObject*)t, args, nargs, kwnames);
  if (likely(o)) {
    assert(Py_TYPE(o) == (PyTypeObject*)t);
    if (unlikely(__pyx_pw_7opendht_5_core_11NodeSetIter_1__init__(o, args, nargs, kwnames) < 0)) {
      Py_CLEAR(o);
    }
  }
  return o;
}
#endif

#if CYTHON_VECTORCALL_TPNEW
static int __pyx_tp_init_7opendht_5_core_NodeSetIter(PyObject *o, PyObject *args, PyObject *kwds) {
  return __Pyx_CallTpinitAsVectorcall(__pyx_pw_7opendht_5_core_11NodeSetIter_1__init__, o, args, kwds);
}
#endif

static void __pyx_tp_dealloc_7opendht_5_core_NodeSetIter(PyObject *o) {
  struct __pyx_obj_7opendht_5_core_NodeSetIter *p = (struct __pyx_obj_7opendht_5_core_NodeSetIter *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7opendht_5_core_NodeSetIter) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  __Pyx_call_destructor(p->_curIter);
  PyTypeObject *tp = Py_TYPE(o);
  #if CYTHON_USE_TYPE_SLOTS
  (*tp->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  Py_DECREF(tp);
  #endif
}

static PyObject *__pyx_specialmethod___pyx_pw_7opendht_5_core_11NodeSetIter_3__next__(PyObject *self, CYTHON_UNUSED PyObject *arg) {
  PyObject *res = __pyx_pw_7opendht_5_core_11NodeSetIter_3__next__(self);
  if (!res && !PyErr_Occurred()) { PyErr_SetNone(PyExc_StopIteration); }
  return res;
}

static PyMethodDef __pyx_methods_7opendht_5_core_NodeSetIter[] = {
  {"__next__", (PyCFunction)__pyx_specialmethod___pyx_pw_7opendht_5_core_11NodeSetIter_3__next__, METH_NOARGS|METH_COEXIST, 0},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_11NodeSetIter_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_11NodeSetIter_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7opendht_5_core_NodeSetIter_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7opendht_5_core_NodeSetIter},
  {Py_tp_iternext, (void *)__pyx_pw_7opendht_5_core_11NodeSetIter_3__next__},
  {Py_tp_methods, (void *)__pyx_methods_7opendht_5_core_NodeSetIter},
  {Py_tp_init, (void *)__pyx_tp_init_7opendht_5_core_NodeSetIter},
  {Py_tp_new, (void *)__pyx_tp_new_7opendht_5_core_NodeSetIter},
  #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
  #if CYTHON_VECTORCALL_TPNEW
  {Py_tp_vectorcall, (void *)__pyx_tp_vectorcall_7opendht_5_core_NodeSetIter},
  #endif
  #endif
  {0, 0},
};
static PyType_Spec __pyx_type_7opendht_5_core_NodeSetIter_spec = {
  "opendht._core.NodeSetIter",
  sizeof(struct __pyx_obj_7opendht_5_core_NodeSetIter),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE,
  __pyx_type_7opendht_5_core_NodeSetIter_slots,
};
#else

static PyTypeObject __pyx_type_7opendht_5_core_NodeSetIter = {
  PyVarObject_HEAD_INIT(0, 0)
  "opendht._core.""NodeSetIter", /*tp_name*/
  sizeof(struct __pyx_obj_7opendht_5_core_NodeSetIter), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7opendht_5_core_NodeSetIter, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  __pyx_pw_7opendht_5_core_11NodeSetIter_3__next__, /*tp_iternext*/
  __pyx_methods_7opendht_5_core_NodeSetIter, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_tp_init_7opendht_5_core_NodeSetIter, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7opendht_5_core_NodeSetIter, /*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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
  #if CYTHON_VECTORCALL_TPNEW
  __pyx_tp_vectorcall_7opendht_5_core_NodeSetIter, /*tp_vectorcall*/
  #else
  NULL, /*tp_vectorcall*/
  #endif
  #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 < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new__initialisation_7opendht_5_core_NodeSet(PyObject *o, 
#if CYTHON_VECTORCALL_TPNEW
    CYTHON_UNUSED PyObject *const *args, CYTHON_UNUSED Py_ssize_t nargs, CYTHON_UNUSED PyObject *kwnames
#else
    CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k
#endif
) {
  struct __pyx_obj_7opendht_5_core_NodeSet *p = ((struct __pyx_obj_7opendht_5_core_NodeSet *)o);
  __Pyx_default_placement_construct(&(p->_nodes));
  return o;
}

static PyObject *__pyx_tp_new_vectorcall_7opendht_5_core_NodeSet(PyTypeObject *t, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
) {
  PyObject *o;
  o = __Pyx_AllocateExtensionType(t, 0);
  if (unlikely(!o)) return 0;
  return __pyx_tp_new__initialisation_7opendht_5_core_NodeSet(o, 
#if CYTHON_VECTORCALL_TPNEW
    args, nargs, kwnames
#else
    a, k
#endif
);
}

#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_new_7opendht_5_core_NodeSet(PyTypeObject *t, PyObject *a, PyObject *k) {
  return __Pyx_CallTpnewAsVectorcall(__pyx_tp_new_vectorcall_7opendht_5_core_NodeSet, t, a, k);
}
#endif

#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_vectorcall_7opendht_5_core_NodeSet(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
  if (unlikely((PyTypeObject*)t != __pyx_mstate_global->__pyx_ptype_7opendht_5_core_NodeSet || __Pyx_PyType_HasFeature((PyTypeObject*)t, Py_TPFLAGS_IS_ABSTRACT))) {
    return __Pyx_CallNewInitFromVectorcall((PyTypeObject*)t, args, nargsf, kwnames);
  }
  Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
  PyObject *o = __pyx_tp_new_vectorcall_7opendht_5_core_NodeSet((PyTypeObject*)t, args, nargs, kwnames);
  return o;
}
#endif

static void __pyx_tp_dealloc_7opendht_5_core_NodeSet(PyObject *o) {
  struct __pyx_obj_7opendht_5_core_NodeSet *p = (struct __pyx_obj_7opendht_5_core_NodeSet *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7opendht_5_core_NodeSet) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  __Pyx_call_destructor(p->_nodes);
  PyTypeObject *tp = Py_TYPE(o);
  #if CYTHON_USE_TYPE_SLOTS
  (*tp->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  Py_DECREF(tp);
  #endif
}

static PyMethodDef __pyx_methods_7opendht_5_core_NodeSet[] = {
  {"size", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_7NodeSet_1size, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"insert", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_7NodeSet_3insert, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"extend", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_7NodeSet_5extend, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"first", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_7NodeSet_7first, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"last", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_7NodeSet_9last, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_7NodeSet_15__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_7NodeSet_17__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7opendht_5_core_NodeSet_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7opendht_5_core_NodeSet},
  {Py_tp_str, (void *)__pyx_pw_7opendht_5_core_7NodeSet_11__str__},
  {Py_tp_iter, (void *)__pyx_pw_7opendht_5_core_7NodeSet_13__iter__},
  {Py_tp_methods, (void *)__pyx_methods_7opendht_5_core_NodeSet},
  {Py_tp_new, (void *)__pyx_tp_new_7opendht_5_core_NodeSet},
  #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
  #if CYTHON_VECTORCALL_TPNEW
  {Py_tp_vectorcall, (void *)__pyx_tp_vectorcall_7opendht_5_core_NodeSet},
  #endif
  #endif
  {0, 0},
};
static PyType_Spec __pyx_type_7opendht_5_core_NodeSet_spec = {
  "opendht._core.NodeSet",
  sizeof(struct __pyx_obj_7opendht_5_core_NodeSet),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE,
  __pyx_type_7opendht_5_core_NodeSet_slots,
};
#else

static PyTypeObject __pyx_type_7opendht_5_core_NodeSet = {
  PyVarObject_HEAD_INIT(0, 0)
  "opendht._core.""NodeSet", /*tp_name*/
  sizeof(struct __pyx_obj_7opendht_5_core_NodeSet), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7opendht_5_core_NodeSet, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pw_7opendht_5_core_7NodeSet_11__str__, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_7opendht_5_core_7NodeSet_13__iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7opendht_5_core_NodeSet, /*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_7opendht_5_core_NodeSet, /*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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
  #if CYTHON_VECTORCALL_TPNEW
  __pyx_tp_vectorcall_7opendht_5_core_NodeSet, /*tp_vectorcall*/
  #else
  NULL, /*tp_vectorcall*/
  #endif
  #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 < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new__initialisation_7opendht_5_core_PrivateKey(PyObject *o, 
#if CYTHON_VECTORCALL_TPNEW
    CYTHON_UNUSED PyObject *const *args, CYTHON_UNUSED Py_ssize_t nargs, CYTHON_UNUSED PyObject *kwnames
#else
    CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k
#endif
) {
  struct __pyx_obj_7opendht_5_core_PrivateKey *p = ((struct __pyx_obj_7opendht_5_core_PrivateKey *)o);
  __Pyx_default_placement_construct(&(p->_key));
  return o;
}

static PyObject *__pyx_tp_new_vectorcall_7opendht_5_core_PrivateKey(PyTypeObject *t, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
) {
  PyObject *o;
  o = __pyx_tp_new_vectorcall_7opendht_5_core__WithPk(t, 
#if CYTHON_VECTORCALL_TPNEW
    args, nargs, kwnames
#else
    a, k
#endif
);
  if (unlikely(!o)) return 0;
  return __pyx_tp_new__initialisation_7opendht_5_core_PrivateKey(o, 
#if CYTHON_VECTORCALL_TPNEW
    args, nargs, kwnames
#else
    a, k
#endif
);
}

#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_new_7opendht_5_core_PrivateKey(PyTypeObject *t, PyObject *a, PyObject *k) {
  return __Pyx_CallTpnewAsVectorcall(__pyx_tp_new_vectorcall_7opendht_5_core_PrivateKey, t, a, k);
}
#endif

#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_vectorcall_7opendht_5_core_PrivateKey(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
  if (unlikely((PyTypeObject*)t != __pyx_mstate_global->__pyx_ptype_7opendht_5_core_PrivateKey || __Pyx_PyType_HasFeature((PyTypeObject*)t, Py_TPFLAGS_IS_ABSTRACT))) {
    return __Pyx_CallNewInitFromVectorcall((PyTypeObject*)t, args, nargsf, kwnames);
  }
  Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
  PyObject *o = __pyx_tp_new_vectorcall_7opendht_5_core_PrivateKey((PyTypeObject*)t, args, nargs, kwnames);
  return o;
}
#endif

static void __pyx_tp_dealloc_7opendht_5_core_PrivateKey(PyObject *o) {
  struct __pyx_obj_7opendht_5_core_PrivateKey *p = (struct __pyx_obj_7opendht_5_core_PrivateKey *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7opendht_5_core_PrivateKey) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  __Pyx_call_destructor(p->_key);
  __pyx_tp_dealloc_7opendht_5_core__WithPk(o);
}

static PyMethodDef __pyx_methods_7opendht_5_core_PrivateKey[] = {
  {"getId", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_10PrivateKey_1getId, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"getLongId", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_10PrivateKey_3getLongId, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"getPublicKey", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_10PrivateKey_5getPublicKey, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"decrypt", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_10PrivateKey_7decrypt, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"sign", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_10PrivateKey_9sign, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"generate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_10PrivateKey_11generate, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"generateEC", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_10PrivateKey_13generateEC, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_10PrivateKey_15__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_10PrivateKey_17__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7opendht_5_core_PrivateKey_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7opendht_5_core_PrivateKey},
  {Py_tp_methods, (void *)__pyx_methods_7opendht_5_core_PrivateKey},
  {Py_tp_new, (void *)__pyx_tp_new_7opendht_5_core_PrivateKey},
  #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
  #if CYTHON_VECTORCALL_TPNEW
  {Py_tp_vectorcall, (void *)__pyx_tp_vectorcall_7opendht_5_core_PrivateKey},
  #endif
  #endif
  {0, 0},
};
static PyType_Spec __pyx_type_7opendht_5_core_PrivateKey_spec = {
  "opendht._core.PrivateKey",
  sizeof(struct __pyx_obj_7opendht_5_core_PrivateKey),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE,
  __pyx_type_7opendht_5_core_PrivateKey_slots,
};
#else

static PyTypeObject __pyx_type_7opendht_5_core_PrivateKey = {
  PyVarObject_HEAD_INIT(0, 0)
  "opendht._core.""PrivateKey", /*tp_name*/
  sizeof(struct __pyx_obj_7opendht_5_core_PrivateKey), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7opendht_5_core_PrivateKey, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_pw_7opendht_5_core_7_WithPk_1__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_pw_7opendht_5_core_7_WithPk_3__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7opendht_5_core_PrivateKey, /*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_7opendht_5_core_PrivateKey, /*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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
  #if CYTHON_VECTORCALL_TPNEW
  __pyx_tp_vectorcall_7opendht_5_core_PrivateKey, /*tp_vectorcall*/
  #else
  NULL, /*tp_vectorcall*/
  #endif
  #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 < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new__initialisation_7opendht_5_core_PublicKey(PyObject *o, 
#if CYTHON_VECTORCALL_TPNEW
    CYTHON_UNUSED PyObject *const *args, CYTHON_UNUSED Py_ssize_t nargs, CYTHON_UNUSED PyObject *kwnames
#else
    CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k
#endif
) {
  struct __pyx_obj_7opendht_5_core_PublicKey *p = ((struct __pyx_obj_7opendht_5_core_PublicKey *)o);
  __Pyx_default_placement_construct(&(p->_key));
  return o;
}

static PyObject *__pyx_tp_new_vectorcall_7opendht_5_core_PublicKey(PyTypeObject *t, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
) {
  PyObject *o;
  o = __pyx_tp_new_vectorcall_7opendht_5_core__WithPk(t, 
#if CYTHON_VECTORCALL_TPNEW
    args, nargs, kwnames
#else
    a, k
#endif
);
  if (unlikely(!o)) return 0;
  return __pyx_tp_new__initialisation_7opendht_5_core_PublicKey(o, 
#if CYTHON_VECTORCALL_TPNEW
    args, nargs, kwnames
#else
    a, k
#endif
);
}

#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_new_7opendht_5_core_PublicKey(PyTypeObject *t, PyObject *a, PyObject *k) {
  return __Pyx_CallTpnewAsVectorcall(__pyx_tp_new_vectorcall_7opendht_5_core_PublicKey, t, a, k);
}
#endif

#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_vectorcall_7opendht_5_core_PublicKey(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
  if (unlikely((PyTypeObject*)t != __pyx_mstate_global->__pyx_ptype_7opendht_5_core_PublicKey || __Pyx_PyType_HasFeature((PyTypeObject*)t, Py_TPFLAGS_IS_ABSTRACT))) {
    return __Pyx_CallNewInitFromVectorcall((PyTypeObject*)t, args, nargsf, kwnames);
  }
  Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
  PyObject *o = __pyx_tp_new_vectorcall_7opendht_5_core_PublicKey((PyTypeObject*)t, args, nargs, kwnames);
  return o;
}
#endif

static void __pyx_tp_dealloc_7opendht_5_core_PublicKey(PyObject *o) {
  struct __pyx_obj_7opendht_5_core_PublicKey *p = (struct __pyx_obj_7opendht_5_core_PublicKey *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7opendht_5_core_PublicKey) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  __Pyx_call_destructor(p->_key);
  __pyx_tp_dealloc_7opendht_5_core__WithPk(o);
}

static PyMethodDef __pyx_methods_7opendht_5_core_PublicKey[] = {
  {"getId", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9PublicKey_1getId, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"getLongId", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9PublicKey_3getLongId, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"encrypt", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9PublicKey_5encrypt, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"checkSignature", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9PublicKey_7checkSignature, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9PublicKey_9__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9PublicKey_11__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7opendht_5_core_PublicKey_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7opendht_5_core_PublicKey},
  {Py_tp_methods, (void *)__pyx_methods_7opendht_5_core_PublicKey},
  {Py_tp_new, (void *)__pyx_tp_new_7opendht_5_core_PublicKey},
  #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
  #if CYTHON_VECTORCALL_TPNEW
  {Py_tp_vectorcall, (void *)__pyx_tp_vectorcall_7opendht_5_core_PublicKey},
  #endif
  #endif
  {0, 0},
};
static PyType_Spec __pyx_type_7opendht_5_core_PublicKey_spec = {
  "opendht._core.PublicKey",
  sizeof(struct __pyx_obj_7opendht_5_core_PublicKey),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE,
  __pyx_type_7opendht_5_core_PublicKey_slots,
};
#else

static PyTypeObject __pyx_type_7opendht_5_core_PublicKey = {
  PyVarObject_HEAD_INIT(0, 0)
  "opendht._core.""PublicKey", /*tp_name*/
  sizeof(struct __pyx_obj_7opendht_5_core_PublicKey), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7opendht_5_core_PublicKey, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_pw_7opendht_5_core_7_WithPk_1__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_pw_7opendht_5_core_7_WithPk_3__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7opendht_5_core_PublicKey, /*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_7opendht_5_core_PublicKey, /*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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
  #if CYTHON_VECTORCALL_TPNEW
  __pyx_tp_vectorcall_7opendht_5_core_PublicKey, /*tp_vectorcall*/
  #else
  NULL, /*tp_vectorcall*/
  #endif
  #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 < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new__initialisation_7opendht_5_core_Certificate(PyObject *o, 
#if CYTHON_VECTORCALL_TPNEW
    CYTHON_UNUSED PyObject *const *args, CYTHON_UNUSED Py_ssize_t nargs, CYTHON_UNUSED PyObject *kwnames
#else
    CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k
#endif
) {
  struct __pyx_obj_7opendht_5_core_Certificate *p = ((struct __pyx_obj_7opendht_5_core_Certificate *)o);
  __Pyx_default_placement_construct(&(p->_cert));
  return o;
}

static PyObject *__pyx_tp_new_vectorcall_7opendht_5_core_Certificate(PyTypeObject *t, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
) {
  PyObject *o;
  o = __pyx_tp_new_vectorcall_7opendht_5_core__WithPk(t, 
#if CYTHON_VECTORCALL_TPNEW
    args, nargs, kwnames
#else
    a, k
#endif
);
  if (unlikely(!o)) return 0;
  return __pyx_tp_new__initialisation_7opendht_5_core_Certificate(o, 
#if CYTHON_VECTORCALL_TPNEW
    args, nargs, kwnames
#else
    a, k
#endif
);
}

#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_new_7opendht_5_core_Certificate(PyTypeObject *t, PyObject *a, PyObject *k) {
  return __Pyx_CallTpnewAsVectorcall(__pyx_tp_new_vectorcall_7opendht_5_core_Certificate, t, a, k);
}
#endif

#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_vectorcall_7opendht_5_core_Certificate(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
  if (unlikely((PyTypeObject*)t != __pyx_mstate_global->__pyx_ptype_7opendht_5_core_Certificate || __Pyx_PyType_HasFeature((PyTypeObject*)t, Py_TPFLAGS_IS_ABSTRACT))) {
    return __Pyx_CallNewInitFromVectorcall((PyTypeObject*)t, args, nargsf, kwnames);
  }
  Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
  PyObject *o = __pyx_tp_new_vectorcall_7opendht_5_core_Certificate((PyTypeObject*)t, args, nargs, kwnames);
  if (likely(o)) {
    assert(Py_TYPE(o) == (PyTypeObject*)t);
    if (unlikely(__pyx_pw_7opendht_5_core_11Certificate_1__init__(o, args, nargs, kwnames) < 0)) {
      Py_CLEAR(o);
    }
  }
  return o;
}
#endif

#if CYTHON_VECTORCALL_TPNEW
static int __pyx_tp_init_7opendht_5_core_Certificate(PyObject *o, PyObject *args, PyObject *kwds) {
  return __Pyx_CallTpinitAsVectorcall(__pyx_pw_7opendht_5_core_11Certificate_1__init__, o, args, kwds);
}
#endif

static void __pyx_tp_dealloc_7opendht_5_core_Certificate(PyObject *o) {
  struct __pyx_obj_7opendht_5_core_Certificate *p = (struct __pyx_obj_7opendht_5_core_Certificate *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7opendht_5_core_Certificate) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  __Pyx_call_destructor(p->_cert);
  __pyx_tp_dealloc_7opendht_5_core__WithPk(o);
}

static PyObject *__pyx_getprop_7opendht_5_core_11Certificate_issuer(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7opendht_5_core_11Certificate_6issuer_1__get__(o);
}

static PyMethodDef __pyx_methods_7opendht_5_core_Certificate[] = {
  {"getId", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_11Certificate_3getId, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"getLongId", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_11Certificate_5getLongId, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"toString", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_11Certificate_7toString, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"getName", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_11Certificate_9getName, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"revoke", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_11Certificate_11revoke, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__bytes__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_11Certificate_13__bytes__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"generate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_11Certificate_15generate, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_11Certificate_17__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_11Certificate_19__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7opendht_5_core_Certificate[] = {
  {"issuer", __pyx_getprop_7opendht_5_core_11Certificate_issuer, 0, 0, 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7opendht_5_core_Certificate_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7opendht_5_core_Certificate},
  {Py_tp_methods, (void *)__pyx_methods_7opendht_5_core_Certificate},
  {Py_tp_getset, (void *)__pyx_getsets_7opendht_5_core_Certificate},
  {Py_tp_init, (void *)__pyx_tp_init_7opendht_5_core_Certificate},
  {Py_tp_new, (void *)__pyx_tp_new_7opendht_5_core_Certificate},
  #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
  #if CYTHON_VECTORCALL_TPNEW
  {Py_tp_vectorcall, (void *)__pyx_tp_vectorcall_7opendht_5_core_Certificate},
  #endif
  #endif
  {0, 0},
};
static PyType_Spec __pyx_type_7opendht_5_core_Certificate_spec = {
  "opendht._core.Certificate",
  sizeof(struct __pyx_obj_7opendht_5_core_Certificate),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE,
  __pyx_type_7opendht_5_core_Certificate_slots,
};
#else

static PyTypeObject __pyx_type_7opendht_5_core_Certificate = {
  PyVarObject_HEAD_INIT(0, 0)
  "opendht._core.""Certificate", /*tp_name*/
  sizeof(struct __pyx_obj_7opendht_5_core_Certificate), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7opendht_5_core_Certificate, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_pw_7opendht_5_core_7_WithPk_1__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_pw_7opendht_5_core_7_WithPk_3__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7opendht_5_core_Certificate, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7opendht_5_core_Certificate, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_tp_init_7opendht_5_core_Certificate, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7opendht_5_core_Certificate, /*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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
  #if CYTHON_VECTORCALL_TPNEW
  __pyx_tp_vectorcall_7opendht_5_core_Certificate, /*tp_vectorcall*/
  #else
  NULL, /*tp_vectorcall*/
  #endif
  #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 < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new__initialisation_7opendht_5_core_VerifyResult(PyObject *o, 
#if CYTHON_VECTORCALL_TPNEW
    CYTHON_UNUSED PyObject *const *args, CYTHON_UNUSED Py_ssize_t nargs, CYTHON_UNUSED PyObject *kwnames
#else
    CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k
#endif
) {
  struct __pyx_obj_7opendht_5_core_VerifyResult *p = ((struct __pyx_obj_7opendht_5_core_VerifyResult *)o);
  __Pyx_default_placement_construct(&(p->_result));
  return o;
}

static PyObject *__pyx_tp_new_vectorcall_7opendht_5_core_VerifyResult(PyTypeObject *t, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
) {
  PyObject *o;
  o = __Pyx_AllocateExtensionType(t, 0);
  if (unlikely(!o)) return 0;
  return __pyx_tp_new__initialisation_7opendht_5_core_VerifyResult(o, 
#if CYTHON_VECTORCALL_TPNEW
    args, nargs, kwnames
#else
    a, k
#endif
);
}

#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_new_7opendht_5_core_VerifyResult(PyTypeObject *t, PyObject *a, PyObject *k) {
  return __Pyx_CallTpnewAsVectorcall(__pyx_tp_new_vectorcall_7opendht_5_core_VerifyResult, t, a, k);
}
#endif

#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_vectorcall_7opendht_5_core_VerifyResult(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
  if (unlikely((PyTypeObject*)t != __pyx_mstate_global->__pyx_ptype_7opendht_5_core_VerifyResult || __Pyx_PyType_HasFeature((PyTypeObject*)t, Py_TPFLAGS_IS_ABSTRACT))) {
    return __Pyx_CallNewInitFromVectorcall((PyTypeObject*)t, args, nargsf, kwnames);
  }
  Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
  PyObject *o = __pyx_tp_new_vectorcall_7opendht_5_core_VerifyResult((PyTypeObject*)t, args, nargs, kwnames);
  return o;
}
#endif

static void __pyx_tp_dealloc_7opendht_5_core_VerifyResult(PyObject *o) {
  struct __pyx_obj_7opendht_5_core_VerifyResult *p = (struct __pyx_obj_7opendht_5_core_VerifyResult *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7opendht_5_core_VerifyResult) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  __Pyx_call_destructor(p->_result);
  PyTypeObject *tp = Py_TYPE(o);
  #if CYTHON_USE_TYPE_SLOTS
  (*tp->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  Py_DECREF(tp);
  #endif
}

static PyMethodDef __pyx_methods_7opendht_5_core_VerifyResult[] = {
  {"_VerifyResult__str", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_12VerifyResult_3_VerifyResult__str, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_12VerifyResult_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_12VerifyResult_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7opendht_5_core_VerifyResult_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7opendht_5_core_VerifyResult},
  {Py_nb_bool, (void *)__pyx_pw_7opendht_5_core_12VerifyResult_1__bool__},
  {Py_tp_methods, (void *)__pyx_methods_7opendht_5_core_VerifyResult},
  {Py_tp_new, (void *)__pyx_tp_new_7opendht_5_core_VerifyResult},
  #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
  #if CYTHON_VECTORCALL_TPNEW
  {Py_tp_vectorcall, (void *)__pyx_tp_vectorcall_7opendht_5_core_VerifyResult},
  #endif
  #endif
  {0, 0},
};
static PyType_Spec __pyx_type_7opendht_5_core_VerifyResult_spec = {
  "opendht._core.VerifyResult",
  sizeof(struct __pyx_obj_7opendht_5_core_VerifyResult),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE,
  __pyx_type_7opendht_5_core_VerifyResult_slots,
};
#else

static PyNumberMethods __pyx_tp_as_number_VerifyResult = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  __pyx_pw_7opendht_5_core_12VerifyResult_1__bool__, /*nb_bool*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  0, /*nb_int*/
  0, /*nb_long (reserved)*/
  0, /*nb_float*/
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  0, /*nb_index*/
  0, /*nb_matrix_multiply*/
  0, /*nb_inplace_matrix_multiply*/
};

static PyTypeObject __pyx_type_7opendht_5_core_VerifyResult = {
  PyVarObject_HEAD_INIT(0, 0)
  "opendht._core.""VerifyResult", /*tp_name*/
  sizeof(struct __pyx_obj_7opendht_5_core_VerifyResult), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7opendht_5_core_VerifyResult, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  &__pyx_tp_as_number_VerifyResult, /*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_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7opendht_5_core_VerifyResult, /*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_7opendht_5_core_VerifyResult, /*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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
  #if CYTHON_VECTORCALL_TPNEW
  __pyx_tp_vectorcall_7opendht_5_core_VerifyResult, /*tp_vectorcall*/
  #else
  NULL, /*tp_vectorcall*/
  #endif
  #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 < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new__initialisation_7opendht_5_core_TrustList(PyObject *o, 
#if CYTHON_VECTORCALL_TPNEW
    CYTHON_UNUSED PyObject *const *args, CYTHON_UNUSED Py_ssize_t nargs, CYTHON_UNUSED PyObject *kwnames
#else
    CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k
#endif
) {
  struct __pyx_obj_7opendht_5_core_TrustList *p = ((struct __pyx_obj_7opendht_5_core_TrustList *)o);
  __Pyx_default_placement_construct(&(p->_trust));
  return o;
}

static PyObject *__pyx_tp_new_vectorcall_7opendht_5_core_TrustList(PyTypeObject *t, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
) {
  PyObject *o;
  o = __Pyx_AllocateExtensionType(t, 0);
  if (unlikely(!o)) return 0;
  return __pyx_tp_new__initialisation_7opendht_5_core_TrustList(o, 
#if CYTHON_VECTORCALL_TPNEW
    args, nargs, kwnames
#else
    a, k
#endif
);
}

#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_new_7opendht_5_core_TrustList(PyTypeObject *t, PyObject *a, PyObject *k) {
  return __Pyx_CallTpnewAsVectorcall(__pyx_tp_new_vectorcall_7opendht_5_core_TrustList, t, a, k);
}
#endif

#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_vectorcall_7opendht_5_core_TrustList(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
  if (unlikely((PyTypeObject*)t != __pyx_mstate_global->__pyx_ptype_7opendht_5_core_TrustList || __Pyx_PyType_HasFeature((PyTypeObject*)t, Py_TPFLAGS_IS_ABSTRACT))) {
    return __Pyx_CallNewInitFromVectorcall((PyTypeObject*)t, args, nargsf, kwnames);
  }
  Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
  PyObject *o = __pyx_tp_new_vectorcall_7opendht_5_core_TrustList((PyTypeObject*)t, args, nargs, kwnames);
  return o;
}
#endif

static void __pyx_tp_dealloc_7opendht_5_core_TrustList(PyObject *o) {
  struct __pyx_obj_7opendht_5_core_TrustList *p = (struct __pyx_obj_7opendht_5_core_TrustList *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7opendht_5_core_TrustList) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  __Pyx_call_destructor(p->_trust);
  PyTypeObject *tp = Py_TYPE(o);
  #if CYTHON_USE_TYPE_SLOTS
  (*tp->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  Py_DECREF(tp);
  #endif
}

static PyMethodDef __pyx_methods_7opendht_5_core_TrustList[] = {
  {"add", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9TrustList_1add, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"remove", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9TrustList_3remove, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"verify", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9TrustList_5verify, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9TrustList_7__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9TrustList_9__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7opendht_5_core_TrustList_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7opendht_5_core_TrustList},
  {Py_tp_methods, (void *)__pyx_methods_7opendht_5_core_TrustList},
  {Py_tp_new, (void *)__pyx_tp_new_7opendht_5_core_TrustList},
  #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
  #if CYTHON_VECTORCALL_TPNEW
  {Py_tp_vectorcall, (void *)__pyx_tp_vectorcall_7opendht_5_core_TrustList},
  #endif
  #endif
  {0, 0},
};
static PyType_Spec __pyx_type_7opendht_5_core_TrustList_spec = {
  "opendht._core.TrustList",
  sizeof(struct __pyx_obj_7opendht_5_core_TrustList),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE,
  __pyx_type_7opendht_5_core_TrustList_slots,
};
#else

static PyTypeObject __pyx_type_7opendht_5_core_TrustList = {
  PyVarObject_HEAD_INIT(0, 0)
  "opendht._core.""TrustList", /*tp_name*/
  sizeof(struct __pyx_obj_7opendht_5_core_TrustList), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7opendht_5_core_TrustList, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7opendht_5_core_TrustList, /*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_7opendht_5_core_TrustList, /*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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
  #if CYTHON_VECTORCALL_TPNEW
  __pyx_tp_vectorcall_7opendht_5_core_TrustList, /*tp_vectorcall*/
  #else
  NULL, /*tp_vectorcall*/
  #endif
  #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 < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new__initialisation_7opendht_5_core_ListenToken(PyObject *o, 
#if CYTHON_VECTORCALL_TPNEW
    CYTHON_UNUSED PyObject *const *args, CYTHON_UNUSED Py_ssize_t nargs, CYTHON_UNUSED PyObject *kwnames
#else
    CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k
#endif
) {
  struct __pyx_obj_7opendht_5_core_ListenToken *p = ((struct __pyx_obj_7opendht_5_core_ListenToken *)o);
  __Pyx_default_placement_construct(&(p->_h));
  __Pyx_default_placement_construct(&(p->_t));
  return o;
}

static PyObject *__pyx_tp_new_vectorcall_7opendht_5_core_ListenToken(PyTypeObject *t, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
) {
  PyObject *o;
  o = __Pyx_AllocateExtensionType(t, 0);
  if (unlikely(!o)) return 0;
  return __pyx_tp_new__initialisation_7opendht_5_core_ListenToken(o, 
#if CYTHON_VECTORCALL_TPNEW
    args, nargs, kwnames
#else
    a, k
#endif
);
}

#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_new_7opendht_5_core_ListenToken(PyTypeObject *t, PyObject *a, PyObject *k) {
  return __Pyx_CallTpnewAsVectorcall(__pyx_tp_new_vectorcall_7opendht_5_core_ListenToken, t, a, k);
}
#endif

#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_vectorcall_7opendht_5_core_ListenToken(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
  if (unlikely((PyTypeObject*)t != __pyx_mstate_global->__pyx_ptype_7opendht_5_core_ListenToken || __Pyx_PyType_HasFeature((PyTypeObject*)t, Py_TPFLAGS_IS_ABSTRACT))) {
    return __Pyx_CallNewInitFromVectorcall((PyTypeObject*)t, args, nargsf, kwnames);
  }
  Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
  PyObject *o = __pyx_tp_new_vectorcall_7opendht_5_core_ListenToken((PyTypeObject*)t, args, nargs, kwnames);
  return o;
}
#endif

static void __pyx_tp_dealloc_7opendht_5_core_ListenToken(PyObject *o) {
  struct __pyx_obj_7opendht_5_core_ListenToken *p = (struct __pyx_obj_7opendht_5_core_ListenToken *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7opendht_5_core_ListenToken) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  __Pyx_call_destructor(p->_h);
  __Pyx_call_destructor(p->_t);
  PyTypeObject *tp = Py_TYPE(o);
  #if CYTHON_USE_TYPE_SLOTS
  (*tp->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  Py_DECREF(tp);
  #endif
}

static PyMethodDef __pyx_methods_7opendht_5_core_ListenToken[] = {
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_11ListenToken_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_11ListenToken_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7opendht_5_core_ListenToken_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7opendht_5_core_ListenToken},
  {Py_tp_methods, (void *)__pyx_methods_7opendht_5_core_ListenToken},
  {Py_tp_new, (void *)__pyx_tp_new_7opendht_5_core_ListenToken},
  #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
  #if CYTHON_VECTORCALL_TPNEW
  {Py_tp_vectorcall, (void *)__pyx_tp_vectorcall_7opendht_5_core_ListenToken},
  #endif
  #endif
  {0, 0},
};
static PyType_Spec __pyx_type_7opendht_5_core_ListenToken_spec = {
  "opendht._core.ListenToken",
  sizeof(struct __pyx_obj_7opendht_5_core_ListenToken),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE,
  __pyx_type_7opendht_5_core_ListenToken_slots,
};
#else

static PyTypeObject __pyx_type_7opendht_5_core_ListenToken = {
  PyVarObject_HEAD_INIT(0, 0)
  "opendht._core.""ListenToken", /*tp_name*/
  sizeof(struct __pyx_obj_7opendht_5_core_ListenToken), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7opendht_5_core_ListenToken, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7opendht_5_core_ListenToken, /*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_7opendht_5_core_ListenToken, /*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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
  #if CYTHON_VECTORCALL_TPNEW
  __pyx_tp_vectorcall_7opendht_5_core_ListenToken, /*tp_vectorcall*/
  #else
  NULL, /*tp_vectorcall*/
  #endif
  #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 < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new__initialisation_7opendht_5_core_Identity(PyObject *o, 
#if CYTHON_VECTORCALL_TPNEW
    CYTHON_UNUSED PyObject *const *args, CYTHON_UNUSED Py_ssize_t nargs, CYTHON_UNUSED PyObject *kwnames
#else
    CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k
#endif
) {
  struct __pyx_obj_7opendht_5_core_Identity *p = ((struct __pyx_obj_7opendht_5_core_Identity *)o);
  __Pyx_default_placement_construct(&(p->_id));
  return o;
}

static PyObject *__pyx_tp_new_vectorcall_7opendht_5_core_Identity(PyTypeObject *t, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
) {
  PyObject *o;
  o = __Pyx_AllocateExtensionType(t, 0);
  if (unlikely(!o)) return 0;
  return __pyx_tp_new__initialisation_7opendht_5_core_Identity(o, 
#if CYTHON_VECTORCALL_TPNEW
    args, nargs, kwnames
#else
    a, k
#endif
);
}

#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_new_7opendht_5_core_Identity(PyTypeObject *t, PyObject *a, PyObject *k) {
  return __Pyx_CallTpnewAsVectorcall(__pyx_tp_new_vectorcall_7opendht_5_core_Identity, t, a, k);
}
#endif

#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_vectorcall_7opendht_5_core_Identity(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
  if (unlikely((PyTypeObject*)t != __pyx_mstate_global->__pyx_ptype_7opendht_5_core_Identity || __Pyx_PyType_HasFeature((PyTypeObject*)t, Py_TPFLAGS_IS_ABSTRACT))) {
    return __Pyx_CallNewInitFromVectorcall((PyTypeObject*)t, args, nargsf, kwnames);
  }
  Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
  PyObject *o = __pyx_tp_new_vectorcall_7opendht_5_core_Identity((PyTypeObject*)t, args, nargs, kwnames);
  if (likely(o)) {
    assert(Py_TYPE(o) == (PyTypeObject*)t);
    if (unlikely(__pyx_pw_7opendht_5_core_8Identity_1__init__(o, args, nargs, kwnames) < 0)) {
      Py_CLEAR(o);
    }
  }
  return o;
}
#endif

#if CYTHON_VECTORCALL_TPNEW
static int __pyx_tp_init_7opendht_5_core_Identity(PyObject *o, PyObject *args, PyObject *kwds) {
  return __Pyx_CallTpinitAsVectorcall(__pyx_pw_7opendht_5_core_8Identity_1__init__, o, args, kwds);
}
#endif

static void __pyx_tp_dealloc_7opendht_5_core_Identity(PyObject *o) {
  struct __pyx_obj_7opendht_5_core_Identity *p = (struct __pyx_obj_7opendht_5_core_Identity *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7opendht_5_core_Identity) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  __Pyx_call_destructor(p->_id);
  PyTypeObject *tp = Py_TYPE(o);
  #if CYTHON_USE_TYPE_SLOTS
  (*tp->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  Py_DECREF(tp);
  #endif
}

static PyObject *__pyx_getprop_7opendht_5_core_8Identity_publickey(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7opendht_5_core_8Identity_9publickey_1__get__(o);
}

static PyObject *__pyx_getprop_7opendht_5_core_8Identity_certificate(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7opendht_5_core_8Identity_11certificate_1__get__(o);
}

static PyObject *__pyx_getprop_7opendht_5_core_8Identity_key(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7opendht_5_core_8Identity_3key_1__get__(o);
}

static PyMethodDef __pyx_methods_7opendht_5_core_Identity[] = {
  {"generate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_8Identity_3generate, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_8Identity_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_8Identity_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7opendht_5_core_Identity[] = {
  {"publickey", __pyx_getprop_7opendht_5_core_8Identity_publickey, 0, 0, 0},
  {"certificate", __pyx_getprop_7opendht_5_core_8Identity_certificate, 0, 0, 0},
  {"key", __pyx_getprop_7opendht_5_core_8Identity_key, 0, 0, 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7opendht_5_core_Identity_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7opendht_5_core_Identity},
  {Py_tp_methods, (void *)__pyx_methods_7opendht_5_core_Identity},
  {Py_tp_getset, (void *)__pyx_getsets_7opendht_5_core_Identity},
  {Py_tp_init, (void *)__pyx_tp_init_7opendht_5_core_Identity},
  {Py_tp_new, (void *)__pyx_tp_new_7opendht_5_core_Identity},
  #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
  #if CYTHON_VECTORCALL_TPNEW
  {Py_tp_vectorcall, (void *)__pyx_tp_vectorcall_7opendht_5_core_Identity},
  #endif
  #endif
  {0, 0},
};
static PyType_Spec __pyx_type_7opendht_5_core_Identity_spec = {
  "opendht._core.Identity",
  sizeof(struct __pyx_obj_7opendht_5_core_Identity),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE,
  __pyx_type_7opendht_5_core_Identity_slots,
};
#else

static PyTypeObject __pyx_type_7opendht_5_core_Identity = {
  PyVarObject_HEAD_INIT(0, 0)
  "opendht._core.""Identity", /*tp_name*/
  sizeof(struct __pyx_obj_7opendht_5_core_Identity), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7opendht_5_core_Identity, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7opendht_5_core_Identity, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7opendht_5_core_Identity, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_tp_init_7opendht_5_core_Identity, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7opendht_5_core_Identity, /*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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
  #if CYTHON_VECTORCALL_TPNEW
  __pyx_tp_vectorcall_7opendht_5_core_Identity, /*tp_vectorcall*/
  #else
  NULL, /*tp_vectorcall*/
  #endif
  #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 < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new__initialisation_7opendht_5_core_DhtConfig(PyObject *o, 
#if CYTHON_VECTORCALL_TPNEW
    CYTHON_UNUSED PyObject *const *args, CYTHON_UNUSED Py_ssize_t nargs, CYTHON_UNUSED PyObject *kwnames
#else
    CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k
#endif
) {
  struct __pyx_obj_7opendht_5_core_DhtConfig *p = ((struct __pyx_obj_7opendht_5_core_DhtConfig *)o);
  __Pyx_default_placement_construct(&(p->_config));
  return o;
}

static PyObject *__pyx_tp_new_vectorcall_7opendht_5_core_DhtConfig(PyTypeObject *t, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
) {
  PyObject *o;
  o = __Pyx_AllocateExtensionType(t, 0);
  if (unlikely(!o)) return 0;
  return __pyx_tp_new__initialisation_7opendht_5_core_DhtConfig(o, 
#if CYTHON_VECTORCALL_TPNEW
    args, nargs, kwnames
#else
    a, k
#endif
);
}

#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_new_7opendht_5_core_DhtConfig(PyTypeObject *t, PyObject *a, PyObject *k) {
  return __Pyx_CallTpnewAsVectorcall(__pyx_tp_new_vectorcall_7opendht_5_core_DhtConfig, t, a, k);
}
#endif

#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_vectorcall_7opendht_5_core_DhtConfig(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
  if (unlikely((PyTypeObject*)t != __pyx_mstate_global->__pyx_ptype_7opendht_5_core_DhtConfig || __Pyx_PyType_HasFeature((PyTypeObject*)t, Py_TPFLAGS_IS_ABSTRACT))) {
    return __Pyx_CallNewInitFromVectorcall((PyTypeObject*)t, args, nargsf, kwnames);
  }
  Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
  PyObject *o = __pyx_tp_new_vectorcall_7opendht_5_core_DhtConfig((PyTypeObject*)t, args, nargs, kwnames);
  if (likely(o)) {
    assert(Py_TYPE(o) == (PyTypeObject*)t);
    if (unlikely(__pyx_pw_7opendht_5_core_9DhtConfig_1__init__(o, args, nargs, kwnames) < 0)) {
      Py_CLEAR(o);
    }
  }
  return o;
}
#endif

#if CYTHON_VECTORCALL_TPNEW
static int __pyx_tp_init_7opendht_5_core_DhtConfig(PyObject *o, PyObject *args, PyObject *kwds) {
  return __Pyx_CallTpinitAsVectorcall(__pyx_pw_7opendht_5_core_9DhtConfig_1__init__, o, args, kwds);
}
#endif

static void __pyx_tp_dealloc_7opendht_5_core_DhtConfig(PyObject *o) {
  struct __pyx_obj_7opendht_5_core_DhtConfig *p = (struct __pyx_obj_7opendht_5_core_DhtConfig *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7opendht_5_core_DhtConfig) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  __Pyx_call_destructor(p->_config);
  PyTypeObject *tp = Py_TYPE(o);
  #if CYTHON_USE_TYPE_SLOTS
  (*tp->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  Py_DECREF(tp);
  #endif
}

static PyMethodDef __pyx_methods_7opendht_5_core_DhtConfig[] = {
  {"setIdentity", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9DhtConfig_3setIdentity, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"setBootstrapMode", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9DhtConfig_5setBootstrapMode, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"setNodeId", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9DhtConfig_7setNodeId, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"setNetwork", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9DhtConfig_9setNetwork, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"setMaintainStorage", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9DhtConfig_11setMaintainStorage, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"setRateLimit", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9DhtConfig_13setRateLimit, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"setProxyInfo", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9DhtConfig_15setProxyInfo, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"setPeerDiscovery", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9DhtConfig_17setPeerDiscovery, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"setBound", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9DhtConfig_19setBound, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9DhtConfig_21__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9DhtConfig_23__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7opendht_5_core_DhtConfig_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7opendht_5_core_DhtConfig},
  {Py_tp_methods, (void *)__pyx_methods_7opendht_5_core_DhtConfig},
  {Py_tp_init, (void *)__pyx_tp_init_7opendht_5_core_DhtConfig},
  {Py_tp_new, (void *)__pyx_tp_new_7opendht_5_core_DhtConfig},
  #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
  #if CYTHON_VECTORCALL_TPNEW
  {Py_tp_vectorcall, (void *)__pyx_tp_vectorcall_7opendht_5_core_DhtConfig},
  #endif
  #endif
  {0, 0},
};
static PyType_Spec __pyx_type_7opendht_5_core_DhtConfig_spec = {
  "opendht._core.DhtConfig",
  sizeof(struct __pyx_obj_7opendht_5_core_DhtConfig),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE,
  __pyx_type_7opendht_5_core_DhtConfig_slots,
};
#else

static PyTypeObject __pyx_type_7opendht_5_core_DhtConfig = {
  PyVarObject_HEAD_INIT(0, 0)
  "opendht._core.""DhtConfig", /*tp_name*/
  sizeof(struct __pyx_obj_7opendht_5_core_DhtConfig), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7opendht_5_core_DhtConfig, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7opendht_5_core_DhtConfig, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_tp_init_7opendht_5_core_DhtConfig, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7opendht_5_core_DhtConfig, /*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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
  #if CYTHON_VECTORCALL_TPNEW
  __pyx_tp_vectorcall_7opendht_5_core_DhtConfig, /*tp_vectorcall*/
  #else
  NULL, /*tp_vectorcall*/
  #endif
  #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 < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new__initialisation_7opendht_5_core_DhtRunner(PyObject *o, 
#if CYTHON_VECTORCALL_TPNEW
    CYTHON_UNUSED PyObject *const *args, CYTHON_UNUSED Py_ssize_t nargs, CYTHON_UNUSED PyObject *kwnames
#else
    CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k
#endif
) {
  struct __pyx_obj_7opendht_5_core_DhtRunner *p = ((struct __pyx_obj_7opendht_5_core_DhtRunner *)o);
  __Pyx_default_placement_construct(&(p->thisptr));
  {
    int cinit_result = __pyx_pw_7opendht_5_core_9DhtRunner_1__cinit__(
    #if CYTHON_VECTORCALL_TPNEW
    o, NULL, 0, NULL);
    #else
    o, __pyx_mstate_global->__pyx_empty_tuple, NULL);
    #endif
    if (unlikely(cinit_result)) goto bad;
  }
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static PyObject *__pyx_tp_new_vectorcall_7opendht_5_core_DhtRunner(PyTypeObject *t, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
) {
  PyObject *o;
  o = __pyx_tp_new_vectorcall_7opendht_5_core__WithID(t, 
#if CYTHON_VECTORCALL_TPNEW
    args, nargs, kwnames
#else
    a, k
#endif
);
  if (unlikely(!o)) return 0;
  return __pyx_tp_new__initialisation_7opendht_5_core_DhtRunner(o, 
#if CYTHON_VECTORCALL_TPNEW
    args, nargs, kwnames
#else
    a, k
#endif
);
}

#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_new_7opendht_5_core_DhtRunner(PyTypeObject *t, PyObject *a, PyObject *k) {
  return __Pyx_CallTpnewAsVectorcall(__pyx_tp_new_vectorcall_7opendht_5_core_DhtRunner, t, a, k);
}
#endif

#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_vectorcall_7opendht_5_core_DhtRunner(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
  if (unlikely((PyTypeObject*)t != __pyx_mstate_global->__pyx_ptype_7opendht_5_core_DhtRunner || __Pyx_PyType_HasFeature((PyTypeObject*)t, Py_TPFLAGS_IS_ABSTRACT))) {
    return __Pyx_CallNewInitFromVectorcall((PyTypeObject*)t, args, nargsf, kwnames);
  }
  Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
  PyObject *o = __pyx_tp_new_vectorcall_7opendht_5_core_DhtRunner((PyTypeObject*)t, args, nargs, kwnames);
  return o;
}
#endif

static void __pyx_tp_dealloc_7opendht_5_core_DhtRunner(PyObject *o) {
  struct __pyx_obj_7opendht_5_core_DhtRunner *p = (struct __pyx_obj_7opendht_5_core_DhtRunner *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7opendht_5_core_DhtRunner) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  __Pyx_call_destructor(p->thisptr);
  __pyx_tp_dealloc_7opendht_5_core__WithID(o);
}

static PyMethodDef __pyx_methods_7opendht_5_core_DhtRunner[] = {
  {"getId", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9DhtRunner_3getId, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"getPublicKey", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9DhtRunner_5getPublicKey, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"getNodeId", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9DhtRunner_7getNodeId, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"ping", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9DhtRunner_9ping, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"bootstrap", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9DhtRunner_11bootstrap, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"run", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9DhtRunner_13run, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"join", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9DhtRunner_15join, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"shutdown", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9DhtRunner_17shutdown, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"registerType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9DhtRunner_19registerType, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"enableLogging", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9DhtRunner_21enableLogging, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"disableLogging", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9DhtRunner_23disableLogging, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"enableFileLogging", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9DhtRunner_25enableFileLogging, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"isRunning", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9DhtRunner_27isRunning, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"getBound", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9DhtRunner_29getBound, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"getStorageLog", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9DhtRunner_31getStorageLog, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"getRoutingTablesLog", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9DhtRunner_33getRoutingTablesLog, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"getSearchesLog", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9DhtRunner_35getSearchesLog, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"getNodeMessageStats", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9DhtRunner_37getNodeMessageStats, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"get", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9DhtRunner_39get, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7opendht_5_core_9DhtRunner_38get},
  {"put", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9DhtRunner_41put, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7opendht_5_core_9DhtRunner_40put},
  {"putSigned", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9DhtRunner_43putSigned, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"putEncrypted", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9DhtRunner_45putEncrypted, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"cancelPut", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9DhtRunner_47cancelPut, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"listen", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9DhtRunner_49listen, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"cancelListen", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9DhtRunner_51cancelListen, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9DhtRunner_53__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_9DhtRunner_55__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7opendht_5_core_DhtRunner_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7opendht_5_core_DhtRunner},
  {Py_tp_methods, (void *)__pyx_methods_7opendht_5_core_DhtRunner},
  {Py_tp_new, (void *)__pyx_tp_new_7opendht_5_core_DhtRunner},
  #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
  #if CYTHON_VECTORCALL_TPNEW
  {Py_tp_vectorcall, (void *)__pyx_tp_vectorcall_7opendht_5_core_DhtRunner},
  #endif
  #endif
  {0, 0},
};
static PyType_Spec __pyx_type_7opendht_5_core_DhtRunner_spec = {
  "opendht._core.DhtRunner",
  sizeof(struct __pyx_obj_7opendht_5_core_DhtRunner),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE,
  __pyx_type_7opendht_5_core_DhtRunner_slots,
};
#else

static PyTypeObject __pyx_type_7opendht_5_core_DhtRunner = {
  PyVarObject_HEAD_INIT(0, 0)
  "opendht._core.""DhtRunner", /*tp_name*/
  sizeof(struct __pyx_obj_7opendht_5_core_DhtRunner), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7opendht_5_core_DhtRunner, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_pw_7opendht_5_core_7_WithID_1__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_pw_7opendht_5_core_7_WithID_3__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7opendht_5_core_DhtRunner, /*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_7opendht_5_core_DhtRunner, /*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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
  #if CYTHON_VECTORCALL_TPNEW
  __pyx_tp_vectorcall_7opendht_5_core_DhtRunner, /*tp_vectorcall*/
  #else
  NULL, /*tp_vectorcall*/
  #endif
  #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 < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new__initialisation_7opendht_5_core_IndexValue(PyObject *o, 
#if CYTHON_VECTORCALL_TPNEW
    CYTHON_UNUSED PyObject *const *args, CYTHON_UNUSED Py_ssize_t nargs, CYTHON_UNUSED PyObject *kwnames
#else
    CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k
#endif
) {
  struct __pyx_obj_7opendht_5_core_IndexValue *p = ((struct __pyx_obj_7opendht_5_core_IndexValue *)o);
  __Pyx_default_placement_construct(&(p->_value));
  return o;
}

static PyObject *__pyx_tp_new_vectorcall_7opendht_5_core_IndexValue(PyTypeObject *t, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
) {
  PyObject *o;
  o = __Pyx_AllocateExtensionType(t, 0);
  if (unlikely(!o)) return 0;
  return __pyx_tp_new__initialisation_7opendht_5_core_IndexValue(o, 
#if CYTHON_VECTORCALL_TPNEW
    args, nargs, kwnames
#else
    a, k
#endif
);
}

#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_new_7opendht_5_core_IndexValue(PyTypeObject *t, PyObject *a, PyObject *k) {
  return __Pyx_CallTpnewAsVectorcall(__pyx_tp_new_vectorcall_7opendht_5_core_IndexValue, t, a, k);
}
#endif

#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_vectorcall_7opendht_5_core_IndexValue(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
  if (unlikely((PyTypeObject*)t != __pyx_mstate_global->__pyx_ptype_7opendht_5_core_IndexValue || __Pyx_PyType_HasFeature((PyTypeObject*)t, Py_TPFLAGS_IS_ABSTRACT))) {
    return __Pyx_CallNewInitFromVectorcall((PyTypeObject*)t, args, nargsf, kwnames);
  }
  Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
  PyObject *o = __pyx_tp_new_vectorcall_7opendht_5_core_IndexValue((PyTypeObject*)t, args, nargs, kwnames);
  if (likely(o)) {
    assert(Py_TYPE(o) == (PyTypeObject*)t);
    if (unlikely(__pyx_pw_7opendht_5_core_10IndexValue_1__init__(o, args, nargs, kwnames) < 0)) {
      Py_CLEAR(o);
    }
  }
  return o;
}
#endif

#if CYTHON_VECTORCALL_TPNEW
static int __pyx_tp_init_7opendht_5_core_IndexValue(PyObject *o, PyObject *args, PyObject *kwds) {
  return __Pyx_CallTpinitAsVectorcall(__pyx_pw_7opendht_5_core_10IndexValue_1__init__, o, args, kwds);
}
#endif

static void __pyx_tp_dealloc_7opendht_5_core_IndexValue(PyObject *o) {
  struct __pyx_obj_7opendht_5_core_IndexValue *p = (struct __pyx_obj_7opendht_5_core_IndexValue *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7opendht_5_core_IndexValue) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  __Pyx_call_destructor(p->_value);
  PyTypeObject *tp = Py_TYPE(o);
  #if CYTHON_USE_TYPE_SLOTS
  (*tp->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  Py_DECREF(tp);
  #endif
}

static PyMethodDef __pyx_methods_7opendht_5_core_IndexValue[] = {
  {"getKey", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_10IndexValue_5getKey, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"getValueId", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_10IndexValue_7getValueId, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_10IndexValue_9__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_10IndexValue_11__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7opendht_5_core_IndexValue_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7opendht_5_core_IndexValue},
  {Py_tp_str, (void *)__pyx_pw_7opendht_5_core_10IndexValue_3__str__},
  {Py_tp_methods, (void *)__pyx_methods_7opendht_5_core_IndexValue},
  {Py_tp_init, (void *)__pyx_tp_init_7opendht_5_core_IndexValue},
  {Py_tp_new, (void *)__pyx_tp_new_7opendht_5_core_IndexValue},
  #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
  #if CYTHON_VECTORCALL_TPNEW
  {Py_tp_vectorcall, (void *)__pyx_tp_vectorcall_7opendht_5_core_IndexValue},
  #endif
  #endif
  {0, 0},
};
static PyType_Spec __pyx_type_7opendht_5_core_IndexValue_spec = {
  "opendht._core.IndexValue",
  sizeof(struct __pyx_obj_7opendht_5_core_IndexValue),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE,
  __pyx_type_7opendht_5_core_IndexValue_slots,
};
#else

static PyTypeObject __pyx_type_7opendht_5_core_IndexValue = {
  PyVarObject_HEAD_INIT(0, 0)
  "opendht._core.""IndexValue", /*tp_name*/
  sizeof(struct __pyx_obj_7opendht_5_core_IndexValue), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7opendht_5_core_IndexValue, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pw_7opendht_5_core_10IndexValue_3__str__, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7opendht_5_core_IndexValue, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_tp_init_7opendht_5_core_IndexValue, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7opendht_5_core_IndexValue, /*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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
  #if CYTHON_VECTORCALL_TPNEW
  __pyx_tp_vectorcall_7opendht_5_core_IndexValue, /*tp_vectorcall*/
  #else
  NULL, /*tp_vectorcall*/
  #endif
  #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 < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new__initialisation_7opendht_5_core_Pht(PyObject *o, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
) {
  {
    int cinit_result = __pyx_pw_7opendht_5_core_3Pht_1__cinit__(o, 
#if CYTHON_VECTORCALL_TPNEW
    args, nargs, kwnames
#else
    a, k
#endif
);
    if (unlikely(cinit_result)) goto bad;
  }
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static PyObject *__pyx_tp_new_vectorcall_7opendht_5_core_Pht(PyTypeObject *t, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
) {
  PyObject *o;
  o = __Pyx_AllocateExtensionType(t, 0);
  if (unlikely(!o)) return 0;
  return __pyx_tp_new__initialisation_7opendht_5_core_Pht(o, 
#if CYTHON_VECTORCALL_TPNEW
    args, nargs, kwnames
#else
    a, k
#endif
);
}

#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_new_7opendht_5_core_Pht(PyTypeObject *t, PyObject *a, PyObject *k) {
  return __Pyx_CallTpnewAsVectorcall(__pyx_tp_new_vectorcall_7opendht_5_core_Pht, t, a, k);
}
#endif

#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_vectorcall_7opendht_5_core_Pht(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
  if (unlikely((PyTypeObject*)t != __pyx_mstate_global->__pyx_ptype_7opendht_5_core_Pht || __Pyx_PyType_HasFeature((PyTypeObject*)t, Py_TPFLAGS_IS_ABSTRACT))) {
    return __Pyx_CallNewInitFromVectorcall((PyTypeObject*)t, args, nargsf, kwnames);
  }
  Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
  PyObject *o = __pyx_tp_new_vectorcall_7opendht_5_core_Pht((PyTypeObject*)t, args, nargs, kwnames);
  return o;
}
#endif

static void __pyx_tp_dealloc_7opendht_5_core_Pht(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7opendht_5_core_Pht) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyTypeObject *tp = Py_TYPE(o);
  #if CYTHON_USE_TYPE_SLOTS
  (*tp->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  Py_DECREF(tp);
  #endif
}

static PyObject *__pyx_getprop_7opendht_5_core_3Pht_MAX_NODE_ENTRY_COUNT(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7opendht_5_core_3Pht_20MAX_NODE_ENTRY_COUNT_1__get__(o);
}

static PyMethodDef __pyx_methods_7opendht_5_core_Pht[] = {
  {"lookup", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_3Pht_3lookup, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7opendht_5_core_3Pht_2lookup},
  {"insert", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_3Pht_5insert, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7opendht_5_core_3Pht_4insert},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_3Pht_7__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7opendht_5_core_3Pht_9__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7opendht_5_core_Pht[] = {
  {"MAX_NODE_ENTRY_COUNT", __pyx_getprop_7opendht_5_core_3Pht_MAX_NODE_ENTRY_COUNT, 0, 0, 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7opendht_5_core_Pht_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7opendht_5_core_Pht},
  {Py_tp_methods, (void *)__pyx_methods_7opendht_5_core_Pht},
  {Py_tp_getset, (void *)__pyx_getsets_7opendht_5_core_Pht},
  {Py_tp_new, (void *)__pyx_tp_new_7opendht_5_core_Pht},
  #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
  #if CYTHON_VECTORCALL_TPNEW
  {Py_tp_vectorcall, (void *)__pyx_tp_vectorcall_7opendht_5_core_Pht},
  #endif
  #endif
  {0, 0},
};
static PyType_Spec __pyx_type_7opendht_5_core_Pht_spec = {
  "opendht._core.Pht",
  sizeof(struct __pyx_obj_7opendht_5_core_Pht),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE,
  __pyx_type_7opendht_5_core_Pht_slots,
};
#else

static PyTypeObject __pyx_type_7opendht_5_core_Pht = {
  PyVarObject_HEAD_INIT(0, 0)
  "opendht._core.""Pht", /*tp_name*/
  sizeof(struct __pyx_obj_7opendht_5_core_Pht), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7opendht_5_core_Pht, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7opendht_5_core_Pht, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7opendht_5_core_Pht, /*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_7opendht_5_core_Pht, /*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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
  #if CYTHON_VECTORCALL_TPNEW
  __pyx_tp_vectorcall_7opendht_5_core_Pht, /*tp_vectorcall*/
  #else
  NULL, /*tp_vectorcall*/
  #endif
  #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 < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new__initialisation_7opendht_5_core___pyx_scope_struct__ping(PyObject *o, 
#if CYTHON_VECTORCALL_TPNEW
    CYTHON_UNUSED PyObject *const *args, CYTHON_UNUSED Py_ssize_t nargs, CYTHON_UNUSED PyObject *kwnames
#else
    CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k
#endif
) {
  return o;
}

static PyObject *__pyx_tp_new_vectorcall_7opendht_5_core___pyx_scope_struct__ping(PyTypeObject *t, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
) {
  PyObject *o;
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_7opendht_5_core___pyx_scope_struct__ping > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_7opendht_5_core___pyx_scope_struct__ping, sizeof(struct __pyx_obj_7opendht_5_core___pyx_scope_struct__ping))))
  {
    o = (PyObject*)__pyx_mstate_global->__pyx_freelist_7opendht_5_core___pyx_scope_struct__ping[--__pyx_mstate_global->__pyx_freecount_7opendht_5_core___pyx_scope_struct__ping];
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(Py_TYPE(o));
    #endif
    memset(o, 0, sizeof(struct __pyx_obj_7opendht_5_core___pyx_scope_struct__ping));
    #if CYTHON_COMPILING_IN_LIMITED_API
    (void) PyObject_Init(o, t);
    #else
    (void) PyObject_INIT(o, t);
    #endif
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = __Pyx_AllocateExtensionType(t, 1);
  }
  if (unlikely(!o)) return 0;
  return __pyx_tp_new__initialisation_7opendht_5_core___pyx_scope_struct__ping(o, 
#if CYTHON_VECTORCALL_TPNEW
    args, nargs, kwnames
#else
    a, k
#endif
);
}

#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_new_7opendht_5_core___pyx_scope_struct__ping(PyTypeObject *t, PyObject *a, PyObject *k) {
  return __Pyx_CallTpnewAsVectorcall(__pyx_tp_new_vectorcall_7opendht_5_core___pyx_scope_struct__ping, t, a, k);
}
#endif

#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_vectorcall_7opendht_5_core___pyx_scope_struct__ping(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
  if (unlikely((PyTypeObject*)t != __pyx_mstate_global->__pyx_ptype_7opendht_5_core___pyx_scope_struct__ping || __Pyx_PyType_HasFeature((PyTypeObject*)t, Py_TPFLAGS_IS_ABSTRACT))) {
    return __Pyx_CallNewInitFromVectorcall((PyTypeObject*)t, args, nargsf, kwnames);
  }
  Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
  PyObject *o = __pyx_tp_new_vectorcall_7opendht_5_core___pyx_scope_struct__ping((PyTypeObject*)t, args, nargs, kwnames);
  return o;
}
#endif

static void __pyx_tp_dealloc_7opendht_5_core___pyx_scope_struct__ping(PyObject *o) {
  struct __pyx_obj_7opendht_5_core___pyx_scope_struct__ping *p = (struct __pyx_obj_7opendht_5_core___pyx_scope_struct__ping *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7opendht_5_core___pyx_scope_struct__ping) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_lock);
  Py_CLEAR(p->__pyx_v_ok);
  Py_CLEAR(p->__pyx_v_pending);
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_7opendht_5_core___pyx_scope_struct__ping < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_7opendht_5_core___pyx_scope_struct__ping, sizeof(struct __pyx_obj_7opendht_5_core___pyx_scope_struct__ping))))
  {
    __pyx_mstate_global->__pyx_freelist_7opendht_5_core___pyx_scope_struct__ping[__pyx_mstate_global->__pyx_freecount_7opendht_5_core___pyx_scope_struct__ping++] = ((struct __pyx_obj_7opendht_5_core___pyx_scope_struct__ping *)o);
  } else
  #endif
  {
    PyTypeObject *tp = Py_TYPE(o);
    #if CYTHON_USE_TYPE_SLOTS
    (*tp->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(tp);
    #endif
  }
}

static int __pyx_tp_traverse_7opendht_5_core___pyx_scope_struct__ping(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7opendht_5_core___pyx_scope_struct__ping *p = (struct __pyx_obj_7opendht_5_core___pyx_scope_struct__ping *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->__pyx_v_lock) {
    e = (*v)(p->__pyx_v_lock, a); if (e) return e;
  }
  if (p->__pyx_v_ok) {
    e = (*v)(p->__pyx_v_ok, a); if (e) return e;
  }
  if (p->__pyx_v_pending) {
    e = (*v)(p->__pyx_v_pending, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7opendht_5_core___pyx_scope_struct__ping(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7opendht_5_core___pyx_scope_struct__ping *p = (struct __pyx_obj_7opendht_5_core___pyx_scope_struct__ping *)o;
  tmp = ((PyObject*)p->__pyx_v_lock);
  p->__pyx_v_lock = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_ok);
  p->__pyx_v_ok = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_pending);
  p->__pyx_v_pending = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7opendht_5_core___pyx_scope_struct__ping_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7opendht_5_core___pyx_scope_struct__ping},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7opendht_5_core___pyx_scope_struct__ping},
  {Py_tp_clear, (void *)__pyx_tp_clear_7opendht_5_core___pyx_scope_struct__ping},
  {Py_tp_new, (void *)__pyx_tp_new_7opendht_5_core___pyx_scope_struct__ping},
  #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
  #if CYTHON_VECTORCALL_TPNEW
  {Py_tp_vectorcall, (void *)__pyx_tp_vectorcall_7opendht_5_core___pyx_scope_struct__ping},
  #endif
  #endif
  {0, 0},
};
static PyType_Spec __pyx_type_7opendht_5_core___pyx_scope_struct__ping_spec = {
  "opendht._core.__pyx_scope_struct__ping",
  sizeof(struct __pyx_obj_7opendht_5_core___pyx_scope_struct__ping),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_HAVE_GC,
  __pyx_type_7opendht_5_core___pyx_scope_struct__ping_slots,
};
#else

static PyTypeObject __pyx_type_7opendht_5_core___pyx_scope_struct__ping = {
  PyVarObject_HEAD_INIT(0, 0)
  "opendht._core.""__pyx_scope_struct__ping", /*tp_name*/
  sizeof(struct __pyx_obj_7opendht_5_core___pyx_scope_struct__ping), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7opendht_5_core___pyx_scope_struct__ping, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7opendht_5_core___pyx_scope_struct__ping, /*tp_traverse*/
  __pyx_tp_clear_7opendht_5_core___pyx_scope_struct__ping, /*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_7opendht_5_core___pyx_scope_struct__ping, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
  #if CYTHON_VECTORCALL_TPNEW
  __pyx_tp_vectorcall_7opendht_5_core___pyx_scope_struct__ping, /*tp_vectorcall*/
  #else
  NULL, /*tp_vectorcall*/
  #endif
  #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 < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new__initialisation_7opendht_5_core___pyx_scope_struct_1_get(PyObject *o, 
#if CYTHON_VECTORCALL_TPNEW
    CYTHON_UNUSED PyObject *const *args, CYTHON_UNUSED Py_ssize_t nargs, CYTHON_UNUSED PyObject *kwnames
#else
    CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k
#endif
) {
  return o;
}

static PyObject *__pyx_tp_new_vectorcall_7opendht_5_core___pyx_scope_struct_1_get(PyTypeObject *t, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
) {
  PyObject *o;
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_7opendht_5_core___pyx_scope_struct_1_get > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_7opendht_5_core___pyx_scope_struct_1_get, sizeof(struct __pyx_obj_7opendht_5_core___pyx_scope_struct_1_get))))
  {
    o = (PyObject*)__pyx_mstate_global->__pyx_freelist_7opendht_5_core___pyx_scope_struct_1_get[--__pyx_mstate_global->__pyx_freecount_7opendht_5_core___pyx_scope_struct_1_get];
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(Py_TYPE(o));
    #endif
    memset(o, 0, sizeof(struct __pyx_obj_7opendht_5_core___pyx_scope_struct_1_get));
    #if CYTHON_COMPILING_IN_LIMITED_API
    (void) PyObject_Init(o, t);
    #else
    (void) PyObject_INIT(o, t);
    #endif
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = __Pyx_AllocateExtensionType(t, 1);
  }
  if (unlikely(!o)) return 0;
  return __pyx_tp_new__initialisation_7opendht_5_core___pyx_scope_struct_1_get(o, 
#if CYTHON_VECTORCALL_TPNEW
    args, nargs, kwnames
#else
    a, k
#endif
);
}

#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_new_7opendht_5_core___pyx_scope_struct_1_get(PyTypeObject *t, PyObject *a, PyObject *k) {
  return __Pyx_CallTpnewAsVectorcall(__pyx_tp_new_vectorcall_7opendht_5_core___pyx_scope_struct_1_get, t, a, k);
}
#endif

#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_vectorcall_7opendht_5_core___pyx_scope_struct_1_get(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
  if (unlikely((PyTypeObject*)t != __pyx_mstate_global->__pyx_ptype_7opendht_5_core___pyx_scope_struct_1_get || __Pyx_PyType_HasFeature((PyTypeObject*)t, Py_TPFLAGS_IS_ABSTRACT))) {
    return __Pyx_CallNewInitFromVectorcall((PyTypeObject*)t, args, nargsf, kwnames);
  }
  Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
  PyObject *o = __pyx_tp_new_vectorcall_7opendht_5_core___pyx_scope_struct_1_get((PyTypeObject*)t, args, nargs, kwnames);
  return o;
}
#endif

static void __pyx_tp_dealloc_7opendht_5_core___pyx_scope_struct_1_get(PyObject *o) {
  struct __pyx_obj_7opendht_5_core___pyx_scope_struct_1_get *p = (struct __pyx_obj_7opendht_5_core___pyx_scope_struct_1_get *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7opendht_5_core___pyx_scope_struct_1_get) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_lock);
  Py_CLEAR(p->__pyx_v_pending);
  Py_CLEAR(p->__pyx_v_res);
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_7opendht_5_core___pyx_scope_struct_1_get < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_7opendht_5_core___pyx_scope_struct_1_get, sizeof(struct __pyx_obj_7opendht_5_core___pyx_scope_struct_1_get))))
  {
    __pyx_mstate_global->__pyx_freelist_7opendht_5_core___pyx_scope_struct_1_get[__pyx_mstate_global->__pyx_freecount_7opendht_5_core___pyx_scope_struct_1_get++] = ((struct __pyx_obj_7opendht_5_core___pyx_scope_struct_1_get *)o);
  } else
  #endif
  {
    PyTypeObject *tp = Py_TYPE(o);
    #if CYTHON_USE_TYPE_SLOTS
    (*tp->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(tp);
    #endif
  }
}

static int __pyx_tp_traverse_7opendht_5_core___pyx_scope_struct_1_get(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7opendht_5_core___pyx_scope_struct_1_get *p = (struct __pyx_obj_7opendht_5_core___pyx_scope_struct_1_get *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->__pyx_v_lock) {
    e = (*v)(p->__pyx_v_lock, a); if (e) return e;
  }
  if (p->__pyx_v_pending) {
    e = (*v)(p->__pyx_v_pending, a); if (e) return e;
  }
  if (p->__pyx_v_res) {
    e = (*v)(p->__pyx_v_res, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7opendht_5_core___pyx_scope_struct_1_get(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7opendht_5_core___pyx_scope_struct_1_get *p = (struct __pyx_obj_7opendht_5_core___pyx_scope_struct_1_get *)o;
  tmp = ((PyObject*)p->__pyx_v_lock);
  p->__pyx_v_lock = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_pending);
  p->__pyx_v_pending = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_res);
  p->__pyx_v_res = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7opendht_5_core___pyx_scope_struct_1_get_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7opendht_5_core___pyx_scope_struct_1_get},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7opendht_5_core___pyx_scope_struct_1_get},
  {Py_tp_clear, (void *)__pyx_tp_clear_7opendht_5_core___pyx_scope_struct_1_get},
  {Py_tp_new, (void *)__pyx_tp_new_7opendht_5_core___pyx_scope_struct_1_get},
  #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
  #if CYTHON_VECTORCALL_TPNEW
  {Py_tp_vectorcall, (void *)__pyx_tp_vectorcall_7opendht_5_core___pyx_scope_struct_1_get},
  #endif
  #endif
  {0, 0},
};
static PyType_Spec __pyx_type_7opendht_5_core___pyx_scope_struct_1_get_spec = {
  "opendht._core.__pyx_scope_struct_1_get",
  sizeof(struct __pyx_obj_7opendht_5_core___pyx_scope_struct_1_get),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_HAVE_GC,
  __pyx_type_7opendht_5_core___pyx_scope_struct_1_get_slots,
};
#else

static PyTypeObject __pyx_type_7opendht_5_core___pyx_scope_struct_1_get = {
  PyVarObject_HEAD_INIT(0, 0)
  "opendht._core.""__pyx_scope_struct_1_get", /*tp_name*/
  sizeof(struct __pyx_obj_7opendht_5_core___pyx_scope_struct_1_get), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7opendht_5_core___pyx_scope_struct_1_get, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7opendht_5_core___pyx_scope_struct_1_get, /*tp_traverse*/
  __pyx_tp_clear_7opendht_5_core___pyx_scope_struct_1_get, /*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_7opendht_5_core___pyx_scope_struct_1_get, /*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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
  #if CYTHON_VECTORCALL_TPNEW
  __pyx_tp_vectorcall_7opendht_5_core___pyx_scope_struct_1_get, /*tp_vectorcall*/
  #else
  NULL, /*tp_vectorcall*/
  #endif
  #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 < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new__initialisation_7opendht_5_core___pyx_scope_struct_2_put(PyObject *o, 
#if CYTHON_VECTORCALL_TPNEW
    CYTHON_UNUSED PyObject *const *args, CYTHON_UNUSED Py_ssize_t nargs, CYTHON_UNUSED PyObject *kwnames
#else
    CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k
#endif
) {
  return o;
}

static PyObject *__pyx_tp_new_vectorcall_7opendht_5_core___pyx_scope_struct_2_put(PyTypeObject *t, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
) {
  PyObject *o;
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_7opendht_5_core___pyx_scope_struct_2_put > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_7opendht_5_core___pyx_scope_struct_2_put, sizeof(struct __pyx_obj_7opendht_5_core___pyx_scope_struct_2_put))))
  {
    o = (PyObject*)__pyx_mstate_global->__pyx_freelist_7opendht_5_core___pyx_scope_struct_2_put[--__pyx_mstate_global->__pyx_freecount_7opendht_5_core___pyx_scope_struct_2_put];
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(Py_TYPE(o));
    #endif
    memset(o, 0, sizeof(struct __pyx_obj_7opendht_5_core___pyx_scope_struct_2_put));
    #if CYTHON_COMPILING_IN_LIMITED_API
    (void) PyObject_Init(o, t);
    #else
    (void) PyObject_INIT(o, t);
    #endif
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = __Pyx_AllocateExtensionType(t, 1);
  }
  if (unlikely(!o)) return 0;
  return __pyx_tp_new__initialisation_7opendht_5_core___pyx_scope_struct_2_put(o, 
#if CYTHON_VECTORCALL_TPNEW
    args, nargs, kwnames
#else
    a, k
#endif
);
}

#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_new_7opendht_5_core___pyx_scope_struct_2_put(PyTypeObject *t, PyObject *a, PyObject *k) {
  return __Pyx_CallTpnewAsVectorcall(__pyx_tp_new_vectorcall_7opendht_5_core___pyx_scope_struct_2_put, t, a, k);
}
#endif

#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_vectorcall_7opendht_5_core___pyx_scope_struct_2_put(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
  if (unlikely((PyTypeObject*)t != __pyx_mstate_global->__pyx_ptype_7opendht_5_core___pyx_scope_struct_2_put || __Pyx_PyType_HasFeature((PyTypeObject*)t, Py_TPFLAGS_IS_ABSTRACT))) {
    return __Pyx_CallNewInitFromVectorcall((PyTypeObject*)t, args, nargsf, kwnames);
  }
  Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
  PyObject *o = __pyx_tp_new_vectorcall_7opendht_5_core___pyx_scope_struct_2_put((PyTypeObject*)t, args, nargs, kwnames);
  return o;
}
#endif

static void __pyx_tp_dealloc_7opendht_5_core___pyx_scope_struct_2_put(PyObject *o) {
  struct __pyx_obj_7opendht_5_core___pyx_scope_struct_2_put *p = (struct __pyx_obj_7opendht_5_core___pyx_scope_struct_2_put *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7opendht_5_core___pyx_scope_struct_2_put) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_lock);
  Py_CLEAR(p->__pyx_v_ok);
  Py_CLEAR(p->__pyx_v_pending);
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_7opendht_5_core___pyx_scope_struct_2_put < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_7opendht_5_core___pyx_scope_struct_2_put, sizeof(struct __pyx_obj_7opendht_5_core___pyx_scope_struct_2_put))))
  {
    __pyx_mstate_global->__pyx_freelist_7opendht_5_core___pyx_scope_struct_2_put[__pyx_mstate_global->__pyx_freecount_7opendht_5_core___pyx_scope_struct_2_put++] = ((struct __pyx_obj_7opendht_5_core___pyx_scope_struct_2_put *)o);
  } else
  #endif
  {
    PyTypeObject *tp = Py_TYPE(o);
    #if CYTHON_USE_TYPE_SLOTS
    (*tp->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(tp);
    #endif
  }
}

static int __pyx_tp_traverse_7opendht_5_core___pyx_scope_struct_2_put(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7opendht_5_core___pyx_scope_struct_2_put *p = (struct __pyx_obj_7opendht_5_core___pyx_scope_struct_2_put *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->__pyx_v_lock) {
    e = (*v)(p->__pyx_v_lock, a); if (e) return e;
  }
  if (p->__pyx_v_ok) {
    e = (*v)(p->__pyx_v_ok, a); if (e) return e;
  }
  if (p->__pyx_v_pending) {
    e = (*v)(p->__pyx_v_pending, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7opendht_5_core___pyx_scope_struct_2_put(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7opendht_5_core___pyx_scope_struct_2_put *p = (struct __pyx_obj_7opendht_5_core___pyx_scope_struct_2_put *)o;
  tmp = ((PyObject*)p->__pyx_v_lock);
  p->__pyx_v_lock = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_ok);
  p->__pyx_v_ok = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_pending);
  p->__pyx_v_pending = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7opendht_5_core___pyx_scope_struct_2_put_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7opendht_5_core___pyx_scope_struct_2_put},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7opendht_5_core___pyx_scope_struct_2_put},
  {Py_tp_clear, (void *)__pyx_tp_clear_7opendht_5_core___pyx_scope_struct_2_put},
  {Py_tp_new, (void *)__pyx_tp_new_7opendht_5_core___pyx_scope_struct_2_put},
  #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
  #if CYTHON_VECTORCALL_TPNEW
  {Py_tp_vectorcall, (void *)__pyx_tp_vectorcall_7opendht_5_core___pyx_scope_struct_2_put},
  #endif
  #endif
  {0, 0},
};
static PyType_Spec __pyx_type_7opendht_5_core___pyx_scope_struct_2_put_spec = {
  "opendht._core.__pyx_scope_struct_2_put",
  sizeof(struct __pyx_obj_7opendht_5_core___pyx_scope_struct_2_put),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_HAVE_GC,
  __pyx_type_7opendht_5_core___pyx_scope_struct_2_put_slots,
};
#else

static PyTypeObject __pyx_type_7opendht_5_core___pyx_scope_struct_2_put = {
  PyVarObject_HEAD_INIT(0, 0)
  "opendht._core.""__pyx_scope_struct_2_put", /*tp_name*/
  sizeof(struct __pyx_obj_7opendht_5_core___pyx_scope_struct_2_put), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7opendht_5_core___pyx_scope_struct_2_put, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7opendht_5_core___pyx_scope_struct_2_put, /*tp_traverse*/
  __pyx_tp_clear_7opendht_5_core___pyx_scope_struct_2_put, /*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_7opendht_5_core___pyx_scope_struct_2_put, /*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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
  #if CYTHON_VECTORCALL_TPNEW
  __pyx_tp_vectorcall_7opendht_5_core___pyx_scope_struct_2_put, /*tp_vectorcall*/
  #else
  NULL, /*tp_vectorcall*/
  #endif
  #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 < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new__initialisation_7opendht_5_core___pyx_scope_struct_3_putSigned(PyObject *o, 
#if CYTHON_VECTORCALL_TPNEW
    CYTHON_UNUSED PyObject *const *args, CYTHON_UNUSED Py_ssize_t nargs, CYTHON_UNUSED PyObject *kwnames
#else
    CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k
#endif
) {
  return o;
}

static PyObject *__pyx_tp_new_vectorcall_7opendht_5_core___pyx_scope_struct_3_putSigned(PyTypeObject *t, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
) {
  PyObject *o;
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_7opendht_5_core___pyx_scope_struct_3_putSigned > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_7opendht_5_core___pyx_scope_struct_3_putSigned, sizeof(struct __pyx_obj_7opendht_5_core___pyx_scope_struct_3_putSigned))))
  {
    o = (PyObject*)__pyx_mstate_global->__pyx_freelist_7opendht_5_core___pyx_scope_struct_3_putSigned[--__pyx_mstate_global->__pyx_freecount_7opendht_5_core___pyx_scope_struct_3_putSigned];
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(Py_TYPE(o));
    #endif
    memset(o, 0, sizeof(struct __pyx_obj_7opendht_5_core___pyx_scope_struct_3_putSigned));
    #if CYTHON_COMPILING_IN_LIMITED_API
    (void) PyObject_Init(o, t);
    #else
    (void) PyObject_INIT(o, t);
    #endif
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = __Pyx_AllocateExtensionType(t, 1);
  }
  if (unlikely(!o)) return 0;
  return __pyx_tp_new__initialisation_7opendht_5_core___pyx_scope_struct_3_putSigned(o, 
#if CYTHON_VECTORCALL_TPNEW
    args, nargs, kwnames
#else
    a, k
#endif
);
}

#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_new_7opendht_5_core___pyx_scope_struct_3_putSigned(PyTypeObject *t, PyObject *a, PyObject *k) {
  return __Pyx_CallTpnewAsVectorcall(__pyx_tp_new_vectorcall_7opendht_5_core___pyx_scope_struct_3_putSigned, t, a, k);
}
#endif

#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_vectorcall_7opendht_5_core___pyx_scope_struct_3_putSigned(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
  if (unlikely((PyTypeObject*)t != __pyx_mstate_global->__pyx_ptype_7opendht_5_core___pyx_scope_struct_3_putSigned || __Pyx_PyType_HasFeature((PyTypeObject*)t, Py_TPFLAGS_IS_ABSTRACT))) {
    return __Pyx_CallNewInitFromVectorcall((PyTypeObject*)t, args, nargsf, kwnames);
  }
  Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
  PyObject *o = __pyx_tp_new_vectorcall_7opendht_5_core___pyx_scope_struct_3_putSigned((PyTypeObject*)t, args, nargs, kwnames);
  return o;
}
#endif

static void __pyx_tp_dealloc_7opendht_5_core___pyx_scope_struct_3_putSigned(PyObject *o) {
  struct __pyx_obj_7opendht_5_core___pyx_scope_struct_3_putSigned *p = (struct __pyx_obj_7opendht_5_core___pyx_scope_struct_3_putSigned *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7opendht_5_core___pyx_scope_struct_3_putSigned) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_lock);
  Py_CLEAR(p->__pyx_v_ok);
  Py_CLEAR(p->__pyx_v_pending);
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_7opendht_5_core___pyx_scope_struct_3_putSigned < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_7opendht_5_core___pyx_scope_struct_3_putSigned, sizeof(struct __pyx_obj_7opendht_5_core___pyx_scope_struct_3_putSigned))))
  {
    __pyx_mstate_global->__pyx_freelist_7opendht_5_core___pyx_scope_struct_3_putSigned[__pyx_mstate_global->__pyx_freecount_7opendht_5_core___pyx_scope_struct_3_putSigned++] = ((struct __pyx_obj_7opendht_5_core___pyx_scope_struct_3_putSigned *)o);
  } else
  #endif
  {
    PyTypeObject *tp = Py_TYPE(o);
    #if CYTHON_USE_TYPE_SLOTS
    (*tp->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(tp);
    #endif
  }
}

static int __pyx_tp_traverse_7opendht_5_core___pyx_scope_struct_3_putSigned(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7opendht_5_core___pyx_scope_struct_3_putSigned *p = (struct __pyx_obj_7opendht_5_core___pyx_scope_struct_3_putSigned *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->__pyx_v_lock) {
    e = (*v)(p->__pyx_v_lock, a); if (e) return e;
  }
  if (p->__pyx_v_ok) {
    e = (*v)(p->__pyx_v_ok, a); if (e) return e;
  }
  if (p->__pyx_v_pending) {
    e = (*v)(p->__pyx_v_pending, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7opendht_5_core___pyx_scope_struct_3_putSigned(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7opendht_5_core___pyx_scope_struct_3_putSigned *p = (struct __pyx_obj_7opendht_5_core___pyx_scope_struct_3_putSigned *)o;
  tmp = ((PyObject*)p->__pyx_v_lock);
  p->__pyx_v_lock = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_ok);
  p->__pyx_v_ok = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_pending);
  p->__pyx_v_pending = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7opendht_5_core___pyx_scope_struct_3_putSigned_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7opendht_5_core___pyx_scope_struct_3_putSigned},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7opendht_5_core___pyx_scope_struct_3_putSigned},
  {Py_tp_clear, (void *)__pyx_tp_clear_7opendht_5_core___pyx_scope_struct_3_putSigned},
  {Py_tp_new, (void *)__pyx_tp_new_7opendht_5_core___pyx_scope_struct_3_putSigned},
  #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
  #if CYTHON_VECTORCALL_TPNEW
  {Py_tp_vectorcall, (void *)__pyx_tp_vectorcall_7opendht_5_core___pyx_scope_struct_3_putSigned},
  #endif
  #endif
  {0, 0},
};
static PyType_Spec __pyx_type_7opendht_5_core___pyx_scope_struct_3_putSigned_spec = {
  "opendht._core.__pyx_scope_struct_3_putSigned",
  sizeof(struct __pyx_obj_7opendht_5_core___pyx_scope_struct_3_putSigned),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_HAVE_GC,
  __pyx_type_7opendht_5_core___pyx_scope_struct_3_putSigned_slots,
};
#else

static PyTypeObject __pyx_type_7opendht_5_core___pyx_scope_struct_3_putSigned = {
  PyVarObject_HEAD_INIT(0, 0)
  "opendht._core.""__pyx_scope_struct_3_putSigned", /*tp_name*/
  sizeof(struct __pyx_obj_7opendht_5_core___pyx_scope_struct_3_putSigned), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7opendht_5_core___pyx_scope_struct_3_putSigned, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7opendht_5_core___pyx_scope_struct_3_putSigned, /*tp_traverse*/
  __pyx_tp_clear_7opendht_5_core___pyx_scope_struct_3_putSigned, /*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_7opendht_5_core___pyx_scope_struct_3_putSigned, /*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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
  #if CYTHON_VECTORCALL_TPNEW
  __pyx_tp_vectorcall_7opendht_5_core___pyx_scope_struct_3_putSigned, /*tp_vectorcall*/
  #else
  NULL, /*tp_vectorcall*/
  #endif
  #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 < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new__initialisation_7opendht_5_core___pyx_scope_struct_4_putEncrypted(PyObject *o, 
#if CYTHON_VECTORCALL_TPNEW
    CYTHON_UNUSED PyObject *const *args, CYTHON_UNUSED Py_ssize_t nargs, CYTHON_UNUSED PyObject *kwnames
#else
    CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k
#endif
) {
  return o;
}

static PyObject *__pyx_tp_new_vectorcall_7opendht_5_core___pyx_scope_struct_4_putEncrypted(PyTypeObject *t, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
) {
  PyObject *o;
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_7opendht_5_core___pyx_scope_struct_4_putEncrypted > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_7opendht_5_core___pyx_scope_struct_4_putEncrypted, sizeof(struct __pyx_obj_7opendht_5_core___pyx_scope_struct_4_putEncrypted))))
  {
    o = (PyObject*)__pyx_mstate_global->__pyx_freelist_7opendht_5_core___pyx_scope_struct_4_putEncrypted[--__pyx_mstate_global->__pyx_freecount_7opendht_5_core___pyx_scope_struct_4_putEncrypted];
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(Py_TYPE(o));
    #endif
    memset(o, 0, sizeof(struct __pyx_obj_7opendht_5_core___pyx_scope_struct_4_putEncrypted));
    #if CYTHON_COMPILING_IN_LIMITED_API
    (void) PyObject_Init(o, t);
    #else
    (void) PyObject_INIT(o, t);
    #endif
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = __Pyx_AllocateExtensionType(t, 1);
  }
  if (unlikely(!o)) return 0;
  return __pyx_tp_new__initialisation_7opendht_5_core___pyx_scope_struct_4_putEncrypted(o, 
#if CYTHON_VECTORCALL_TPNEW
    args, nargs, kwnames
#else
    a, k
#endif
);
}

#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_new_7opendht_5_core___pyx_scope_struct_4_putEncrypted(PyTypeObject *t, PyObject *a, PyObject *k) {
  return __Pyx_CallTpnewAsVectorcall(__pyx_tp_new_vectorcall_7opendht_5_core___pyx_scope_struct_4_putEncrypted, t, a, k);
}
#endif

#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_vectorcall_7opendht_5_core___pyx_scope_struct_4_putEncrypted(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
  if (unlikely((PyTypeObject*)t != __pyx_mstate_global->__pyx_ptype_7opendht_5_core___pyx_scope_struct_4_putEncrypted || __Pyx_PyType_HasFeature((PyTypeObject*)t, Py_TPFLAGS_IS_ABSTRACT))) {
    return __Pyx_CallNewInitFromVectorcall((PyTypeObject*)t, args, nargsf, kwnames);
  }
  Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
  PyObject *o = __pyx_tp_new_vectorcall_7opendht_5_core___pyx_scope_struct_4_putEncrypted((PyTypeObject*)t, args, nargs, kwnames);
  return o;
}
#endif

static void __pyx_tp_dealloc_7opendht_5_core___pyx_scope_struct_4_putEncrypted(PyObject *o) {
  struct __pyx_obj_7opendht_5_core___pyx_scope_struct_4_putEncrypted *p = (struct __pyx_obj_7opendht_5_core___pyx_scope_struct_4_putEncrypted *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7opendht_5_core___pyx_scope_struct_4_putEncrypted) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_lock);
  Py_CLEAR(p->__pyx_v_ok);
  Py_CLEAR(p->__pyx_v_pending);
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_7opendht_5_core___pyx_scope_struct_4_putEncrypted < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_7opendht_5_core___pyx_scope_struct_4_putEncrypted, sizeof(struct __pyx_obj_7opendht_5_core___pyx_scope_struct_4_putEncrypted))))
  {
    __pyx_mstate_global->__pyx_freelist_7opendht_5_core___pyx_scope_struct_4_putEncrypted[__pyx_mstate_global->__pyx_freecount_7opendht_5_core___pyx_scope_struct_4_putEncrypted++] = ((struct __pyx_obj_7opendht_5_core___pyx_scope_struct_4_putEncrypted *)o);
  } else
  #endif
  {
    PyTypeObject *tp = Py_TYPE(o);
    #if CYTHON_USE_TYPE_SLOTS
    (*tp->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(tp);
    #endif
  }
}

static int __pyx_tp_traverse_7opendht_5_core___pyx_scope_struct_4_putEncrypted(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7opendht_5_core___pyx_scope_struct_4_putEncrypted *p = (struct __pyx_obj_7opendht_5_core___pyx_scope_struct_4_putEncrypted *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->__pyx_v_lock) {
    e = (*v)(p->__pyx_v_lock, a); if (e) return e;
  }
  if (p->__pyx_v_ok) {
    e = (*v)(p->__pyx_v_ok, a); if (e) return e;
  }
  if (p->__pyx_v_pending) {
    e = (*v)(p->__pyx_v_pending, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7opendht_5_core___pyx_scope_struct_4_putEncrypted(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7opendht_5_core___pyx_scope_struct_4_putEncrypted *p = (struct __pyx_obj_7opendht_5_core___pyx_scope_struct_4_putEncrypted *)o;
  tmp = ((PyObject*)p->__pyx_v_lock);
  p->__pyx_v_lock = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_ok);
  p->__pyx_v_ok = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_pending);
  p->__pyx_v_pending = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7opendht_5_core___pyx_scope_struct_4_putEncrypted_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7opendht_5_core___pyx_scope_struct_4_putEncrypted},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7opendht_5_core___pyx_scope_struct_4_putEncrypted},
  {Py_tp_clear, (void *)__pyx_tp_clear_7opendht_5_core___pyx_scope_struct_4_putEncrypted},
  {Py_tp_new, (void *)__pyx_tp_new_7opendht_5_core___pyx_scope_struct_4_putEncrypted},
  #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
  #if CYTHON_VECTORCALL_TPNEW
  {Py_tp_vectorcall, (void *)__pyx_tp_vectorcall_7opendht_5_core___pyx_scope_struct_4_putEncrypted},
  #endif
  #endif
  {0, 0},
};
static PyType_Spec __pyx_type_7opendht_5_core___pyx_scope_struct_4_putEncrypted_spec = {
  "opendht._core.__pyx_scope_struct_4_putEncrypted",
  sizeof(struct __pyx_obj_7opendht_5_core___pyx_scope_struct_4_putEncrypted),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_HAVE_GC,
  __pyx_type_7opendht_5_core___pyx_scope_struct_4_putEncrypted_slots,
};
#else

static PyTypeObject __pyx_type_7opendht_5_core___pyx_scope_struct_4_putEncrypted = {
  PyVarObject_HEAD_INIT(0, 0)
  "opendht._core.""__pyx_scope_struct_4_putEncrypted", /*tp_name*/
  sizeof(struct __pyx_obj_7opendht_5_core___pyx_scope_struct_4_putEncrypted), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7opendht_5_core___pyx_scope_struct_4_putEncrypted, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7opendht_5_core___pyx_scope_struct_4_putEncrypted, /*tp_traverse*/
  __pyx_tp_clear_7opendht_5_core___pyx_scope_struct_4_putEncrypted, /*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_7opendht_5_core___pyx_scope_struct_4_putEncrypted, /*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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
  #if CYTHON_VECTORCALL_TPNEW
  __pyx_tp_vectorcall_7opendht_5_core___pyx_scope_struct_4_putEncrypted, /*tp_vectorcall*/
  #else
  NULL, /*tp_vectorcall*/
  #endif
  #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 < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new__initialisation___pyx_scope_struct____Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_(PyObject *o, 
#if CYTHON_VECTORCALL_TPNEW
    CYTHON_UNUSED PyObject *const *args, CYTHON_UNUSED Py_ssize_t nargs, CYTHON_UNUSED PyObject *kwnames
#else
    CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k
#endif
) {
  return o;
}

static PyObject *__pyx_tp_new_vectorcall___pyx_scope_struct____Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_(PyTypeObject *t, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
) {
  PyObject *o;
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount___pyx_scope_struct____Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_ > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype___pyx_scope_struct____Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_, sizeof(struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_))))
  {
    o = (PyObject*)__pyx_mstate_global->__pyx_freelist___pyx_scope_struct____Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_[--__pyx_mstate_global->__pyx_freecount___pyx_scope_struct____Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_];
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(Py_TYPE(o));
    #endif
    memset(o, 0, sizeof(struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_));
    #if CYTHON_COMPILING_IN_LIMITED_API
    (void) PyObject_Init(o, t);
    #else
    (void) PyObject_INIT(o, t);
    #endif
  } else
  #endif
  {
    o = __Pyx_AllocateExtensionType(t, 1);
  }
  if (unlikely(!o)) return 0;
  return __pyx_tp_new__initialisation___pyx_scope_struct____Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_(o, 
#if CYTHON_VECTORCALL_TPNEW
    args, nargs, kwnames
#else
    a, k
#endif
);
}

#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_new___pyx_scope_struct____Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_(PyTypeObject *t, PyObject *a, PyObject *k) {
  return __Pyx_CallTpnewAsVectorcall(__pyx_tp_new_vectorcall___pyx_scope_struct____Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_, t, a, k);
}
#endif

#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_vectorcall___pyx_scope_struct____Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
  if (unlikely((PyTypeObject*)t != __pyx_mstate_global->__pyx_ptype___pyx_scope_struct____Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_ || __Pyx_PyType_HasFeature((PyTypeObject*)t, Py_TPFLAGS_IS_ABSTRACT))) {
    return __Pyx_CallNewInitFromVectorcall((PyTypeObject*)t, args, nargsf, kwnames);
  }
  Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
  PyObject *o = __pyx_tp_new_vectorcall___pyx_scope_struct____Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_((PyTypeObject*)t, args, nargs, kwnames);
  return o;
}
#endif

static void __pyx_tp_dealloc___pyx_scope_struct____Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc___pyx_scope_struct____Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount___pyx_scope_struct____Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_ < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype___pyx_scope_struct____Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_, sizeof(struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_))))
  {
    __pyx_mstate_global->__pyx_freelist___pyx_scope_struct____Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_[__pyx_mstate_global->__pyx_freecount___pyx_scope_struct____Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_++] = ((struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_ *)o);
  } else
  #endif
  {
    PyTypeObject *tp = Py_TYPE(o);
    #if CYTHON_USE_TYPE_SLOTS
    (*tp->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(tp);
    #endif
  }
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_scope_struct____Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py__slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc___pyx_scope_struct____Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_},
  {Py_tp_new, (void *)__pyx_tp_new___pyx_scope_struct____Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_},
  #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
  #if CYTHON_VECTORCALL_TPNEW
  {Py_tp_vectorcall, (void *)__pyx_tp_vectorcall___pyx_scope_struct____Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_},
  #endif
  #endif
  {0, 0},
};
static PyType_Spec __pyx_scope_struct____Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py__spec = {
  "opendht._core.__pyx_scope_struct____Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_",
  sizeof(struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG,
  __pyx_scope_struct____Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py__slots,
};
#else

static PyTypeObject __pyx_scope_struct____Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_ = {
  PyVarObject_HEAD_INIT(0, 0)
  "opendht._core.""__pyx_scope_struct____Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_", /*tp_name*/
  sizeof(struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc___pyx_scope_struct____Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new___pyx_scope_struct____Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
  #if CYTHON_VECTORCALL_TPNEW
  __pyx_tp_vectorcall___pyx_scope_struct____Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_, /*tp_vectorcall*/
  #else
  NULL, /*tp_vectorcall*/
  #endif
  #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 < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyMethodDef __pyx_methods[] = {
  {0, 0, 0, 0}
};
/* #### Code section: initfunc_declarations ### */
static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_InitAfterSharedUtility(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_Global_init_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_Variable_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_Function_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_Exttype___pyx_obj_7opendht_5_core__WithID(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_Exttype___pyx_obj_7opendht_5_core__WithPk(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_InfoHash(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_PkId(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_SockAddr(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_Node(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_NodeEntry(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_Query(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_Select(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_Where(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_Value(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_ValueType(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_NodeSetIter(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_NodeSet(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_PrivateKey(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_PublicKey(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_Certificate(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_VerifyResult(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_TrustList(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_ListenToken(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_Identity(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_DhtConfig(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_DhtRunner(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_IndexValue(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_Pht(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_Exttype___pyx_obj_7opendht_5_core___pyx_scope_struct__ping(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_Exttype___pyx_obj_7opendht_5_core___pyx_scope_struct_1_get(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_Exttype___pyx_obj_7opendht_5_core___pyx_scope_struct_2_put(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_Exttype___pyx_obj_7opendht_5_core___pyx_scope_struct_3_putSigned(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_Exttype___pyx_obj_7opendht_5_core___pyx_scope_struct_4_putEncrypted(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_Exttype___pyx_obj___pyx_scope_struct____Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_Type_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_Variable_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_Function_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate); /*proto*/
/* #### Code section: init_module ### */

static int __Pyx_modinit_Global_init_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_Global_init_code", 0);
  /*--- Global init code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_Variable_export_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_Variable_export_code", 0);
  /*--- Variable export code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_Function_export_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_Function_export_code", 0);
  /*--- Function export code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_Exttype___pyx_obj_7opendht_5_core__WithID(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_Exttype___pyx_obj_7opendht_5_core__WithID", 0);
  /*--- Exttype __pyx_obj_7opendht_5_core__WithID ---*/
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_7opendht_5_core__WithID = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7opendht_5_core__WithID_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_7opendht_5_core__WithID)) __PYX_ERR(0, 92, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7opendht_5_core__WithID = &__pyx_type_7opendht_5_core__WithID;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7opendht_5_core__WithID) < (0)) __PYX_ERR(0, 92, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7opendht_5_core__WithID);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7opendht_5_core__WithID->tp_dictoffset && __pyx_mstate->__pyx_ptype_7opendht_5_core__WithID->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7opendht_5_core__WithID->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_WithID, (PyObject *) __pyx_mstate->__pyx_ptype_7opendht_5_core__WithID) < (0)) __PYX_ERR(0, 92, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7opendht_5_core__WithID) < (0)) __PYX_ERR(0, 92, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_Exttype___pyx_obj_7opendht_5_core__WithPk(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_Exttype___pyx_obj_7opendht_5_core__WithPk", 0);
  /*--- Exttype __pyx_obj_7opendht_5_core__WithPk ---*/
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_7opendht_5_core__WithPk = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7opendht_5_core__WithPk_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_7opendht_5_core__WithPk)) __PYX_ERR(0, 98, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7opendht_5_core__WithPk = &__pyx_type_7opendht_5_core__WithPk;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7opendht_5_core__WithPk) < (0)) __PYX_ERR(0, 98, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7opendht_5_core__WithPk);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7opendht_5_core__WithPk->tp_dictoffset && __pyx_mstate->__pyx_ptype_7opendht_5_core__WithPk->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7opendht_5_core__WithPk->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_WithPk, (PyObject *) __pyx_mstate->__pyx_ptype_7opendht_5_core__WithPk) < (0)) __PYX_ERR(0, 98, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7opendht_5_core__WithPk) < (0)) __PYX_ERR(0, 98, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_InfoHash(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_InfoHash", 0);
  /*--- Exttype __pyx_obj_7opendht_5_core_InfoHash ---*/
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_7opendht_5_core__WithID); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_7opendht_5_core_InfoHash = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7opendht_5_core_InfoHash_spec, __pyx_t_1);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_7opendht_5_core_InfoHash)) __PYX_ERR(0, 104, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7opendht_5_core_InfoHash = &__pyx_type_7opendht_5_core_InfoHash;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7opendht_5_core_InfoHash->tp_base = __pyx_mstate_global->__pyx_ptype_7opendht_5_core__WithID;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7opendht_5_core_InfoHash) < (0)) __PYX_ERR(0, 104, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7opendht_5_core_InfoHash);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7opendht_5_core_InfoHash->tp_dictoffset && __pyx_mstate->__pyx_ptype_7opendht_5_core_InfoHash->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7opendht_5_core_InfoHash->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_InfoHash, (PyObject *) __pyx_mstate->__pyx_ptype_7opendht_5_core_InfoHash) < (0)) __PYX_ERR(0, 104, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7opendht_5_core_InfoHash) < (0)) __PYX_ERR(0, 104, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_PkId(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_PkId", 0);
  /*--- Exttype __pyx_obj_7opendht_5_core_PkId ---*/
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_7opendht_5_core__WithPk); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 142, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_7opendht_5_core_PkId = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7opendht_5_core_PkId_spec, __pyx_t_1);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_7opendht_5_core_PkId)) __PYX_ERR(0, 142, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7opendht_5_core_PkId = &__pyx_type_7opendht_5_core_PkId;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7opendht_5_core_PkId->tp_base = __pyx_mstate_global->__pyx_ptype_7opendht_5_core__WithPk;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7opendht_5_core_PkId) < (0)) __PYX_ERR(0, 142, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7opendht_5_core_PkId);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7opendht_5_core_PkId->tp_dictoffset && __pyx_mstate->__pyx_ptype_7opendht_5_core_PkId->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7opendht_5_core_PkId->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_PkId, (PyObject *) __pyx_mstate->__pyx_ptype_7opendht_5_core_PkId) < (0)) __PYX_ERR(0, 142, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7opendht_5_core_PkId) < (0)) __PYX_ERR(0, 142, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_SockAddr(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_SockAddr", 0);
  /*--- Exttype __pyx_obj_7opendht_5_core_SockAddr ---*/
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_7opendht_5_core_SockAddr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7opendht_5_core_SockAddr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_7opendht_5_core_SockAddr)) __PYX_ERR(0, 180, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7opendht_5_core_SockAddr = &__pyx_type_7opendht_5_core_SockAddr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7opendht_5_core_SockAddr) < (0)) __PYX_ERR(0, 180, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7opendht_5_core_SockAddr);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7opendht_5_core_SockAddr->tp_dictoffset && __pyx_mstate->__pyx_ptype_7opendht_5_core_SockAddr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7opendht_5_core_SockAddr->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_SockAddr, (PyObject *) __pyx_mstate->__pyx_ptype_7opendht_5_core_SockAddr) < (0)) __PYX_ERR(0, 180, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7opendht_5_core_SockAddr) < (0)) __PYX_ERR(0, 180, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_Node(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_Node", 0);
  /*--- Exttype __pyx_obj_7opendht_5_core_Node ---*/
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_7opendht_5_core__WithID); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 212, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_7opendht_5_core_Node = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7opendht_5_core_Node_spec, __pyx_t_1);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_7opendht_5_core_Node)) __PYX_ERR(0, 212, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7opendht_5_core_Node = &__pyx_type_7opendht_5_core_Node;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7opendht_5_core_Node->tp_base = __pyx_mstate_global->__pyx_ptype_7opendht_5_core__WithID;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7opendht_5_core_Node) < (0)) __PYX_ERR(0, 212, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7opendht_5_core_Node);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7opendht_5_core_Node->tp_dictoffset && __pyx_mstate->__pyx_ptype_7opendht_5_core_Node->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7opendht_5_core_Node->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_Node, (PyObject *) __pyx_mstate->__pyx_ptype_7opendht_5_core_Node) < (0)) __PYX_ERR(0, 212, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7opendht_5_core_Node) < (0)) __PYX_ERR(0, 212, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_NodeEntry(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_NodeEntry", 0);
  /*--- Exttype __pyx_obj_7opendht_5_core_NodeEntry ---*/
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_7opendht_5_core__WithID); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 223, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_7opendht_5_core_NodeEntry = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7opendht_5_core_NodeEntry_spec, __pyx_t_1);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_7opendht_5_core_NodeEntry)) __PYX_ERR(0, 223, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7opendht_5_core_NodeEntry = &__pyx_type_7opendht_5_core_NodeEntry;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7opendht_5_core_NodeEntry->tp_base = __pyx_mstate_global->__pyx_ptype_7opendht_5_core__WithID;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7opendht_5_core_NodeEntry) < (0)) __PYX_ERR(0, 223, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7opendht_5_core_NodeEntry);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7opendht_5_core_NodeEntry->tp_dictoffset && __pyx_mstate->__pyx_ptype_7opendht_5_core_NodeEntry->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7opendht_5_core_NodeEntry->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_NodeEntry, (PyObject *) __pyx_mstate->__pyx_ptype_7opendht_5_core_NodeEntry) < (0)) __PYX_ERR(0, 223, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7opendht_5_core_NodeEntry) < (0)) __PYX_ERR(0, 223, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_Query(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_Query", 0);
  /*--- Exttype __pyx_obj_7opendht_5_core_Query ---*/
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_7opendht_5_core_Query = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7opendht_5_core_Query_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_7opendht_5_core_Query)) __PYX_ERR(0, 234, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7opendht_5_core_Query = &__pyx_type_7opendht_5_core_Query;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7opendht_5_core_Query) < (0)) __PYX_ERR(0, 234, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7opendht_5_core_Query);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7opendht_5_core_Query->tp_dictoffset && __pyx_mstate->__pyx_ptype_7opendht_5_core_Query->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7opendht_5_core_Query->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_Query, (PyObject *) __pyx_mstate->__pyx_ptype_7opendht_5_core_Query) < (0)) __PYX_ERR(0, 234, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7opendht_5_core_Query) < (0)) __PYX_ERR(0, 234, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_Select(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_Select", 0);
  /*--- Exttype __pyx_obj_7opendht_5_core_Select ---*/
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_7opendht_5_core_Select = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7opendht_5_core_Select_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_7opendht_5_core_Select)) __PYX_ERR(0, 245, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7opendht_5_core_Select = &__pyx_type_7opendht_5_core_Select;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7opendht_5_core_Select) < (0)) __PYX_ERR(0, 245, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7opendht_5_core_Select);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7opendht_5_core_Select->tp_dictoffset && __pyx_mstate->__pyx_ptype_7opendht_5_core_Select->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7opendht_5_core_Select->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_Select, (PyObject *) __pyx_mstate->__pyx_ptype_7opendht_5_core_Select) < (0)) __PYX_ERR(0, 245, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7opendht_5_core_Select) < (0)) __PYX_ERR(0, 245, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_Where(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_Where", 0);
  /*--- Exttype __pyx_obj_7opendht_5_core_Where ---*/
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_7opendht_5_core_Where = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7opendht_5_core_Where_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_7opendht_5_core_Where)) __PYX_ERR(0, 260, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7opendht_5_core_Where = &__pyx_type_7opendht_5_core_Where;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7opendht_5_core_Where) < (0)) __PYX_ERR(0, 260, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7opendht_5_core_Where);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7opendht_5_core_Where->tp_dictoffset && __pyx_mstate->__pyx_ptype_7opendht_5_core_Where->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7opendht_5_core_Where->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_Where, (PyObject *) __pyx_mstate->__pyx_ptype_7opendht_5_core_Where) < (0)) __PYX_ERR(0, 260, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7opendht_5_core_Where) < (0)) __PYX_ERR(0, 260, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_Value(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_Value", 0);
  /*--- Exttype __pyx_obj_7opendht_5_core_Value ---*/
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_7opendht_5_core_Value = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7opendht_5_core_Value_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_7opendht_5_core_Value)) __PYX_ERR(0, 287, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7opendht_5_core_Value = &__pyx_type_7opendht_5_core_Value;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7opendht_5_core_Value) < (0)) __PYX_ERR(0, 287, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7opendht_5_core_Value);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7opendht_5_core_Value->tp_dictoffset && __pyx_mstate->__pyx_ptype_7opendht_5_core_Value->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7opendht_5_core_Value->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_Value, (PyObject *) __pyx_mstate->__pyx_ptype_7opendht_5_core_Value) < (0)) __PYX_ERR(0, 287, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7opendht_5_core_Value) < (0)) __PYX_ERR(0, 287, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_ValueType(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_ValueType", 0);
  /*--- Exttype __pyx_obj_7opendht_5_core_ValueType ---*/
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_7opendht_5_core_ValueType = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7opendht_5_core_ValueType_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_7opendht_5_core_ValueType)) __PYX_ERR(0, 330, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7opendht_5_core_ValueType = &__pyx_type_7opendht_5_core_ValueType;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7opendht_5_core_ValueType) < (0)) __PYX_ERR(0, 330, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7opendht_5_core_ValueType);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7opendht_5_core_ValueType->tp_dictoffset && __pyx_mstate->__pyx_ptype_7opendht_5_core_ValueType->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7opendht_5_core_ValueType->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_ValueType, (PyObject *) __pyx_mstate->__pyx_ptype_7opendht_5_core_ValueType) < (0)) __PYX_ERR(0, 330, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7opendht_5_core_ValueType) < (0)) __PYX_ERR(0, 330, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_NodeSetIter(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_NodeSetIter", 0);
  /*--- Exttype __pyx_obj_7opendht_5_core_NodeSetIter ---*/
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_7opendht_5_core_NodeSetIter = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7opendht_5_core_NodeSetIter_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_7opendht_5_core_NodeSetIter)) __PYX_ERR(0, 338, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7opendht_5_core_NodeSetIter = &__pyx_type_7opendht_5_core_NodeSetIter;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7opendht_5_core_NodeSetIter) < (0)) __PYX_ERR(0, 338, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7opendht_5_core_NodeSetIter);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7opendht_5_core_NodeSetIter->tp_dictoffset && __pyx_mstate->__pyx_ptype_7opendht_5_core_NodeSetIter->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7opendht_5_core_NodeSetIter->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_NodeSetIter, (PyObject *) __pyx_mstate->__pyx_ptype_7opendht_5_core_NodeSetIter) < (0)) __PYX_ERR(0, 338, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7opendht_5_core_NodeSetIter) < (0)) __PYX_ERR(0, 338, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_NodeSet(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_NodeSet", 0);
  /*--- Exttype __pyx_obj_7opendht_5_core_NodeSet ---*/
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_7opendht_5_core_NodeSet = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7opendht_5_core_NodeSet_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_7opendht_5_core_NodeSet)) __PYX_ERR(0, 352, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7opendht_5_core_NodeSet = &__pyx_type_7opendht_5_core_NodeSet;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7opendht_5_core_NodeSet) < (0)) __PYX_ERR(0, 352, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7opendht_5_core_NodeSet);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7opendht_5_core_NodeSet->tp_dictoffset && __pyx_mstate->__pyx_ptype_7opendht_5_core_NodeSet->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7opendht_5_core_NodeSet->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_NodeSet, (PyObject *) __pyx_mstate->__pyx_ptype_7opendht_5_core_NodeSet) < (0)) __PYX_ERR(0, 352, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7opendht_5_core_NodeSet) < (0)) __PYX_ERR(0, 352, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_PrivateKey(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_PrivateKey", 0);
  /*--- Exttype __pyx_obj_7opendht_5_core_PrivateKey ---*/
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_7opendht_5_core__WithPk); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 383, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_7opendht_5_core_PrivateKey = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7opendht_5_core_PrivateKey_spec, __pyx_t_1);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_7opendht_5_core_PrivateKey)) __PYX_ERR(0, 383, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7opendht_5_core_PrivateKey = &__pyx_type_7opendht_5_core_PrivateKey;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7opendht_5_core_PrivateKey->tp_base = __pyx_mstate_global->__pyx_ptype_7opendht_5_core__WithPk;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7opendht_5_core_PrivateKey) < (0)) __PYX_ERR(0, 383, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7opendht_5_core_PrivateKey);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7opendht_5_core_PrivateKey->tp_dictoffset && __pyx_mstate->__pyx_ptype_7opendht_5_core_PrivateKey->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7opendht_5_core_PrivateKey->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_PrivateKey, (PyObject *) __pyx_mstate->__pyx_ptype_7opendht_5_core_PrivateKey) < (0)) __PYX_ERR(0, 383, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7opendht_5_core_PrivateKey) < (0)) __PYX_ERR(0, 383, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_PublicKey(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_PublicKey", 0);
  /*--- Exttype __pyx_obj_7opendht_5_core_PublicKey ---*/
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_7opendht_5_core__WithPk); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 440, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_7opendht_5_core_PublicKey = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7opendht_5_core_PublicKey_spec, __pyx_t_1);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_7opendht_5_core_PublicKey)) __PYX_ERR(0, 440, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7opendht_5_core_PublicKey = &__pyx_type_7opendht_5_core_PublicKey;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7opendht_5_core_PublicKey->tp_base = __pyx_mstate_global->__pyx_ptype_7opendht_5_core__WithPk;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7opendht_5_core_PublicKey) < (0)) __PYX_ERR(0, 440, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7opendht_5_core_PublicKey);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7opendht_5_core_PublicKey->tp_dictoffset && __pyx_mstate->__pyx_ptype_7opendht_5_core_PublicKey->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7opendht_5_core_PublicKey->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_PublicKey, (PyObject *) __pyx_mstate->__pyx_ptype_7opendht_5_core_PublicKey) < (0)) __PYX_ERR(0, 440, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7opendht_5_core_PublicKey) < (0)) __PYX_ERR(0, 440, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_Certificate(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_Certificate", 0);
  /*--- Exttype __pyx_obj_7opendht_5_core_Certificate ---*/
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_7opendht_5_core__WithPk); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 481, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_7opendht_5_core_Certificate = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7opendht_5_core_Certificate_spec, __pyx_t_1);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_7opendht_5_core_Certificate)) __PYX_ERR(0, 481, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7opendht_5_core_Certificate = &__pyx_type_7opendht_5_core_Certificate;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7opendht_5_core_Certificate->tp_base = __pyx_mstate_global->__pyx_ptype_7opendht_5_core__WithPk;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7opendht_5_core_Certificate) < (0)) __PYX_ERR(0, 481, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7opendht_5_core_Certificate);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7opendht_5_core_Certificate->tp_dictoffset && __pyx_mstate->__pyx_ptype_7opendht_5_core_Certificate->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7opendht_5_core_Certificate->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_Certificate, (PyObject *) __pyx_mstate->__pyx_ptype_7opendht_5_core_Certificate) < (0)) __PYX_ERR(0, 481, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7opendht_5_core_Certificate) < (0)) __PYX_ERR(0, 481, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_VerifyResult(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_VerifyResult", 0);
  /*--- Exttype __pyx_obj_7opendht_5_core_VerifyResult ---*/
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_7opendht_5_core_VerifyResult = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7opendht_5_core_VerifyResult_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_7opendht_5_core_VerifyResult)) __PYX_ERR(0, 521, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7opendht_5_core_VerifyResult = &__pyx_type_7opendht_5_core_VerifyResult;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7opendht_5_core_VerifyResult) < (0)) __PYX_ERR(0, 521, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7opendht_5_core_VerifyResult);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7opendht_5_core_VerifyResult->tp_dictoffset && __pyx_mstate->__pyx_ptype_7opendht_5_core_VerifyResult->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7opendht_5_core_VerifyResult->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_VerifyResult, (PyObject *) __pyx_mstate->__pyx_ptype_7opendht_5_core_VerifyResult) < (0)) __PYX_ERR(0, 521, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7opendht_5_core_VerifyResult) < (0)) __PYX_ERR(0, 521, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_TrustList(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_TrustList", 0);
  /*--- Exttype __pyx_obj_7opendht_5_core_TrustList ---*/
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_7opendht_5_core_TrustList = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7opendht_5_core_TrustList_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_7opendht_5_core_TrustList)) __PYX_ERR(0, 528, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7opendht_5_core_TrustList = &__pyx_type_7opendht_5_core_TrustList;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7opendht_5_core_TrustList) < (0)) __PYX_ERR(0, 528, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7opendht_5_core_TrustList);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7opendht_5_core_TrustList->tp_dictoffset && __pyx_mstate->__pyx_ptype_7opendht_5_core_TrustList->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7opendht_5_core_TrustList->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_TrustList, (PyObject *) __pyx_mstate->__pyx_ptype_7opendht_5_core_TrustList) < (0)) __PYX_ERR(0, 528, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7opendht_5_core_TrustList) < (0)) __PYX_ERR(0, 528, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_ListenToken(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_ListenToken", 0);
  /*--- Exttype __pyx_obj_7opendht_5_core_ListenToken ---*/
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_7opendht_5_core_ListenToken = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7opendht_5_core_ListenToken_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_7opendht_5_core_ListenToken)) __PYX_ERR(0, 539, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7opendht_5_core_ListenToken = &__pyx_type_7opendht_5_core_ListenToken;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7opendht_5_core_ListenToken) < (0)) __PYX_ERR(0, 539, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7opendht_5_core_ListenToken);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7opendht_5_core_ListenToken->tp_dictoffset && __pyx_mstate->__pyx_ptype_7opendht_5_core_ListenToken->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7opendht_5_core_ListenToken->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_ListenToken, (PyObject *) __pyx_mstate->__pyx_ptype_7opendht_5_core_ListenToken) < (0)) __PYX_ERR(0, 539, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7opendht_5_core_ListenToken) < (0)) __PYX_ERR(0, 539, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_Identity(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_Identity", 0);
  /*--- Exttype __pyx_obj_7opendht_5_core_Identity ---*/
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_7opendht_5_core_Identity = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7opendht_5_core_Identity_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_7opendht_5_core_Identity)) __PYX_ERR(0, 544, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7opendht_5_core_Identity = &__pyx_type_7opendht_5_core_Identity;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7opendht_5_core_Identity) < (0)) __PYX_ERR(0, 544, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7opendht_5_core_Identity);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7opendht_5_core_Identity->tp_dictoffset && __pyx_mstate->__pyx_ptype_7opendht_5_core_Identity->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7opendht_5_core_Identity->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_Identity, (PyObject *) __pyx_mstate->__pyx_ptype_7opendht_5_core_Identity) < (0)) __PYX_ERR(0, 544, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7opendht_5_core_Identity) < (0)) __PYX_ERR(0, 544, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_DhtConfig(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_DhtConfig", 0);
  /*--- Exttype __pyx_obj_7opendht_5_core_DhtConfig ---*/
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_7opendht_5_core_DhtConfig = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7opendht_5_core_DhtConfig_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_7opendht_5_core_DhtConfig)) __PYX_ERR(0, 598, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7opendht_5_core_DhtConfig = &__pyx_type_7opendht_5_core_DhtConfig;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7opendht_5_core_DhtConfig) < (0)) __PYX_ERR(0, 598, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7opendht_5_core_DhtConfig);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7opendht_5_core_DhtConfig->tp_dictoffset && __pyx_mstate->__pyx_ptype_7opendht_5_core_DhtConfig->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7opendht_5_core_DhtConfig->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_DhtConfig, (PyObject *) __pyx_mstate->__pyx_ptype_7opendht_5_core_DhtConfig) < (0)) __PYX_ERR(0, 598, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7opendht_5_core_DhtConfig) < (0)) __PYX_ERR(0, 598, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_DhtRunner(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_DhtRunner", 0);
  /*--- Exttype __pyx_obj_7opendht_5_core_DhtRunner ---*/
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_7opendht_5_core__WithID); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 631, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_7opendht_5_core_DhtRunner = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7opendht_5_core_DhtRunner_spec, __pyx_t_1);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_7opendht_5_core_DhtRunner)) __PYX_ERR(0, 631, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7opendht_5_core_DhtRunner = &__pyx_type_7opendht_5_core_DhtRunner;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7opendht_5_core_DhtRunner->tp_base = __pyx_mstate_global->__pyx_ptype_7opendht_5_core__WithID;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7opendht_5_core_DhtRunner) < (0)) __PYX_ERR(0, 631, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7opendht_5_core_DhtRunner);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7opendht_5_core_DhtRunner->tp_dictoffset && __pyx_mstate->__pyx_ptype_7opendht_5_core_DhtRunner->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7opendht_5_core_DhtRunner->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_DhtRunner, (PyObject *) __pyx_mstate->__pyx_ptype_7opendht_5_core_DhtRunner) < (0)) __PYX_ERR(0, 631, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7opendht_5_core_DhtRunner) < (0)) __PYX_ERR(0, 631, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_IndexValue(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_IndexValue", 0);
  /*--- Exttype __pyx_obj_7opendht_5_core_IndexValue ---*/
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_7opendht_5_core_IndexValue = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7opendht_5_core_IndexValue_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_7opendht_5_core_IndexValue)) __PYX_ERR(0, 862, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7opendht_5_core_IndexValue = &__pyx_type_7opendht_5_core_IndexValue;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7opendht_5_core_IndexValue) < (0)) __PYX_ERR(0, 862, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7opendht_5_core_IndexValue);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7opendht_5_core_IndexValue->tp_dictoffset && __pyx_mstate->__pyx_ptype_7opendht_5_core_IndexValue->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7opendht_5_core_IndexValue->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_IndexValue, (PyObject *) __pyx_mstate->__pyx_ptype_7opendht_5_core_IndexValue) < (0)) __PYX_ERR(0, 862, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7opendht_5_core_IndexValue) < (0)) __PYX_ERR(0, 862, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_Pht(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_Pht", 0);
  /*--- Exttype __pyx_obj_7opendht_5_core_Pht ---*/
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_7opendht_5_core_Pht = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7opendht_5_core_Pht_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_7opendht_5_core_Pht)) __PYX_ERR(0, 876, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7opendht_5_core_Pht = &__pyx_type_7opendht_5_core_Pht;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7opendht_5_core_Pht) < (0)) __PYX_ERR(0, 876, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7opendht_5_core_Pht);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7opendht_5_core_Pht->tp_dictoffset && __pyx_mstate->__pyx_ptype_7opendht_5_core_Pht->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7opendht_5_core_Pht->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_Pht, (PyObject *) __pyx_mstate->__pyx_ptype_7opendht_5_core_Pht) < (0)) __PYX_ERR(0, 876, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7opendht_5_core_Pht) < (0)) __PYX_ERR(0, 876, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_Exttype___pyx_obj_7opendht_5_core___pyx_scope_struct__ping(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_Exttype___pyx_obj_7opendht_5_core___pyx_scope_struct__ping", 0);
  /*--- Exttype __pyx_obj_7opendht_5_core___pyx_scope_struct__ping ---*/
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_7opendht_5_core___pyx_scope_struct__ping = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7opendht_5_core___pyx_scope_struct__ping_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_7opendht_5_core___pyx_scope_struct__ping)) __PYX_ERR(0, 651, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7opendht_5_core___pyx_scope_struct__ping = &__pyx_type_7opendht_5_core___pyx_scope_struct__ping;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7opendht_5_core___pyx_scope_struct__ping) < (0)) __PYX_ERR(0, 651, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7opendht_5_core___pyx_scope_struct__ping);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7opendht_5_core___pyx_scope_struct__ping->tp_dictoffset && __pyx_mstate->__pyx_ptype_7opendht_5_core___pyx_scope_struct__ping->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7opendht_5_core___pyx_scope_struct__ping->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_Exttype___pyx_obj_7opendht_5_core___pyx_scope_struct_1_get(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_Exttype___pyx_obj_7opendht_5_core___pyx_scope_struct_1_get", 0);
  /*--- Exttype __pyx_obj_7opendht_5_core___pyx_scope_struct_1_get ---*/
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_7opendht_5_core___pyx_scope_struct_1_get = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7opendht_5_core___pyx_scope_struct_1_get_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_7opendht_5_core___pyx_scope_struct_1_get)) __PYX_ERR(0, 718, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7opendht_5_core___pyx_scope_struct_1_get = &__pyx_type_7opendht_5_core___pyx_scope_struct_1_get;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7opendht_5_core___pyx_scope_struct_1_get) < (0)) __PYX_ERR(0, 718, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7opendht_5_core___pyx_scope_struct_1_get);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7opendht_5_core___pyx_scope_struct_1_get->tp_dictoffset && __pyx_mstate->__pyx_ptype_7opendht_5_core___pyx_scope_struct_1_get->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7opendht_5_core___pyx_scope_struct_1_get->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_Exttype___pyx_obj_7opendht_5_core___pyx_scope_struct_2_put(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_Exttype___pyx_obj_7opendht_5_core___pyx_scope_struct_2_put", 0);
  /*--- Exttype __pyx_obj_7opendht_5_core___pyx_scope_struct_2_put ---*/
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_7opendht_5_core___pyx_scope_struct_2_put = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7opendht_5_core___pyx_scope_struct_2_put_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_7opendht_5_core___pyx_scope_struct_2_put)) __PYX_ERR(0, 756, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7opendht_5_core___pyx_scope_struct_2_put = &__pyx_type_7opendht_5_core___pyx_scope_struct_2_put;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7opendht_5_core___pyx_scope_struct_2_put) < (0)) __PYX_ERR(0, 756, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7opendht_5_core___pyx_scope_struct_2_put);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7opendht_5_core___pyx_scope_struct_2_put->tp_dictoffset && __pyx_mstate->__pyx_ptype_7opendht_5_core___pyx_scope_struct_2_put->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7opendht_5_core___pyx_scope_struct_2_put->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_Exttype___pyx_obj_7opendht_5_core___pyx_scope_struct_3_putSigned(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_Exttype___pyx_obj_7opendht_5_core___pyx_scope_struct_3_putSigned", 0);
  /*--- Exttype __pyx_obj_7opendht_5_core___pyx_scope_struct_3_putSigned ---*/
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_7opendht_5_core___pyx_scope_struct_3_putSigned = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7opendht_5_core___pyx_scope_struct_3_putSigned_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_7opendht_5_core___pyx_scope_struct_3_putSigned)) __PYX_ERR(0, 784, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7opendht_5_core___pyx_scope_struct_3_putSigned = &__pyx_type_7opendht_5_core___pyx_scope_struct_3_putSigned;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7opendht_5_core___pyx_scope_struct_3_putSigned) < (0)) __PYX_ERR(0, 784, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7opendht_5_core___pyx_scope_struct_3_putSigned);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7opendht_5_core___pyx_scope_struct_3_putSigned->tp_dictoffset && __pyx_mstate->__pyx_ptype_7opendht_5_core___pyx_scope_struct_3_putSigned->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7opendht_5_core___pyx_scope_struct_3_putSigned->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_Exttype___pyx_obj_7opendht_5_core___pyx_scope_struct_4_putEncrypted(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_Exttype___pyx_obj_7opendht_5_core___pyx_scope_struct_4_putEncrypted", 0);
  /*--- Exttype __pyx_obj_7opendht_5_core___pyx_scope_struct_4_putEncrypted ---*/
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_7opendht_5_core___pyx_scope_struct_4_putEncrypted = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7opendht_5_core___pyx_scope_struct_4_putEncrypted_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_7opendht_5_core___pyx_scope_struct_4_putEncrypted)) __PYX_ERR(0, 806, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7opendht_5_core___pyx_scope_struct_4_putEncrypted = &__pyx_type_7opendht_5_core___pyx_scope_struct_4_putEncrypted;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7opendht_5_core___pyx_scope_struct_4_putEncrypted) < (0)) __PYX_ERR(0, 806, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7opendht_5_core___pyx_scope_struct_4_putEncrypted);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7opendht_5_core___pyx_scope_struct_4_putEncrypted->tp_dictoffset && __pyx_mstate->__pyx_ptype_7opendht_5_core___pyx_scope_struct_4_putEncrypted->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7opendht_5_core___pyx_scope_struct_4_putEncrypted->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_Exttype___pyx_obj___pyx_scope_struct____Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_Exttype___pyx_obj___pyx_scope_struct____Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_", 0);
  /*--- Exttype __pyx_obj___pyx_scope_struct____Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_ ---*/
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype___pyx_scope_struct____Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_ = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_scope_struct____Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py__spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype___pyx_scope_struct____Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_)) __PYX_ERR(1, 84, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype___pyx_scope_struct____Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_ = &__pyx_scope_struct____Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype___pyx_scope_struct____Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_) < (0)) __PYX_ERR(1, 84, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype___pyx_scope_struct____Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype___pyx_scope_struct____Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_->tp_dictoffset && __pyx_mstate->__pyx_ptype___pyx_scope_struct____Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype___pyx_scope_struct____Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_Type_import_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_Type_import_code", 0);
  /*--- Type import code ---*/
  __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_3_0(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyTypeObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  0, 0,
  #else
  sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyHeapTypeObject),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_7cpython_4type_type) __PYX_ERR(3, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 8, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType_3_3_0(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "bool",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyLongObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyLongObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  0, 0,
  #else
  sizeof(PyLongObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyLongObject),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_7cpython_4bool_bool) __PYX_ERR(4, 8, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType_3_3_0(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "complex",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyComplexObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyComplexObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  0, 0,
  #else
  sizeof(PyComplexObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyComplexObject),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_7cpython_7complex_complex) __PYX_ERR(5, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_Variable_import_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_Variable_import_code", 0);
  /*--- Variable import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_Function_import_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_Function_import_code", 0);
  /*--- Function import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

#if CYTHON_PEP489_MULTI_PHASE_INIT
static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
static int __pyx_pymod_exec__core(PyObject* module); /*proto*/
static PyModuleDef_Slot __pyx_moduledef_slots[] = {
  {Py_mod_create, (void*)__pyx_pymod_create},
  {Py_mod_exec, (void*)__pyx_pymod_exec__core},
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
  {Py_mod_gil, __Pyx_FREETHREADING_COMPATIBLE},
  #endif
  #if PY_VERSION_HEX >= 0x030C0000 && CYTHON_USE_MODULE_STATE
  {Py_mod_multiple_interpreters, Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED},
  #endif
  {0, NULL}
};
#endif

#ifdef __cplusplus
namespace {
  struct PyModuleDef __pyx_moduledef =
  #else
  static struct PyModuleDef __pyx_moduledef =
  #endif
  {
      PyModuleDef_HEAD_INIT,
      "_core",
      0, /* m_doc */
    #if CYTHON_USE_MODULE_STATE
      sizeof(__pyx_mstatetype), /* m_size */
    #else
      (CYTHON_PEP489_MULTI_PHASE_INIT) ? 0 : -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

/* PyModInitFuncType */
#ifndef CYTHON_NO_PYINIT_EXPORT
  #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
#else
  #ifdef __cplusplus
  #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
  #else
  #define __Pyx_PyMODINIT_FUNC PyObject *
  #endif
#endif

__Pyx_PyMODINIT_FUNC PyInit__core(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC PyInit__core(void)
#if CYTHON_PEP489_MULTI_PHASE_INIT
{
  return PyModuleDef_Init(&__pyx_moduledef);
}
/* ModuleCreationPEP489 */
#if CYTHON_COMPILING_IN_LIMITED_API && (__PYX_LIMITED_VERSION_HEX < 0x030A0000 &&\
      (defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)))
static PY_INT64_T __Pyx_GetCurrentInterpreterId(void) {
    {
        PyObject *module = PyImport_ImportModule("_interpreters"); // 3.13+ I think
        if (!module) {
            if (!PyErr_ExceptionMatches(PyExc_Exception)) {
                goto bad; // BaseException
            }
            PyErr_Clear(); // just try the 3.8-3.12 version
            module = PyImport_ImportModule("_xxsubinterpreters");
            if (!module) goto bad;
        }
        PyObject *current = PyObject_CallMethod(module, "get_current", NULL);
        Py_DECREF(module);
        if (!current) goto bad;
        if (PyTuple_Check(current)) {
            PyObject *new_current = PySequence_GetItem(current, 0);
            Py_DECREF(current);
            current = new_current;
            if (!new_current) goto bad;
        }
        long long as_c_int = PyLong_AsLongLong(current);
        Py_DECREF(current);
        return as_c_int;
    }
  bad:
    PySys_WriteStderr("__Pyx_GetCurrentInterpreterId failed. Try setting the C define CYTHON_PEP489_MULTI_PHASE_INIT=0\n");
    return -1;
}
#endif
#if !CYTHON_USE_MODULE_STATE
static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
    static PY_INT64_T main_interpreter_id = -1;
#if CYTHON_COMPILING_IN_GRAAL && defined(GRAALPY_VERSION_NUM) && GRAALPY_VERSION_NUM > 0x19000000
    PY_INT64_T current_id = GraalPyInterpreterState_GetIDFromThreadState(PyThreadState_Get());
#elif CYTHON_COMPILING_IN_GRAAL
    PY_INT64_T current_id = PyInterpreterState_GetIDFromThreadState(PyThreadState_Get());
#elif CYTHON_COMPILING_IN_LIMITED_API && (__PYX_LIMITED_VERSION_HEX < 0x030A0000 &&\
      (defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)))
    PY_INT64_T current_id = __Pyx_GetCurrentInterpreterId();
#elif CYTHON_COMPILING_IN_LIMITED_API
    PY_INT64_T current_id = PyInterpreterState_GetID(PyInterpreterState_Get());
#else
    PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
#endif
    if (unlikely(current_id == -1)) {
        return -1;
    }
    if (main_interpreter_id == -1) {
        main_interpreter_id = current_id;
        return 0;
    } else if (unlikely(main_interpreter_id != current_id)) {
        PyErr_SetString(
            PyExc_ImportError,
            "Interpreter change detected - this module can only be loaded into one interpreter per process.");
        return -1;
    }
    return 0;
}
#endif
static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none)
{
    PyObject *value = PyObject_GetAttrString(spec, from_name);
    int result = 0;
    if (likely(value)) {
        if (allow_none || value != Py_None) {
            result = PyDict_SetItemString(moddict, to_name, value);
        }
        Py_DECREF(value);
    } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
        PyErr_Clear();
    } else {
        result = -1;
    }
    return result;
}
static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) {
    PyObject *module = NULL, *moddict, *modname;
    CYTHON_UNUSED_VAR(def);
    #if !CYTHON_USE_MODULE_STATE
    if (__Pyx_check_single_interpreter())
        return NULL;
    #endif
    if (__pyx_m)
        return __Pyx_NewRef(__pyx_m);
    modname = PyObject_GetAttrString(spec, "name");
    if (unlikely(!modname)) goto bad;
    module = PyModule_NewObject(modname);
    Py_DECREF(modname);
    if (unlikely(!module)) goto bad;
    moddict = PyModule_GetDict(module);
    if (unlikely(!moddict)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
    return module;
bad:
    Py_XDECREF(module);
    return NULL;
}


static CYTHON_SMALL_CODE int __pyx_pymod_exec__core(PyObject *__pyx_pyinit_module)
#endif
{
  int stringtab_initialized = 0;
  #if CYTHON_USE_MODULE_STATE
  int pystate_addmodule_run = 0;
  #endif
  __pyx_mstatetype *__pyx_mstate = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  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 '_core' has already been imported. Re-initialisation is not supported.");
    return -1;
  }
  #else
  if (__pyx_m) return __Pyx_NewRef(__pyx_m);
  #endif
  /*--- Module creation code ---*/
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  __pyx_t_1 = __pyx_pyinit_module;
  Py_INCREF(__pyx_t_1);
  #else
  __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #if CYTHON_USE_MODULE_STATE
  {
    int add_module_result = __Pyx_State_AddModule(__pyx_t_1, &__pyx_moduledef);
    __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "_core" pseudovariable */
    if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
    pystate_addmodule_run = 1;
  }
  #else
  __pyx_m = __pyx_t_1;
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
  PyUnstable_Module_SetGIL(__pyx_m, Py_MOD_GIL_USED);
  #endif
  __pyx_mstate = __pyx_mstate_global;
  CYTHON_UNUSED_VAR(__pyx_t_1);
  __pyx_mstate->__pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_mstate->__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
  Py_INCREF(__pyx_mstate->__pyx_d);
  __pyx_mstate->__pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_mstate->__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_cython_runtime = __Pyx_PyImport_AddModuleRef("cython_runtime"); if (unlikely(!__pyx_mstate->__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_mstate->__pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  /* ImportRefnannyAPI */
  #if CYTHON_REFNANNY
  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
  if (!__Pyx_RefNanny) {
    if (PyErr_ExceptionMatches(PyExc_Exception)) {
      PyErr_Clear();
      __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
    }
    if (!__Pyx_RefNanny)
        Py_FatalError("failed to import 'refnanny' module");
  }
  #endif
  
__Pyx_RefNannySetupContext("PyInit__core", 0);
  __Pyx_init_runtime_version();
  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)
  __pyx_mstate->__pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_mstate->__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Library function declarations ---*/
  /*--- Initialize various global constants etc. ---*/
  if (__Pyx_InitConstants(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
  stringtab_initialized = 1;
  if (__Pyx_InitGlobals() < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__pyx_module_is_main_opendht___core) {
    if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_main) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
  }
  {
    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
    if (!PyDict_GetItemString(modules, "opendht._core")) {
      if (unlikely((PyDict_SetItemString(modules, "opendht._core", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
    }
  }
  /*--- Builtin init code ---*/
  if (__Pyx_InitCachedBuiltins(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Constants init code ---*/
  if (__Pyx_InitCachedConstants(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_CreateCodeObjects(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Global type/function init code ---*/
  (void)__Pyx_modinit_Global_init_code(__pyx_mstate);
  (void)__Pyx_modinit_Variable_export_code(__pyx_mstate);
  (void)__Pyx_modinit_Function_export_code(__pyx_mstate);
  /*--- Type init code ---*/
  if (unlikely((__Pyx_modinit_Exttype___pyx_obj_7opendht_5_core__WithID(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  if (unlikely((__Pyx_modinit_Exttype___pyx_obj_7opendht_5_core__WithPk(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  if (unlikely((__Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_InfoHash(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  if (unlikely((__Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_PkId(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  if (unlikely((__Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_SockAddr(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  if (unlikely((__Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_Node(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  if (unlikely((__Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_NodeEntry(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  if (unlikely((__Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_Query(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  if (unlikely((__Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_Select(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  if (unlikely((__Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_Where(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  if (unlikely((__Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_Value(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  if (unlikely((__Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_ValueType(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  if (unlikely((__Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_NodeSetIter(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  if (unlikely((__Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_NodeSet(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  if (unlikely((__Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_PrivateKey(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  if (unlikely((__Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_PublicKey(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  if (unlikely((__Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_Certificate(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  if (unlikely((__Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_VerifyResult(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  if (unlikely((__Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_TrustList(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  if (unlikely((__Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_ListenToken(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  if (unlikely((__Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_Identity(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  if (unlikely((__Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_DhtConfig(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  if (unlikely((__Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_DhtRunner(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  if (unlikely((__Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_IndexValue(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  if (unlikely((__Pyx_modinit_Exttype___pyx_obj_7opendht_5_core_Pht(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  if (unlikely((__Pyx_modinit_Exttype___pyx_obj_7opendht_5_core___pyx_scope_struct__ping(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  if (unlikely((__Pyx_modinit_Exttype___pyx_obj_7opendht_5_core___pyx_scope_struct_1_get(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  if (unlikely((__Pyx_modinit_Exttype___pyx_obj_7opendht_5_core___pyx_scope_struct_2_put(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  if (unlikely((__Pyx_modinit_Exttype___pyx_obj_7opendht_5_core___pyx_scope_struct_3_putSigned(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  if (unlikely((__Pyx_modinit_Exttype___pyx_obj_7opendht_5_core___pyx_scope_struct_4_putEncrypted(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  if (unlikely((__Pyx_modinit_Exttype___pyx_obj___pyx_scope_struct____Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  if (unlikely((__Pyx_modinit_Type_import_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  (void)__Pyx_modinit_Variable_import_code(__pyx_mstate);
  (void)__Pyx_modinit_Function_import_code(__pyx_mstate);
  if (__Pyx_InitAfterSharedUtility() < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Execution code ---*/

  /* "opendht.pyx":19
 * from cython.operator cimport dereference as deref, preincrement as inc, predecrement as dec
 * from cpython cimport ref
 * from datetime import timedelta             # <<<<<<<<<<<<<<
 * 
 * cimport opendht_cpp as cpp
*/
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_timedelta};
    __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_datetime, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_2);
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_timedelta};
    __pyx_t_3 = 0; {
      __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 19, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_3], __pyx_t_4) < (0)) __PYX_ERR(0, 19, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opendht.pyx":23
 * cimport opendht_cpp as cpp
 * 
 * import threading             # <<<<<<<<<<<<<<
 * 
 * cdef inline void _initialize_gnutls():
*/
  __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_threading, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_threading, __pyx_t_2) < (0)) __PYX_ERR(0, 23, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opendht.pyx":37
 * 
 * # Initialize GnuTLS when this module is imported
 * _initialize_gnutls()             # <<<<<<<<<<<<<<
 * 
 * def version() -> str:
*/
  __pyx_f_7opendht_5_core__initialize_gnutls(); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 37, __pyx_L1_error)

  /* "opendht.pyx":39
 * _initialize_gnutls()
 * 
 * def version() -> str:             # <<<<<<<<<<<<<<
 *     return cpp.version().decode()
 * 
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_str) < (0)) __PYX_ERR(0, 39, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_1version, 0, __pyx_mstate_global->__pyx_n_u_version, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[7])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 39, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_version, __pyx_t_4) < (0)) __PYX_ERR(0, 39, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_7_WithID_5__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_WithID___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[8])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core__WithID, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_4) < (0)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "(tree fragment)":17
 *     else:
 *         return __pyx_unpickle__WithID, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle__WithID__set_state(self, __pyx_state)
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_7_WithID_7__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_WithID___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[9])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core__WithID, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_4) < (0)) __PYX_ERR(1, 17, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_7_WithPk_5__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_WithPk___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[10])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core__WithPk, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_4) < (0)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "(tree fragment)":17
 *     else:
 *         return __pyx_unpickle__WithPk, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle__WithPk__set_state(self, __pyx_state)
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_7_WithPk_7__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_WithPk___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[11])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core__WithPk, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_4) < (0)) __PYX_ERR(1, 17, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opendht.pyx":118
 *             return self._infohash == other._infohash
 *         return NotImplemented
 *     def getBit(InfoHash self, bit):             # <<<<<<<<<<<<<<
 *         return self._infohash.getBit(bit)
 *     def setBit(InfoHash self, bit, b):
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_8InfoHash_7getBit, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_InfoHash_getBit, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[12])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 118, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_InfoHash, __pyx_mstate_global->__pyx_n_u_getBit, __pyx_t_4) < (0)) __PYX_ERR(0, 118, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opendht.pyx":120
 *     def getBit(InfoHash self, bit):
 *         return self._infohash.getBit(bit)
 *     def setBit(InfoHash self, bit, b):             # <<<<<<<<<<<<<<
 *         self._infohash.setBit(bit, b)
 *     def getId(InfoHash self):
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_8InfoHash_9setBit, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_InfoHash_setBit, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[13])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 120, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_InfoHash, __pyx_mstate_global->__pyx_n_u_setBit, __pyx_t_4) < (0)) __PYX_ERR(0, 120, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opendht.pyx":122
 *     def setBit(InfoHash self, bit, b):
 *         self._infohash.setBit(bit, b)
 *     def getId(InfoHash self):             # <<<<<<<<<<<<<<
 *         return self
 *     def toString(InfoHash self):
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_8InfoHash_11getId, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_InfoHash_getId, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[14])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 122, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_InfoHash, __pyx_mstate_global->__pyx_n_u_getId, __pyx_t_4) < (0)) __PYX_ERR(0, 122, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opendht.pyx":124
 *     def getId(InfoHash self):
 *         return self
 *     def toString(InfoHash self):             # <<<<<<<<<<<<<<
 *         return self._infohash.toString()
 *     def toFloat(InfoHash self):
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_8InfoHash_13toString, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_InfoHash_toString, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[15])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 124, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_InfoHash, __pyx_mstate_global->__pyx_n_u_toString, __pyx_t_4) < (0)) __PYX_ERR(0, 124, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opendht.pyx":126
 *     def toString(InfoHash self):
 *         return self._infohash.toString()
 *     def toFloat(InfoHash self):             # <<<<<<<<<<<<<<
 *         return self._infohash.toFloat()
 *     @staticmethod
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_8InfoHash_15toFloat, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_InfoHash_toFloat, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[16])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 126, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_InfoHash, __pyx_mstate_global->__pyx_n_u_toFloat, __pyx_t_4) < (0)) __PYX_ERR(0, 126, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opendht.pyx":128
 *     def toFloat(InfoHash self):
 *         return self._infohash.toFloat()
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def commonBits(InfoHash a, InfoHash b) -> int:
 *         return cpp.InfoHash.commonBits(a._infohash, b._infohash)
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 128, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(0, 128, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_8InfoHash_17commonBits, __Pyx_CYFUNCTION_STATICMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_InfoHash_commonBits, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[17])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 128, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_InfoHash, __pyx_mstate_global->__pyx_n_u_commonBits, __pyx_t_2) < (0)) __PYX_ERR(0, 128, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = NULL;
  __Pyx_GetNameInClass(__pyx_t_5, (PyObject*)__pyx_mstate_global->__pyx_ptype_7opendht_5_core_InfoHash, __pyx_mstate_global->__pyx_n_u_commonBits); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 128, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_staticmethod, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 128, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_InfoHash, __pyx_mstate_global->__pyx_n_u_commonBits, __pyx_t_2) < (0)) __PYX_ERR(0, 128, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opendht.pyx":131
 *     def commonBits(InfoHash a, InfoHash b) -> int:
 *         return cpp.InfoHash.commonBits(a._infohash, b._infohash)
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def get(str key) -> InfoHash:
 *         h = InfoHash()
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_InfoHash) < (0)) __PYX_ERR(0, 131, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_8InfoHash_19get, __Pyx_CYFUNCTION_STATICMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_InfoHash_get, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[18])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_InfoHash, __pyx_mstate_global->__pyx_n_u_get, __pyx_t_5) < (0)) __PYX_ERR(0, 131, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_2 = NULL;
  __Pyx_GetNameInClass(__pyx_t_4, (PyObject*)__pyx_mstate_global->__pyx_ptype_7opendht_5_core_InfoHash, __pyx_mstate_global->__pyx_n_u_get); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_4};
    __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_staticmethod, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 131, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
  }
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_InfoHash, __pyx_mstate_global->__pyx_n_u_get, __pyx_t_5) < (0)) __PYX_ERR(0, 131, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "opendht.pyx":136
 *         h._infohash = cpp.InfoHash.get(key.encode())
 *         return h
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def getRandom() -> InfoHash:
 *         h = InfoHash()
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 136, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_InfoHash) < (0)) __PYX_ERR(0, 136, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_8InfoHash_21getRandom, __Pyx_CYFUNCTION_STATICMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_InfoHash_getRandom, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[19])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 136, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_InfoHash, __pyx_mstate_global->__pyx_n_u_getRandom, __pyx_t_4) < (0)) __PYX_ERR(0, 136, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_5 = NULL;
  __Pyx_GetNameInClass(__pyx_t_2, (PyObject*)__pyx_mstate_global->__pyx_ptype_7opendht_5_core_InfoHash, __pyx_mstate_global->__pyx_n_u_getRandom); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 136, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_2};
    __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_staticmethod, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 136, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_InfoHash, __pyx_mstate_global->__pyx_n_u_getRandom, __pyx_t_4) < (0)) __PYX_ERR(0, 136, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_8InfoHash_23__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_InfoHash___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[20])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_4) < (0)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_8InfoHash_25__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_InfoHash___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[21])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_4) < (0)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opendht.pyx":156
 *             return self._pkid == other._pkid
 *         return NotImplemented
 *     def getBit(PkId self, bit):             # <<<<<<<<<<<<<<
 *         return self._pkid.getBit(bit)
 *     def setBit(PkId self, bit, b):
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_4PkId_7getBit, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PkId_getBit, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[22])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 156, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_PkId, __pyx_mstate_global->__pyx_n_u_getBit, __pyx_t_4) < (0)) __PYX_ERR(0, 156, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opendht.pyx":158
 *     def getBit(PkId self, bit):
 *         return self._pkid.getBit(bit)
 *     def setBit(PkId self, bit, b):             # <<<<<<<<<<<<<<
 *         self._pkid.setBit(bit, b)
 *     def getLongId(PkId self):
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_4PkId_9setBit, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PkId_setBit, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[23])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 158, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_PkId, __pyx_mstate_global->__pyx_n_u_setBit, __pyx_t_4) < (0)) __PYX_ERR(0, 158, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opendht.pyx":160
 *     def setBit(PkId self, bit, b):
 *         self._pkid.setBit(bit, b)
 *     def getLongId(PkId self):             # <<<<<<<<<<<<<<
 *         return self
 *     def toString(PkId self):
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_4PkId_11getLongId, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PkId_getLongId, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[24])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 160, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_PkId, __pyx_mstate_global->__pyx_n_u_getLongId, __pyx_t_4) < (0)) __PYX_ERR(0, 160, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opendht.pyx":162
 *     def getLongId(PkId self):
 *         return self
 *     def toString(PkId self):             # <<<<<<<<<<<<<<
 *         return self._pkid.toString()
 *     def toFloat(PkId self) -> float:
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_4PkId_13toString, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PkId_toString, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[25])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 162, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_PkId, __pyx_mstate_global->__pyx_n_u_toString, __pyx_t_4) < (0)) __PYX_ERR(0, 162, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opendht.pyx":164
 *     def toString(PkId self):
 *         return self._pkid.toString()
 *     def toFloat(PkId self) -> float:             # <<<<<<<<<<<<<<
 *         return self._pkid.toFloat()
 *     @staticmethod
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 164, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(0, 164, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_4PkId_15toFloat, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PkId_toFloat, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[26])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 164, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_PkId, __pyx_mstate_global->__pyx_n_u_toFloat, __pyx_t_2) < (0)) __PYX_ERR(0, 164, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opendht.pyx":166
 *     def toFloat(PkId self) -> float:
 *         return self._pkid.toFloat()
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def commonBits(PkId a, PkId b) -> int:
 *         return cpp.PkId.commonBits(a._pkid, b._pkid)
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(0, 166, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_4PkId_17commonBits, __Pyx_CYFUNCTION_STATICMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PkId_commonBits, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[27])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_PkId, __pyx_mstate_global->__pyx_n_u_commonBits, __pyx_t_4) < (0)) __PYX_ERR(0, 166, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_2 = NULL;
  __Pyx_GetNameInClass(__pyx_t_5, (PyObject*)__pyx_mstate_global->__pyx_ptype_7opendht_5_core_PkId, __pyx_mstate_global->__pyx_n_u_commonBits); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_5};
    __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_staticmethod, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 166, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_PkId, __pyx_mstate_global->__pyx_n_u_commonBits, __pyx_t_4) < (0)) __PYX_ERR(0, 166, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opendht.pyx":169
 *     def commonBits(PkId a, PkId b) -> int:
 *         return cpp.PkId.commonBits(a._pkid, b._pkid)
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def get(str key) -> PkId:
 *         h = PkId()
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 169, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_PkId) < (0)) __PYX_ERR(0, 169, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_4PkId_19get, __Pyx_CYFUNCTION_STATICMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PkId_get, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[28])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 169, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_PkId, __pyx_mstate_global->__pyx_n_u_get, __pyx_t_5) < (0)) __PYX_ERR(0, 169, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_4 = NULL;
  __Pyx_GetNameInClass(__pyx_t_2, (PyObject*)__pyx_mstate_global->__pyx_ptype_7opendht_5_core_PkId, __pyx_mstate_global->__pyx_n_u_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 169, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2};
    __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_staticmethod, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 169, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
  }
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_PkId, __pyx_mstate_global->__pyx_n_u_get, __pyx_t_5) < (0)) __PYX_ERR(0, 169, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "opendht.pyx":174
 *         h._pkid = cpp.PkId.get(key.encode())
 *         return h
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def getRandom() -> PkId:
 *         h = PkId()
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 174, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_PkId) < (0)) __PYX_ERR(0, 174, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_4PkId_21getRandom, __Pyx_CYFUNCTION_STATICMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PkId_getRandom, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[29])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 174, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_PkId, __pyx_mstate_global->__pyx_n_u_getRandom, __pyx_t_2) < (0)) __PYX_ERR(0, 174, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_5 = NULL;
  __Pyx_GetNameInClass(__pyx_t_4, (PyObject*)__pyx_mstate_global->__pyx_ptype_7opendht_5_core_PkId, __pyx_mstate_global->__pyx_n_u_getRandom); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 174, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_4};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_staticmethod, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 174, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_PkId, __pyx_mstate_global->__pyx_n_u_getRandom, __pyx_t_2) < (0)) __PYX_ERR(0, 174, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_4PkId_23__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PkId___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[30])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_2) < (0)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_4PkId_25__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PkId___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[31])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_2) < (0)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opendht.pyx":182
 * cdef class SockAddr(object):
 *     cdef cpp.SockAddr _addr
 *     def toString(SockAddr self):             # <<<<<<<<<<<<<<
 *         return self._addr.toString()
 *     def getPort(SockAddr self):
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_8SockAddr_1toString, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SockAddr_toString, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[32])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 182, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_SockAddr, __pyx_mstate_global->__pyx_n_u_toString, __pyx_t_2) < (0)) __PYX_ERR(0, 182, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opendht.pyx":184
 *     def toString(SockAddr self):
 *         return self._addr.toString()
 *     def getPort(SockAddr self):             # <<<<<<<<<<<<<<
 *         return self._addr.getPort()
 *     def getFamily(SockAddr self):
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_8SockAddr_3getPort, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SockAddr_getPort, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[33])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 184, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_SockAddr, __pyx_mstate_global->__pyx_n_u_getPort, __pyx_t_2) < (0)) __PYX_ERR(0, 184, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opendht.pyx":186
 *     def getPort(SockAddr self):
 *         return self._addr.getPort()
 *     def getFamily(SockAddr self):             # <<<<<<<<<<<<<<
 *         return self._addr.getFamily()
 *     def setPort(SockAddr self, cpp.in_port_t port):
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_8SockAddr_5getFamily, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SockAddr_getFamily, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[34])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 186, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_SockAddr, __pyx_mstate_global->__pyx_n_u_getFamily, __pyx_t_2) < (0)) __PYX_ERR(0, 186, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opendht.pyx":188
 *     def getFamily(SockAddr self):
 *         return self._addr.getFamily()
 *     def setPort(SockAddr self, cpp.in_port_t port):             # <<<<<<<<<<<<<<
 *         return self._addr.setPort(port)
 *     def setFamily(SockAddr self, cpp.sa_family_t af):
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_8SockAddr_7setPort, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SockAddr_setPort, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[35])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 188, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_SockAddr, __pyx_mstate_global->__pyx_n_u_setPort, __pyx_t_2) < (0)) __PYX_ERR(0, 188, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opendht.pyx":190
 *     def setPort(SockAddr self, cpp.in_port_t port):
 *         return self._addr.setPort(port)
 *     def setFamily(SockAddr self, cpp.sa_family_t af):             # <<<<<<<<<<<<<<
 *         return self._addr.setFamily(af)
 *     def isLoopback(SockAddr self):
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_8SockAddr_9setFamily, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SockAddr_setFamily, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[36])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 190, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_SockAddr, __pyx_mstate_global->__pyx_n_u_setFamily, __pyx_t_2) < (0)) __PYX_ERR(0, 190, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opendht.pyx":192
 *     def setFamily(SockAddr self, cpp.sa_family_t af):
 *         return self._addr.setFamily(af)
 *     def isLoopback(SockAddr self):             # <<<<<<<<<<<<<<
 *         return self._addr.isLoopback()
 *     def isPrivate(SockAddr self):
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_8SockAddr_11isLoopback, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SockAddr_isLoopback, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[37])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_SockAddr, __pyx_mstate_global->__pyx_n_u_isLoopback, __pyx_t_2) < (0)) __PYX_ERR(0, 192, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opendht.pyx":194
 *     def isLoopback(SockAddr self):
 *         return self._addr.isLoopback()
 *     def isPrivate(SockAddr self):             # <<<<<<<<<<<<<<
 *         return self._addr.isPrivate()
 *     def isUnspecified(SockAddr self):
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_8SockAddr_13isPrivate, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SockAddr_isPrivate, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[38])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_SockAddr, __pyx_mstate_global->__pyx_n_u_isPrivate, __pyx_t_2) < (0)) __PYX_ERR(0, 194, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opendht.pyx":196
 *     def isPrivate(SockAddr self):
 *         return self._addr.isPrivate()
 *     def isUnspecified(SockAddr self):             # <<<<<<<<<<<<<<
 *         return self._addr.isUnspecified()
 *     def __str__(self):
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_8SockAddr_15isUnspecified, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SockAddr_isUnspecified, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[39])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 196, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_SockAddr, __pyx_mstate_global->__pyx_n_u_isUnspecified, __pyx_t_2) < (0)) __PYX_ERR(0, 196, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opendht.pyx":202
 *     def __repr__(self):
 *         return "<%s '%s'>" % (self.__class__.__name__, str(self))
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def resolve(str host, str service=None):
 *         vals = []
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_8SockAddr_21resolve, __Pyx_CYFUNCTION_STATICMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SockAddr_resolve, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[40])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 202, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[4]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_SockAddr, __pyx_mstate_global->__pyx_n_u_resolve, __pyx_t_2) < (0)) __PYX_ERR(0, 202, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = NULL;
  __Pyx_GetNameInClass(__pyx_t_5, (PyObject*)__pyx_mstate_global->__pyx_ptype_7opendht_5_core_SockAddr, __pyx_mstate_global->__pyx_n_u_resolve); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 202, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_staticmethod, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 202, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_SockAddr, __pyx_mstate_global->__pyx_n_u_resolve, __pyx_t_2) < (0)) __PYX_ERR(0, 202, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._addr cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_8SockAddr_23__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SockAddr___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[41])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_2) < (0)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._addr cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._addr cannot be converted to a Python object for pickling"
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_8SockAddr_25__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SockAddr___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[42])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_2) < (0)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opendht.pyx":214
 * cdef class Node(_WithID):
 *     cdef shared_ptr[cpp.Node] _node
 *     def getId(self):             # <<<<<<<<<<<<<<
 *         h = InfoHash()
 *         h._infohash = self._node.get().getId()
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_4Node_1getId, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Node_getId, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[43])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 214, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_Node, __pyx_mstate_global->__pyx_n_u_getId, __pyx_t_2) < (0)) __PYX_ERR(0, 214, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opendht.pyx":218
 *         h._infohash = self._node.get().getId()
 *         return h
 *     def getAddr(self):             # <<<<<<<<<<<<<<
 *         return self._node.get().getAddrStr()
 *     def isExpired(self):
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_4Node_3getAddr, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Node_getAddr, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[44])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_Node, __pyx_mstate_global->__pyx_n_u_getAddr, __pyx_t_2) < (0)) __PYX_ERR(0, 218, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opendht.pyx":220
 *     def getAddr(self):
 *         return self._node.get().getAddrStr()
 *     def isExpired(self):             # <<<<<<<<<<<<<<
 *         return self._node.get().isExpired()
 * 
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_4Node_5isExpired, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Node_isExpired, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[45])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 220, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_Node, __pyx_mstate_global->__pyx_n_u_isExpired, __pyx_t_2) < (0)) __PYX_ERR(0, 220, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._node cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_4Node_7__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Node___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[46])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_2) < (0)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._node cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._node cannot be converted to a Python object for pickling"
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_4Node_9__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Node___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[47])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_2) < (0)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opendht.pyx":225
 * cdef class NodeEntry(_WithID):
 *     cdef cpp.pair[cpp.InfoHash, shared_ptr[cpp.Node]] _v
 *     def getId(self):             # <<<<<<<<<<<<<<
 *         h = InfoHash()
 *         h._infohash = self._v.first
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_9NodeEntry_1getId, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_NodeEntry_getId, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[48])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 225, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_NodeEntry, __pyx_mstate_global->__pyx_n_u_getId, __pyx_t_2) < (0)) __PYX_ERR(0, 225, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opendht.pyx":229
 *         h._infohash = self._v.first
 *         return h
 *     def getNode(self):             # <<<<<<<<<<<<<<
 *         n = Node()
 *         n._node = self._v.second
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_9NodeEntry_3getNode, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_NodeEntry_getNode, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[49])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 229, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_NodeEntry, __pyx_mstate_global->__pyx_n_u_getNode, __pyx_t_2) < (0)) __PYX_ERR(0, 229, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._v cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_9NodeEntry_5__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_NodeEntry___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[50])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_2) < (0)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._v cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._v cannot be converted to a Python object for pickling"
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_9NodeEntry_7__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_NodeEntry___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[51])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_2) < (0)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opendht.pyx":240
 *     def __str__(self):
 *         return self._query.toString().decode()
 *     def buildFrom(self, Select s, Where w):             # <<<<<<<<<<<<<<
 *         self._query = cpp.Query(s._select, w._where)
 *     def isSatisfiedBy(self, Query q):
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_5Query_5buildFrom, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Query_buildFrom, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[52])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 240, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_Query, __pyx_mstate_global->__pyx_n_u_buildFrom, __pyx_t_2) < (0)) __PYX_ERR(0, 240, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opendht.pyx":242
 *     def buildFrom(self, Select s, Where w):
 *         self._query = cpp.Query(s._select, w._where)
 *     def isSatisfiedBy(self, Query q):             # <<<<<<<<<<<<<<
 *         return self._query.isSatisfiedBy(q._query)
 * 
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_5Query_7isSatisfiedBy, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Query_isSatisfiedBy, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[53])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 242, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_Query, __pyx_mstate_global->__pyx_n_u_isSatisfiedBy, __pyx_t_2) < (0)) __PYX_ERR(0, 242, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_5Query_9__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Query___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[54])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_2) < (0)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_5Query_11__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Query___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[55])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_2) < (0)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opendht.pyx":254
 *     def __str__(self):
 *         return self._select.toString().decode()
 *     def isSatisfiedBy(self, Select os):             # <<<<<<<<<<<<<<
 *         return self._select.isSatisfiedBy(os._select)
 *     def field(self, int field):
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_6Select_5isSatisfiedBy, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Select_isSatisfiedBy, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[56])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 254, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_Select, __pyx_mstate_global->__pyx_n_u_isSatisfiedBy, __pyx_t_2) < (0)) __PYX_ERR(0, 254, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opendht.pyx":256
 *     def isSatisfiedBy(self, Select os):
 *         return self._select.isSatisfiedBy(os._select)
 *     def field(self, int field):             # <<<<<<<<<<<<<<
 *         self._select.field(<cpp.Field> field)
 *         return self
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_6Select_7field, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Select_field, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[57])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 256, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_Select, __pyx_mstate_global->__pyx_n_u_field, __pyx_t_2) < (0)) __PYX_ERR(0, 256, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_6Select_9__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Select___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[58])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_2) < (0)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_6Select_11__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Select___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[59])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_2) < (0)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opendht.pyx":269
 *     def __str__(self):
 *         return self._where.toString().decode()
 *     def isSatisfiedBy(self, Where where) -> bool:             # <<<<<<<<<<<<<<
 *         return self._where.isSatisfiedBy(where._where)
 *     def id(self, cpp.uint64_t id):
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 269, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(0, 269, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_5Where_5isSatisfiedBy, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Where_isSatisfiedBy, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[60])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 269, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_Where, __pyx_mstate_global->__pyx_n_u_isSatisfiedBy, __pyx_t_5) < (0)) __PYX_ERR(0, 269, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "opendht.pyx":271
 *     def isSatisfiedBy(self, Where where) -> bool:
 *         return self._where.isSatisfiedBy(where._where)
 *     def id(self, cpp.uint64_t id):             # <<<<<<<<<<<<<<
 *         self._where.id(id)
 *         return self
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_5Where_7id, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Where_id, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[61])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 271, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_Where, __pyx_mstate_global->__pyx_n_u_id, __pyx_t_5) < (0)) __PYX_ERR(0, 271, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "opendht.pyx":274
 *         self._where.id(id)
 *         return self
 *     def valueType(self, cpp.uint16_t type):             # <<<<<<<<<<<<<<
 *         self._where.valueType(type)
 *         return self
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_5Where_9valueType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Where_valueType, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[62])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 274, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_Where, __pyx_mstate_global->__pyx_n_u_valueType, __pyx_t_5) < (0)) __PYX_ERR(0, 274, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "opendht.pyx":277
 *         self._where.valueType(type)
 *         return self
 *     def owner(self, InfoHash owner_pk_hash):             # <<<<<<<<<<<<<<
 *         self._where.owner(owner_pk_hash._infohash)
 *         return self
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_5Where_11owner, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Where_owner, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[63])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 277, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_Where, __pyx_mstate_global->__pyx_n_u_owner, __pyx_t_5) < (0)) __PYX_ERR(0, 277, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "opendht.pyx":280
 *         self._where.owner(owner_pk_hash._infohash)
 *         return self
 *     def seq(self, cpp.uint16_t seq_no):             # <<<<<<<<<<<<<<
 *         self._where.seq(seq_no)
 *         return self
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_5Where_13seq, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Where_seq, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[64])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_Where, __pyx_mstate_global->__pyx_n_u_seq, __pyx_t_5) < (0)) __PYX_ERR(0, 280, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "opendht.pyx":283
 *         self._where.seq(seq_no)
 *         return self
 *     def userType(self, str user_type):             # <<<<<<<<<<<<<<
 *         self._where.userType(user_type.encode())
 *         return self
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_5Where_15userType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Where_userType, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[65])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 283, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_Where, __pyx_mstate_global->__pyx_n_u_userType, __pyx_t_5) < (0)) __PYX_ERR(0, 283, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_5Where_17__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Where___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[66])); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_5) < (0)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_5Where_19__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Where___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[67])); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_5) < (0)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._value cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_5Value_5__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Value___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[68])); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_5) < (0)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._value cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._value cannot be converted to a Python object for pickling"
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_5Value_7__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Value___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[69])); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_5) < (0)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._value cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_9ValueType_3__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ValueType___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[70])); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_5) < (0)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._value cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._value cannot be converted to a Python object for pickling"
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_9ValueType_5__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ValueType___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[71])); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_5) < (0)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._curIter,self._nodes cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_11NodeSetIter_5__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_NodeSetIter___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[72])); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_5) < (0)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._curIter,self._nodes cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._curIter,self._nodes cannot be converted to a Python object for pickling"
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_11NodeSetIter_7__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_NodeSetIter___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[73])); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_5) < (0)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "opendht.pyx":354
 * cdef class NodeSet(object):
 *     cdef map[cpp.InfoHash, shared_ptr[cpp.Node]] _nodes
 *     def size(self):             # <<<<<<<<<<<<<<
 *         return self._nodes.size()
 *     def insert(self, NodeEntry l):
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_7NodeSet_1size, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_NodeSet_size, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[74])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 354, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_NodeSet, __pyx_mstate_global->__pyx_n_u_size, __pyx_t_5) < (0)) __PYX_ERR(0, 354, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "opendht.pyx":356
 *     def size(self):
 *         return self._nodes.size()
 *     def insert(self, NodeEntry l):             # <<<<<<<<<<<<<<
 *         return self._nodes.insert(l._v).second
 *     def extend(self, li):
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_7NodeSet_3insert, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_NodeSet_insert, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[75])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 356, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_NodeSet, __pyx_mstate_global->__pyx_n_u_insert, __pyx_t_5) < (0)) __PYX_ERR(0, 356, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "opendht.pyx":358
 *     def insert(self, NodeEntry l):
 *         return self._nodes.insert(l._v).second
 *     def extend(self, li):             # <<<<<<<<<<<<<<
 *         for n in li:
 *             self.insert(n)
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_7NodeSet_5extend, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_NodeSet_extend, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[76])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 358, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_NodeSet, __pyx_mstate_global->__pyx_n_u_extend, __pyx_t_5) < (0)) __PYX_ERR(0, 358, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "opendht.pyx":361
 *         for n in li:
 *             self.insert(n)
 *     def first(self):             # <<<<<<<<<<<<<<
 *         if self._nodes.empty():
 *             raise IndexError()
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_7NodeSet_7first, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_NodeSet_first, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[77])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 361, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_NodeSet, __pyx_mstate_global->__pyx_n_u_first, __pyx_t_5) < (0)) __PYX_ERR(0, 361, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "opendht.pyx":367
 *         h._infohash = deref(self._nodes.begin()).first
 *         return h
 *     def last(self):             # <<<<<<<<<<<<<<
 *         if self._nodes.empty():
 *             raise IndexError()
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_7NodeSet_9last, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_NodeSet_last, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[78])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 367, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_NodeSet, __pyx_mstate_global->__pyx_n_u_last, __pyx_t_5) < (0)) __PYX_ERR(0, 367, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._nodes cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_7NodeSet_15__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_NodeSet___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[79])); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_5) < (0)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._nodes cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._nodes cannot be converted to a Python object for pickling"
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_7NodeSet_17__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_NodeSet___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[80])); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_5) < (0)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "opendht.pyx":386
 *     cdef shared_ptr[cpp.PrivateKey] _key
 * 
 *     def getId(self) -> InfoHash:             # <<<<<<<<<<<<<<
 *         if not self._key:
 *             raise ValueError("PrivateKey is not initialized")
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 386, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_InfoHash) < (0)) __PYX_ERR(0, 386, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_10PrivateKey_1getId, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PrivateKey_getId, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[81])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 386, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_PrivateKey, __pyx_mstate_global->__pyx_n_u_getId, __pyx_t_2) < (0)) __PYX_ERR(0, 386, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opendht.pyx":393
 *         return h
 * 
 *     def getLongId(self) -> PkId:             # <<<<<<<<<<<<<<
 *         if not self._key:
 *             raise ValueError("PrivateKey is not initialized")
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 393, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_PkId) < (0)) __PYX_ERR(0, 393, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_10PrivateKey_3getLongId, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PrivateKey_getLongId, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[82])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 393, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_PrivateKey, __pyx_mstate_global->__pyx_n_u_getLongId, __pyx_t_5) < (0)) __PYX_ERR(0, 393, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "opendht.pyx":400
 *         return id
 * 
 *     def getPublicKey(self) -> PublicKey:             # <<<<<<<<<<<<<<
 *         if not self._key:
 *             raise ValueError("PrivateKey is not initialized")
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 400, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_PublicKey) < (0)) __PYX_ERR(0, 400, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_10PrivateKey_5getPublicKey, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PrivateKey_getPublicKey, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[83])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 400, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_PrivateKey, __pyx_mstate_global->__pyx_n_u_getPublicKey, __pyx_t_2) < (0)) __PYX_ERR(0, 400, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opendht.pyx":407
 *         return pk
 * 
 *     def decrypt(self, bytes dat) -> bytes:             # <<<<<<<<<<<<<<
 *         cdef size_t d_len = len(dat)
 *         cdef cpp.uint8_t* d_ptr = <cpp.uint8_t*>dat
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 407, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bytes) < (0)) __PYX_ERR(0, 407, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_10PrivateKey_7decrypt, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PrivateKey_decrypt, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[84])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 407, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_PrivateKey, __pyx_mstate_global->__pyx_n_u_decrypt, __pyx_t_5) < (0)) __PYX_ERR(0, 407, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "opendht.pyx":417
 *         return decrypted_c_str[:length]
 * 
 *     def sign(self, bytes dat) -> bytes:             # <<<<<<<<<<<<<<
 *         if not self._key:
 *             raise ValueError("PrivateKey is not initialized")
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 417, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bytes) < (0)) __PYX_ERR(0, 417, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_10PrivateKey_9sign, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PrivateKey_sign, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[85])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 417, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_PrivateKey, __pyx_mstate_global->__pyx_n_u_sign, __pyx_t_2) < (0)) __PYX_ERR(0, 417, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opendht.pyx":429
 *         return signature_c_str[:length]
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def generate() -> PrivateKey:
 *         k = PrivateKey()
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_PrivateKey) < (0)) __PYX_ERR(0, 429, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_10PrivateKey_11generate, __Pyx_CYFUNCTION_STATICMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PrivateKey_generate, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[86])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_PrivateKey, __pyx_mstate_global->__pyx_n_u_generate, __pyx_t_5) < (0)) __PYX_ERR(0, 429, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_2 = NULL;
  __Pyx_GetNameInClass(__pyx_t_4, (PyObject*)__pyx_mstate_global->__pyx_ptype_7opendht_5_core_PrivateKey, __pyx_mstate_global->__pyx_n_u_generate); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_4};
    __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_staticmethod, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 429, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
  }
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_PrivateKey, __pyx_mstate_global->__pyx_n_u_generate, __pyx_t_5) < (0)) __PYX_ERR(0, 429, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "opendht.pyx":434
 *         k._key = cpp.make_shared[cpp.PrivateKey](cpp.PrivateKey.generate())
 *         return k
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def generateEC() -> PrivateKey:
 *         k = PrivateKey()
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 434, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_PrivateKey) < (0)) __PYX_ERR(0, 434, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_10PrivateKey_13generateEC, __Pyx_CYFUNCTION_STATICMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PrivateKey_generateEC, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[87])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 434, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_PrivateKey, __pyx_mstate_global->__pyx_n_u_generateEC, __pyx_t_4) < (0)) __PYX_ERR(0, 434, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_5 = NULL;
  __Pyx_GetNameInClass(__pyx_t_2, (PyObject*)__pyx_mstate_global->__pyx_ptype_7opendht_5_core_PrivateKey, __pyx_mstate_global->__pyx_n_u_generateEC); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 434, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_2};
    __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_staticmethod, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 434, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_PrivateKey, __pyx_mstate_global->__pyx_n_u_generateEC, __pyx_t_4) < (0)) __PYX_ERR(0, 434, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._key cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_10PrivateKey_15__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PrivateKey___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[88])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_4) < (0)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._key cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._key cannot be converted to a Python object for pickling"
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_10PrivateKey_17__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PrivateKey___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[89])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_4) < (0)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opendht.pyx":442
 * cdef class PublicKey(_WithPk):
 *     cdef cpp.shared_ptr[cpp.PublicKey] _key
 *     def getId(self) -> InfoHash:             # <<<<<<<<<<<<<<
 *         if not self._key:
 *             raise ValueError("PublicKey is not initialized")
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 442, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_InfoHash) < (0)) __PYX_ERR(0, 442, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_9PublicKey_1getId, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PublicKey_getId, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[90])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 442, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_PublicKey, __pyx_mstate_global->__pyx_n_u_getId, __pyx_t_2) < (0)) __PYX_ERR(0, 442, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opendht.pyx":449
 *         return h
 * 
 *     def getLongId(self) -> PkId:             # <<<<<<<<<<<<<<
 *         if not self._key:
 *             raise ValueError("PublicKey is not initialized")
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 449, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_PkId) < (0)) __PYX_ERR(0, 449, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_9PublicKey_3getLongId, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PublicKey_getLongId, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[91])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 449, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_PublicKey, __pyx_mstate_global->__pyx_n_u_getLongId, __pyx_t_4) < (0)) __PYX_ERR(0, 449, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opendht.pyx":456
 *         return id
 * 
 *     def encrypt(self, bytes dat) -> bytes:             # <<<<<<<<<<<<<<
 *         if not self._key:
 *             raise ValueError("PublicKey is not initialized")
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 456, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bytes) < (0)) __PYX_ERR(0, 456, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_9PublicKey_5encrypt, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PublicKey_encrypt, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[92])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 456, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_PublicKey, __pyx_mstate_global->__pyx_n_u_encrypt, __pyx_t_2) < (0)) __PYX_ERR(0, 456, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opendht.pyx":468
 *         return encrypted_c_str[:length]
 * 
 *     def checkSignature(self, bytes dat, bytes signature) -> bool:             # <<<<<<<<<<<<<<
 *         if not self._key:
 *             raise ValueError("PublicKey is not initialized")
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 468, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(0, 468, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_9PublicKey_7checkSignature, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PublicKey_checkSignature, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[93])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 468, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_PublicKey, __pyx_mstate_global->__pyx_n_u_checkSignature, __pyx_t_4) < (0)) __PYX_ERR(0, 468, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._key cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_9PublicKey_9__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PublicKey___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[94])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_4) < (0)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._key cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._key cannot be converted to a Python object for pickling"
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_9PublicKey_11__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PublicKey___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[95])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_4) < (0)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opendht.pyx":486
 *         if dat:
 *             self._cert = cpp.make_shared[cpp.Certificate](<cpp.string>dat)
 *     def getId(self) -> InfoHash:             # <<<<<<<<<<<<<<
 *         if not self._cert:
 *             raise ValueError("Certificate is not initialized")
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 486, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_InfoHash) < (0)) __PYX_ERR(0, 486, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_11Certificate_3getId, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Certificate_getId, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[96])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 486, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_Certificate, __pyx_mstate_global->__pyx_n_u_getId, __pyx_t_2) < (0)) __PYX_ERR(0, 486, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opendht.pyx":492
 *         h._infohash = self._cert.get().getId()
 *         return h
 *     def getLongId(self) -> PkId:             # <<<<<<<<<<<<<<
 *         if not self._cert:
 *             raise ValueError("Certificate is not initialized")
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 492, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_PkId) < (0)) __PYX_ERR(0, 492, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_11Certificate_5getLongId, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Certificate_getLongId, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[97])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 492, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_Certificate, __pyx_mstate_global->__pyx_n_u_getLongId, __pyx_t_4) < (0)) __PYX_ERR(0, 492, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opendht.pyx":498
 *         id._pkid = self._cert.get().getLongId()
 *         return id
 *     def toString(self) -> str:             # <<<<<<<<<<<<<<
 *         if not self._cert:
 *             return ""
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 498, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_str) < (0)) __PYX_ERR(0, 498, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_11Certificate_7toString, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Certificate_toString, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[98])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 498, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_Certificate, __pyx_mstate_global->__pyx_n_u_toString, __pyx_t_2) < (0)) __PYX_ERR(0, 498, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opendht.pyx":502
 *             return ""
 *         return self._cert.get().toString().decode()
 *     def getName(self) -> str:             # <<<<<<<<<<<<<<
 *         return self._cert.get().getName().decode()
 *     def revoke(self, PrivateKey k, Certificate c):
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 502, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_str) < (0)) __PYX_ERR(0, 502, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_11Certificate_9getName, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Certificate_getName, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[99])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 502, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_Certificate, __pyx_mstate_global->__pyx_n_u_getName, __pyx_t_4) < (0)) __PYX_ERR(0, 502, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opendht.pyx":504
 *     def getName(self) -> str:
 *         return self._cert.get().getName().decode()
 *     def revoke(self, PrivateKey k, Certificate c):             # <<<<<<<<<<<<<<
 *         self._cert.get().revoke(deref(k._key.get()), deref(c._cert.get()));
 *     def __bytes__(self):
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_11Certificate_11revoke, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Certificate_revoke, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[100])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 504, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_Certificate, __pyx_mstate_global->__pyx_n_u_revoke, __pyx_t_4) < (0)) __PYX_ERR(0, 504, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opendht.pyx":506
 *     def revoke(self, PrivateKey k, Certificate c):
 *         self._cert.get().revoke(deref(k._key.get()), deref(c._cert.get()));
 *     def __bytes__(self):             # <<<<<<<<<<<<<<
 *         return self._cert.get().toString().encode() if self._cert else b''
 *     @property
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_11Certificate_13__bytes__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Certificate___bytes, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[101])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 506, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_Certificate, __pyx_mstate_global->__pyx_n_u_bytes_2, __pyx_t_4) < (0)) __PYX_ERR(0, 506, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opendht.pyx":516
 *         return None
 *     @staticmethod
 *     def generate(PrivateKey k, str name, Identity i = Identity(), bool is_ca = False):             # <<<<<<<<<<<<<<
 *         c = Certificate()
 *         c._cert = cpp.make_shared[cpp.Certificate](cpp.Certificate.generate(deref(k._key.get()), name.encode(), i._id, is_ca))
*/
  __pyx_t_2 = NULL;
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7opendht_5_core_Identity, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 516, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_4);
  }
  __pyx_mstate_global->__pyx_k__8 = ((struct __pyx_obj_7opendht_5_core_Identity *)__pyx_t_4);
  __Pyx_GIVEREF((PyObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "opendht.pyx":515
 *             return c
 *         return None
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def generate(PrivateKey k, str name, Identity i = Identity(), bool is_ca = False):
 *         c = Certificate()
*/
  __pyx_t_2 = NULL;

  /* "opendht.pyx":516
 *         return None
 *     @staticmethod
 *     def generate(PrivateKey k, str name, Identity i = Identity(), bool is_ca = False):             # <<<<<<<<<<<<<<
 *         c = Certificate()
 *         c._cert = cpp.make_shared[cpp.Certificate](cpp.Certificate.generate(deref(k._key.get()), name.encode(), i._id, is_ca))
*/
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7opendht_5_core_Identity, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 516, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_4);
  }

  /* "opendht.pyx":515
 *             return c
 *         return None
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def generate(PrivateKey k, str name, Identity i = Identity(), bool is_ca = False):
 *         c = Certificate()
*/
  {
    PyObject* __pyx_temp[2] = {((PyObject *)__pyx_t_4), Py_False};
    __pyx_t_2 = __Pyx_PyTuple_FromArray(__pyx_temp, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 515, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF((PyObject *)__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_11Certificate_15generate, __Pyx_CYFUNCTION_STATICMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Certificate_generate, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[102])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 515, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_Certificate, __pyx_mstate_global->__pyx_n_u_generate, __pyx_t_4) < (0)) __PYX_ERR(0, 515, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_2 = NULL;
  __Pyx_GetNameInClass(__pyx_t_5, (PyObject*)__pyx_mstate_global->__pyx_ptype_7opendht_5_core_Certificate, __pyx_mstate_global->__pyx_n_u_generate); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 515, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_5};
    __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_staticmethod, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 515, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_Certificate, __pyx_mstate_global->__pyx_n_u_generate, __pyx_t_4) < (0)) __PYX_ERR(0, 515, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._cert cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_11Certificate_17__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Certificate___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[103])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_4) < (0)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._cert cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._cert cannot be converted to a Python object for pickling"
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_11Certificate_19__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Certificate___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[104])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_4) < (0)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opendht.pyx":525
 *     def __bool__(self):
 *         return self._result.isValid()
 *     def __str(self):             # <<<<<<<<<<<<<<
 *         return self._result.toString()
 * 
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_12VerifyResult_3_VerifyResult__str, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_VerifyResult___str, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[105])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_VerifyResult, __pyx_mstate_global->__pyx_n_u_VerifyResult__str, __pyx_t_4) < (0)) __PYX_ERR(0, 525, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._result cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_12VerifyResult_5__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_VerifyResult___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[106])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_4) < (0)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._result cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._result cannot be converted to a Python object for pickling"
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_12VerifyResult_7__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_VerifyResult___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[107])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_4) < (0)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opendht.pyx":530
 * cdef class TrustList(object):
 *     cdef cpp.TrustList _trust
 *     def add(self, Certificate cert):             # <<<<<<<<<<<<<<
 *         self._trust.add(deref(cert._cert.get()))
 *     def remove(self, Certificate cert):
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_9TrustList_1add, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TrustList_add, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[108])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 530, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_TrustList, __pyx_mstate_global->__pyx_n_u_add, __pyx_t_4) < (0)) __PYX_ERR(0, 530, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opendht.pyx":532
 *     def add(self, Certificate cert):
 *         self._trust.add(deref(cert._cert.get()))
 *     def remove(self, Certificate cert):             # <<<<<<<<<<<<<<
 *         self._trust.remove(deref(cert._cert.get()))
 *     def verify(self, Certificate cert):
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_9TrustList_3remove, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TrustList_remove, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[109])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 532, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_TrustList, __pyx_mstate_global->__pyx_n_u_remove, __pyx_t_4) < (0)) __PYX_ERR(0, 532, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opendht.pyx":534
 *     def remove(self, Certificate cert):
 *         self._trust.remove(deref(cert._cert.get()))
 *     def verify(self, Certificate cert):             # <<<<<<<<<<<<<<
 *         r = VerifyResult()
 *         r._result = self._trust.verify(deref(cert._cert.get()))
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_9TrustList_5verify, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TrustList_verify, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[110])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 534, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_TrustList, __pyx_mstate_global->__pyx_n_u_verify, __pyx_t_4) < (0)) __PYX_ERR(0, 534, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._trust cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_9TrustList_7__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TrustList___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[111])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_4) < (0)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._trust cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._trust cannot be converted to a Python object for pickling"
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_9TrustList_9__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TrustList___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[112])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_4) < (0)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opendht.pyx":542
 *     cdef cpp.InfoHash _h
 *     cdef cpp.shared_future[size_t] _t
 *     _cb = dict()             # <<<<<<<<<<<<<<
 * 
 * cdef class Identity(object):
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_ListenToken, __pyx_mstate_global->__pyx_n_u_cb, __pyx_t_4) < (0)) __PYX_ERR(0, 542, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._h,self._t cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_11ListenToken_1__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ListenToken___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[113])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_4) < (0)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._h,self._t cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._h,self._t cannot be converted to a Python object for pickling"
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_11ListenToken_3__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ListenToken___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[114])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_4) < (0)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opendht.pyx":552
 *             self._id.second = c._cert
 *     @staticmethod
 *     def generate(str name = "pydht", Identity ca = Identity(), unsigned bits = 4096):             # <<<<<<<<<<<<<<
 *         i = Identity()
 *         i._id = cpp.generateIdentity(name.encode(), ca._id, bits)
*/
  __pyx_t_5 = NULL;
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
    __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7opendht_5_core_Identity, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 552, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_4);
  }
  __pyx_mstate_global->__pyx_k__9 = ((struct __pyx_obj_7opendht_5_core_Identity *)__pyx_t_4);
  __Pyx_GIVEREF((PyObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "opendht.pyx":551
 *         if c:
 *             self._id.second = c._cert
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def generate(str name = "pydht", Identity ca = Identity(), unsigned bits = 4096):
 *         i = Identity()
*/
  __pyx_t_5 = NULL;

  /* "opendht.pyx":552
 *             self._id.second = c._cert
 *     @staticmethod
 *     def generate(str name = "pydht", Identity ca = Identity(), unsigned bits = 4096):             # <<<<<<<<<<<<<<
 *         i = Identity()
 *         i._id = cpp.generateIdentity(name.encode(), ca._id, bits)
*/
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
    __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7opendht_5_core_Identity, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 552, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_4);
  }

  /* "opendht.pyx":551
 *         if c:
 *             self._id.second = c._cert
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def generate(str name = "pydht", Identity ca = Identity(), unsigned bits = 4096):
 *         i = Identity()
*/
  {
    PyObject* __pyx_temp[3] = {__pyx_mstate_global->__pyx_n_u_pydht, ((PyObject *)__pyx_t_4), __pyx_mstate_global->__pyx_int_4096};
    __pyx_t_5 = __Pyx_PyTuple_FromArray(__pyx_temp, 3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 551, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
  }
  __Pyx_DECREF((PyObject *)__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_8Identity_3generate, __Pyx_CYFUNCTION_STATICMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Identity_generate, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[115])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 551, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_Identity, __pyx_mstate_global->__pyx_n_u_generate, __pyx_t_4) < (0)) __PYX_ERR(0, 551, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_5 = NULL;
  __Pyx_GetNameInClass(__pyx_t_2, (PyObject*)__pyx_mstate_global->__pyx_ptype_7opendht_5_core_Identity, __pyx_mstate_global->__pyx_n_u_generate); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 551, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_2};
    __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_staticmethod, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 551, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_Identity, __pyx_mstate_global->__pyx_n_u_generate, __pyx_t_4) < (0)) __PYX_ERR(0, 551, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._id cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_8Identity_5__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Identity___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[116])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_4) < (0)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._id cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._id cannot be converted to a Python object for pickling"
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_8Identity_7__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Identity___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[117])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_4) < (0)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opendht.pyx":578
 *         return k
 * 
 * def aesEncrypt(bytes data, str password) -> bytes :             # <<<<<<<<<<<<<<
 *     cdef size_t d_len = len(data)
 *     cdef cpp.uint8_t* d_ptr = <cpp.uint8_t*>data
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 578, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bytes) < (0)) __PYX_ERR(0, 578, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_3aesEncrypt, 0, __pyx_mstate_global->__pyx_n_u_aesEncrypt, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[118])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 578, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_aesEncrypt, __pyx_t_2) < (0)) __PYX_ERR(0, 578, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opendht.pyx":588
 *     return encrypted_c_str[:length]
 * 
 * def aesDecrypt(bytes data, str password) -> bytes :             # <<<<<<<<<<<<<<
 *     cdef size_t d_len = len(data)
 *     cdef cpp.uint8_t* d_ptr = <cpp.uint8_t*>data
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 588, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bytes) < (0)) __PYX_ERR(0, 588, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_5aesDecrypt, 0, __pyx_mstate_global->__pyx_n_u_aesDecrypt, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[119])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 588, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_aesDecrypt, __pyx_t_4) < (0)) __PYX_ERR(0, 588, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opendht.pyx":603
 *         self._config = cpp.DhtRunnerConfig()
 *         self._config.threaded = True
 *     def setIdentity(self, Identity id):             # <<<<<<<<<<<<<<
 *         self._config.dht_config.id = id._id
 *     def setBootstrapMode(self, bool bootstrap):
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_9DhtConfig_3setIdentity, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DhtConfig_setIdentity, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[120])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 603, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_DhtConfig, __pyx_mstate_global->__pyx_n_u_setIdentity, __pyx_t_4) < (0)) __PYX_ERR(0, 603, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opendht.pyx":605
 *     def setIdentity(self, Identity id):
 *         self._config.dht_config.id = id._id
 *     def setBootstrapMode(self, bool bootstrap):             # <<<<<<<<<<<<<<
 *         self._config.dht_config.node_config.is_bootstrap = bootstrap
 *     def setNodeId(self, InfoHash id):
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_9DhtConfig_5setBootstrapMode, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DhtConfig_setBootstrapMode, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[121])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 605, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_DhtConfig, __pyx_mstate_global->__pyx_n_u_setBootstrapMode, __pyx_t_4) < (0)) __PYX_ERR(0, 605, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opendht.pyx":607
 *     def setBootstrapMode(self, bool bootstrap):
 *         self._config.dht_config.node_config.is_bootstrap = bootstrap
 *     def setNodeId(self, InfoHash id):             # <<<<<<<<<<<<<<
 *         self._config.dht_config.node_config.node_id = id._infohash
 *     def setNetwork(self, unsigned netid):
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_9DhtConfig_7setNodeId, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DhtConfig_setNodeId, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[122])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 607, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_DhtConfig, __pyx_mstate_global->__pyx_n_u_setNodeId, __pyx_t_4) < (0)) __PYX_ERR(0, 607, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opendht.pyx":609
 *     def setNodeId(self, InfoHash id):
 *         self._config.dht_config.node_config.node_id = id._infohash
 *     def setNetwork(self, unsigned netid):             # <<<<<<<<<<<<<<
 *         self._config.dht_config.node_config.network = netid
 *     def setMaintainStorage(self, bool maintain_storage):
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_9DhtConfig_9setNetwork, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DhtConfig_setNetwork, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[123])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 609, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_DhtConfig, __pyx_mstate_global->__pyx_n_u_setNetwork, __pyx_t_4) < (0)) __PYX_ERR(0, 609, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opendht.pyx":611
 *     def setNetwork(self, unsigned netid):
 *         self._config.dht_config.node_config.network = netid
 *     def setMaintainStorage(self, bool maintain_storage):             # <<<<<<<<<<<<<<
 *         self._config.dht_config.node_config.maintain_storage = maintain_storage
 *     def setRateLimit(self, ssize_t max_req_per_sec, ssize_t max_peer_req_per_sec):
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_9DhtConfig_11setMaintainStorage, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DhtConfig_setMaintainStorage, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[124])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 611, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_DhtConfig, __pyx_mstate_global->__pyx_n_u_setMaintainStorage, __pyx_t_4) < (0)) __PYX_ERR(0, 611, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opendht.pyx":613
 *     def setMaintainStorage(self, bool maintain_storage):
 *         self._config.dht_config.node_config.maintain_storage = maintain_storage
 *     def setRateLimit(self, ssize_t max_req_per_sec, ssize_t max_peer_req_per_sec):             # <<<<<<<<<<<<<<
 *         self._config.dht_config.node_config.max_req_per_sec = max_req_per_sec
 *         self._config.dht_config.node_config.max_peer_req_per_sec = max_peer_req_per_sec
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_9DhtConfig_13setRateLimit, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DhtConfig_setRateLimit, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[125])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 613, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_DhtConfig, __pyx_mstate_global->__pyx_n_u_setRateLimit, __pyx_t_4) < (0)) __PYX_ERR(0, 613, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opendht.pyx":616
 *         self._config.dht_config.node_config.max_req_per_sec = max_req_per_sec
 *         self._config.dht_config.node_config.max_peer_req_per_sec = max_peer_req_per_sec
 *     def setProxyInfo(self, str proxy_server, str push_node_id="", str push_token="", str push_topic="", str push_platform="", str user_agent="", Certificate server_ca = Certificate()):             # <<<<<<<<<<<<<<
 *         self._config.proxy_server = proxy_server.encode()
 *         self._config.push_node_id = push_node_id.encode()
*/
  __pyx_t_2 = NULL;
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7opendht_5_core_Certificate, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 616, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_4);
  }
  __pyx_mstate_global->__pyx_k__10 = ((struct __pyx_obj_7opendht_5_core_Certificate *)__pyx_t_4);
  __Pyx_GIVEREF((PyObject *)__pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7opendht_5_core_Certificate, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 616, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_4);
  }
  {
    PyObject* __pyx_temp[6] = {__pyx_mstate_global->__pyx_kp_u__5, __pyx_mstate_global->__pyx_kp_u__5, __pyx_mstate_global->__pyx_kp_u__5, __pyx_mstate_global->__pyx_kp_u__5, __pyx_mstate_global->__pyx_kp_u__5, ((PyObject *)__pyx_t_4)};
    __pyx_t_2 = __Pyx_PyTuple_FromArray(__pyx_temp, 6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 616, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF((PyObject *)__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_9DhtConfig_15setProxyInfo, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DhtConfig_setProxyInfo, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[126])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 616, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_DhtConfig, __pyx_mstate_global->__pyx_n_u_setProxyInfo, __pyx_t_4) < (0)) __PYX_ERR(0, 616, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opendht.pyx":624
 *         self._config.proxy_user_agent = user_agent.encode()
 *         self._config.server_ca = server_ca._cert
 *     def setPeerDiscovery(self, bool peer_discovery, bool peer_publish):             # <<<<<<<<<<<<<<
 *         self._config.peer_discovery = peer_discovery
 *         self._config.peer_publish = peer_publish
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_9DhtConfig_17setPeerDiscovery, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DhtConfig_setPeerDiscovery, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[127])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 624, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_DhtConfig, __pyx_mstate_global->__pyx_n_u_setPeerDiscovery, __pyx_t_4) < (0)) __PYX_ERR(0, 624, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opendht.pyx":627
 *         self._config.peer_discovery = peer_discovery
 *         self._config.peer_publish = peer_publish
 *     def setBound(self, SockAddr bind4, SockAddr bind6):             # <<<<<<<<<<<<<<
 *         self._config.bind4 = bind4._addr
 *         self._config.bind6 = bind6._addr
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_9DhtConfig_19setBound, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DhtConfig_setBound, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[128])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 627, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_DhtConfig, __pyx_mstate_global->__pyx_n_u_setBound, __pyx_t_4) < (0)) __PYX_ERR(0, 627, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._config cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_9DhtConfig_21__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DhtConfig___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[129])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_4) < (0)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._config cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._config cannot be converted to a Python object for pickling"
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_9DhtConfig_23__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DhtConfig___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[130])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_4) < (0)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opendht.pyx":635
 *     def __cinit__(self):
 *         self.thisptr.reset(new cpp.DhtRunner())
 *     def getId(self) -> InfoHash:             # <<<<<<<<<<<<<<
 *         h = InfoHash()
 *         if self.thisptr:
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 635, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_InfoHash) < (0)) __PYX_ERR(0, 635, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_9DhtRunner_3getId, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DhtRunner_getId, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[131])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 635, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_DhtRunner, __pyx_mstate_global->__pyx_n_u_getId, __pyx_t_2) < (0)) __PYX_ERR(0, 635, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opendht.pyx":640
 *             h._infohash = self.thisptr.get().getId()
 *         return h
 *     def getPublicKey(self) -> PublicKey:             # <<<<<<<<<<<<<<
 *         if not self.thisptr:
 *             raise ValueError("DhtRunner is not initialized")
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 640, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_PublicKey) < (0)) __PYX_ERR(0, 640, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_9DhtRunner_5getPublicKey, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DhtRunner_getPublicKey, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[132])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 640, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_DhtRunner, __pyx_mstate_global->__pyx_n_u_getPublicKey, __pyx_t_4) < (0)) __PYX_ERR(0, 640, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opendht.pyx":646
 *         pk._key = self.thisptr.get().getPublicKey()
 *         return pk
 *     def getNodeId(self) -> InfoHash:             # <<<<<<<<<<<<<<
 *         h = InfoHash()
 *         if self.thisptr:
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 646, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_InfoHash) < (0)) __PYX_ERR(0, 646, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_9DhtRunner_7getNodeId, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DhtRunner_getNodeId, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[133])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 646, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_DhtRunner, __pyx_mstate_global->__pyx_n_u_getNodeId, __pyx_t_2) < (0)) __PYX_ERR(0, 646, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opendht.pyx":651
 *             h._infohash = self.thisptr.get().getNodeId()
 *         return h
 *     def ping(self, SockAddr addr, done_cb=None):             # <<<<<<<<<<<<<<
 *         if done_cb:
 *             cb_obj = {'done':done_cb}
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_9DhtRunner_9ping, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DhtRunner_ping, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[134])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 651, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[4]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_DhtRunner, __pyx_mstate_global->__pyx_n_u_ping, __pyx_t_2) < (0)) __PYX_ERR(0, 651, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opendht.pyx":672
 *                     lock.wait()
 *             return ok
 *     def bootstrap(self, str host, str port=None):             # <<<<<<<<<<<<<<
 *         host_bytes = host.encode()
 *         port_bytes = port.encode() if port else b'4222'
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_9DhtRunner_11bootstrap, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DhtRunner_bootstrap, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[135])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 672, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[4]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_DhtRunner, __pyx_mstate_global->__pyx_n_u_bootstrap, __pyx_t_2) < (0)) __PYX_ERR(0, 672, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opendht.pyx":676
 *         port_bytes = port.encode() if port else b'4222'
 *         self.thisptr.get().bootstrap(<cpp.const_char*>host_bytes, <cpp.const_char*>port_bytes)
 *     def run(self, Identity id=None, is_bootstrap=False, cpp.in_port_t port=0, str ipv4="", str ipv6="", DhtConfig config=DhtConfig()):             # <<<<<<<<<<<<<<
 *         if id:
 *             config.setIdentity(id)
*/
  __pyx_t_4 = NULL;
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7opendht_5_core_DhtConfig, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 676, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_2);
  }
  __pyx_mstate_global->__pyx_k__11 = ((struct __pyx_obj_7opendht_5_core_DhtConfig *)__pyx_t_2);
  __Pyx_GIVEREF((PyObject *)__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_4 = NULL;
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7opendht_5_core_DhtConfig, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 676, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_2);
  }
  {
    PyObject* __pyx_temp[6] = {Py_None, Py_False, __pyx_mstate_global->__pyx_int_0, __pyx_mstate_global->__pyx_kp_u__5, __pyx_mstate_global->__pyx_kp_u__5, ((PyObject *)__pyx_t_2)};
    __pyx_t_4 = __Pyx_PyTuple_FromArray(__pyx_temp, 6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 676, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  __Pyx_DECREF((PyObject *)__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_9DhtRunner_13run, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DhtRunner_run, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[136])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 676, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_DhtRunner, __pyx_mstate_global->__pyx_n_u_run, __pyx_t_2) < (0)) __PYX_ERR(0, 676, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opendht.pyx":685
 *         else:
 *             self.thisptr.get().run(port, config._config)
 *     def join(self):             # <<<<<<<<<<<<<<
 *         self.thisptr.get().join()
 *     def shutdown(self, shutdown_cb=None):
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_9DhtRunner_15join, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DhtRunner_join, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[137])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 685, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_DhtRunner, __pyx_mstate_global->__pyx_n_u_join, __pyx_t_2) < (0)) __PYX_ERR(0, 685, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opendht.pyx":687
 *     def join(self):
 *         self.thisptr.get().join()
 *     def shutdown(self, shutdown_cb=None):             # <<<<<<<<<<<<<<
 *         cb_obj = {'shutdown':shutdown_cb}
 *         ref.Py_INCREF(cb_obj)
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_9DhtRunner_17shutdown, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DhtRunner_shutdown, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[138])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 687, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[4]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_DhtRunner, __pyx_mstate_global->__pyx_n_u_shutdown, __pyx_t_2) < (0)) __PYX_ERR(0, 687, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opendht.pyx":691
 *         ref.Py_INCREF(cb_obj)
 *         self.thisptr.get().shutdown(cpp.bindShutdownCb(shutdown_callback, <void*>cb_obj))
 *     def registerType(self, ValueType type):             # <<<<<<<<<<<<<<
 *         self.thisptr.get().registerType(deref(type._value))
 *     def enableLogging(self):
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_9DhtRunner_19registerType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DhtRunner_registerType, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[139])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 691, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_DhtRunner, __pyx_mstate_global->__pyx_n_u_registerType, __pyx_t_2) < (0)) __PYX_ERR(0, 691, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opendht.pyx":693
 *     def registerType(self, ValueType type):
 *         self.thisptr.get().registerType(deref(type._value))
 *     def enableLogging(self):             # <<<<<<<<<<<<<<
 *         cpp.enableLogging(self.thisptr.get()[0])
 *     def disableLogging(self):
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_9DhtRunner_21enableLogging, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DhtRunner_enableLogging, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[140])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 693, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_DhtRunner, __pyx_mstate_global->__pyx_n_u_enableLogging, __pyx_t_2) < (0)) __PYX_ERR(0, 693, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opendht.pyx":695
 *     def enableLogging(self):
 *         cpp.enableLogging(self.thisptr.get()[0])
 *     def disableLogging(self):             # <<<<<<<<<<<<<<
 *         cpp.disableLogging(self.thisptr.get()[0])
 *     def enableFileLogging(self, str path):
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_9DhtRunner_23disableLogging, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DhtRunner_disableLogging, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[141])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 695, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_DhtRunner, __pyx_mstate_global->__pyx_n_u_disableLogging, __pyx_t_2) < (0)) __PYX_ERR(0, 695, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opendht.pyx":697
 *     def disableLogging(self):
 *         cpp.disableLogging(self.thisptr.get()[0])
 *     def enableFileLogging(self, str path):             # <<<<<<<<<<<<<<
 *         cpp.enableFileLogging(self.thisptr.get()[0], path.encode())
 *     def isRunning(self):
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_9DhtRunner_25enableFileLogging, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DhtRunner_enableFileLogging, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[142])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 697, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_DhtRunner, __pyx_mstate_global->__pyx_n_u_enableFileLogging, __pyx_t_2) < (0)) __PYX_ERR(0, 697, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opendht.pyx":699
 *     def enableFileLogging(self, str path):
 *         cpp.enableFileLogging(self.thisptr.get()[0], path.encode())
 *     def isRunning(self):             # <<<<<<<<<<<<<<
 *         return self.thisptr.get().isRunning()
 *     def getBound(self, cpp.sa_family_t af = 0):
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_9DhtRunner_27isRunning, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DhtRunner_isRunning, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[143])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 699, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_DhtRunner, __pyx_mstate_global->__pyx_n_u_isRunning, __pyx_t_2) < (0)) __PYX_ERR(0, 699, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opendht.pyx":701
 *     def isRunning(self):
 *         return self.thisptr.get().isRunning()
 *     def getBound(self, cpp.sa_family_t af = 0):             # <<<<<<<<<<<<<<
 *         s = SockAddr()
 *         s._addr = self.thisptr.get().getBound(af)
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_9DhtRunner_29getBound, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DhtRunner_getBound, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[144])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 701, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[5]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_DhtRunner, __pyx_mstate_global->__pyx_n_u_getBound, __pyx_t_2) < (0)) __PYX_ERR(0, 701, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opendht.pyx":705
 *         s._addr = self.thisptr.get().getBound(af)
 *         return s
 *     def getStorageLog(self):             # <<<<<<<<<<<<<<
 *         return self.thisptr.get().getStorageLog().decode()
 *     def getRoutingTablesLog(self, cpp.sa_family_t af):
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_9DhtRunner_31getStorageLog, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DhtRunner_getStorageLog, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[145])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 705, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_DhtRunner, __pyx_mstate_global->__pyx_n_u_getStorageLog, __pyx_t_2) < (0)) __PYX_ERR(0, 705, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opendht.pyx":707
 *     def getStorageLog(self):
 *         return self.thisptr.get().getStorageLog().decode()
 *     def getRoutingTablesLog(self, cpp.sa_family_t af):             # <<<<<<<<<<<<<<
 *         return self.thisptr.get().getRoutingTablesLog(af).decode()
 *     def getSearchesLog(self, cpp.sa_family_t af):
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_9DhtRunner_33getRoutingTablesLog, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DhtRunner_getRoutingTablesLog, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[146])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 707, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_DhtRunner, __pyx_mstate_global->__pyx_n_u_getRoutingTablesLog, __pyx_t_2) < (0)) __PYX_ERR(0, 707, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opendht.pyx":709
 *     def getRoutingTablesLog(self, cpp.sa_family_t af):
 *         return self.thisptr.get().getRoutingTablesLog(af).decode()
 *     def getSearchesLog(self, cpp.sa_family_t af):             # <<<<<<<<<<<<<<
 *         return self.thisptr.get().getSearchesLog(af).decode()
 *     def getNodeMessageStats(self):
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_9DhtRunner_35getSearchesLog, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DhtRunner_getSearchesLog, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[147])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 709, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_DhtRunner, __pyx_mstate_global->__pyx_n_u_getSearchesLog, __pyx_t_2) < (0)) __PYX_ERR(0, 709, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opendht.pyx":711
 *     def getSearchesLog(self, cpp.sa_family_t af):
 *         return self.thisptr.get().getSearchesLog(af).decode()
 *     def getNodeMessageStats(self):             # <<<<<<<<<<<<<<
 *         stats = []
 *         cdef cpp.vector[unsigned] res = self.thisptr.get().getNodeMessageStats(False)
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_9DhtRunner_37getNodeMessageStats, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DhtRunner_getNodeMessageStats, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[148])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 711, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_DhtRunner, __pyx_mstate_global->__pyx_n_u_getNodeMessageStats, __pyx_t_2) < (0)) __PYX_ERR(0, 711, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opendht.pyx":718
 *         return stats
 * 
 *     def get(self, InfoHash key, get_cb=None, done_cb=None, filter=None, Where where=None):             # <<<<<<<<<<<<<<
 *         """Retreive values associated with a key on the DHT.
 * 
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_9DhtRunner_39get, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DhtRunner_get, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[149])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 718, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[6]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_DhtRunner, __pyx_mstate_global->__pyx_n_u_get, __pyx_t_2) < (0)) __PYX_ERR(0, 718, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opendht.pyx":756
 *             return res
 * 
 *     def put(self, InfoHash key, Value val, done_cb=None, permanent=False):             # <<<<<<<<<<<<<<
 *         """Publish a new value on the DHT at key.
 * 
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_9DhtRunner_41put, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DhtRunner_put, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[150])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 756, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[7]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_DhtRunner, __pyx_mstate_global->__pyx_n_u_put, __pyx_t_2) < (0)) __PYX_ERR(0, 756, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opendht.pyx":784
 *             return ok
 * 
 *     def putSigned(self, InfoHash key, Value val, done_cb=None, permanent=False):             # <<<<<<<<<<<<<<
 *         if done_cb:
 *             cb_obj = {'done':done_cb}
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_9DhtRunner_43putSigned, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DhtRunner_putSigned, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[151])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 784, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[7]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_DhtRunner, __pyx_mstate_global->__pyx_n_u_putSigned, __pyx_t_2) < (0)) __PYX_ERR(0, 784, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opendht.pyx":806
 *             return ok
 * 
 *     def putEncrypted(self, InfoHash key, Value val, to, done_cb=None, bool permanent=False):             # <<<<<<<<<<<<<<
 *         if to is None:
 *             raise ValueError("'to' must be provided")
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_9DhtRunner_45putEncrypted, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DhtRunner_putEncrypted, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[152])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 806, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[7]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_DhtRunner, __pyx_mstate_global->__pyx_n_u_putEncrypted, __pyx_t_2) < (0)) __PYX_ERR(0, 806, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opendht.pyx":845
 *             return ok
 * 
 *     def cancelPut(self, InfoHash key, Value val):             # <<<<<<<<<<<<<<
 *         self.thisptr.get().cancelPut(key._infohash, val._value)
 * 
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_9DhtRunner_47cancelPut, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DhtRunner_cancelPut, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[153])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 845, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_DhtRunner, __pyx_mstate_global->__pyx_n_u_cancelPut, __pyx_t_2) < (0)) __PYX_ERR(0, 845, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opendht.pyx":848
 *         self.thisptr.get().cancelPut(key._infohash, val._value)
 * 
 *     def listen(self, InfoHash key, value_cb):             # <<<<<<<<<<<<<<
 *         t = ListenToken()
 *         t._h = key._infohash
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_9DhtRunner_49listen, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DhtRunner_listen, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[154])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 848, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_DhtRunner, __pyx_mstate_global->__pyx_n_u_listen, __pyx_t_2) < (0)) __PYX_ERR(0, 848, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opendht.pyx":857
 *         t._t = self.thisptr.get().listen(t._h, cpp.bindValueCb(value_callback, <void*>cb_obj)).share()
 *         return t
 *     def cancelListen(self, ListenToken token):             # <<<<<<<<<<<<<<
 *         self.thisptr.get().cancelListen(token._h, token._t)
 *         ref.Py_DECREF(<object>token._cb['cb'])
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_9DhtRunner_51cancelListen, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DhtRunner_cancelListen, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[155])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 857, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_DhtRunner, __pyx_mstate_global->__pyx_n_u_cancelListen, __pyx_t_2) < (0)) __PYX_ERR(0, 857, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_9DhtRunner_53__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DhtRunner___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[156])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_2) < (0)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_9DhtRunner_55__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DhtRunner___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[157])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_2) < (0)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opendht.pyx":869
 *     def __str__(self):
 *         return "(" + self.getKey().toString().decode() +", "+ str(self.getValueId()) +")"
 *     def getKey(self):             # <<<<<<<<<<<<<<
 *         h = InfoHash()
 *         h._infohash = self._value.get().first
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_10IndexValue_5getKey, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_IndexValue_getKey, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[158])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 869, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_IndexValue, __pyx_mstate_global->__pyx_n_u_getKey, __pyx_t_2) < (0)) __PYX_ERR(0, 869, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opendht.pyx":873
 *         h._infohash = self._value.get().first
 *         return h
 *     def getValueId(self):             # <<<<<<<<<<<<<<
 *         return self._value.get().second
 * 
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_10IndexValue_7getValueId, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_IndexValue_getValueId, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[159])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 873, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_IndexValue, __pyx_mstate_global->__pyx_n_u_getValueId, __pyx_t_2) < (0)) __PYX_ERR(0, 873, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._value cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_10IndexValue_9__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_IndexValue___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[160])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_2) < (0)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._value cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._value cannot be converted to a Python object for pickling"
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_10IndexValue_11__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_IndexValue___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[161])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_2) < (0)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opendht.pyx":886
 *     def MAX_NODE_ENTRY_COUNT(self):
 *         return cpp.PHT_MAX_NODE_ENTRY_COUNT
 *     def lookup(self, key, lookup_cb=None, done_cb=None):             # <<<<<<<<<<<<<<
 *         """Query the Index with a specified key.
 * 
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_3Pht_3lookup, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Pht_lookup, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[162])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 886, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[8]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_Pht, __pyx_mstate_global->__pyx_n_u_lookup, __pyx_t_2) < (0)) __PYX_ERR(0, 886, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opendht.pyx":905
 *                 cpp.bindDoneCbSimple(done_callback_simple, <void*>cb_obj)
 *         )
 *     def insert(self, key, IndexValue value, done_cb=None):             # <<<<<<<<<<<<<<
 *         """Add an index entry to the Index.
 * 
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_3Pht_5insert, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Pht_insert, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[163])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 905, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[4]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7opendht_5_core_Pht, __pyx_mstate_global->__pyx_n_u_insert, __pyx_t_2) < (0)) __PYX_ERR(0, 905, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_3Pht_7__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Pht___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[164])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_2) < (0)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_3Pht_9__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Pht___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[165])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_2) < (0)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle__WithID(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_7__pyx_unpickle__WithID, 0, __pyx_mstate_global->__pyx_n_u_pyx_unpickle__WithID, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[166])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_pyx_unpickle__WithID, __pyx_t_2) < (0)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":1
 * cdef extern from *:             # <<<<<<<<<<<<<<
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7opendht_5_core_9__pyx_unpickle__WithPk, 0, __pyx_mstate_global->__pyx_n_u_pyx_unpickle__WithPk, NULL, __pyx_mstate_global->__pyx_n_u_opendht__core, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[167])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_pyx_unpickle__WithPk, __pyx_t_2) < (0)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opendht.pyx":1
 * # distutils: language = c++             # <<<<<<<<<<<<<<
 * # distutils: extra_compile_args = -std=c++17
 * # distutils: include_dirs = ../../include
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test, __pyx_t_2) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /*--- Wrapped vars code ---*/

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  if (__pyx_m) {
    if (__pyx_mstate->__pyx_d && stringtab_initialized) {
      __Pyx_AddTraceback("init opendht._core", __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;
      __Pyx_PyErr_FetchException(&tp, &value, &tb);
      __Pyx_State_RemoveModule(&__pyx_moduledef);
      __Pyx_PyErr_RestoreException(tp, value, tb);
    }
    #endif
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init opendht._core");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  return (__pyx_m != NULL) ? 0 : -1;
  #else
  return __pyx_m;
  #endif
}
/* #### Code section: pystring_table ### */
/* #### Code section: cached_builtins ### */

static int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate) {
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __pyx_builtin_staticmethod = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_staticmethod); if (!__pyx_builtin_staticmethod) __PYX_ERR(0, 128, __pyx_L1_error)
  __pyx_builtin_print = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_print); if (!__pyx_builtin_print) __PYX_ERR(0, 28, __pyx_L1_error)
  __pyx_builtin_NotImplemented = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_NotImplemented); if (!__pyx_builtin_NotImplemented) __PYX_ERR(0, 117, __pyx_L1_error)

  /* Cached unbound methods */
  __pyx_mstate->__pyx_umethod_PyDict_Type_items.type = (PyObject*)&PyDict_Type;
  __pyx_mstate->__pyx_umethod_PyDict_Type_items.method_name = &__pyx_mstate->__pyx_n_u_items;
  __pyx_mstate->__pyx_umethod_PyDict_Type_pop.type = (PyObject*)&PyDict_Type;
  __pyx_mstate->__pyx_umethod_PyDict_Type_pop.method_name = &__pyx_mstate->__pyx_n_u_pop;
  __pyx_mstate->__pyx_umethod_PyDict_Type_values.type = (PyObject*)&PyDict_Type;
  __pyx_mstate->__pyx_umethod_PyDict_Type_values.method_name = &__pyx_mstate->__pyx_n_u_values;
  return 0;
  __pyx_L1_error:;
  return -1;
}
/* #### Code section: cached_constants ### */

static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);

  /* "opendht.pyx":662
 *             def tmp_done(ok_ret):
 *                 nonlocal pending, ok, lock
 *                 with lock:             # <<<<<<<<<<<<<<
 *                     ok = ok_ret
 *                     pending -= 1
*/
  {
    PyObject* __pyx_temp[3] = {Py_None, Py_None, Py_None};
    __pyx_mstate_global->__pyx_tuple[0] = __Pyx_PyTuple_FromArray(__pyx_temp, 3); if (unlikely(!__pyx_mstate_global->__pyx_tuple[0])) __PYX_ERR(0, 662, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[0]);
  }
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[0]);

  /* "opendht.pyx":668
 *             with lock:
 *                 pending += 1
 *                 self.ping(addr, done_cb=tmp_done)             # <<<<<<<<<<<<<<
 *                 while pending > 0:
 *                     lock.wait()
*/
  {
    PyObject* __pyx_temp[1] = {__pyx_mstate_global->__pyx_n_u_done_cb};
    __pyx_mstate_global->__pyx_tuple[1] = __Pyx_PyTuple_FromArray(__pyx_temp, 1); if (unlikely(!__pyx_mstate_global->__pyx_tuple[1])) __PYX_ERR(0, 668, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[1]);
  }
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[1]);

  /* "opendht.pyx":751
 *             with lock:
 *                 pending += 1
 *                 self.get(key, get_cb=tmp_get, done_cb=tmp_done, filter=filter, where=where)             # <<<<<<<<<<<<<<
 *                 while pending > 0:
 *                     lock.wait()
*/
  {
    PyObject* __pyx_temp[4] = {__pyx_mstate_global->__pyx_n_u_get_cb, __pyx_mstate_global->__pyx_n_u_done_cb, __pyx_mstate_global->__pyx_n_u_filter, __pyx_mstate_global->__pyx_n_u_where};
    __pyx_mstate_global->__pyx_tuple[2] = __Pyx_PyTuple_FromArray(__pyx_temp, 4); if (unlikely(!__pyx_mstate_global->__pyx_tuple[2])) __PYX_ERR(0, 751, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[2]);
  }
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[2]);

  /* "opendht.pyx":840
 *             with lock:
 *                 pending += 1
 *                 self.putEncrypted(key, val, to=to, done_cb=tmp_done, permanent=permanent)             # <<<<<<<<<<<<<<
 *                 while pending > 0:
 *                     lock.wait()
*/
  {
    PyObject* __pyx_temp[3] = {__pyx_mstate_global->__pyx_n_u_to, __pyx_mstate_global->__pyx_n_u_done_cb, __pyx_mstate_global->__pyx_n_u_permanent};
    __pyx_mstate_global->__pyx_tuple[3] = __Pyx_PyTuple_FromArray(__pyx_temp, 3); if (unlikely(!__pyx_mstate_global->__pyx_tuple[3])) __PYX_ERR(0, 840, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[3]);
  }
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[3]);

  /* "opendht.pyx":202
 *     def __repr__(self):
 *         return "<%s '%s'>" % (self.__class__.__name__, str(self))
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def resolve(str host, str service=None):
 *         vals = []
*/
  {
    PyObject* __pyx_temp[1] = {Py_None};
    __pyx_mstate_global->__pyx_tuple[4] = __Pyx_PyTuple_FromArray(__pyx_temp, 1); if (unlikely(!__pyx_mstate_global->__pyx_tuple[4])) __PYX_ERR(0, 202, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[4]);
  }
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[4]);

  /* "opendht.pyx":701
 *     def isRunning(self):
 *         return self.thisptr.get().isRunning()
 *     def getBound(self, cpp.sa_family_t af = 0):             # <<<<<<<<<<<<<<
 *         s = SockAddr()
 *         s._addr = self.thisptr.get().getBound(af)
*/
  {
    PyObject* __pyx_temp[1] = {__pyx_mstate_global->__pyx_int_0};
    __pyx_mstate_global->__pyx_tuple[5] = __Pyx_PyTuple_FromArray(__pyx_temp, 1); if (unlikely(!__pyx_mstate_global->__pyx_tuple[5])) __PYX_ERR(0, 701, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[5]);
  }
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[5]);

  /* "opendht.pyx":718
 *         return stats
 * 
 *     def get(self, InfoHash key, get_cb=None, done_cb=None, filter=None, Where where=None):             # <<<<<<<<<<<<<<
 *         """Retreive values associated with a key on the DHT.
 * 
*/
  {
    PyObject* __pyx_temp[4] = {Py_None, Py_None, Py_None, Py_None};
    __pyx_mstate_global->__pyx_tuple[6] = __Pyx_PyTuple_FromArray(__pyx_temp, 4); if (unlikely(!__pyx_mstate_global->__pyx_tuple[6])) __PYX_ERR(0, 718, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[6]);
  }
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[6]);

  /* "opendht.pyx":756
 *             return res
 * 
 *     def put(self, InfoHash key, Value val, done_cb=None, permanent=False):             # <<<<<<<<<<<<<<
 *         """Publish a new value on the DHT at key.
 * 
*/
  {
    PyObject* __pyx_temp[2] = {Py_None, Py_False};
    __pyx_mstate_global->__pyx_tuple[7] = __Pyx_PyTuple_FromArray(__pyx_temp, 2); if (unlikely(!__pyx_mstate_global->__pyx_tuple[7])) __PYX_ERR(0, 756, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[7]);
  }
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[7]);

  /* "opendht.pyx":886
 *     def MAX_NODE_ENTRY_COUNT(self):
 *         return cpp.PHT_MAX_NODE_ENTRY_COUNT
 *     def lookup(self, key, lookup_cb=None, done_cb=None):             # <<<<<<<<<<<<<<
 *         """Query the Index with a specified key.
 * 
*/
  {
    PyObject* __pyx_temp[2] = {Py_None, Py_None};
    __pyx_mstate_global->__pyx_tuple[8] = __Pyx_PyTuple_FromArray(__pyx_temp, 2); if (unlikely(!__pyx_mstate_global->__pyx_tuple[8])) __PYX_ERR(0, 886, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[8]);
  }
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[8]);
  #if CYTHON_IMMORTAL_CONSTANTS
  {
    PyObject **table = __pyx_mstate->__pyx_tuple;
    for (Py_ssize_t i=0; i<9; ++i) {
      #if PY_VERSION_HEX >= 0x030F0000
      PyUnstable_SetImmortal(table[i]);
      #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
      if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL)) break;
      #if PY_VERSION_HEX < 0x030E0000
      if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
      #else
      if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
      #endif
      {
        Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1));
      }
      #else
      if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT)) break;
      Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
      #endif
    }
  }
  #endif
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}
/* #### Code section: init_constants ### */

static int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate) {
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  CYTHON_UNUSED_VAR(__pyx_mstate);
  {
    const struct { const unsigned int length: 8; } str_length_index[] = {{0},{1},{1},{2},{2},{30},{21},{1},{15},{1},{2},{1},{1},{1},{30},{28},{29},{179},{29},{28},{8},{11},{7},{6},{45},{2},{9},{50},{11},{62},{62},{64},{77},{67},{60},{61},{62},{63},{64},{63},{59},{63},{5},{11},{21},{29},{31},{20},{17},{21},{19},{18},{20},{9},{9},{27},{29},{26},{18},{21},{28},{20},{19},{26},{22},{22},{9},{27},{29},{19},{22},{19},{24},{27},{23},{13},{18},{15},{19},{29},{22},{29},{24},{23},{19},{14},{16},{14},{13},{22},{19},{22},{13},{18},{8},{26},{28},{17},{10},{28},{30},{17},{21},{8},{26},{28},{19},{12},{15},{14},{18},{15},{16},{17},{11},{29},{31},{4},{22},{24},{12},{10},{14},{9},{27},{29},{15},{17},{7},{25},{27},{14},{13},{14},{12},{12},{11},{29},{31},{14},{3},{21},{23},{10},{10},{4},{22},{24},{15},{8},{11},{14},{14},{11},{12},{13},{10},{28},{30},{18},{19},{21},{16},{20},{23},{15},{9},{27},{29},{24},{17},{15},{19},{5},{23},{25},{15},{19},{6},{24},{26},{12},{20},{8},{26},{28},{18},{16},{19},{18},{22},{16},{18},{16},{17},{9},{27},{29},{13},{16},{16},{5},{23},{25},{9},{27},{29},{12},{30},{32},{18},{5},{23},{25},{8},{19},{11},{9},{14},{15},{18},{7},{25},{27},{7},{25},{27},{71},{20},{12},{9},{9},{8},{9},{8},{8},{12},{8},{10},{8},{7},{14},{12},{11},{10},{22},{22},{12},{10},{17},{13},{12},{12},{19},{5},{8},{3},{5},{13},{1},{3},{4},{10},{10},{2},{18},{6},{1},{5},{5},{3},{4},{4},{9},{9},{5},{1},{2},{12},{9},{2},{6},{4},{11},{14},{18},{10},{6},{4},{5},{5},{3},{4},{8},{6},{7},{9},{15},{3},{14},{4},{7},{17},{13},{6},{7},{9},{15},{10},{6},{5},{6},{5},{5},{8},{10},{3},{21},{20},{7},{6},{8},{9},{5},{6},{9},{7},{7},{9},{19},{7},{12},{9},{19},{14},{13},{10},{6},{1},{4},{10},{1},{2},{5},{6},{3},{4},{4},{9},{10},{9},{9},{13},{13},{12},{5},{5},{4},{1},{3},{8},{2},{1},{4},{6},{2},{6},{4},{6},{9},{16},{20},{15},{1},{4},{5},{5},{6},{2},{6},{13},{2},{5},{13},{8},{4},{14},{12},{7},{9},{4},{22},{2},{3},{4},{10},{5},{12},{12},{13},{10},{10},{3},{21},{12},{30},{9},{27},{5},{1},{5},{1},{8},{12},{6},{3},{7},{6},{6},{6},{3},{1},{5},{5},{4},{3},{6},{9},{7},{6},{16},{8},{9},{11},{18},{10},{9},{16},{7},{12},{12},{10},{8},{11},{3},{4},{9},{15},{4},{5},{12},{5},{3},{1},{9},{9},{8},{7},{2},{7},{8},{5},{13},{4},{6},{12},{8},{10},{9},{1},{3},{5},{4},{5},{9},{8},{6},{6},{7},{3},{1},{4},{5},{4}};
    const struct { const unsigned int length: 8; } bytes_length_index[] = {{0},{4},{9},{11},{55},{94},{51},{49},{25},{18},{35},{15},{18},{18},{21},{20},{21},{22},{18},{25},{31},{29},{15},{23},{38},{21},{20},{24},{15},{15},{17},{16},{30},{16},{22},{15},{87},{37},{19},{7},{27},{17},{17},{15},{13},{15},{13},{13},{15},{13},{13},{15},{13},{19},{17},{17},{21},{23},{24},{13},{17},{15},{13},{13},{46},{19},{19},{25},{33},{27},{27},{33},{33},{33},{46},{69},{20},{20},{71},{9},{19},{25},{20},{16},{82},{52},{61},{52},{41},{24},{38},{52},{61},{52},{41},{53},{52},{16},{130},{102},{44},{102},{84},{95},{189},{121},{51},{36},{20},{147},{106},{133},{108},{133},{248}};
    #ifndef CYTHON_COMPRESS_STRINGS
      #define CYTHON_COMPRESS_STRINGS 90
    #endif
    #if (CYTHON_COMPRESS_STRINGS) == 3 && __PYX_LIMITED_VERSION_HEX >= 0x030e0000 /* compression: zstd (4360 bytes) */
static const char cstring[] = "(\265/\375`\336+\365\207\000\252\237,!H\300\222q\033(\212\302tQ]\250\n\252\213\352B6\227\315U\005\262\271\252@6;B\347\326<6ZYl\021\364\260h\237K\310\315\234\033\215N7W\031rk\246Z\351#r\263,C\3204\3434\344\227\270wn\032\373\213\316\001\315\001+\002\327\345\272\035+\317\0234\374f\013\240\247\026\307\376\\\252CV\016\037\214\365`\357\261\365j\212\276\006c\270\2636:\004\301\257^\033\271\262:<?\225{txy\262\236:\365\336\314\371U\350\367\352\215\347\335\034\035\356\330\327\271\346|\337\331\331\251tu\325\234\327\223\347\256,N\014\350\342\330\355r\255\301\377;8-|\177\364\353\\\235\322\266N\0251]\265}\212Cm\370\364\252\000\047\276w\206\246R{i\260N]\335\272\260\307\256\251\343\331\233Cq\264}OO\235\365\347\216\343\362\353\230\212\343Zd2\254t\030~\023\246s\210u~\034\373\026\255\254\374\364Z\014\3705\016\016\275\272\262\267\373Z]\0057|W\233\352\356lS\343\207\331\333u\033\346ZV\337g\240\030\330\242Y\324>x9\256\323\031\354\265!\3358\356\273\220>\346\270M\177\341\\]Ks\355\274\251\337U\365\026zxn\270\202@\366\377S\315\\i\014\344\256n\351l\270\352\236\243t\276\236\260\212wZ>\177\363\346a\025W\272\225<[9{\253\236v\2266\375y\263\317\322y\202o\267\360\306\266\025\316\326\222\037\214\351\315V\375\325P\265\255\356\226?\347\371u\2520oYwo\343\361F\355\334`d`2\354\330\354l\026\277\356*\326y\213}\257\047~U\375\236\332\313\3221\232MO\226\276:\333\207TNOhMlWo\364\277:o\360[\033\362hV\r\375\033\365\233UW[7}\355\226\353\366zvuU5~\032\022!Z6\014,,\332\276\313\233x\265\375c\275\262B\237V\330\305 \305i\355l\370n\261O\321\325O\025\356l\257\332t\016][\351\352\322\210Ri\333\014\004\"\242\032\017\252\267f \312\003\344\206\255\277v\004QP\210\307\211\257F\324\250\202\022/\310\014\210j!\036...0?\272\316\237\037Za\366\326\234\263\252\203y\223\373\034\202\341\375\346\325\3631K\353L/K\277\253\253\331\253\371\273\372\372\234s\266!\2668\324\217\361\353\025\323!\250]\370\256\364\374@Z9\216\225C\020W\014j|A\360\202-\020\324\366\355t\201\224\245\047H\361\375a\345\311\342Z \227\257n\335\326\325\327\322\252\337\332""\016\277\036s\370\037\344\200\246+s\256V\375X\332\263\377}\255\026\027\373V+\273^\327\311\345\032\003\003\003\253\266\225\326\252\363e\2618\320\245\365{+\374\372\263O\337^\332q\364\351\355~\352I\261\0069j\377\343h\013\004\273\357\270\267\365\353T\235\252\233]\367\335\253R\305\300P[U*=s\313\255\235\215\345\271\26265\371\047\246t\316\317U\245\363k.\353\317\337\014_\334\333\020\214iW\230\301\237wM\373\205\364\332:]^\005\302\224\343\270\325\363h\240\327\2515\340\304?-#\3627\273\373\205h\341\354\343\271\363q\217o\307q\340:p\235\roh8\240\330\016\327\332\251\301a\351\352\303\301r\370\372\214\237\326\307\317\362\301\232\047\266\252\370a\017\273\256\307\224\316\236\014\373n~\\\273\007\263e\321\352\246\n\274U\343\373U\327\274iu\227~\272\373\357S\261\031\372u\225\253\236\251\\]\027\337\320\030\376\020\365\217C=[\235\365j\246\261y\232\301\260u\357\247Y;\364\377\003]8\372F\315\363\303\237m\315\270\256\250}\r\364\372S1\254\255\315\333\344\212)=\331o\335\236y\277\233\253\263\353RK\263\25636\265\321\202\332I\026\022\203\200~\372\317\253\277\300\016~\375\373\376\263O\031]\206\213\356\"\325S<\375\206f\242\261\314f\\\272\013\251\313\020\035\214\350#b\310\323\013\304N\001\251ih91\342\230\342\013\031\202\020\020\223O\213\376\200\02633Q\372\224\036\224*\224+r\206\024\221&\274g\024\351\rV\200\3502\344\213\003\022\rG\2460\342\2451\357\211r\302-\214\022\032\024\350\047&\264X\251 g\232\224\364\220#*N\201\257\240\366\203\311Q\334\205\353\021\210\264\033\2408\035Y\243\215r \264M\304\321\2136i:\037\372GYC\236\230.P>\373\003\2270\302\303\314\244\354H\024\311\201\324K\023\244\010\031\"#\230\220\230Ch)\205F\325\246\260;\214\020RLc\003\224\361\304\204\304q\214\370\215Y\210\022\377\340\261\315\023c\342\r\306P\311Va*5YB\366\314\361\247FL\3319O;\245\321i\264\350?\264\025$\372,1\220+!n2\342\r\263eD=\203\246\310\222\241d#\244\275B\022\263\254\344%\246@mOD1R\230c\205\221^\222\230\321\314r\204\251\004q\241\207J\325$A\360\034\260\235\2024\262\3308!nH$\345\003B0\343o\226\210\022I\016\324^\244\n\311\202\013""\340$\r\031\302S\343i\264\360\261k^#Oi\246\302\236\260\351\334\250\375\001\305\275\361\305>m\017-\306\2211f\217\031b*\214\024\346%N\361E4\261U\366h\227\346\214\302\354\2464\225-H\001d\r\017\3079\016\030_\233\300V\335\204Bj#\321f\264;\221\202\210\022\022kBd\212\303F\0022\023\2519\01471\212\306\232\007\262\002\342\tY\310\266 2\010\251\235\366J\374\221\301\310\016\200\324N<^As\366S\246 }\370\211\213\370\212\202\256\000\244\366\nz\211&\"\003\220\032j\217l\033\321G\006#\361o\017\330/\221@H\\\220b\000\000H\217\020\017\223\354\200\250F\232\351\220\026\370\210\263\200\324H9x\020\020\325L#i\\\331\035\304/\032\214\331\207R\206\324\234FE\305\024\tb\331)$\000\006\3648\225\"\035\037p\"y\261cL\251\205f\251\322#_\310\003\\\304N9q\201 \030\211\235\354\205E\211^B\205h\200\257\314\030ULp\013\243\216\370\"\t\2209\037\260\2170\374\260a\343CG\047\204\343\006\252\243D\035Ez\227C\t\327@\022;\224!F\344\t\267\231\033E\306\035\327^U]\205#@\231\303E<t\017\343\205\315\342%\3340\304\017A\"&.3\376\016\0357\372\215\256w2:G;\321Rf2\310\t\344\227\240\307K\177\021\365\311IpPD\275g\246\177!\322\3068\240G$\271\020\342 \243m\023\302\362\272W\243\327@\321G4\034\231\036\203\217\330\330\036\267 \352,\261d\001\214\0064#0\263A\262\370\213\321\333$;\224\262\240&\302\000\200\201\036\t\020\314\021\305\366\0204*K$\t\t&\265\026,\272GK0{\2250\310;\276\010\330\047\013j!\230LA\210\002\034\322\303\211\222\020\026=\275g\246\317 u\214%Q\047\315:\224 Dj\250\322#cT\272\211i\233\010\2658E\0221\224\022\005\004q\217E\024)\000\200A\017\022\251C*G\345\211\250\227h(:\364I\356`\271`\032\047\210\372\016\256\302QF\322\223/\270\213Q\205\234$\t\014\177\006d\014_\261}\304\223\350\023\024\"[F\t4\333\301\250\277x\t\217\t2\321Z\314Ff\245\222\205H\007\272g\266\350\305a\214\260\221\000\"\207\327\236\033\303G\315\007\315\007M\350\006\000\000=b\264S\237\036\202\226\302\324M\020\372\210T1J`\235H\230_\231\223D\201\342\037F\006c\317\206\275f0J\027\036\222\203\204\376\021\262\310\014\210=2\004)\242>\022\021\365\020\036\201H\344\315\214\327""\234\r\230\251J\n\345G)\243\322]FMQ\333$jQ?m\t\233\204\211\377\003\021\n?1\235H\031I\234GAH4\221\025\020\005\235\270\335\020\266i\007\330\047\"\014\252\004\242\021\200~2R\033A\031\251\225\220,\250\231D\026\004\204\025\250\243Gr6\005:\246\020\315H\220\266\240\220\016\203\200P\260h\251\\4\230+\304\017s\003\223T\022\t\006i\006\252\214!\310\022\021\221$IIARP\330b\354\306\022\031\212\246a$\237\022\343\250\313I\3548\333\320cGxUC\306H-\215\341\204\002\200\357yW\326<\010\020\362y^D\366\215;+\213b\306\367\342\305\207\034\357)O\260@*\236\020\"\354\214\2674\240b\210\217\006\361\2204\217\314\010\220\301\203t\353\231@D#\310\035\231\234\345@\377cxO\214\360\222\334|?\354\321\"RFF~9\224B\300tnP\347\234\326\027\264P\355\333IU\227`\234\027\320b\244\3525\202d\023f\375I.K\214z\200M\241\006\375K\034\200\342\245\237\371\260\205\r\217>\317#\263\234t\261\216ls\363k\270\272\274\212\264\022}\274\240\325\221\256\320\331IC=q\223\375X\243\216\207FHF%\214\341\317\233\306\272#(\027\257=d\270\020\260\021\245\005uD\026H\350\314\237\211\202y\325\332s\356XXw\022;\211\300\344\261\202\360\000~\220[Y\333\355\317Wc\237\354?0\275\267\205\303\260\363.\r\020h\354z\214 \324#\024\023\375\221\036In$\"\"\313\342\246\355\250\321u\032]\256\252\030\222\361<\t\223c\204KI\033\366\345\037+S\177\263@\276a\004[7\017\206\367\277\355\t\024@\326_\277noE\r_/\024\234\244\0474eANdf\303.\250\006\232\217\220d\244\336<H\224}\rk\035h\360S\356\313\206\306\366U}\027\213\372\216\245a\200-1XWDp\367@\022I\027\030\256C,\364\241(\037y\336\202\263\020\3564Q\037\014\313\177\231\000&d\266_\271d\316\304\212\003\034\353\033\245\001x\300\014\265\034k\332\304^\374$\255\200\246\020\217S\204\325/&\365O\027u<O\\\234\342^\353K\324\005\264\210Kg\344E\250L@\333\213<\037\366k\354H^\\\266\277\020+\363\221\026_\334P\010\244;\230\343O5\370.^PN~\253=\047\260\026.u\010\317\223\305\377\211E\372Y\031\374\206v\345cK\036{\205\304Vf\255\376{\016\332\327\273\2158\204\031\014\\\253\277\253\252!\221\001\227\267\243\250\235\353\342t\243\343\021~\030Yv\347\343""\246\212\017\312is\261\215\204\255\003y\201=G8\t\267c\324\325\321\317\021\010Mz\253\314\001\017G\020(q\252\027\307w\206\342\201H\200\366\260\313\241\233Ov\2745\264)\n\211\261\317G\310\004\223]\231\276@\026!\321\017y\\\347\311\331t:\244\326\177 \006\"\275\340\222)(\355\007\035\331\253#\231V\036\001Oo\360\235b\010\026Y2\261\251Dzf#i;\266\340(\234\357\356;\047\271\375|\031\346DzZ\266\260\271\245\000*#\206\206\206\317\002\275\"w\275w\235\315\200[\243\254\235t\005\371*a\007uf-\373\021\203\325\002\334\023\354\320i1\024\3057\201k\274U\330\353\0073L_-\005\344J\003U\233\320\312\n\222\004<\246\030a4\021\tV\244\377\333\032\263!\370?\373\001FJJ\203\024\251\317\313\321j\231\021g\002\360\353\221N\310\261`\254\n\233\311\303\252\t6\327\002v\220x\030}]Q\336\376\306B\020\225\014d\344\361\177\037j\262J\314\330\230G(\255L\314\241\277(\222=\333\334\337\247\320V)G\255\005HS\235\362\245\216G\370\205R\237\300FXg\310]\333\361?0\022-8\027\274\211@;3\207.\232o(\3024\3541\306\321\"\235Wp\203u\352\033\005#L\327\345\367_o\225\240\310O\354l\275\356\206\204``5?\307\357\311\276\2203\364S!\025\037\250\225\364\210\245\237\241\002\210\366\323P=\330\214\335j<0),K\363#O\263\350\314L\226\tQ\216\201\307F\213+\372ZX\342!\314V/\026\n\236e\031\331\242\013\214K\304\332\345\246)\352q\027]\202/\001(\340\226R\017\225|\221\315\233\204\340\241>\031g\341_\275\214\010i}\357\243\321\014\016\014(m\372|.\037\325\251V\247 8\344\230\332\365\271\264\"\372\236\346g`\227\"D\032i\335\300W\n\006\000\335/\314S/\226\301\025E|\225I\237\213\006\367!\035\337\000\220kf\002\231\014\023\215\230\365@*\004\021\225\2611y\336\250#g\351\tf\024\236\226\213\206\010\035\264\265J:]_\353\n\253cA\\\001(\310[%N\206\001\316Tl1\252V\233\216\005m \306\324\334}\025\253\343\234\361\007v\047y\305\334k\022Z\262\016\3417\021\327\320p\304\177+\312\016\024\007\257\311\360\271z\364\213\\\275\250\234\022\340b\027\254\273\302\2762Q\352L\360ki\324\014#\215\230\251\237\240\243\n~\350N\331\020\005\357\2620\311\2170y\034\350\342\2721.\304\3161\2726\204!\360\354""\313J~\276\014\340\2754;\020\262\334\022\215\032.HW[L\350l\221Do\310i\\w\226\257\331\236O\214\263\263L: Y\031w\351>\365\235\217[\033\272\334t\331i\344\311\323\357\263\311P\266-S\224\271\047\365\236\032j~\262Z\005\037\215\312\235IZ\266\271fYYt\224Z\033w<\025\370\230.#I\035\244\373-\243o\327\226\346Ym8-\215\017 B\376/\tuX\026\241\004B,I\"\3643W\255\272\034\020\267\263\024\022\325\275\234qf\371Wi\267\\\022\047\363\3621qyN\247\001;\242\300BW\030\302\372\023\010\323\333 o\210A\252h\317hS\320\267Hz\030\362\360\007Yk\025\027:|)O5\257\257\244\234\330*6&\253\314\014\342\367\220MaK\013\232\344\262P\375\315\251\336\347q.\270T\215\032J\303\007\275\010\235\336\034]@\303\n\t\367\3361\261b\2368\265}^\226\254\250\365\002\246\307\360%\307GC2x\264\357}\022\365\264\360_ <\273>`\216\216\362\037\330\371a\235\2478\366w\305\252\247\025\000\017h\223\331\276\276\361\047~g=,\35759\347\047\265\007L\320%\317\344=\310\250:Z\256\217\371C]\377\360\311\336\324\204\010`>\241Pl\r\276\2053\376\302\327nRy#\202h\020\035\266\215\317\035\033s#\301\3068\317\361\006d\335s\370\020W5K\321\332\336\210\242f\032\270\275\305U\345\307,\240\210\004\370F\362/g]\200:\320\034\346\331]\325\351UR\016\254\264\2048 \027\013|\321\033\264R\216\007\334\201U5\000\342\210T\301\177h\365\207\312\034\240Ve\314\250\255\300u\026\355$\213J\370`h\341M\214\274\206\340g$\312\231Xx\352\255$\000\r\345@83\265\271/\356\013\243\300\363p\217\023\304\230\244\377\031\233\010\003\221d\200#\353S=\017\337#\210$Q`3\t\344\020\010\244\243G\375q\364_\326\014!\256\303\\.\324-n\241\253\307\312\324\274<\336\232m\325B6\003\362\027\237\337\267EUzQ\200\201SR\356\302\361\3357\\\034?r<\017\206\233\354\273NW\335,\265P\027\370\240V\010\235\332;;,\020B\023\330\344\365X;X\035\355\237\037Q\214\261\016N2\214\2318R\25485t\373-\233\371Z\237&\"\240\307\003\271Qr/\350h\035\016\365\212C\3573w\005\200\306\340/\225\277`2%a\047 \2606^\024w)\337K\317\241\025\300\252(\256\337\022\354s\227a\r\367\"\331XVT\002\260\347/\260\r~xr\255\034\\\364 \340\372~\326\240\337\230\360""\016\334\n+\206\274^5\0166\205\205\2130\"\253M\346\256\023\303e\002\253\002K\337\000\341\023\277p\326W\247FC\302\\\223[\233\370\3107:\004]{\334\261(C\216\310\\\300\300\205:\364\022\216\313\346\262\215:\025\355,}\360\377r\217\351\r0\241\216;O\321\341\207?m? :\377\047\035LuS\252\341\207 >z\224\030\316\005\346\276\333\200O\221\260\246\003\242g\247\334@\215\317\016\334\371\036\006\tF0\017\277\253\025\047o\2736@\233\356h\304]\335\273\000\240\315\003\312C\301\024\034\317\331\353\375\233\265\301\3211J\205A3\243\250\024\252\356\3435mD\237\313\\xt\321[\014,\350\024B\261\216\250x\241.\206\211\017\272";
    PyObject *data = __Pyx_DecompressString(cstring, 4360, 3);
    #define __Pyx_DecompressString_LZSS_UNUSED
    if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error)
    const char* const bytes = __Pyx_PyBytes_AsString(data);
    #if !CYTHON_ASSUME_SAFE_MACROS
    if (likely(bytes)); else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) }
    #endif
    #elif (CYTHON_COMPRESS_STRINGS) == 1 /* compression: zlib (4398 bytes) */
static const char cstring[] = "x\332\2559I{\023I\262\310\255\006\2635\030\033lp\303H\264\215\331\332\363\014\306\254\017\306\330\030\314\342\366\006n\030zjJU)\251p\251J\252E\266`\276i\216:\326\261\216u\254c\035u\324\321\307:\352\350\237\300Ox\021\231\265Z\342\r\313\370\223\224\221\021\231\221\221\221\221\261\244\017\345r\023\023\367\047\014u\"W1u#W \271e\263 K\3023\322\310\251ZnysQLQ\253\232Z\227D\"^\274hh\204\344\212\032_\252\020\305\270t\351jn\362\336\2039\242\031RQ\022x\203\344$=\247\250FNR$C\342e\351=\021\347\313\306\252\251(D\353A[\340%\231\2109CM s\217\025s\375\371\332\235\334\222\n\374\2142o\344\346\032FYUp\276Hd\251@4XIn\344tC\223\004\003\030\303 %\267\374h\371\327\351[\3239^\021s\032yG\004C\317\351fA\220y]\047zN-\346\n\246$\033\222\2223\032U\242O\346\026\213\271\206j\346\024\302$\250\302\270\344\004\243L\224\234N\014\004r\023\274\002\242\363\206\244*\034L\227\224\322DN\2244XD\252\023\234\275\300\313:\231\\\326\244:\310\206j\354\336l\254\342n\032/\212\034\240\210P4\025a\322P\271jC\224t\276 \023\242\320\337\355\252\244\321\345s\274V2Q\371\321\341\300\316pG9C\252\020\320\217\301\227\004Ig\323DE\005\225\025yS6r\034\247\021\321\024\010\307\345D\223\312\254\250\312\257\240\302:\310\000T\001\305\3418\265J\024\261lLV\033\333:\221\213\223\034\210\246\345\004\272\177\\MP\225:\2347\323\031\237[fG\243\026P\341\271\"\030OU\0226eP\020\233-\300\330\357\230\255*E\251\364\035\363Mm\021\014\344*\353)\252\010\347\372\315\314\312\001\233\357\330\217$~\373\334M0\234o\236\214[\377\276\331\337\2418\215\350h\200\337<\337\320\320\322\277yz\375;\246\362\262\371Mz3\215\342\257\267\022~1\001Nr\\\241a\020\235\343\322\310\340v\n\224\347^\"\370!\035\334Oor\211(\324%\246q\306\242\270\007\361\\UJ]\310%\276\222\232\250\221\272\272\231\302\030\352\032x\t\2454\247*\242\204.\010<\372\034\275\230\021\320-~\222\324%|L\004\322CU\005\262\306W_\200\225\355\241\230\212\230\302,\212\340\370$\243\221B\276\340%\305\200\357\232\241B\\J\263X\"\306\226\252m\246q\260\316b\232\3572!\332\274\244\013*\234n\232\371\262\246n7\026\225\242""\232\302\256\302n\236K\025\311\210\202[\004\364TED\352\245\212\200X\010\365\020\243\300\360\004\"?\227t\203({\261\313f\274\370d\020+\236\253\245\022\034T\214gQ`A\372,\251\013\r\026\221\352\204g\020c\026\323\335H\233i\324\013\242\353p\030k\260Y=E\214\242`\n\273\252\232\020\231K\353(\223\016B\245\210k\204\327\204r\017<;\360\024Z\322\021Hm\351\235*%\264\047\357\321f55\266\232\324*t\036)\202\326\250\032\211,\006\261kRII\2424RB\256\332:\204\341\004\326L,\243\227MCT\267\224\320\202\303\266\333\\\022\224.k\211h\341\225_TD\262\375\n\275T\014\365`\231\244u3\215\251\240T8\2314\202q\027\361\016<\341\365r\330\366Z%\242\364X#\240\tj\245\242*\017%C\217PhS\t\030h)\222\230\354\255Bv\247V\"\214\236\036n\250\013\262\312\047\373\314s\261\033\264\016~MI\200\335;H\023\2736\201v\215\337\356\211\001\266\347\014\024{\026r\250\020^\024)$\351\2170\247#\264\367H1\264F\004\364\346\037\222z.\302\210\021\367\250\033\212\274\306@hz3g\204\236\254\221D\266A/b\330+J\232\036\261\223\024\035bE\330\203\3349\202uHl\003\030\223\260\004\370Y\031\002b\0179\214\305JU&\230\367B\"]6\340\323\315\204!\273&#\232I\211\220\254\252\233f\025+\034\374\366`\302\260\335\\\020\037[/\355\242;\013Z\300\205 \013\263a\217Y,\355\351\361\260\300R\003\230Yi\\<\304P\017\371\222\264n)c\252H\250\353J`B\247\321\003\365h.\205\0043J\367\203=\245p\221\047O\240u\360\2141>\004z\354\"A\352\336DD\004\257/l\242\267\345\rS#1\2360\267\034#\230\310\311.\223x\305\204\200N\177\272e\010\321]\3533\002V\213\342\202\246VXW\322\327\240\376\322\213\022\021\0376\326\210\014\031\037\373\355f\034\341\2738\007\024`\"\213\001\234\346\253\n\233\350+\302\266\007\357\230\322\315=\244\301\366\027\370\212$7\222\230eU3\242\276\004\301T\255\026x\320n\214\n\3161\201y\251\350U\"H(\\\204\205l^\225\353\361(\275k1}\317b\241\201\257c\036\217>6\002\272\367\227$um0&BQ\032w4R\201\304-\356C\022\047\025\0334n}& ~6\026R\002\206\361\010\370\314\344\200\324\315\200\256\275J+\236$\334\203M\232\372\377rB\272\241m\224\211F\350O7\267\020\335\305\206\021$1h\223\326\306P\220\224""\020\306\032\016\256\306\000Sg\311\014\353\325\303\r\247d\242\"q\033\222Q^\234\017\232n\261bB\227`\224\264\274\0314\237\231J\t\335S\271\345\30667\267`*\002w3x\260\340np\202\252\021\216\025c\034\047/\363\032\201\261\032k\351\223\n7yOV\005^\326\357OnA\242\315\330,7\346%\230\260\0041n\225\0249.x\351!\270LP\250q\034}\024B@\304\261\360\207\201H\243\300\266D\021\370p\203m)\024\026\376*P\225\320V\025M\231b\024\250\266hK\266\260\251\302\372\324\307\351f\205\365\264@\267\010\007|\020\304\007\036\006\231\n\2551I\250\332^X\320*W3y9\\-|\370\351\326q\210 \333\330\001EG\022\352\211}\3648\000<{\016\224\203{\027\nL-\222\216G@3y\302\303\r\305\227#\236\350\363,\020\001\024d\323|\221\327\033\212 \251\223\321p\035\270\203\"\013\005I\021\247\361g\246\000=\210\263P\025\311Qe\024\271dz.\202\300\047\013\244\250,\022\n \020\230\001>=%\336\323\322\261D\200*\235pp<\300W \350\010\343\330\316^\235\204juS\344d0.\256jh\"o\300\207\207/a\357l\002d,A\210\r\032\"F\000\047\240\202\300*\323\205\231\250B\331\000_\320XWe\226\252\307`7\300>\210ra#F\000c\037\277\t\262\364\214F\225\242$\203a\322\014\255\210\031F\030\340\343@\017\006\n\237\370&\030\225*\207Bu!\331@\364\340,\277\t\253\301(\272\320\240\313J\206(\340\006/\nA\352\031\325\207=\252\302 $%\023\211(]\352Q\021\246\353\300T\365\027\027)\000\201n\313eU7\360\313\356\257$\211`P\240(\232\003JP@U\353\323\360\235\211R\3608\032FA0\252#S\0363\025\021\301\334#\313D\323\347%\203Tt\254677I\003>\034\016\335\334\2241)\006;*\031eYb\345\047\250y\223%\242\354\027\204\256\004\257\030p\262t_\025~\233\253\022\3601\032\251\001\240\301%\024\020\227\350*xW\025\260G\221>\320\201\333\002\347\254n\252\2330\310\010\337q\251WTu\352\345\351\017W\335\344\312P\035\341{\367\226\252\211U\336(\323\205\304\360\001\204\366\252x(0\n\270\200\026`\305\n\257\200\323\303r\031\277\335\366S\335\254\252\325*\234(~\231\346\253\020\365\215*\276\240\200\270\032\260\256\232z\231\276&r\222H\341\252\314\033EU\253\320\216\201\205W\000\201;\203B\033>=\026J\224\345I\270\347HV\252G@\2171\r\320R\255\206""\027J\013\353\370d=\317\222\013p\313A\336\303\0344(\330\324\024\366V\006u>\304\0068`\035\035\005>\034B\034\205\017l\224\355\032L\003\001I \254\002\330\373\350\025>uE\231T\342\245\253\373}+~\325\212\336\262\366\276`\005\tX\362\371*\371h\005p\360O\201\360U\"l\301\016!\203\307$^\017\035e\0040\247\203E\035\215\005\370#\t\025\002\027MDX\007\242a\2245\302\243\275D\377\213\010\325\0348\024C\r*\2370\047\244g\016X^F\213VA\t\030\352\314*:Z\310B\242\320\023f$\330r\240\005\305\240\020\016\256C~\002\037\241\000?:\315U\242\204\205\002\034\245\230Dgy!\374\352\3403\353\222\270\265\005Wv\013S\034\314\006\246\257]\273\3661\323\311\036j^\261V\020\030wV\234\242;\3731\263\233\375\213]\363s\377\343\035n\335mo\372+\253\235\354\240u\323\276\350\344\235\251N\366\300\307\177A\047\337\351\277\344\016\270\227\275\245v\276\223=\334\234\372\230\371\324\277\357\320(\022\216[\031\3749`\325\354\375\266\354\346qN\275\271a=\262\207\354\225N\377\t\013\306\014[\265]\374AZ\255\323\177\314?v\321\315\272\263\356\206\367\254\265\325\346w\323\230\332\307\331N\377\341\346ts\313*\332\263\235#\047\254\313\320\364\037i>\261\2409\330<\013\350y\047\353<v\247]\303\233\002~\315/\233r\300\251\273k^&\232p\2449\217\302\037l\236\266\306,\301\036H\020\036Y\003\235#lW\031\206Y\2001\005\373\200]s\366;\274c\272\363\336\217\336\253\326Tk\241=\326\346\303!\023\366\200=n\007<\036[\327-\336\252%\270>\266\246\221a\027f\277-:\027p\377!r\006\370\374\352\244\247\3021\3303\316\220\363\n\266\035!o\333\263\366k\247\344\256\244\206\336\261Wl>\201\211\264 \332\277\330+\275\t\027@\243\017\321$z\223\047`\345\325\224DO\254y\273/\336-\353^vf\2355\367\2107\347\245\320\260\027\367G\367\2457\356\325:\207OZ+V\331&\3164 3{G\355wE/\037\"\027`\313\367\366,\272h\277t\362\t0\304?\263\353(`\334\375\227{\327\343\323\335B+\223@\370W\356\266\246R\375\373->\321\233k\247\251\017Z!w\177\350\202\303\007\320\230\023\234\332S\253\004j\047N0\351\031\236\374\301\346\251\246\2167\340\204u\021/\313\301\346Ps\245Y\266\370]\252\005\236\2150\254[\366\264\2559\303n""\006n\331E\357j\213\367\037\374\266\263\345\277\372\207\377\017\321\027IB\001\317mj\261\243\240\260\003\366\026Xb\335]\367NyFk*1\350\205}\n\3544\343\234q\247\230M\005\224c\260\324\014\334\313U\273\341\366\271\023t\336\275\366\036\322{w \215\370\340\346c\3040\260M\320G\366t\234\304\320\323\311\316\031\246\227\250\343\314\306\335\321d\347\234\023\311s\323\036\263\013N&\356\006\306\306:\023\270\032\032Q\214\232\244\n\214VeZ\005%\244\021\347\\\315\033ne\322\310\277x\031o\320{\334J\217\365\3637\274\025Oh\r\267\023\303o\307\342\336\262\357\303\202\347\335\010q\307\336\200\033\260\022w\177Ov^;\324 \251\313D\177\367\304\233o\365\371w\226v\370\235Z\344u\006\254a;\023;\243\303\247\301\027\214\331eG\304u\\\344v\370\014\334\213i{\3331\334k\356\212\213<\017\237\005\333\023\235\213\356\230[\200\235\014y\353\201\314\247\206\231m\362\314j\236\243\247?\326j\354DNhx$v\204\376\3013x\203\323$\346\004\374\203\347\235\313\261s\0309\235\2365f\363\266\356L\270\003\351\001\361\33410U\035Ln\317\200\275\202}\330\311\207\003~\276\356\335\362\357\376\3064\023x\2423\376 \3347g\335\035\366\262\336C\257\330\212\004\2720A\241N\377YT9(k\002\224\260\321z\334\236\3319\353\277\332`~q\n}z?\334\240#G\233\257a\345\320\303\047\231\014[\0370\3649O\002eO\376\265\323?j\337\005\361k\340\327f=\304\315\334\367\357\007\202\005\327\374g\353\255\237\277\346_{\330\276\2643\265\263\340\257\256\371k\277\373\277\277\365\337\362>O|\"\373r\325\257\326\374\332\226\277\265\035,\267\213\215\225i\316v\216\017t\216\017R\007?\3259\016q\222\241N\236\352\014\301\341w\206 @w\206F0\366\304\204\030\347\357\033\000\263\311\376\004n\245\300\372W\341\234\262#\366\017\366\024\004\301\3549[qgw\263\007\233\303V\006L\353\030x\214U\027Bq\336\031\245\001\367\t(i\n\273#\356i\352\240\263g\301P\211;\205\221\376\201}\336\236\365\263\030\273i|5P\2074\272b\034IE\210q\333p\256Atb\216\350+\346\370\343\267Z}\255\261V\241\275\277\315\177\305\344t\304\n\346\004#pj\r\217\371\217\350\356,x\371`\340iv\273B\377\266\355h`O\031?{\006]t\264\350\2405\325\3551""\007\374\354(\034R\017\321\2166\327\341\030\372\0175/AH7!\333\350\213\356\313W\314\361\317\337\360V\301+_k\275i\327\276br\335^wN8w\202< \230\363y]<\365BE\237\303D\241\027s\274\037\300\374\"\244=\204\271\302io\366+&\225\301\035\235w^\004\027>\230\023\305\t\350\373\347\246\374\251g;\367\374\r\010q\215O\373\366\275\317\314\365A3\3277\337\207\334)\347\253\340W\250%\334\260~\300\265\206h\334\253;o\300\202\323\035\274\330Y\373!\254\232wn\302I\r\302]}\331\232h\017\265_\355L\355\246\3103\356)\027$\312;\003\275v\361\263=\207\301\263\323\177\336\231\3642\273\260\253\rk\326\332\260\177sg\274\023\230n\2423#\220\204i\336I\217\207\373\322?\356\374\356\276\366\010\206\340\274s\332\035w\351\311\375\211\261\313\317\376\002i4\204\377+\300:\214\371a\276s\t\242\327\237\036\357\337|\2723\001\211\267\237\035sf\277S\242\221\326@+\377\037$\242\253\374\327y.y\371O\047\366\035\034\264.\201\263\304\204\224\355v\227\206\211\037\2555Hr\251\303\315X\047!+6 \2573\321\3032m<F\3077\320\031\006\321\374\361\031\257\324Z\351\014R\370n\353f;\357g\047\234\177{\177\370\017\327\375\365\227\270\310\0214\216S\220\323?\201\"\340\266\267\010\303\217a\230\314w\216\034k\326a\255L\347\370\210\375#\350.u\356\327\035\325{\323\252\265\177\332)\371/_u\206\317\003\356\2017\321\032\300H\207\256v\027.\375m\373)\344v\300\235\307\023\000\216G\241\3249\372\323\247C\373N\014v\216\343\275:\216v\227\261O\332%\347\265[\366\336\265\017\264\267w\352\310\361\370)0{\320\007zf\272:\370\020?{\331\315\007\366|\nS\304H\324P\264w\220\265\014\271\177\367o-\356\014\370O\377\351\377\263\344\227\312{EA\037\017\242\034IJ\361\010\370\\p\372\335\314g\026\276\202\276\370\244\265\216I[\010\354w\336a\005\224\310\327Q\341\262\377\020\002\326\272\237\305\320\021{\331\323\321=^\304<#\270\311W\335T\302u\322\345\375\354u\377:\244\313\237~\212\316\246\327F\331\031\310\336/\336\333\366\350\316\354\016\347\277\025|\341\275\377\376\337p\355\377\214o\377\227\354\235\235\000qn\301\036{\357\036\334\025\3123\210E\331\027\032\343.\034\323\035\353\215m\202Y]w""\251\217\273c\275\264\2578i3\205O\312:o\373\267\341\350\376\343\031\017\272\317[?@\276\375\201f\007\005\277 \371\222\346k\372\227l\367)\370A\323y\344\216\200?\355\275\335{\255o\363\035{\007\034n\336\264\362p\264\177\005\047\251yA\240\274A7\241\202\021\224\274\025?\013\351\317\212\277\002n\373=\234\330\207\314\022\036\334R\337;l\336\365\231\330\230}\365\276\250@z\356\035\360j=z\326\022\204\310\307\336Tw\307\037\032w\376\2407\223\365.\272\207\242\236\365\002\274\017h\375o\376\337^\342\245\003\211\2577\005\324Y\264\351\036\007q\0243\254;4I\316\243\342\372i\362P\201\365FF\355\377u\017{\327\301\353\254\2653\235Q(\355\300+\227Z\257\333\374\356IH\263`\340l\217\031\373]\001<\343 h=9\343\323\376}\047G\301\261C}\263;x\226\226\341\307\007\276\344\200_@53\016V8\347\032\336\255\326\235\366\033H/{\035\364\377\001\364c\235\014";
    PyObject *data = __Pyx_DecompressString(cstring, 4398, 1);
    #define __Pyx_DecompressString_LZSS_UNUSED
    if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error)
    const char* const bytes = __Pyx_PyBytes_AsString(data);
    #if !CYTHON_ASSUME_SAFE_MACROS
    if (likely(bytes)); else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) }
    #endif
    #elif (CYTHON_COMPRESS_STRINGS) > 0 && (CYTHON_COMPRESS_STRINGS) <= 90 /* compression: lzss (5975 bytes) */
static const char cstring[] = "\377\n  \047\047>\047t\377o\047 must \377be Publi\377cKey or \357PkId\021\npro\377vided((t\377ree frag\377ment)), \377.<?Certi\377ficate i\377s not in\377itialize\377dDhtRunn\373er\t\020Faile\357d to&\010 Gn\377uTLS: No\376M\000that Cy\357thonX\001del\357iberg\000ly ?strictV\000\"\000\377n PEP-48\3774 and re\377jects su\377bclasses\377 of buil\377tin type\377s. If yo/u ne|\003p%\000%\t\377then set\275 \006\000 \047an\324\000a\337tion_<\000in\277g\047 dirb\000i\373ve\274\001False\037.Priv\203 \303!\367\017\274\331\047\223/add_\265 e\377cfunc.to\377_pydisab\357leen\001\002xpi}rz\002 argu\371!\370\262F\327\000\316\001 time~\235 tagcis1\003\377dno defa\377ult __re\377duce__ d\275u\257\002non-\300 v\364\246@\033\000c\260A__op\377endht.py\177xself._\230\000\347r c\373\002\245acon\271v\355@\260Ca P\225Co\355b\355! f\272`pic\223kl\236 8\003c\231`\0038o\357nfigC8urI:\236`,\304\003nod\206`\222\2006\265h@\004t\324\2007id\220\2017k\243ey\315\2017\367\001\000;s\312\2027r3es\375a\213\2036tr\241\210\001\312\2036}v\204\2047value\311\2041\237utf-8\215\211\010\230\211\010.\377__bytes_\311_\007\013\227\206\004c\347\210\002\r\rse\177tstate_\013\021\347gen\216\211\002Y\tget{Id\002\014Long\004\016\357Name\222\trev\373ok\005\ntoStr\377ingCondi\236\376\210\001DhtC\224\206\002\000\006.\340\324\207\006\267\005\017\t\254\016.\007set\367Boo\331\000rapMwode\013\014und\037\n\377Identity\2764\nMaint\001\000S\337torag5\013Ne\337tworkd\nNo\367deIJ\013Peer\377Discover\376O\013ProxyIn\373fo\247\nRateL\017imit\324\214\006\335\214\006\366\022\373\214\003\310\367@\367\021\026\004b\200%A\007ca\377ncelList[en\006\rPus\007.\245\213\004\177Logging\202\007\036\267\213\003File\004\024!\016\265`\014\301\007\302`Bo\376#\273\004\322b\024\nx\305&\030\007\335!Mess\212@\037StatsD\n\340\217\006Z\n\377RoutingT\362\356\214\001s\304\000w\nSear\307che\006\017\353C\"\nis\\\351\217\001\370\njoi\263(l\277,\345p\244*p\312)\n\000Enc\257rypt\273\220\010. \000Swign\007\treg\240A\337rType\377Gru\376\252Hshutdow\001n\272\204""\005\302\204\005\250\205\017\017\010\345\206\016-\006\353\206\005?IndexV\242\210\001\000\007\360@\020\035\006\357q/\010getK\323ey\003\013X\003d\200\205\001Ha3sh\000\005R\021fo\036\001N\023\376\025\004commonB\047its@\006\247\210\001n4\004\356a\353it\016\nd\035\tRan\307dom{\006\273\207\001$\010to\217Floa5\007\262\210\005\274\205\003T\017oken\000\010\243\210\017\017\013\343\211\016\340\265\207\001\271\207\001\334\210\017\017\004\035\022.ge\037tAddr5\002\222\212\002?\002\267isE\320\222\001ed\213\210\001E\017ntry\000\006J\023\037\002\257\207\021\270.\007U\006&\003get\253\005S\300\005\003\004\000\247\023\023\003\335\0220\001ex\347ten\245\002>\001fir\371sU\002K\001inser\366\005\006la\020\007size\200\350\211\001y\000\201\222\001\000\010k\026\251\222\001\315\023t\337Imple\361\227\001ed\007Pht\000\000\342\213\017\017\003\232\215\016(\001\374\240\0032\001lookup8\336\230\001\342\230\0012\020kId\225\212\021)\002\334\264\204\0078\002get\000\005Bi\000\002\006\341\215\003\031\005\254\204\003g\002\250\204\003r\002\243\204\004\000\005\004\332\215\003\263\227\007\275\227\007\322\020\332\227\006\221\022\024\007\303de\266\210\002A\010\240\217\005\000\020EC\016\033\ntId\002\013\315\004r\007\367\001<\253\233\005\244\010sign\302\233\006\313\233\006\360\230P\347\233\005\3262\024\006chec}k\352\211\001atureF\007\301e\221\212\003W\007\352\220\002\002\n\347\220\003Qu\007ery\000\002\221\220\017\017\005\313\221\016*\003\276\252\233\001dFrom9\003i\377sSatisfi\377edBySele\003ct\000\003\352\220\017\017\006\245\222\016+\004B\000sld7\004J\013ock\250\207\001\301S\001\004I\020\020\007L\017.\005ge\377tFamilyS\336\007\010PortO\006is?Loopba\333 c\005\363is\267\234\004\032\010Unsp\347eci\361\001\212\006res\257olve\232\006s\\\016s\023et`\n\271\223\005T\304\226\001\312\220\001\000\006p\246\223\017\017\t\344\224\016.\007add;\007\277removeK\007v\037erify\221\215\002\226\215\002\214\224\017\000\017\005\306\225\016\306\215\002\303\216\001\000\006&\024\347\216\001\274\222\021\005Vw\002R\355\230\002\000\tq\020\037""\010*\035\376\266\223\001trWhere`\000\002\336\225\017\017\005\230\227\016*\003id\001\004\274\272\204\tE\003owneU\003.wseqY\003use\310\220\002\350g\003\201\231\002\330\220\001_\322\t__s\377tr_WithI\301D\000\004\365\226\017\017\007\261\230\0166\002Pk\354\000\004$\024Pk\241\225\021__P\377yx_CFunc\373_7\252\240\004_5_co\367re_\204\240\003__lP\177aren__r\002\003\376\316\241\002_.<loca\377ls>.wrap\376A\003PyDict_\377NextRef_\335_\343\242\004e__\240\232\006__\344\301\243\002\016\001d(\001\030\000ent{er\037\001exit\047\001\344\265\242\001/\001g\242\232\005=\000mai\376\177\000__modulnL\002nam\002\003ew\\\001\371p\304\000\337\210\002sum__\200\n\001\246\235\003\006\003\354\232\003\022\002\257\244\001\033\003u\rn\334\241\002e_\363%2\002\010\013\323 \037_qualf\005\361\242\005\225\232\016\366\213\243\006ex\353\001set_\342\232\005s\275\010\252O\367B_te\335s\370\001cb_\222\"is|\377!\305\226\002eaadd\266\243\001\217aesD\203\214\003\007\000\307\225\004a\377fasyncio\271.\257@)\003sat\305!b\337bind4\001\0016b\373it\000\000sbool8\221\231\006\212\212\006\274\235\002cca\225\231\t\247\231\003\337Putcb\216\000ob\361j\367\243\001\305\245\010\276\213\013clin\373e_\234@trace\364\205\211\001\220\224\007c\361\243\002cppk\377d_lend_p_trdat\000\000a\004\000=e\342\245\003code\334\215\004\343\215\004\333ed\000\006_c\231\205\001dh\275t\213\232\013done\000\001_ccb\211\232\016\342\246\003\273\232\004en[\001L\337\214\004\346\214\004ed\000\006Y\003e\213\247\006\374\231\222\003\321\213\002filter\342\235\222\002f\210\225\001\224\237\005\234\237\005ECg\337etget\200\205\007tm\003p_\225\001\004\016#\003\267\224\001\220\226\003\206\233\0058\325\213\006\337\237\002\255\227\003get\330\237\003\360\223\001game\364\223\004\373\223\004Id\204\224\004r\212\233\tg\240\213\003\275\217\tget\333\226\003\034\005\001\203\233\014get\375\232\010\n\001\365\232\006wget\236\230\004get\331 \237hhost\000\001\343\241\003i\333id\323`at\244\224\003in_tipv4\001\0006\372\225\006\260\204\215\007\374\214\006\277\233\006\353\216\nis\207""\215\010i\363s_\253\236\006\367\204\001aite\373ms\352\233\001kkeykwey_\271\215\001kkl\221\225\001\276\305`gthli\371\233\003lGock\203\224\003\211\224\003\216`m\277\240\004\373_s\301\240\003max_p\177eer_req\006\000\237r_sec\020\001\004\010n\276\312\207\001netid\325\250\002n\377otifyoko\237k_ret\300\252\005\221\211\002o\371s\341\212\002\346\212\002_pk_h\367ash\354\254\001word/pathd\002d\371\240\005r\002\331p\215\257\001#\000en\273 gp\377ermanent\370\253\235\001\257\235\001\256opkpop\317port\000\001\335\244\003pr\361i/\000\276\241\001\273\000rver\337push_\203\252\001_i\375d\007\002platfo\313rm\024\002t\235\232\001\003\004pi?cputpu\226\204\020\213\236\t\214\227\236\t\200\020ut\245\236\003\253\236\006\244\020y_dhtqq\311\214\001r\300\236\005\034\304\236\t\327\217\003res\361\220\004\307\250\003\336 \367urn\246\245\003runs\345s\245\207\001s\245\207\001\261\255\001seq\275s\263@nose\362\001_;ca\005\001ice\252\234\003\345\244\r.\200\245\002und\301\221\006s\271\246\001\344\244\003wset\321\244\014set\317\244\004\005s\332\232\003I5\001\265\244\n\372\221\004\204\222\001\267\244\0059s\327\205\001\256\244\004set\216\257\004\216\240\005~\226\240\005_cbsig\301\226\001\200\305\226\001\360\225\002\000\006\316\210\003\321\232\001\205\250\002\213\250\001i\177cmethod\227\250\001\377sstrtthr\303ea\254a\203\260\006\326\207\005\342\207\001ge\207tto\235\236\004\315\247\005\357B\023\000ael\335\204\001o\202 \232\262\001up\345\211\001\217use_\361\250\005\212\220\005\226\220\001_\237agent\005\002\307\262\001v\377valvalcb\217vals\255\252\002\250\220\006\273\252\002_\356\025\002ues\222\223\003ver\377sionvidw\237waitw\321\221\001\212\217\0014\377222\200\001\330\004\n\357\210+\220Q\005\001%\240Q\377\240f\250A\200\001\340\004\377\037\230q\320 0\260\013\377\270;\300k\320QR\330\377\004\023\2207\230(\240!\177\2401\330\004\007\200|\n\000\377!\330\010)\250\021\250*\377\260N\300!\330\004\013\210\3771\200\001\360\010\000\n\033\375\230\026\000\020\220\001\330\010\020\377\220\007\220q\230\006\230l\375\250\035""\000\007\200v\210W\220\377E\230\024\230Q\330\010\022}\220:\000\027\220q\340\010\002\000\376L\001q\330\010\017\320\017(\377\250\004\250A\250W\260K\337\270w\300a\340\004\013q\200\377A\330\010\013\2104\210w\377\220f\230A\330\014\022\220}*\004\000\010\014\210H\220\026\000\367\t\210\035\024\000D\240\004\240\177G\2504\250t\2601M\000\375\210\r#\007\240v\250S\260\335\001(\006\014\210D\271\001\t\210\177\031\220$\220c\230\021\016\010_E\220\021\330\014\320\003\001\213\001\367\014\210F!\000b\230\007\230\377q\240\006\240a\240u\250\377D\260\005\260V\2701\270\337F\300$\300a\033\005\047\230\357\021\230%\230\274\002\014\210G\277\2203\220a\220qd\010G\353\2204\244 \001\001\016\006\230ds\240&\216!e\003G\2206E\000\373-\240-\0137\230!\2306\317\240\024\240V\364\000Y\0069\230\177A\230Y\240g\250QY\n\237:\230Q\230a\334\010\260&d\257\230#\230Q\003\023&\317 B\324\217a\"\023\047w\000R\205\nH\220\347D\230\002\344\007\t\003*\240A\177\240S\250\014\260C\260\376\004\374 \003\311\000\250\005\250U\260%\377\260q\330\013\025\220Q\220\377h\230e\2404\240q\250|\326$\034\007\006\250d\260!\354#\327H\220F\360\000<f\014I\230\217U\240!\330\211b\006\002$\005K\347\230v\240\236\000\005\007|\250;\273\260a\001\013b\270\001\025\010\320\357+;\2701\003\n>\270a\376T\003K\230|\320+C\300\366\020\013?\270\314\005\320\024&\240\276$\003\320\024$\240A\233cJ[\220g\364 e\240L\004K\366A\337\t\210\026\210s\376\204\001\022\220\375(\251\205\001\t\210\024\210Q\210\217h\220a\340\201\"\241@\036\001t\377\2208\2304\230r\240\027\377\250\001\250\021\250(\260,\377\270a\320?O\310w\320\377V^\320^d\320de\376\247\204\010L\230\001\330\010\t\210\375\033\372 \007\230w\240a\240\377v\250T\260\026\260t\270\376\376\204\007\014\210M\230\026\230q\177\240\001\240\032\2501\250\231\002\335\017\234\205\003\017\210t\330`\024\230\177R\230y\250\002\250\0473\002s<\300\353\205\002\021\007z\250\021\375\205\001.\"\007{\250!\007\007\027T\000\025\010[\030\240\000\n\021\240 \010\031\001\tA\032\222#|\003\n\000\260#\213\003\033\001\t\373\036\240\207\0067\230$\230b""\313\240\001\206\0057\323\205\005\303\0017\230#\047\240k\000\301a\026\007.\274\"\245\006\360\320#\202 \310\005\341#\036\250r\260\367\027\270\001\007\013\037\260\001\260\307\023\260G\213c\244!\216B\320!\3775\260Q\260c\270\027\300\372$\0109\262\0078\230>\250\021\373\250\"\335%t\220:\230W\357\240A\240Q\271%:\230X\306\001\tY\240\245\207\002\256\211\002\376\210\001H\260\377D\270\002\320:N\310a\363\310q\317\204\001\361\207\002\021\220\027\230\275\001\203\210\007\013\031\230\021\205 h\353\240dd\001\250W\001\013\032\230\375!\256`x\240t\2502\250\373Q\250\372\207\001\013\035\230Q\230\177d\240(\250$\250b\307\000\267\024\260T\255\004\026\027\250\205\001J\335\220\346b\033\220L\346\212\001\017\270\233y\310\375\210\006\027\030\311\205\001\203\211\003\320?\t\032\230*\240A\312\211\005\025\003~\360\211\003\320\t\"\240*\250\022\006\373\030\031(\013$\230a\230s\307\240\047\250\273\211\006\033\0032\007$\240\307a\240s\360`\022\014\211\r{\310\375!\310\212\005\0343\2608\320;\371O\224#\364\212\004\032\320\023$\240\377A\240T\250\027\260\004\260oB\260f\270\243\006&\047\203\213\002\347\330\010\035\357!\252 \047\260\024\377\260W\270G\3006\310\035w\320VW\255\207\001G\2201\320\212\001\377\010\230\001\330\014\r\210Yp\220 \332\212\005\273\213\005A\001\027\220{\367\214\001\357\240H\250A\350\"./\330\377\010\033\230;\240a\240q\337\250\014\260A\260\330A6>\363\320>\222\004\340\206\004\034\220\\\320\377!2\3202B\300)\310\3771\310F\320RS\320S\377X\320X\\\320\\a\320\377ae\320el\320lp\377\320pq\320qw\320w\375x\253\214\004\340\010\017\210q\220\377\001\210A\330\020\021\330\020\376\361\215\001!\2301\330\020\027\220\275q\r\003\025\026\330\024\372@\330\177\024\037\230q\330\024\030\370\213\001\374\017\007\n\007\320\000\021\220\021\330\337\004\016\210h\220\233\214\002\320\000\375,\245@\004\030\230\003\2301\377\230A\330\004\036\230n\250\377A\340\004\t\210\027\220\001\376\330`\017\240v\250R\250q_\330\004!\240\033\376\215\002H\242 \3351\013\001\030\250\031\234\212\002\004\035\277\230Y\240e\2501\346\216\001\077\077\230""\"\230A\320\004\270\216\001\216\216\002\341t\300!\214\216\002\331\216\001\210\216\010d\230%\177\230t\2402\240V\250\213\216\003\376\t(\320%8\270\002\270$\037\270b\300\006\300\260\214\003K#\244\214\013\250\236\004\237\217\004\273\217\001q\343A]\263\205\006F\235\260\325c\320\004\031\345\216\003\204\211\005x{\240r\315`\001\320\004\032\314\220\001\314\365\217\001\341\002\023\220\326\217\002\244\211\013\021\320\363\004\033\242@\371\020\r\210T\220\377\021\330\010\n\210)\2204?\220u\230D\240\002\247\205\006\t(\377\320\"5\260R\260t\270\3172\270Z\300\264\217\003K#v\230\037T\240\022\240:\201\217\004\236\004\362\027\013J\260\341%\036\245\217\001\353\006\321F\232\205\003\276\313\000(\220$\220e\232\214\001\320\267!4\260\224\207\003\320\004\021!h\177\230d\240\"\240M\260\320\221\003\354-\004\373\213\003\030\240\304 \036\320\036\3771\3201K\310<\320W\377d\320dy\360\000\000z\367\001C\002\004\000C\002D\002\372\374\222\0011\366\222\001,\230a\230q\256\212\223\0015\220\003\273\206\001\024\363\214\002v\347\240Z\250\333@\000\n\020\220\010\377\230\004\230B\230d\240!\377\2407\250\047\260\023\260A\377\260U\270\047\300\024\300V\357\3101\340\014\023\t6\250\026\377\250q\320\004!\240\021\330\356\302\204\020\034\230C\271\215\001\330\010\"\377\240.\260\001\340\010\r\210\377W\220A\220W\230O\250\3676\260\022\353\223\001\"\240$\240\377e\2504\250r\260\025\260\377a\260q\330\010%\240X\357\250Y\260e\377\215\001!\240\031\327\250%\250\357\222\002\177\270\214\001\320\004\367#\2401\202\225\001+\230Q\330\370\354\216\005\306\224\001\270\221\001)\2404\240\177\377\260a\3207J\310\047\320\177QR\320\004$\240AS<\037\030\270\021\270!s\034a\002\273\200(\376.#N\260!\360\022\000\t\237\023\220)\230;\214\224\002\334\220\003\340\375\010\342\225\001\005\220S\230\006\230\375a\317\225\001\001\220\025\220a\220\237t\230<\240u\336\211\001\304\222\003G\376\365\210\001\021\330\027$\240A\320\177%6\260g\270Q\330\345\212\001\377\320%;\2707\300!\320\377\004\047\240~\260]\320B\357T\320TUa\001\014\2101\377\330\014\026\220f\230H\240_G\2509""\260I,\000\017\243\215\001\277!\330\014\017\210vi\000\001\377\330\020\030\230\005\230Q\330\376\353J3\240o\260Z\270q\377\300\016\310g\320UV\330\377\027\"\240!\240?\260\047\365\270v\000\030\346\211\002\340\014\023\220/9\230J\240\246\000\026\233\213\001\271\230\001\377\014\r\360\010\000\r\016\360\277\n\000\022\023\330\020\371\206\001\020\376\201\204\001\001\230\025\230g\240Y\377\250h\260j\300\007\300x{\310vN\001\020\026\220h\256\220\001\374\252\212\001y\002\023\2201\320\004*+\250!\311\204\004\026\237\223\001\330\243\005\252\204\005\377j\250\001\250\024\250[\320\3778I\310\021\320J`\320\037`g\320gh{\r\340\212\001\210\000\375\014z\tE\230\021\230&\240\323\010\250\353\000d\022+\210\212\001\025\220\177T\230\027\240\001\330\010\003\003\247\006\240j\376\230\001\373e*\353#l\377\320BS\320ST\320\004\020\267\213\001\340\231\007\224\231\001\302\206\003I\344\217\001\345\231\002\035\004\374\376\221\003\355\221\001\025\250a\320\0043\377\3203C\3001\360\016\000\235\t\225Dg\230Q\330\016\227\206\0013\377\240l\260#\260\\\300\033\377\310A\310_\320\\c\320\377cz\320z~\360\000\000\331\177\364\206\007\330\200!D\230\376!e\240\3578\2501\330\34134\260A~\214\001\023\220\047\230\021\330\347\203#\377\340\010\013\210:\220Z\230\177u\240G\2503\250a\202\234\001\177:\220U\230+\240Q\232\204\n;\020\021\220\204\0139\3209\270@\303^\377\023\250L\270\003\270<\300\375{\231\217\002b\320bi\320i\357r\320rs\307\202!J\230a\276\223\000E\250\030\260\021\330\024<\371\270\206\2073\337\210\r\013\2107\220!\377\2207\230/\250\026\250r\356\270\212\003t\2205\326\211\002o\250Q\377\250g\260Q\320\004>\320\377>Q\320Qd\320dz\277\360\000\000{\001N\263\212\001N\273\002j\272\212\001j\002u\301\212\001u\347\002v\002\240\232\002\235\231\001L\260\007\356\243\211\001\014\210H\000\013\220N\240\307*\250G\276\236\001\330\236\001\001\t\320\024\347%\240]\225\206\002\363\236\001\320\024(\373\250\n\005\006\220M\240\031\250\177!\320\004@\320@U\303\206\001?\010\013\2103\210c\254\236\001\217\220\006\311\013\232\207\003\370i\r\336\221\001\224\235""\001d\240\365!\311\221\001\010\352\234\002m\2601\330\377\030\033\230=\250\013\2603\377\260g\270S\300\001\330\033\377&\240a\240\177\260g\270\377Y\300a\340\025\037\230q\357\240\004\240A\037\020\006\250c\277\260\030\270\023\270A%\n\360\377\006\000\025\033\230)\2401\357\240A\340\023\220\226\001a\330\020\375\021\250\206!M\240\021\240%\240\377u\250C\250t\2608\270\037:\300Z\310q\303\204\022";
    PyObject *data = __Pyx_DecompressString_LZSS(cstring, 5975, 11486);
    #define __Pyx_DecompressString_UNUSED
    if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error)
    const char* const bytes = __Pyx_PyBytes_AsString(data);
    #if !CYTHON_ASSUME_SAFE_MACROS
    if (likely(bytes)); else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) }
    #endif
    #else /* compression: none (11486 bytes) */
static const char bytes[] = "\n  \047\047>\047to\047 must be PublicKey or PkId\047to\047 must be provided((tree fragment)), .<?Certificate is not initializedDhtRunner is not initializedFailed to initialize GnuTLS: Note that Cython is deliberately stricter than PEP-484 and rejects subclasses of builtin types. If you need to pass subclasses then set the \047annotation_typing\047 directive to False.PrivateKey is not initializedPublicKey is not initializedadd_notecfunc.to_pydisableenableexpiration argument must be of type timedeltagcisenabledno default __reduce__ due to non-trivial __cinit__opendht.pyxself._addr cannot be converted to a Python object for picklingself._cert cannot be converted to a Python object for picklingself._config cannot be converted to a Python object for picklingself._curIter,self._nodes cannot be converted to a Python object for picklingself._h,self._t cannot be converted to a Python object for picklingself._id cannot be converted to a Python object for picklingself._key cannot be converted to a Python object for picklingself._node cannot be converted to a Python object for picklingself._nodes cannot be converted to a Python object for picklingself._result cannot be converted to a Python object for picklingself._trust cannot be converted to a Python object for picklingself._v cannot be converted to a Python object for picklingself._value cannot be converted to a Python object for picklingutf-8CertificateCertificate.__bytes__Certificate.__reduce_cython__Certificate.__setstate_cython__Certificate.generateCertificate.getIdCertificate.getLongIdCertificate.getNameCertificate.revokeCertificate.toStringConditionDhtConfigDhtConfig.__reduce_cython__DhtConfig.__setstate_cython__DhtConfig.setBootstrapModeDhtConfig.setBoundDhtConfig.setIdentityDhtConfig.setMaintainStorageDhtConfig.setNetworkDhtConfig.setNodeIdDhtConfig.setPeerDiscoveryDhtConfig.setProxyInfoDhtConfig.setRateLimitDhtRunnerDhtRunner.__reduce_cython__DhtRunner.__setstate_cython__DhtRunner.bootstrapDhtRunner.cancelListenDht""Runner.cancelPutDhtRunner.disableLoggingDhtRunner.enableFileLoggingDhtRunner.enableLoggingDhtRunner.getDhtRunner.getBoundDhtRunner.getIdDhtRunner.getNodeIdDhtRunner.getNodeMessageStatsDhtRunner.getPublicKeyDhtRunner.getRoutingTablesLogDhtRunner.getSearchesLogDhtRunner.getStorageLogDhtRunner.isRunningDhtRunner.joinDhtRunner.listenDhtRunner.pingDhtRunner.putDhtRunner.putEncryptedDhtRunner.putSignedDhtRunner.registerTypeDhtRunner.runDhtRunner.shutdownIdentityIdentity.__reduce_cython__Identity.__setstate_cython__Identity.generateIndexValueIndexValue.__reduce_cython__IndexValue.__setstate_cython__IndexValue.getKeyIndexValue.getValueIdInfoHashInfoHash.__reduce_cython__InfoHash.__setstate_cython__InfoHash.commonBitsInfoHash.getInfoHash.getBitInfoHash.getIdInfoHash.getRandomInfoHash.setBitInfoHash.toFloatInfoHash.toStringListenTokenListenToken.__reduce_cython__ListenToken.__setstate_cython__NodeNode.__reduce_cython__Node.__setstate_cython__Node.getAddrNode.getIdNode.isExpiredNodeEntryNodeEntry.__reduce_cython__NodeEntry.__setstate_cython__NodeEntry.getIdNodeEntry.getNodeNodeSetNodeSet.__reduce_cython__NodeSet.__setstate_cython__NodeSet.extendNodeSet.firstNodeSet.insertNodeSet.lastNodeSet.sizeNodeSetIterNodeSetIter.__reduce_cython__NodeSetIter.__setstate_cython__NotImplementedPhtPht.__reduce_cython__Pht.__setstate_cython__Pht.insertPht.lookupPkIdPkId.__reduce_cython__PkId.__setstate_cython__PkId.commonBitsPkId.getPkId.getBitPkId.getLongIdPkId.getRandomPkId.setBitPkId.toFloatPkId.toStringPrivateKeyPrivateKey.__reduce_cython__PrivateKey.__setstate_cython__PrivateKey.decryptPrivateKey.generatePrivateKey.generateECPrivateKey.getIdPrivateKey.getLongIdPrivateKey.getPublicKeyPrivateKey.signPublicKeyPublicKey.__reduce_cython__PublicKey.__setstate_cython__PublicKey.checkSignaturePublicKey.encryptPublicKey.getIdPublicKey.getLongIdQueryQuery.__reduce_cython__Query.__setstate_cython__Query.buildFromQuery.isSatisfiedBySelectSelect.__reduce_cython__Select.__setstate_cython__Select.fieldSe""lect.isSatisfiedBySockAddrSockAddr.__reduce_cython__SockAddr.__setstate_cython__SockAddr.getFamilySockAddr.getPortSockAddr.isLoopbackSockAddr.isPrivateSockAddr.isUnspecifiedSockAddr.resolveSockAddr.setFamilySockAddr.setPortSockAddr.toStringTrustListTrustList.__reduce_cython__TrustList.__setstate_cython__TrustList.addTrustList.removeTrustList.verifyValueValue.__reduce_cython__Value.__setstate_cython__ValueTypeValueType.__reduce_cython__ValueType.__setstate_cython__VerifyResultVerifyResult.__reduce_cython__VerifyResult.__setstate_cython__VerifyResult.__strWhereWhere.__reduce_cython__Where.__setstate_cython__Where.idWhere.isSatisfiedByWhere.ownerWhere.seqWhere.userTypeWhere.valueType_VerifyResult__str_WithID_WithID.__reduce_cython___WithID.__setstate_cython___WithPk_WithPk.__reduce_cython___WithPk.__setstate_cython____Pyx_CFunc_7opendht_5_core_object__lParen__rParen_to_py_.<locals>.wrap__Pyx_PyDict_NextRef__annotate____bytes____class____dict____enter____exit____func____getstate____main____module____name____new____pyx_checksum__pyx_result__pyx_state__pyx_type__pyx_unpickle__WithID__pyx_unpickle__WithPk__qualname____reduce____reduce_cython____reduce_ex____set_name____setstate____setstate_cython____str__test___cb_dict_is_coroutineaaddaddraesDecryptaesEncryptafasyncio.coroutinesatexitbbind4bind6bitbitsboolbootstrapbuildFrombytesccacancelListencancelPutcbcb_objcertcfunc.to_pycheckSignaturecline_in_tracebackcommonBitsconfigcppkd_lend_ptrdatdatadatetimedecodedecryptdecrypteddecrypted_c_strdhtdisableLoggingdonedone_cbenableFileLoggingenableLoggingencodeencryptencryptedencrypted_c_strexpirationextendfieldfilterfirstfloatgenerategenerateECgetget.<locals>.tmp_doneget.<locals>.tmp_getgetAddrgetBitgetBoundgetFamilygetIdgetKeygetLongIdgetNamegetNodegetNodeIdgetNodeMessageStatsgetPortgetPublicKeygetRandomgetRoutingTablesLoggetSearchesLoggetStorageLoggetValueIdget_cbhhosthost_bytesiidindatinsertintipv4ipv6isExpiredisLoopbackisPrivateisRunningisSatisfiedByisUnspecifiedis_bootstrapis_ca""itemsjoinkkeykey_speckkllastlengthlilistenlocklookuplookup_cbmaintain_storagemax_peer_req_per_secmax_req_per_secnnamenetidnodesnotifyokok_retopendht._coreosownerowner_pk_hashpasswordpathpeer_discoverypeer_publishpendingpermanentpingping.<locals>.tmp_donepkpopportport_bytesprintproxy_serverpush_node_idpush_platformpush_tokenpush_topicputput.<locals>.tmp_doneputEncryptedputEncrypted.<locals>.tmp_doneputSignedputSigned.<locals>.tmp_donepydhtqq_strrregisterregisterTyperemoveresresolveresultreturnrevokerunss_lens_ptrselfseqseq_noserver_caservicesetBitsetBootstrapModesetBoundsetFamilysetIdentitysetMaintainStoragesetNetworksetNodeIdsetPeerDiscoverysetPortsetProxyInfosetRateLimitsetdefaultshutdownshutdown_cbsigsignsignaturesignature_c_strsizestatestaticmethodstatsstrtthreadingtimedeltatmp_donetmp_gettotoFloattoStringtokentotal_secondstypeupdateuse_setstateuserTypeuser_agentuser_typevvalvalcbvalsvaluevalueTypevalue_cbvaluesverifyversionvidwwaitwherewrap4222\200\001\330\004\n\210+\220Q\200\001\330\004%\240Q\240f\250A\200\001\340\004\037\230q\320 0\260\013\270;\300k\320QR\330\004\023\2207\230(\240!\2401\330\004\007\200|\2207\230!\330\010)\250\021\250*\260N\300!\330\004\013\2101\200\001\360\010\000\n\033\230!\330\010\020\220\001\330\010\020\220\007\220q\230\006\230l\250!\330\004\007\200v\210W\220E\230\024\230Q\330\010\022\220!\330\010\027\220q\340\010\027\220q\330\004\007\200q\330\010\017\320\017(\250\004\250A\250W\260K\270w\300a\340\010\017\320\017(\250\004\250A\250W\260K\270q\200A\330\010\013\2104\210w\220f\230A\330\014\022\220*\230A\330\010\014\210H\220A\330\010\t\210\035\220f\230D\240\004\240G\2504\250t\2601\330\010\017\210q\200A\330\010\013\2104\210w\220f\230A\330\014\022\220*\230A\330\010\014\210H\220A\330\010\t\210\035\220f\230D\240\007\240v\250S\260\001\330\010\017\210q\200A\330\010\014\210D\220\001\330\010\t\210\031\220$\220c\230\021\330\010\017\210q\200A\330\010\014\210E\220\021\330\014\020\220\007\220q\230\001\200A\330\010\014\210F\220$\220b\230\007\230q\240\006\240a""\240u\250D\260\005\260V\2701\270F\300$\300a\200A\330\010\014\210F\220\047\230\021\230%\230q\200A\330\010\014\210G\2203\220a\220q\330\010\017\210q\200A\330\010\014\210G\2204\220q\230\001\330\010\017\210q\200A\330\010\014\210G\2204\220q\230\006\230d\240&\250\004\250A\200A\330\010\014\210G\2206\230\021\230-\240q\330\010\017\210q\200A\330\010\014\210G\2207\230!\2306\240\024\240V\2504\250q\200A\330\010\014\210G\2209\230A\230Y\240g\250Q\330\010\017\210q\200A\330\010\014\210G\220:\230Q\230a\330\010\017\210q\200A\330\010\014\210H\220A\330\010\t\210\035\220d\230#\230Q\330\010\017\210q\200A\330\010\014\210H\220A\330\010\t\210\035\220d\230&\240\004\240B\240f\250A\330\010\017\210q\200A\330\010\014\210H\220A\330\010\t\210\035\220d\230\047\240\024\240R\240q\330\010\017\210q\200A\330\010\014\210H\220D\230\002\230%\230q\200A\330\010\014\210H\220D\230\002\230*\240A\240S\250\014\260C\260q\200A\330\010\014\210H\220D\230\002\230-\240q\250\005\250U\260%\260q\330\013\025\220Q\220h\230e\2404\240q\250\001\200A\330\010\014\210H\220D\230\002\230-\240q\250\006\250d\260!\200A\330\010\014\210H\220F\230!\230<\240q\330\010\017\210q\200A\330\010\014\210H\220I\230U\240!\330\010\014\210H\220I\230U\240!\200A\330\010\014\210H\220K\230v\240R\240q\200A\330\010\014\210H\220K\230|\250;\260a\200A\330\010\014\210H\220K\230|\250;\260b\270\001\200A\330\010\014\210H\220K\230|\320+;\2701\200A\330\010\014\210H\220K\230|\320+>\270a\330\010\014\210H\220K\230|\320+C\3001\200A\330\010\014\210H\220K\230|\320+?\270q\200A\330\010\014\210H\320\024&\240a\330\010\014\210H\320\024$\240A\200A\330\010\014\210J\220g\230Q\230e\2401\200A\330\010\014\210K\220q\330\010\t\210\026\210s\220!\330\010\022\220(\230!\330\010\t\210\024\210Q\210h\220a\340\013\025\220Q\220a\330\010\t\210\026\210t\2208\2304\230r\240\027\250\001\250\021\250(\260,\270a\320?O\310w\320V^\320^d\320de\330\010\017\210q\200A\330\010\014\210L\230\001\330\010\t\210\033\220D\230\007\230w\240a\240v\250T\260\026\260t\2701\330\010\017\210q\200A\330\010\014\210M\230\026""\230q\240\001\240\032\2501\250A\200A\330\010\017\210q\200A\330\010\017\210t\2206\230\024\230R\230y\250\002\250\047\260\026\260t\270<\300q\200A\330\010\017\210t\2206\230\024\230R\230z\250\021\200A\330\010\017\210t\2206\230\024\230R\230{\250!\200A\330\010\017\210t\2206\230\027\240\001\240\021\200A\330\010\017\210t\2206\230\030\240\021\200A\330\010\017\210t\2206\230\030\240\021\240!\200A\330\010\017\210t\2206\230\031\240!\200A\330\010\017\210t\2206\230\032\2401\200A\330\010\017\210t\2206\230\032\2401\240A\200A\330\010\017\210t\2206\230\033\240A\200A\330\010\017\210t\2206\230\036\240q\200A\330\010\017\210t\2207\230$\230b\240\001\200A\330\010\017\210t\2207\230%\230q\200A\330\010\017\210t\2207\230\047\240\021\240!\2404\240q\200A\330\010\017\210t\2207\230.\250\001\250\021\250!\200A\330\010\017\210t\2208\2304\230r\240\032\2501\200A\330\010\017\210t\2208\2304\230r\240\036\250r\260\027\270\001\200A\330\010\017\210t\2208\2304\230r\240\037\260\001\260\023\260G\2701\200A\330\010\017\210t\2208\2304\230r\320!5\260Q\260c\270\027\300\001\200A\330\010\017\210t\2208\2309\240A\200A\330\010\017\210t\2208\230>\250\021\250\"\250A\200A\330\010\017\210t\220:\230W\240A\240Q\200A\330\010\017\210t\220:\230X\240Q\200A\330\010\017\210t\220:\230Y\240a\200A\330\010\020\220\001\330\010(\250\004\250H\260D\270\002\320:N\310a\310q\330\010\014\210E\220\021\330\014\021\220\027\230\001\230\021\330\010\017\210q\200A\330\013\031\230\021\230$\230h\240d\250\"\250A\250Q\200A\330\013\032\230!\2304\230x\240t\2502\250Q\250a\200A\330\013\035\230Q\230d\240(\250$\250b\260\001\260\024\260T\270\027\300\001\200A\330\026\027\330\010\014\210J\220a\330\010\t\210\033\220L\320 0\260\017\270y\310\001\330\010\017\210q\200A\330\027\030\330\010\014\210D\220\001\330\010\t\320\t\032\230*\240A\330\010\017\210q\200A\330\027\030\330\010\014\210H\220A\330\010\t\320\t\"\240*\250A\330\010\017\210q\200A\330\030\031\330\010\014\210D\220\001\330\010\t\320\t\032\230$\230a\230s\240\047\250\021\330\010\017\210q\200A\330\030\031\330\010\014""\210H\220A\330\010\t\320\t\"\240$\240a\240s\250\047\260\021\330\010\017\210q\200A\330\030\031\330\010\014\210J\220a\330\010\t\210\033\220L\320 0\260\017\270{\310!\330\010\017\210q\200A\330\0343\2608\320;O\310q\330\010\014\210H\220A\330\010\t\210\032\320\023$\240A\240T\250\027\260\004\260B\260f\270A\330\010\017\210q\200A\330&\047\330\010\017\210q\330\010\035\230X\240Q\240d\250\047\260\024\260W\270G\3006\310\035\320VW\330\010\014\210G\2201\330\014\020\220\010\230\001\330\014\r\210Y\220a\330\014\020\220\007\220q\230\001\330\010\017\210q\200A\330&\047\330\010\027\220{\240!\2401\240H\250A\250Q\200A\330./\330\010\033\230;\240a\240q\250\014\260A\260Q\200A\3306>\320>O\310q\330\010\014\210K\220q\330\010\t\210\034\220\\\320!2\3202B\300)\3101\310F\320RS\320SX\320X\\\320\\a\320ae\320el\320lp\320pq\320qw\320wx\330\010\017\210q\200A\340\010\017\210q\220\001\210A\330\020\021\330\020\023\2207\230!\2301\330\020\027\220q\210A\330\020\021\330\025\026\330\024\031\230\021\330\024\037\230q\330\024\030\230\007\230q\210A\330\020\021\330\025\026\330\024\037\230q\330\024\030\230\007\230q\320\000\021\220\021\330\004\016\210h\220b\230\007\230q\320\000,\250A\330\004\030\230\003\2301\230A\330\004\036\230n\250A\340\004\t\210\027\220\001\220\027\230\017\240v\250R\250q\330\004!\240\033\250A\250W\260H\270G\3001\330\004!\240\030\250\031\260%\260q\330\004\035\230Y\240e\2501\330\004\013\210?\230\"\230A\320\004\027\220q\330\010\013\2104\210t\2201\330\014\022\220*\230A\230Q\330\010\014\210H\220A\330\010\t\210\035\220d\230%\230t\2402\240V\2501\330\010\017\210q\320\004\027\220q\330\010\013\2104\210t\2201\330\014\022\220*\230A\230Q\330\010\014\210H\220A\330\010\t\210\035\220d\230%\230t\2402\320%8\270\002\270$\270b\300\006\300a\330\010\017\210q\320\004\027\220q\330\010\013\2104\210t\2201\330\014\022\220*\230A\230Q\330\010\014\210H\220A\330\010\t\210\035\220d\230&\240\004\240B\240f\250A\330\010\017\210q\320\004\027\220q\330\010\014\210H\220A\330\010\013\2104\210q\330\014\r\210]\230$\230h\240d\250\"\250F\260!""\330\010\017\210q\320\004\031\230\021\330\010\017\210t\2206\230\024\230R\230x\240r\250\027\260\001\320\004\032\230!\330\010\013\2104\210t\2201\330\014\023\2201\330\010\017\210t\2206\230\024\230R\230y\250\002\250\047\260\021\320\004\033\2301\330\010\013\2104\210t\2201\330\014\022\220*\230A\230Q\330\010\r\210T\220\021\330\010\n\210)\2204\220u\230D\240\002\240*\250A\330\010\017\210q\320\004\033\2301\330\010\013\2104\210t\2201\330\014\022\220*\230A\230Q\330\010\r\210T\220\021\330\010\n\210)\2204\220u\230D\240\002\320\"5\260R\260t\2702\270Z\300q\330\010\017\210q\320\004\033\2301\330\010\013\2104\210t\2201\330\014\022\220*\230A\230Q\330\010\r\210T\220\021\330\010\n\210)\2204\220v\230T\240\022\240:\250Q\330\010\017\210q\320\004\033\2301\330\010\014\210H\220A\330\010\013\2104\210q\330\014\r\210]\230$\230h\240d\250\"\250J\260a\330\010\017\210q\320\004\036\230a\330\010\013\2104\210t\2201\330\014\022\220*\230A\230Q\330\010\r\210Y\220a\330\010\n\210(\220$\220e\2304\230r\320!4\260A\330\010\017\210q\320\004\036\230a\330\010\013\2104\210t\2201\330\014\022\220*\230A\230Q\330\010\r\210Y\220a\330\010\n\210(\220$\220h\230d\240\"\240M\260\021\330\010\017\210q\320\004\036\230a\330\010\017\210t\2206\230\030\240\021\320\004\036\320\0361\3201K\310<\320Wd\320dy\360\000\000z\001C\002\360\000\000C\002D\002\330\010\013\2101\330\014\022\220,\230a\230q\330\010\013\2105\220\003\2201\330\014\024\220D\230\007\230v\240Z\250q\330\014\024\220D\230\007\230v\240Z\250q\330\014\020\220\010\230\004\230B\230d\240!\2407\250\047\260\023\260A\260U\270\047\300\024\300V\3101\340\014\020\220\010\230\004\230B\230d\240!\2406\250\026\250q\320\004!\240\021\330\010\013\2104\210t\2201\330\014\022\220*\230A\230Q\330\010\034\230C\230q\240\001\330\010\"\240.\260\001\340\010\r\210W\220A\220W\230O\2506\260\022\2601\330\010\"\240$\240e\2504\250r\260\025\260a\260q\330\010%\240X\250Y\260e\2701\330\010!\240\031\250%\250q\330\010\017\210\177\230b\240\001\320\004#\2401\330\010\022\220+\230Q\330\013\025\220Q\220a\330\010\014\210H""\220D\230\002\230)\2404\240\177\260a\3207J\310\047\320QR\320\004$\240A\330\010\013\2104\210t\2201\330\014\022\220*\230A\230Q\330\010\034\230C\230q\240\001\330\010\"\240.\260\001\340\010\r\210W\220A\220W\230O\2506\260\022\2601\330\010\"\240$\240e\2504\250r\260\030\270\021\270!\330\010%\240X\250Y\260e\2701\330\010!\240\031\250%\250q\330\010\017\210\177\230b\240\001\320\004$\240A\330\010\034\230C\230q\240\001\330\010\"\240.\260\001\340\010\r\210W\220A\220W\230O\2506\260\022\2601\330\010\"\240$\240e\2504\250r\260\030\270\021\270!\330\010%\240X\250Y\260e\2701\330\010!\240\031\250%\250q\330\010\017\210\177\230b\240\001\320\004$\240N\260!\360\022\000\t\023\220)\230;\240g\250Q\330\013\025\220Q\220a\340\010\014\210D\220\005\220S\230\006\230a\330\014\020\220\001\220\025\220a\220t\230<\240u\250A\250Q\330\010\014\210H\220G\2301\330\020\021\330\027$\240A\320%6\260g\270Q\330\023$\240A\320%;\2707\300!\320\004\047\240~\260]\320BT\320TU\360\022\000\t\014\2101\330\014\026\220f\230H\240G\2509\260I\270Q\330\017\031\230\021\230!\330\014\017\210v\220S\230\001\330\020\030\230\005\230Q\330\014\020\220\010\230\004\230B\230d\240!\2403\240o\260Z\270q\300\016\310g\320UV\330\027\"\240!\240?\260\047\270\021\330\027\030\330\024\031\230\021\340\014\023\2209\230J\240a\330\014\026\220a\330\014\022\220!\330\014\r\360\010\000\r\016\360\n\000\022\023\330\020\033\2301\330\020\024\220D\230\001\230\025\230g\240Y\250h\260j\300\007\300x\310v\320UV\330\020\026\220h\230b\240\001\330\024\030\230\005\230Q\330\014\023\2201\320\004*\250!\330\010\013\2101\330\014\026\220g\230Q\330\017\031\230\021\230!\330\014\020\220\010\230\004\230B\230j\250\001\250\024\250[\3208I\310\021\320J`\320`g\320gh\340\014\023\2209\230J\240a\330\014\026\220a\330\014\021\220\021\330\014\r\360\014\000\022\023\330\020\033\2301\330\020\024\220E\230\021\230&\240\010\250\001\330\020\026\220h\230b\240\001\330\024\030\230\005\230Q\330\014\023\2201\320\004+\2501\330\010\025\220T\230\027\240\001\330\010\025\220T\230\027\240\006\240j\260\001\330""\010\014\210H\220D\230\002\230*\240A\320%6\260l\320BS\320ST\320\004,\250A\330\010\014\210H\220A\330\010\t\210\031\220$\220h\230d\240\"\240I\250Q\250a\330\010\017\210q\320\004,\250A\330\010\017\210t\2207\230.\250\001\250\025\250a\320\0043\3203C\3001\360\016\000\t\014\2101\330\014\026\220g\230Q\330\017\031\230\021\230!\330\014\020\220\010\230\004\230B\230d\240!\2403\240l\260#\260\\\300\033\310A\310_\320\\c\320cz\320z~\360\000\000\177\001C\002\360\000\000C\002D\002\340\014\023\2209\230J\240a\330\014\026\220a\330\014\021\220\021\330\014\r\360\014\000\022\023\330\020\033\2301\330\020\024\220D\230\001\230\025\230e\2408\2501\330\020\026\220h\230b\240\001\330\024\030\230\005\230Q\330\014\023\2201\320\0044\260A\360\016\000\t\023\220\047\230\021\330\013\025\220Q\220a\340\010\014\210D\220\005\220S\230\006\230a\330\014\020\220\001\220\025\220a\220t\230<\240u\250A\250Q\340\010\013\210:\220Z\230u\240G\2503\250a\330\010\013\210:\220U\230+\240Q\330\010\014\210H\220G\2301\330\020\021\330\020\021\330\023$\240A\320%;\2707\300!\320\0049\3209I\310\021\330\010\013\2101\330\014\026\220g\230Q\330\017\031\230\021\230!\330\014\020\220\010\230\004\230B\230j\250\001\250\023\250L\270\003\270<\300{\320RS\320Sb\320bi\320ir\320rs\340\014\023\2209\230J\240a\330\014\026\220a\330\014\021\220\021\330\014\r\360\014\000\022\023\330\020\033\2301\330\020\024\220J\230a\230u\240E\250\030\260\021\330\020\026\220h\230b\240\001\330\024\030\230\005\230Q\330\014\023\2201\320\004<\270A\330\010\013\2104\210t\2201\330\014\022\220*\230A\230Q\330\010\034\230C\230q\240\001\330\010\"\240.\260\001\340\010\r\210W\220A\220W\230O\2506\260\022\2601\330\010\034\230C\230q\240\001\330\010\"\240.\260\001\340\010\013\2107\220!\2207\230/\250\026\250r\260\021\330\010\017\210t\2205\230\004\230B\230o\250Q\250g\260Q\320\004>\320>Q\320Qd\320dz\360\000\000{\001N\002\360\000\000N\002j\002\360\000\000j\002u\002\360\000\000u\002v\002\330\010\014\210H\320\024$\240L\260\007\260q\330\010\014\210H\320\024$\240L\260\007\260q\330\010\014\210H""\220N\240*\250G\2601\330\010\014\210H\220N\240*\250G\2601\330\010\014\210H\320\024%\240]\260\047\270\021\330\010\014\210H\320\024(\250\n\260\047\270\021\330\010\014\210H\220M\240\031\250!\320\004@\320@U\320UV\330\010\013\2103\210c\220\021\330\014\022\220*\230A\230Q\330\010\013\2101\330\014\026\220g\230Q\330\017\031\230\021\230!\330\014\r\330\020\023\220:\230Q\230d\240!\330\024\030\230\010\240\004\240B\240m\2601\330\030\033\230=\250\013\2603\260g\270S\300\001\330\033&\240a\240\177\260g\270Y\300a\340\025\037\230q\240\004\240A\330\024\030\230\010\240\004\240B\240m\2601\330\030\033\230=\250\006\250c\260\030\270\023\270A\330\033&\240a\240\177\260g\270Y\300a\360\006\000\025\033\230)\2401\240A\340\023\035\230Q\230a\330\020\021\340\014\023\2209\230J\240a\330\014\026\220a\330\014\021\220\021\330\014\r\360\014\000\022\023\330\020\033\2301\330\020\024\220M\240\021\240%\240u\250C\250t\2608\270:\300Z\310q\330\020\026\220h\230b\240\001\330\024\030\230\005\230Q\330\014\023\2201";
    PyObject *data = NULL;
    #define __Pyx_DecompressString_UNUSED
    #define __Pyx_DecompressString_LZSS_UNUSED
    #endif
    PyObject **stringtab = __pyx_mstate->__pyx_string_tab;
    Py_ssize_t pos = 0;
    for (int i = 0; i < 484; i++) {
      Py_ssize_t bytes_length = str_length_index[i].length;
      PyObject *string = PyUnicode_DecodeUTF8(bytes + pos, bytes_length, NULL);
      if (likely(string) && i >= 43) PyUnicode_InternInPlace(&string);
      if (unlikely(!string)) {
        Py_XDECREF(data);
        __PYX_ERR(0, 1, __pyx_L1_error)
      }
      stringtab[i] = string;
      pos += bytes_length;
    }
    for (int i = 484; i < 599; i++) {
      Py_ssize_t bytes_length = bytes_length_index[i-484].length;
      PyObject *string = PyBytes_FromStringAndSize(bytes + pos, bytes_length);
      stringtab[i] = string;
      pos += bytes_length;
      if (unlikely(!string)) {
        Py_XDECREF(data);
        __PYX_ERR(0, 1, __pyx_L1_error)
      }
    }
    Py_XDECREF(data);
    for (Py_ssize_t i = 0; i < 599; i++) {
      if (unlikely(PyObject_Hash(stringtab[i]) == -1)) {
        __PYX_ERR(0, 1, __pyx_L1_error)
      }
    }
    #if CYTHON_IMMORTAL_CONSTANTS
    {
      PyObject **table = stringtab + 484;
      for (Py_ssize_t i=0; i<115; ++i) {
        #if PY_VERSION_HEX >= 0x030F0000
        PyUnstable_SetImmortal(table[i]);
        #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
        if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL)) break;
        #if PY_VERSION_HEX < 0x030E0000
        if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
        #else
        if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
        #endif
        {
          Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1));
        }
        #else
        if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT)) break;
        Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
        #endif
      }
    }
    #endif
  }
  {
    PyObject **numbertab = __pyx_mstate->__pyx_number_tab + 0;
    int8_t const cint_constants_1[] = {0,1};
    int16_t const cint_constants_2[] = {4096};
    int32_t const cint_constants_4[] = {238750788L};
    for (int i = 0; i < 4; i++) {
      numbertab[i] = PyLong_FromLong((i < 2 ? cint_constants_1[i - 0] : (i < 3 ? cint_constants_2[i - 2] : cint_constants_4[i - 3])));
      if (unlikely(!numbertab[i])) __PYX_ERR(0, 1, __pyx_L1_error)
    }
  }
  #if CYTHON_IMMORTAL_CONSTANTS
  {
    PyObject **table = __pyx_mstate->__pyx_number_tab;
    for (Py_ssize_t i=0; i<4; ++i) {
      #if PY_VERSION_HEX >= 0x030F0000
      PyUnstable_SetImmortal(table[i]);
      #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
      if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL)) break;
      #if PY_VERSION_HEX < 0x030E0000
      if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
      #else
      if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
      #endif
      {
        Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1));
      }
      #else
      if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT)) break;
      Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
      #endif
    }
  }
  #endif
  return 0;
  __pyx_L1_error:;
  return -1;
}
/* #### Code section: init_codeobjects ### */
#ifdef __cplusplus
namespace {
#endif
typedef struct {
    unsigned int argcount : 4;
    unsigned int num_posonly_args : 1;
    unsigned int num_kwonly_args : 1;
    unsigned int nlocals : 4;
    unsigned int flags : 10;
    unsigned int first_line : 10;
} __Pyx_PyCode_New_function_description;
#ifdef __cplusplus
} /* anonymous namespace */
#endif
/* NewCodeObj.proto */
static PyObject* __Pyx_PyCode_New(
        const __Pyx_PyCode_New_function_description descr,
        PyObject * const *varnames,
        PyObject *filename,
        PyObject *funcname,
        PyObject *line_table,
        PyObject *tuple_dedup_map
);


static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) {
  PyObject* tuple_dedup_map = PyDict_New();
  if (unlikely(!tuple_dedup_map)) return -1;
  {
    const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 0, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 86};
    PyObject* const varnames[] = {0};
    __pyx_mstate_global->__pyx_codeobj_tab[0] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cfunc_to_py, __pyx_mstate->__pyx_n_u_wrap, __pyx_mstate->__pyx_kp_b_iso88591_A_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[0])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 660};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_ok_ret};
    __pyx_mstate_global->__pyx_codeobj_tab[1] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_tmp_done, __pyx_mstate->__pyx_kp_b_iso88591_A_q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 740};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_v};
    __pyx_mstate_global->__pyx_codeobj_tab[2] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_tmp_get, __pyx_mstate->__pyx_kp_b_iso88591_A_7_1_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 744};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_ok, __pyx_mstate->__pyx_n_u_nodes};
    __pyx_mstate_global->__pyx_codeobj_tab[3] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_tmp_done, __pyx_mstate->__pyx_kp_b_iso88591_A_q_q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[3])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 771};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_ok_ret, __pyx_mstate->__pyx_n_u_nodes};
    __pyx_mstate_global->__pyx_codeobj_tab[4] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_tmp_done, __pyx_mstate->__pyx_kp_b_iso88591_A_q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[4])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 793};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_ok_ret, __pyx_mstate->__pyx_n_u_nodes};
    __pyx_mstate_global->__pyx_codeobj_tab[5] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_tmp_done, __pyx_mstate->__pyx_kp_b_iso88591_A_q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[5])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 832};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_ok_ret, __pyx_mstate->__pyx_n_u_nodes};
    __pyx_mstate_global->__pyx_codeobj_tab[6] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_tmp_done, __pyx_mstate->__pyx_kp_b_iso88591_A_q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[6])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 0, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 39};
    PyObject* const varnames[] = {0};
    __pyx_mstate_global->__pyx_codeobj_tab[7] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_version, __pyx_mstate->__pyx_kp_b_iso88591_hb_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[7])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_state, __pyx_mstate->__pyx_n_u_dict_2, __pyx_mstate->__pyx_n_u_use_setstate};
    __pyx_mstate_global->__pyx_codeobj_tab[8] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_q_l_vWE_Q_q_q_q_AWKwa_AWKq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[8])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 17};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[9] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_QfA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[9])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_state, __pyx_mstate->__pyx_n_u_dict_2, __pyx_mstate->__pyx_n_u_use_setstate};
    __pyx_mstate_global->__pyx_codeobj_tab[10] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_q_l_vWE_Q_q_q_q_AWKwa_AWKq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[10])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 17};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[11] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_QfA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[11])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 118};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_bit};
    __pyx_mstate_global->__pyx_codeobj_tab[12] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_getBit, __pyx_mstate->__pyx_kp_b_iso88591_A_t_WAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[12])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 120};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_bit, __pyx_mstate->__pyx_n_u_b};
    __pyx_mstate_global->__pyx_codeobj_tab[13] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_setBit, __pyx_mstate->__pyx_kp_b_iso88591_A_JgQe1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[13])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 122};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[14] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_getId, __pyx_mstate->__pyx_kp_b_iso88591_A_q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[14])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 124};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[15] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_toString, __pyx_mstate->__pyx_kp_b_iso88591_A_t_Ya, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[15])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 126};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[16] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_toFloat, __pyx_mstate->__pyx_kp_b_iso88591_A_t_XQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[16])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 128};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_a, __pyx_mstate->__pyx_n_u_b};
    __pyx_mstate_global->__pyx_codeobj_tab[17] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_commonBits, __pyx_mstate->__pyx_kp_b_iso88591_A_aq_AQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[17])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 131};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_key, __pyx_mstate->__pyx_n_u_h};
    __pyx_mstate_global->__pyx_codeobj_tab[18] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_get, __pyx_mstate->__pyx_kp_b_iso88591_A_HA_as_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[18])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 136};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_h};
    __pyx_mstate_global->__pyx_codeobj_tab[19] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_getRandom, __pyx_mstate->__pyx_kp_b_iso88591_A_HA_A_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[19])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[20] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[20])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[21] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[21])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 156};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_bit};
    __pyx_mstate_global->__pyx_codeobj_tab[22] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_getBit, __pyx_mstate->__pyx_kp_b_iso88591_A_t6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[22])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 158};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_bit, __pyx_mstate->__pyx_n_u_b};
    __pyx_mstate_global->__pyx_codeobj_tab[23] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_setBit, __pyx_mstate->__pyx_kp_b_iso88591_A_F_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[23])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 160};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[24] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_getLongId, __pyx_mstate->__pyx_kp_b_iso88591_A_q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[24])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 162};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[25] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_toString, __pyx_mstate->__pyx_kp_b_iso88591_A_t6_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[25])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 164};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[26] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_toFloat, __pyx_mstate->__pyx_kp_b_iso88591_a_t6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[26])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 166};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_a, __pyx_mstate->__pyx_n_u_b};
    __pyx_mstate_global->__pyx_codeobj_tab[27] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_commonBits, __pyx_mstate->__pyx_kp_b_iso88591_A_1HAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[27])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 169};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_key, __pyx_mstate->__pyx_n_u_h};
    __pyx_mstate_global->__pyx_codeobj_tab[28] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_get, __pyx_mstate->__pyx_kp_b_iso88591_A_D_as_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[28])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 174};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_h};
    __pyx_mstate_global->__pyx_codeobj_tab[29] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_getRandom, __pyx_mstate->__pyx_kp_b_iso88591_A_D_A_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[29])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[30] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[30])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[31] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[31])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 182};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[32] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_toString, __pyx_mstate->__pyx_kp_b_iso88591_A_t6_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[32])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 184};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[33] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_getPort, __pyx_mstate->__pyx_kp_b_iso88591_A_t6_3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[33])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 186};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[34] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_getFamily, __pyx_mstate->__pyx_kp_b_iso88591_A_t6_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[34])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 188};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_port};
    __pyx_mstate_global->__pyx_codeobj_tab[35] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_setPort, __pyx_mstate->__pyx_kp_b_iso88591_A_t6_4, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[35])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 190};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_af};
    __pyx_mstate_global->__pyx_codeobj_tab[36] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_setFamily, __pyx_mstate->__pyx_kp_b_iso88591_A_t6_1A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[36])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 192};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[37] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_isLoopback, __pyx_mstate->__pyx_kp_b_iso88591_A_t6_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[37])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 194};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[38] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_isPrivate, __pyx_mstate->__pyx_kp_b_iso88591_A_t6_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[38])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 196};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[39] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_isUnspecified, __pyx_mstate->__pyx_kp_b_iso88591_A_t6_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[39])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 202};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_host, __pyx_mstate->__pyx_n_u_service, __pyx_mstate->__pyx_n_u_vals, __pyx_mstate->__pyx_n_u_result, __pyx_mstate->__pyx_n_u_val, __pyx_mstate->__pyx_n_u_a};
    __pyx_mstate_global->__pyx_codeobj_tab[40] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_resolve, __pyx_mstate->__pyx_kp_b_iso88591_A_q_XQd_WG6_VW_G1_Ya_q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[40])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[41] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[41])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[42] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[42])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 214};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_h};
    __pyx_mstate_global->__pyx_codeobj_tab[43] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_getId, __pyx_mstate->__pyx_kp_b_iso88591_A_HA_d_BfA_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[43])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 218};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[44] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_getAddr, __pyx_mstate->__pyx_kp_b_iso88591_A_t6_R, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[44])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 220};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[45] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_isExpired, __pyx_mstate->__pyx_kp_b_iso88591_A_t6_Rz, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[45])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[46] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[46])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[47] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[47])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 225};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_h};
    __pyx_mstate_global->__pyx_codeobj_tab[48] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_getId, __pyx_mstate->__pyx_kp_b_iso88591_A_HA_d_Q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[48])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 229};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_n};
    __pyx_mstate_global->__pyx_codeobj_tab[49] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_getNode, __pyx_mstate->__pyx_kp_b_iso88591_A_D_c_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[49])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[50] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[50])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[51] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[51])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 240};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_s, __pyx_mstate->__pyx_n_u_w};
    __pyx_mstate_global->__pyx_codeobj_tab[52] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_buildFrom, __pyx_mstate->__pyx_kp_b_iso88591_A_M_q_1A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[52])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 242};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_q};
    __pyx_mstate_global->__pyx_codeobj_tab[53] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_isSatisfiedBy, __pyx_mstate->__pyx_kp_b_iso88591_A_t7, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[53])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[54] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[54])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[55] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[55])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 254};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_os};
    __pyx_mstate_global->__pyx_codeobj_tab[56] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_isSatisfiedBy, __pyx_mstate->__pyx_kp_b_iso88591_A_t8_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[56])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 256};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_field};
    __pyx_mstate_global->__pyx_codeobj_tab[57] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_field, __pyx_mstate->__pyx_kp_b_iso88591_A_HF_q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[57])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[58] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[58])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[59] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[59])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 269};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_where};
    __pyx_mstate_global->__pyx_codeobj_tab[60] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_isSatisfiedBy, __pyx_mstate->__pyx_kp_b_iso88591_A_t7_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[60])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 271};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_id};
    __pyx_mstate_global->__pyx_codeobj_tab[61] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_id, __pyx_mstate->__pyx_kp_b_iso88591_A_G3aq_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[61])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 274};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_type};
    __pyx_mstate_global->__pyx_codeobj_tab[62] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_valueType, __pyx_mstate->__pyx_kp_b_iso88591_A_G_Qa_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[62])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 277};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_owner_pk_hash};
    __pyx_mstate_global->__pyx_codeobj_tab[63] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_owner, __pyx_mstate->__pyx_kp_b_iso88591_A_G6_q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[63])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 280};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_seq_no};
    __pyx_mstate_global->__pyx_codeobj_tab[64] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_seq, __pyx_mstate->__pyx_kp_b_iso88591_A_G4q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[64])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 283};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_user_type};
    __pyx_mstate_global->__pyx_codeobj_tab[65] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_userType, __pyx_mstate->__pyx_kp_b_iso88591_A_G9AYgQ_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[65])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[66] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[66])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[67] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[67])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[68] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[68])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[69] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[69])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[70] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[70])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[71] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[71])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[72] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[72])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[73] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[73])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 354};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[74] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_size, __pyx_mstate->__pyx_kp_b_iso88591_A_t7_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[74])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 356};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_l};
    __pyx_mstate_global->__pyx_codeobj_tab[75] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_insert, __pyx_mstate->__pyx_kp_b_iso88591_A_t7_4q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[75])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 358};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_li, __pyx_mstate->__pyx_n_u_n};
    __pyx_mstate_global->__pyx_codeobj_tab[76] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_extend, __pyx_mstate->__pyx_kp_b_iso88591_A_E_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[76])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 361};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_h};
    __pyx_mstate_global->__pyx_codeobj_tab[77] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_first, __pyx_mstate->__pyx_kp_b_iso88591_A_4wfA_A_HA_fD_vS_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[77])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 367};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_h};
    __pyx_mstate_global->__pyx_codeobj_tab[78] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_last, __pyx_mstate->__pyx_kp_b_iso88591_A_4wfA_A_HA_fD_G4t1_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[78])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[79] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[79])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[80] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[80])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 386};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_h};
    __pyx_mstate_global->__pyx_codeobj_tab[81] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_getId, __pyx_mstate->__pyx_kp_b_iso88591_q_4t1_AQ_HA_d_t2_8_b_a_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[81])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 393};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_id};
    __pyx_mstate_global->__pyx_codeobj_tab[82] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_getLongId, __pyx_mstate->__pyx_kp_b_iso88591_1_4t1_AQ_T_4uD_5Rt2Zq_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[82])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 400};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pk};
    __pyx_mstate_global->__pyx_codeobj_tab[83] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_getPublicKey, __pyx_mstate->__pyx_kp_b_iso88591_a_4t1_AQ_Ya_e4r_4A_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[83])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 407};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dat, __pyx_mstate->__pyx_n_u_d_len, __pyx_mstate->__pyx_n_u_d_ptr, __pyx_mstate->__pyx_n_u_indat, __pyx_mstate->__pyx_n_u_decrypted, __pyx_mstate->__pyx_n_u_decrypted_c_str, __pyx_mstate->__pyx_n_u_length};
    __pyx_mstate_global->__pyx_codeobj_tab[84] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_decrypt, __pyx_mstate->__pyx_kp_b_iso88591_A_Cq_WAWO6_1_e4r_XYe1_q_b, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[84])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 417};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dat, __pyx_mstate->__pyx_n_u_d_len, __pyx_mstate->__pyx_n_u_d_ptr, __pyx_mstate->__pyx_n_u_indat, __pyx_mstate->__pyx_n_u_signature, __pyx_mstate->__pyx_n_u_signature_c_str, __pyx_mstate->__pyx_n_u_length};
    __pyx_mstate_global->__pyx_codeobj_tab[85] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_sign, __pyx_mstate->__pyx_kp_b_iso88591_4t1_AQ_Cq_WAWO6_1_e4r_aq_XYe1_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[85])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 429};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_k};
    __pyx_mstate_global->__pyx_codeobj_tab[86] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_generate, __pyx_mstate->__pyx_kp_b_iso88591_A_Ja_L_0_y_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[86])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 434};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_k};
    __pyx_mstate_global->__pyx_codeobj_tab[87] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_generateEC, __pyx_mstate->__pyx_kp_b_iso88591_A_Ja_L_0_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[87])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[88] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[88])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[89] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[89])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 442};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_h};
    __pyx_mstate_global->__pyx_codeobj_tab[90] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_getId, __pyx_mstate->__pyx_kp_b_iso88591_q_4t1_AQ_HA_d_t2V1_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[90])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 449};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_id};
    __pyx_mstate_global->__pyx_codeobj_tab[91] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_getLongId, __pyx_mstate->__pyx_kp_b_iso88591_1_4t1_AQ_T_4uD_A_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[91])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 456};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dat, __pyx_mstate->__pyx_n_u_d_len, __pyx_mstate->__pyx_n_u_d_ptr, __pyx_mstate->__pyx_n_u_indat, __pyx_mstate->__pyx_n_u_encrypted, __pyx_mstate->__pyx_n_u_encrypted_c_str, __pyx_mstate->__pyx_n_u_length};
    __pyx_mstate_global->__pyx_codeobj_tab[92] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_encrypt, __pyx_mstate->__pyx_kp_b_iso88591_A_4t1_AQ_Cq_WAWO6_1_e4r_XYe1_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[92])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 468};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dat, __pyx_mstate->__pyx_n_u_signature, __pyx_mstate->__pyx_n_u_d_len, __pyx_mstate->__pyx_n_u_d_ptr, __pyx_mstate->__pyx_n_u_indat, __pyx_mstate->__pyx_n_u_s_len, __pyx_mstate->__pyx_n_u_s_ptr, __pyx_mstate->__pyx_n_u_sig};
    __pyx_mstate_global->__pyx_codeobj_tab[93] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_checkSignature, __pyx_mstate->__pyx_kp_b_iso88591_A_4t1_AQ_Cq_WAWO6_1_Cq_7_7_r_t5, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[93])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[94] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[94])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[95] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[95])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 486};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_h};
    __pyx_mstate_global->__pyx_codeobj_tab[96] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_getId, __pyx_mstate->__pyx_kp_b_iso88591_q_4t1_AQ_HA_d_BfA_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[96])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 492};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_id};
    __pyx_mstate_global->__pyx_codeobj_tab[97] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_getLongId, __pyx_mstate->__pyx_kp_b_iso88591_1_4t1_AQ_T_4vT_Q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[97])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 498};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[98] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_toString, __pyx_mstate->__pyx_kp_b_iso88591_4t1_1_t6_Ry, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[98])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 502};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[99] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_getName, __pyx_mstate->__pyx_kp_b_iso88591_t6_Rxr, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[99])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 504};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_k, __pyx_mstate->__pyx_n_u_c};
    __pyx_mstate_global->__pyx_codeobj_tab[100] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_revoke, __pyx_mstate->__pyx_kp_b_iso88591_A_F_b_q_auD_V1F_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[100])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 506};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[101] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_bytes_2, __pyx_mstate->__pyx_kp_b_iso88591_A_t6_Ry_t_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[101])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 515};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_k, __pyx_mstate->__pyx_n_u_name_2, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_is_ca, __pyx_mstate->__pyx_n_u_c};
    __pyx_mstate_global->__pyx_codeobj_tab[102] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_generate, __pyx_mstate->__pyx_kp_b_iso88591_A6_Oq_Kq_22B_1FRSSXX_aaeellppqqw, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[102])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[103] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[103])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[104] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[104])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 525};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[105] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_str_2, __pyx_mstate->__pyx_kp_b_iso88591_A_t89A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[105])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[106] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[106])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[107] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[107])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 530};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cert};
    __pyx_mstate_global->__pyx_codeobj_tab[108] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_add, __pyx_mstate->__pyx_kp_b_iso88591_A_G4q_d_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[108])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 532};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cert};
    __pyx_mstate_global->__pyx_codeobj_tab[109] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_remove, __pyx_mstate->__pyx_kp_b_iso88591_A_G7_6_V4q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[109])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 534};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cert, __pyx_mstate->__pyx_n_u_r};
    __pyx_mstate_global->__pyx_codeobj_tab[110] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_verify, __pyx_mstate->__pyx_kp_b_iso88591_A_L_D_wavT_t1_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[110])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[111] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[111])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[112] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[112])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[113] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[113])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[114] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[114])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 551};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_name_2, __pyx_mstate->__pyx_n_u_ca, __pyx_mstate->__pyx_n_u_bits, __pyx_mstate->__pyx_n_u_i};
    __pyx_mstate_global->__pyx_codeobj_tab[115] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_generate, __pyx_mstate->__pyx_kp_b_iso88591_A_38_Oq_HA_AT_BfA_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[115])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[116] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[116])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[117] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[117])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 578};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_data, __pyx_mstate->__pyx_n_u_password, __pyx_mstate->__pyx_n_u_d_len, __pyx_mstate->__pyx_n_u_d_ptr, __pyx_mstate->__pyx_n_u_indat, __pyx_mstate->__pyx_n_u_encrypted, __pyx_mstate->__pyx_n_u_encrypted_c_str, __pyx_mstate->__pyx_n_u_length};
    __pyx_mstate_global->__pyx_codeobj_tab[118] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_aesEncrypt, __pyx_mstate->__pyx_kp_b_iso88591_A_1A_nA_vRq_AWHG1_q_Ye1_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[118])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 588};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_data, __pyx_mstate->__pyx_n_u_password, __pyx_mstate->__pyx_n_u_d_len, __pyx_mstate->__pyx_n_u_d_ptr, __pyx_mstate->__pyx_n_u_indat, __pyx_mstate->__pyx_n_u_decrypted, __pyx_mstate->__pyx_n_u_decrypted_c_str, __pyx_mstate->__pyx_n_u_length};
    __pyx_mstate_global->__pyx_codeobj_tab[119] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_aesDecrypt, __pyx_mstate->__pyx_kp_b_iso88591_A_1A_nA_vRq_AWHG1_q_Ye1_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[119])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 603};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_id};
    __pyx_mstate_global->__pyx_codeobj_tab[120] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_setIdentity, __pyx_mstate->__pyx_kp_b_iso88591_A_HKvRq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[120])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 605};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_bootstrap};
    __pyx_mstate_global->__pyx_codeobj_tab[121] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_setBootstrapMode, __pyx_mstate->__pyx_kp_b_iso88591_A_HK_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[121])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 607};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_id};
    __pyx_mstate_global->__pyx_codeobj_tab[122] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_setNodeId, __pyx_mstate->__pyx_kp_b_iso88591_A_HK_b, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[122])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 609};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_netid};
    __pyx_mstate_global->__pyx_codeobj_tab[123] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_setNetwork, __pyx_mstate->__pyx_kp_b_iso88591_A_HK_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[123])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 611};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_maintain_storage};
    __pyx_mstate_global->__pyx_codeobj_tab[124] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_setMaintainStorage, __pyx_mstate->__pyx_kp_b_iso88591_A_HK_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[124])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 613};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_max_req_per_sec, __pyx_mstate->__pyx_n_u_max_peer_req_per_sec};
    __pyx_mstate_global->__pyx_codeobj_tab[125] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_setRateLimit, __pyx_mstate->__pyx_kp_b_iso88591_A_HK_a_HK_C1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[125])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {8, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 616};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_proxy_server, __pyx_mstate->__pyx_n_u_push_node_id, __pyx_mstate->__pyx_n_u_push_token, __pyx_mstate->__pyx_n_u_push_topic, __pyx_mstate->__pyx_n_u_push_platform, __pyx_mstate->__pyx_n_u_user_agent, __pyx_mstate->__pyx_n_u_server_ca};
    __pyx_mstate_global->__pyx_codeobj_tab[126] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_setProxyInfo, __pyx_mstate->__pyx_kp_b_iso88591_QQddz_N_N_j_j_u_u_v_H_L_q_H_L_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[126])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 624};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_peer_discovery, __pyx_mstate->__pyx_n_u_peer_publish};
    __pyx_mstate_global->__pyx_codeobj_tab[127] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_setPeerDiscovery, __pyx_mstate->__pyx_kp_b_iso88591_A_H_a_H_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[127])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 627};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_bind4, __pyx_mstate->__pyx_n_u_bind6};
    __pyx_mstate_global->__pyx_codeobj_tab[128] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_setBound, __pyx_mstate->__pyx_kp_b_iso88591_A_HIU_HIU, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[128])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[129] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[129])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[130] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[130])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 635};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_h};
    __pyx_mstate_global->__pyx_codeobj_tab[131] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_getId, __pyx_mstate->__pyx_kp_b_iso88591_q_HA_4q_hd_F_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[131])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 640};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pk};
    __pyx_mstate_global->__pyx_codeobj_tab[132] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_getPublicKey, __pyx_mstate->__pyx_kp_b_iso88591_a_4t1_AQ_Ya_hd_M_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[132])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 646};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_h};
    __pyx_mstate_global->__pyx_codeobj_tab[133] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_getNodeId, __pyx_mstate->__pyx_kp_b_iso88591_1_HA_4q_hd_Ja_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[133])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 651};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_addr, __pyx_mstate->__pyx_n_u_done_cb, __pyx_mstate->__pyx_n_u_cb_obj, __pyx_mstate->__pyx_n_u_lock, __pyx_mstate->__pyx_n_u_pending, __pyx_mstate->__pyx_n_u_ok, __pyx_mstate->__pyx_n_u_tmp_done, __pyx_mstate->__pyx_n_u_tmp_done};
    __pyx_mstate_global->__pyx_codeobj_tab[134] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_ping, __pyx_mstate->__pyx_kp_b_iso88591_1_gQ_Bj_8I_J_ggh_9Ja_a_1_E_hb_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[134])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 672};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_host, __pyx_mstate->__pyx_n_u_port, __pyx_mstate->__pyx_n_u_host_bytes, __pyx_mstate->__pyx_n_u_port_bytes};
    __pyx_mstate_global->__pyx_codeobj_tab[135] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_bootstrap, __pyx_mstate->__pyx_kp_b_iso88591_1_T_T_j_HD_A_6lBSST, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[135])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {7, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 676};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_id, __pyx_mstate->__pyx_n_u_is_bootstrap, __pyx_mstate->__pyx_n_u_port, __pyx_mstate->__pyx_n_u_ipv4, __pyx_mstate->__pyx_n_u_ipv6, __pyx_mstate->__pyx_n_u_config, __pyx_mstate->__pyx_n_u_bind4, __pyx_mstate->__pyx_n_u_bind6};
    __pyx_mstate_global->__pyx_codeobj_tab[136] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_run, __pyx_mstate->__pyx_kp_b_iso88591_11K_Wddy_z_C_C_D_1_aq_5_1_D_vZq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[136])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 685};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[137] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_join, __pyx_mstate->__pyx_kp_b_iso88591_A_HD_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[137])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 687};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_shutdown_cb, __pyx_mstate->__pyx_n_u_cb_obj};
    __pyx_mstate_global->__pyx_codeobj_tab[138] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_shutdown, __pyx_mstate->__pyx_kp_b_iso88591_1_Q_Qa_HD_4_a7J_QR, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[138])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 691};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_type};
    __pyx_mstate_global->__pyx_codeobj_tab[139] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_registerType, __pyx_mstate->__pyx_kp_b_iso88591_A_HD_q_d, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[139])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 693};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[140] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_enableLogging, __pyx_mstate->__pyx_kp_b_iso88591_A_hd_AQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[140])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 695};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[141] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_disableLogging, __pyx_mstate->__pyx_kp_b_iso88591_A_4xt2Qa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[141])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 697};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_path};
    __pyx_mstate_global->__pyx_codeobj_tab[142] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_enableFileLogging, __pyx_mstate->__pyx_kp_b_iso88591_A_Qd_b_T, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[142])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 699};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[143] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_isRunning, __pyx_mstate->__pyx_kp_b_iso88591_A_t84r_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[143])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 701};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_af, __pyx_mstate->__pyx_n_u_s};
    __pyx_mstate_global->__pyx_codeobj_tab[144] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_getBound, __pyx_mstate->__pyx_kp_b_iso88591_A_HA_hd_IQa_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[144])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 705};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[145] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_getStorageLog, __pyx_mstate->__pyx_kp_b_iso88591_A_t84r_r, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[145])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 707};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_af};
    __pyx_mstate_global->__pyx_codeobj_tab[146] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_getRoutingTablesLog, __pyx_mstate->__pyx_kp_b_iso88591_A_t84r_5Qc, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[146])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 709};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_af};
    __pyx_mstate_global->__pyx_codeobj_tab[147] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_getSearchesLog, __pyx_mstate->__pyx_kp_b_iso88591_A_t84r_G1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[147])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 711};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_stats, __pyx_mstate->__pyx_n_u_res, __pyx_mstate->__pyx_n_u_n};
    __pyx_mstate_global->__pyx_codeobj_tab[148] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_getNodeMessageStats, __pyx_mstate->__pyx_kp_b_iso88591_A_HD_Naq_E_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[148])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 14, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 718};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_key, __pyx_mstate->__pyx_n_u_get_cb, __pyx_mstate->__pyx_n_u_done_cb, __pyx_mstate->__pyx_n_u_filter, __pyx_mstate->__pyx_n_u_where, __pyx_mstate->__pyx_n_u_cb_obj, __pyx_mstate->__pyx_n_u_lock, __pyx_mstate->__pyx_n_u_pending, __pyx_mstate->__pyx_n_u_res, __pyx_mstate->__pyx_n_u_tmp_get, __pyx_mstate->__pyx_n_u_tmp_get, __pyx_mstate->__pyx_n_u_tmp_done, __pyx_mstate->__pyx_n_u_tmp_done};
    __pyx_mstate_global->__pyx_codeobj_tab[149] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_get, __pyx_mstate->__pyx_kp_b_iso88591_BTTU_1_fHG9IQ_vS_Q_Bd_3oZq_gUV, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[149])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 756};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_key, __pyx_mstate->__pyx_n_u_val, __pyx_mstate->__pyx_n_u_done_cb, __pyx_mstate->__pyx_n_u_permanent, __pyx_mstate->__pyx_n_u_cb_obj, __pyx_mstate->__pyx_n_u_lock, __pyx_mstate->__pyx_n_u_pending, __pyx_mstate->__pyx_n_u_ok, __pyx_mstate->__pyx_n_u_tmp_done, __pyx_mstate->__pyx_n_u_tmp_done};
    __pyx_mstate_global->__pyx_codeobj_tab[150] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_put, __pyx_mstate->__pyx_kp_b_iso88591_33C1_1_gQ_Bd_3l_A__cczz_C_C_D_9, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[150])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 784};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_key, __pyx_mstate->__pyx_n_u_val, __pyx_mstate->__pyx_n_u_done_cb, __pyx_mstate->__pyx_n_u_permanent, __pyx_mstate->__pyx_n_u_cb_obj, __pyx_mstate->__pyx_n_u_lock, __pyx_mstate->__pyx_n_u_pending, __pyx_mstate->__pyx_n_u_ok, __pyx_mstate->__pyx_n_u_tmp_done, __pyx_mstate->__pyx_n_u_tmp_done};
    __pyx_mstate_global->__pyx_codeobj_tab[151] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_putSigned, __pyx_mstate->__pyx_kp_b_iso88591_99I_1_gQ_Bj_L_RSSbbiirrs_9Ja_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[151])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 806};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_key, __pyx_mstate->__pyx_n_u_val, __pyx_mstate->__pyx_n_u_to, __pyx_mstate->__pyx_n_u_done_cb, __pyx_mstate->__pyx_n_u_permanent, __pyx_mstate->__pyx_n_u_cb_obj, __pyx_mstate->__pyx_n_u_lock, __pyx_mstate->__pyx_n_u_pending, __pyx_mstate->__pyx_n_u_ok, __pyx_mstate->__pyx_n_u_tmp_done, __pyx_mstate->__pyx_n_u_tmp_done};
    __pyx_mstate_global->__pyx_codeobj_tab[152] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_putEncrypted, __pyx_mstate->__pyx_kp_b_iso88591_UUV_3c_AQ_1_gQ_Qd_Bm1_3gS_a_gYa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[152])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 845};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_key, __pyx_mstate->__pyx_n_u_val};
    __pyx_mstate_global->__pyx_codeobj_tab[153] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_cancelPut, __pyx_mstate->__pyx_kp_b_iso88591_A_HD_AS_Cq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[153])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 848};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_key, __pyx_mstate->__pyx_n_u_value_cb, __pyx_mstate->__pyx_n_u_t, __pyx_mstate->__pyx_n_u_cb_obj};
    __pyx_mstate_global->__pyx_codeobj_tab[154] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_listen, __pyx_mstate->__pyx_kp_b_iso88591_A_Kq_s_Qha_Qa_t84r_a_OwV_dde_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[154])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 857};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_token};
    __pyx_mstate_global->__pyx_codeobj_tab[155] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_cancelListen, __pyx_mstate->__pyx_kp_b_iso88591_A_HD_q_U_q_Qhe4q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[155])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[156] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[156])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[157] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[157])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 869};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_h};
    __pyx_mstate_global->__pyx_codeobj_tab[158] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_getKey, __pyx_mstate->__pyx_kp_b_iso88591_A_HA_d_Rq_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[158])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 873};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[159] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_getValueId, __pyx_mstate->__pyx_kp_b_iso88591_A_t7_b, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[159])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[160] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[160])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[161] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[161])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 886};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_key, __pyx_mstate->__pyx_n_u_lookup_cb, __pyx_mstate->__pyx_n_u_done_cb, __pyx_mstate->__pyx_n_u_cb_obj, __pyx_mstate->__pyx_n_u_cppk, __pyx_mstate->__pyx_n_u_kk, __pyx_mstate->__pyx_n_u_v};
    __pyx_mstate_global->__pyx_codeobj_tab[162] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_lookup, __pyx_mstate->__pyx_kp_b_iso88591_N_gQ_Qa_D_S_a_at_uAQ_HG1_A_6gQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[162])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 905};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_key, __pyx_mstate->__pyx_n_u_value, __pyx_mstate->__pyx_n_u_done_cb, __pyx_mstate->__pyx_n_u_cb_obj, __pyx_mstate->__pyx_n_u_cppk, __pyx_mstate->__pyx_n_u_kk, __pyx_mstate->__pyx_n_u_v, __pyx_mstate->__pyx_n_u_val};
    __pyx_mstate_global->__pyx_codeobj_tab[163] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opendht_pyx, __pyx_mstate->__pyx_n_u_insert, __pyx_mstate->__pyx_kp_b_iso88591_4A_Qa_D_S_a_at_uAQ_ZuG3a_U_Q_HG, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[163])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[164] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[164])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[165] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[165])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_pyx_type, __pyx_mstate->__pyx_n_u_pyx_checksum, __pyx_mstate->__pyx_n_u_pyx_state, __pyx_mstate->__pyx_n_u_pyx_result};
    __pyx_mstate_global->__pyx_codeobj_tab[166] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_pyx_unpickle__WithID, __pyx_mstate->__pyx_kp_b_iso88591_q_0_kQR_7_1_7_N_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[166])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_pyx_type, __pyx_mstate->__pyx_n_u_pyx_checksum, __pyx_mstate->__pyx_n_u_pyx_state, __pyx_mstate->__pyx_n_u_pyx_result};
    __pyx_mstate_global->__pyx_codeobj_tab[167] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_pyx_unpickle__WithPk, __pyx_mstate->__pyx_kp_b_iso88591_q_0_kQR_7_1_7_N_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[167])) goto bad;
  }
  Py_DECREF(tuple_dedup_map);
  return 0;
  bad:
  Py_DECREF(tuple_dedup_map);
  return -1;
}
/* #### Code section: init_globals ### */

static int __Pyx_InitGlobals(void) {
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  /* PythonCompatibility.init */
  if (likely(__Pyx_init_co_variables() == 0 && __Pyx_init_tpflags_variables() == 0)); else
  
  if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)

  /* CommonTypesMetaclass.init */
  if (likely(__pyx_CommonTypesMetaclass_init(__pyx_m) == 0)); else
  
  if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)

  /* CachedMethodType.init */
  #if CYTHON_COMPILING_IN_LIMITED_API
  {
      PyObject *typesModule=NULL;
      typesModule = PyImport_ImportModule("types");
      if (typesModule) {
          __pyx_mstate_global->__Pyx_CachedMethodType = PyObject_GetAttrString(typesModule, "MethodType");
          Py_DECREF(typesModule);
      }
  } // error handling follows
  #endif
  
  if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)

  /* PyFrozenDict.init */
  #if CYTHON_COMPILING_IN_LIMITED_API
  {
      PyObject *builtins = PyEval_GetBuiltins(); // borrowed
      if (likely(builtins)) {
          PyObject *type_name = PyUnicode_FromStringAndSize("frozendict", sizeof("frozendict")-1);
          if (likely(type_name)) {
              PyObject *frozendict_type = PyObject_GetItem(builtins, type_name);
              Py_DECREF(type_name);
              if (!frozendict_type && PyErr_ExceptionMatches(PyExc_KeyError)) {
                  PyErr_Clear();
                  frozendict_type = (PyObject*) &PyDict_Type;
                  Py_INCREF(frozendict_type);
              }
              __pyx_mstate_global->__Pyx_PyFrozenDictType = frozendict_type;
          }
      }
  } // error handling follows
  #endif
  
  if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)

  return 0;
  __pyx_L1_error:;
  return -1;
}
/* #### Code section: init_after_shared_utility ### */

static int __Pyx_InitAfterSharedUtility(void) {
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  /* CythonFunctionPerModule.init */
  if (likely(__pyx_CyFunction_init(__pyx_m) == 0)); else
  
  if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)

  return 0;
  __pyx_L1_error:;
  return -1;
}
/* #### 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

/* FastTypeChecks (used by GivenExceptionMatches) */
#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);
}
#endif

/* PyErrFetchRestore (used by GivenExceptionMatches) */
#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

/* GivenExceptionMatches (used by PyErrExceptionMatches) */
#if CYTHON_COMPILING_IN_CPYTHON
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);
    }
}
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);
    for (i=0; i<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
    for (i=0; i<n; i++) {
        PyObject *t = PyTuple_GET_ITEM(tuple, i);
        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

/* PyErrExceptionMatches (used by PyObjectGetAttrStrNoError) */
#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);
    for (i=0; i<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
    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

/* PyObjectGetAttrStr (used by PyObjectGetAttrStrNoError) */
#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);
    return PyObject_GetAttr(obj, attr_name);
}
#endif

/* PyObjectGetAttrStrNoError (used by GetBuiltinName) */
#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
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 >= 0x030d0000
    (void) PyObject_GetOptionalAttr(obj, attr_name, &result);
    return result;
#else
#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS
    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_mstate_global->__pyx_b, name);
    if (unlikely(!result) && !PyErr_Occurred()) {
        PyErr_Format(PyExc_NameError,
            "name '%U' is not defined", name);
    }
    return result;
}

/* CopyObjectArray (used by TupleOrListFromArrayImpl) */
#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);
    }
}
#endif

/* TupleOrListFromArrayImpl (used by TupleFromArray) */
#if !(PY_VERSION_HEX >= 0x030F0000 && !CYTHON_COMPILING_IN_LIMITED_API)
CYTHON_UNUSED static PyObject *
__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) {
    if (n <= 0) {
        return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple);
    }
    PyObject *res = PyTuple_New(n);
    if (unlikely(res == NULL)) return NULL;
    #if CYTHON_COMPILING_IN_CPYTHON
    __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n);
    #else
    Py_ssize_t i;
    for (i = 0; i < n; i++) {
        Py_INCREF(src[i]);
        if (unlikely(__Pyx_PyTuple_SET_ITEM(res, i, src[i]) < (0))) {
            Py_DECREF(res);
            return NULL;
        }
    }
    #endif
    return res;
}
#endif

/* PyObjectCompare (used by UnicodeEquals) */
#ifndef __Pyx_DEFINED_PyObject_CompareStrStrBoolEq
#define __Pyx_DEFINED_PyObject_CompareStrStrBoolEq
static CYTHON_INLINE int __Pyx_PyObject_CompareStrStrBoolEq(PyObject* s1, PyObject* s2) {
    #if __PYX_LIMITED_VERSION_HEX >= 0x030e0000
    int result = PyUnicode_Equal(s1, s2);
    #if !CYTHON_COMPILING_IN_CPYTHON
    if (unlikely(result == -1)) return -1;
    #endif
    if (result == 0) goto __pyx_return_false; else goto __pyx_return_true;
    #else
    int result = PyUnicode_Compare(s1, s2);
    if (unlikely((result == -1) && PyErr_Occurred())) return -1;
    if (result == 0) goto __pyx_return_true; else goto __pyx_return_false;
    #endif
__pyx_return_true:
    return 1;
__pyx_return_false:
    return 0;
}
#endif
static CYTHON_INLINE int __Pyx_PyObject_CompareBoolEq_str_str(PyObject *op1, PyObject *op2, int pyop) {
    CYTHON_UNUSED_VAR(pyop);
    if (unlikely(op1 == Py_None)) {
        if (op2 == Py_None) goto __pyx_return_true; else goto __pyx_return_false;
    }
    if (unlikely(op2 == Py_None)) {
        if (op1 == Py_None) goto __pyx_return_true; else goto __pyx_return_false;
    }
    
    if (likely(op1 != Py_None)) {
        if (op1 == op2) goto __pyx_return_true;
        if (likely(op2 != Py_None)) {
            return __Pyx_PyObject_CompareStrStrBoolEq(op1, op2);
        }
        goto __pyx_richcmp;
    }
    
    if ((0)) goto __pyx_richcmp;
    if ((0)) goto __pyx_return_true;
    if ((0)) goto __pyx_return_false;
__pyx_richcmp:
    return __Pyx_PyObject_RichCompareBool(op1, op2, Py_EQ);
__pyx_return_true:
    return 1;
__pyx_return_false:
    return 0;
}

/* fastcall */
#if CYTHON_VECTORCALL
static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s)
{
    Py_ssize_t i, n = __Pyx_PyTuple_GET_SIZE(kwnames);
    #if !CYTHON_ASSUME_SAFE_SIZE
    if (unlikely(n == -1)) return NULL;
    #endif
    for (i = 0; i < n; i++)
    {
        PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i);
        #if !CYTHON_ASSUME_SAFE_MACROS
        if (unlikely(!namei)) return NULL;
        #endif
        if (s == namei) return kwvalues[i];
    }
    for (i = 0; i < n; i++)
    {
        PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i);
        #if !CYTHON_ASSUME_SAFE_MACROS
        if (unlikely(!namei)) return NULL;
        #endif
        int eq = __Pyx_PyUnicode_Equals(s, namei);
        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_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL
CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) {
    Py_ssize_t i, nkwargs;
    PyObject *dict;
#if !CYTHON_ASSUME_SAFE_SIZE
    nkwargs = PyTuple_Size(kwnames);
    if (unlikely(nkwargs < 0)) return NULL;
#else
    nkwargs = PyTuple_GET_SIZE(kwnames);
#endif
    dict = PyDict_New();
    if (unlikely(!dict))
        return NULL;
    for (i=0; i<nkwargs; i++) {
#if !CYTHON_ASSUME_SAFE_MACROS
        PyObject *key = PyTuple_GetItem(kwnames, i);
        if (!key) goto bad;
#else
        PyObject *key = PyTuple_GET_ITEM(kwnames, i);
#endif
        if (unlikely(PyDict_SetItem(dict, key, kwvalues[i]) < 0))
            goto bad;
    }
    return dict;
bad:
    Py_DECREF(dict);
    return NULL;
}
#endif
#endif

/* dict_setdefault (used by FetchCommonType) */
static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value) {
    PyObject* value;
#if __PYX_LIMITED_VERSION_HEX >= 0x030F0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4)
    PyDict_SetDefaultRef(d, key, default_value, &value);
#elif CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX >= 0x030C0000
    PyObject *args[] = {d, key, default_value};
    value = PyObject_VectorcallMethod(__pyx_mstate_global->__pyx_n_u_setdefault, args, 3 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
#elif CYTHON_COMPILING_IN_LIMITED_API
    value = PyObject_CallMethodObjArgs(d, __pyx_mstate_global->__pyx_n_u_setdefault, key, default_value, NULL);
#else
    value = PyDict_SetDefault(d, key, default_value);
    if (unlikely(!value)) return NULL;
    Py_INCREF(value);
#endif
    return value;
}

/* AddModuleRef (used by FetchSharedCythonModule) */
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && PY_VERSION_HEX < 0x030F00a3
  static PyObject *__Pyx_PyImport_AddModuleObjectRef(PyObject *name) {
      PyObject *module_dict = PyImport_GetModuleDict();
      PyObject *m;
      if (PyMapping_GetOptionalItem(module_dict, name, &m) < 0) {
          return NULL;
      }
      if (m != NULL && PyModule_Check(m)) {
          return m;
      }
      Py_XDECREF(m);
      m = PyModule_NewObject(name);
      if (m == NULL)
          return NULL;
      if (PyDict_CheckExact(module_dict)) {
          PyObject *new_m;
          (void)PyDict_SetDefaultRef(module_dict, name, m, &new_m);
          Py_DECREF(m);
          return new_m;
      } else {
           if (PyObject_SetItem(module_dict, name, m) != 0) {
                Py_DECREF(m);
                return NULL;
            }
            return m;
      }
  }
  static PyObject *__Pyx_PyImport_AddModuleRef(const char *name) {
      if ((PY_VERSION_HEX >= 0x030E0000) &&  Py_Version >= 0x030E0100) {
          return PyImport_AddModuleRef(name);
      }
      PyObject *py_name = PyUnicode_FromString(name);
      if (!py_name) return NULL;
      PyObject *module = __Pyx_PyImport_AddModuleObjectRef(py_name);
      Py_DECREF(py_name);
      return module;
  }
#elif __PYX_LIMITED_VERSION_HEX < 0x030d0000
  static PyObject *__Pyx_PyImport_AddModuleRef(const char *name) {
      PyObject *module = PyImport_AddModule(name);
      Py_XINCREF(module);
      return module;
  }
#endif

/* FetchSharedCythonModule (used by FetchCommonType) */
static PyObject *__Pyx_FetchSharedCythonABIModule(void) {
    return __Pyx_PyImport_AddModuleRef(__PYX_ABI_MODULE_NAME);
}

/* VerifyCachedType (used by FetchCommonType) */
static int __Pyx_VerifyCachedType(PyObject *cached_type,
                               const char *name,
                               Py_ssize_t expected_basicsize) {
    Py_ssize_t basicsize;
    if (!PyType_Check(cached_type)) {
        PyErr_Format(PyExc_TypeError,
            "Shared Cython type %.200s is not a type object", name);
        return -1;
    }
    if (expected_basicsize == 0) {
        return 0; // size is inherited, nothing useful to check
    }
#if CYTHON_COMPILING_IN_LIMITED_API && CYTHON_OPAQUE_OBJECTS
    if (expected_basicsize < 0) {
        basicsize = PyType_GetTypeDataSize((PyTypeObject*)cached_type);
    } else
#endif
    {
    #if CYTHON_COMPILING_IN_LIMITED_API
        PyObject *py_basicsize;
        py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__");
        if (unlikely(!py_basicsize)) return -1;
        basicsize = PyLong_AsSsize_t(py_basicsize);
        Py_DECREF(py_basicsize);
        py_basicsize = NULL;
        if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) return -1;
    #else
        basicsize = ((PyTypeObject*) cached_type)->tp_basicsize;
    #endif
    }
    if ((expected_basicsize >= 0) ?
            (basicsize != expected_basicsize) :
            (basicsize < -expected_basicsize)) {
        PyErr_Format(PyExc_TypeError,
            "Shared Cython type %.200s has the wrong size, try recompiling",
            name);
        return -1;
    }
    return 0;
}

/* FetchCommonType (used by CommonTypesMetaclass) */
#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
static PyObject* __Pyx_PyType_FromMetaclass(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases) {
    PyObject *result = __Pyx_PyType_FromModuleAndSpec(module, spec, bases);
    if (result && metaclass) {
        PyObject *old_tp = (PyObject*)Py_TYPE(result);
        Py_INCREF((PyObject*)metaclass);
        Py_SET_TYPE(result, metaclass);
        Py_DECREF(old_tp);
        PyType_Modified((PyTypeObject*)result);
    }
    return result;
}
#else
#define __Pyx_PyType_FromMetaclass(me, mo, s, b) PyType_FromMetaclass(me, mo, s, b)
#endif
static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases) {
    PyObject *abi_module = NULL, *cached_type = NULL, *abi_module_dict, *new_cached_type, *py_object_name;
    int get_item_ref_result;
    const char* object_name = strrchr(spec->name, '.');
    object_name = object_name ? object_name+1 : spec->name;
    py_object_name = PyUnicode_FromString(object_name);
    if (!py_object_name) return NULL;
    abi_module = __Pyx_FetchSharedCythonABIModule();
    if (!abi_module) goto done;
    abi_module_dict = PyModule_GetDict(abi_module);
    if (!abi_module_dict) goto done;
    get_item_ref_result = __Pyx_PyDict_GetItemRef(abi_module_dict, py_object_name, &cached_type);
    if (get_item_ref_result == 1) {
        if (__Pyx_VerifyCachedType(
              cached_type,
              object_name,
              spec->basicsize) < 0) {
            goto bad;
        }
        goto done;
    } else if (unlikely(get_item_ref_result == -1)) {
        goto bad;
    }
    cached_type = __Pyx_PyType_FromMetaclass(
        metaclass,
        CYTHON_USE_MODULE_STATE ? module : abi_module,
        spec, bases);
    if (unlikely(!cached_type)) goto bad;
    new_cached_type = __Pyx_PyDict_SetDefault(abi_module_dict, py_object_name, cached_type);
    if (unlikely(new_cached_type != cached_type)) {
        if (unlikely(!new_cached_type)) goto bad;
        Py_DECREF(cached_type);
        cached_type = new_cached_type;
        if (__Pyx_VerifyCachedType(
                cached_type,
                object_name,
                spec->basicsize) < 0) {
            goto bad;
        }
        goto done;
    } else {
        Py_DECREF(new_cached_type);
    }
done:
    Py_XDECREF(abi_module);
    Py_DECREF(py_object_name);
    assert(cached_type == NULL || PyType_Check(cached_type));
    return (PyTypeObject *) cached_type;
bad:
    Py_XDECREF(cached_type);
    cached_type = NULL;
    goto done;
}

/* CommonTypesMetaclass (used by CythonFunctionShared) */
static PyObject* __pyx_CommonTypesMetaclass_get_module(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED void* context) {
    return PyUnicode_FromString(__PYX_ABI_MODULE_NAME);
}
#if __PYX_LIMITED_VERSION_HEX < 0x030A0000
static PyObject* __pyx_CommonTypesMetaclass_call(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED PyObject *args, CYTHON_UNUSED PyObject *kwds) {
    PyErr_SetString(PyExc_TypeError, "Cannot instantiate Cython internal types");
    return NULL;
}
static int __pyx_CommonTypesMetaclass_setattr(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED PyObject *attr, CYTHON_UNUSED PyObject *value) {
    PyErr_SetString(PyExc_TypeError, "Cython internal types are immutable");
    return -1;
}
#endif
static PyGetSetDef __pyx_CommonTypesMetaclass_getset[] = {
    {"__module__", __pyx_CommonTypesMetaclass_get_module, NULL, NULL, NULL},
    {0, 0, 0, 0, 0}
};
static PyType_Slot __pyx_CommonTypesMetaclass_slots[] = {
    {Py_tp_getset, (void *)__pyx_CommonTypesMetaclass_getset},
    #if __PYX_LIMITED_VERSION_HEX < 0x030A0000
    {Py_tp_call, (void*)__pyx_CommonTypesMetaclass_call},
    {Py_tp_new, (void*)__pyx_CommonTypesMetaclass_call},
    {Py_tp_setattro, (void*)__pyx_CommonTypesMetaclass_setattr},
    #endif
    {0, 0}
};
static PyType_Spec __pyx_CommonTypesMetaclass_spec = {
    __PYX_TYPE_MODULE_PREFIX "_common_types_metatype",
    0,
    0,
    Py_TPFLAGS_IMMUTABLETYPE |
    Py_TPFLAGS_DISALLOW_INSTANTIATION |
    Py_TPFLAGS_DEFAULT,
    __pyx_CommonTypesMetaclass_slots
};
static int __pyx_CommonTypesMetaclass_init(PyObject *module) {
    __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module);
    PyObject *bases = PyTuple_Pack(1, &PyType_Type);
    if (unlikely(!bases)) {
        return -1;
    }
    mstate->__pyx_CommonTypesMetaclassType = __Pyx_FetchCommonTypeFromSpec(NULL, module, &__pyx_CommonTypesMetaclass_spec, bases);
    Py_DECREF(bases);
    if (unlikely(mstate->__pyx_CommonTypesMetaclassType == NULL)) {
        return -1;
    }
    return 0;
}

/* CythonFunctionPerModule (used by CythonFunctionShared) */
#if CYTHON_COMPILING_IN_LIMITED_API
static CYTHON_INLINE int __Pyx__IsSameCyOrCFunctionNoMethod(PyObject *func, void (*cfunc)(void)) {
    if (__Pyx_CyFunction_Check(func)) {
        return __Pyx_as_CyFunctionObject(func)->func_methoddef->ml_meth == (PyCFunction) cfunc;
    } else if (PyCFunction_Check(func)) {
        return PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
    }
    return 0;
}
static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void)) {
    if ((PyObject*)Py_TYPE(func) == __pyx_mstate_global->__Pyx_CachedMethodType) {
        int result;
        PyObject *newFunc = PyObject_GetAttr(func, __pyx_mstate_global->__pyx_n_u_func);
        if (unlikely(!newFunc)) {
            PyErr_Clear(); // It's only an optimization, so don't throw an error
            return 0;
        }
        result = __Pyx__IsSameCyOrCFunctionNoMethod(newFunc, cfunc);
        Py_DECREF(newFunc);
        return result;
    }
    return __Pyx__IsSameCyOrCFunctionNoMethod(func, cfunc);
}
#else
static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void)) {
    if (PyMethod_Check(func)) {
        func = PyMethod_GET_FUNCTION(func);
    }
    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 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 CYTHON_INLINE PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func, PyTypeObject *defaults_type) {
    __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(func);
    m->defaults = PyObject_CallObject((PyObject*)defaults_type, NULL); // _PyObject_New(defaults_type);
    if (unlikely(!m->defaults))
        return NULL;
    return m->defaults;
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
    __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(func);
    m->defaults_tuple = tuple;
    Py_INCREF(tuple);
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
    __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(func);
    m->defaults_kwdict = dict;
    Py_INCREF(dict);
}
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
    __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(func);
    m->func_annotations = dict;
    Py_INCREF(dict);
}

/* IgnoreException (used by CythonFunctionShared) */
static CYTHON_INLINE int __Pyx_IgnoreGivenException(PyObject *given_exception, PyObject *ignorable_exception) {
    if (PyErr_GivenExceptionMatches(given_exception ? given_exception : PyErr_Occurred(), ignorable_exception)) {
        PyErr_Clear();
        return 1;
    }
    return 0;
}

/* CallTypeTraverse (used by CythonFunctionShared) */
#if !CYTHON_USE_TYPE_SPECS
#else
static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visit, void *arg) {
    if (!always_call) {
        PyTypeObject *base = __Pyx_PyObject_GetSlot(o, tp_base, PyTypeObject*);
        unsigned long flags = PyType_GetFlags(base);
        if (flags & Py_TPFLAGS_HEAPTYPE) {
            return 0;
        }
    }
    Py_VISIT((PyObject*)Py_TYPE(o));
    return 0;
}
#endif

/* PyMethodNew (used by CythonFunctionShared) */
#if CYTHON_COMPILING_IN_LIMITED_API
static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
    PyObject *result;
    CYTHON_UNUSED_VAR(typ);
    if (!self)
        return __Pyx_NewRef(func);
    #if __PYX_LIMITED_VERSION_HEX >= 0x030C0000
    {
        PyObject *args[] = {func, self};
        result = PyObject_Vectorcall(__pyx_mstate_global->__Pyx_CachedMethodType, args, 2, NULL);
    }
    #else
    result = PyObject_CallFunctionObjArgs(__pyx_mstate_global->__Pyx_CachedMethodType, func, self, NULL);
    #endif
    return result;
}
#else
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);
}
#endif

/* PyObjectCall (used by PyObjectFastCall) */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyObject *result;
    ternaryfunc call = Py_TYPE(func)->tp_call;
    if (unlikely(!call))
        return PyObject_Call(func, arg, kw);
    if (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
        return NULL;
    result = (*call)(func, arg, kw);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

/* PyObjectCallMethO (used by PyObjectFastCall) */
#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 (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
        return NULL;
    result = cfunc(self, arg);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

/* PyObjectFastCall (used by PyObjectCallOneArg) */
#if CYTHON_COMPILING_IN_LIMITED_API
static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject * const*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
#if CYTHON_VECTORCALL && !(CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY)
  #if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE vectorcallfunc __Pyx_PyVectorcall_Function(PyObject *callable) {
    PyTypeObject *tp = Py_TYPE(callable);
    #if defined(__Pyx_CyFunction_USED)
    if (__Pyx_CyFunction_CheckExact(callable)) {
        return __Pyx_CyFunction_func_vectorcall(callable);
    }
    #endif
    if (!PyType_HasFeature(tp, Py_TPFLAGS_HAVE_VECTORCALL)) {
        return NULL;
    }
    assert(PyCallable_Check(callable));
    Py_ssize_t offset = tp->tp_vectorcall_offset;
    assert(offset > 0);
    vectorcallfunc ptr;
    memcpy(&ptr, (char *) callable + offset, sizeof(ptr));
    return ptr;
}
  #else
    #define __Pyx_PyVectorcall_Function(callable) PyVectorcall_Function(callable)
  #endif
#endif
static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwargs) {
    Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(nargsf);
#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 (kwargs == NULL) {
        #if CYTHON_VECTORCALL
          #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
            return PyObject_Vectorcall(func, args, nargsf, NULL);
          #else
            vectorcallfunc f = __Pyx_PyVectorcall_Function(func);
            if (f) {
                return f(func, args, nargsf, NULL);
            }
          #endif
        #endif
    }
    if (nargs == 0) {
        return __Pyx_PyObject_Call(func, __pyx_mstate_global->__pyx_empty_tuple, kwargs);
    }
    #if CYTHON_COMPILING_IN_LIMITED_API
    return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs);
    #elif CYTHON_COMPILING_IN_PYPY
    return PyObject_VectorcallDict(func, args, (size_t) nargs, kwargs);
    #else
    return PyObject_VectorcallDict(func, args, nargsf, kwargs);
    #endif
}

/* PyObjectCallOneArg (used by CythonFunctionShared) */
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);
}

/* UnpackUnboundCMethod_impl (used by UnpackUnboundCMethod) */
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000
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;
}
#else
static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) {
    return PyObject_Vectorcall(method, args ? args+1 : NULL, nargs ? (size_t) nargs-1 : 0, kwnames);
}
#endif
static PyMethodDef __Pyx_UnboundCMethod_Def = {
     "CythonUnboundCMethod",
     __PYX_REINTERPRET_FUNCION(PyCFunction, __Pyx_SelflessCall),
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000
     METH_VARARGS | METH_KEYWORDS,
#else
     METH_FASTCALL | METH_KEYWORDS,
#endif
     NULL
};
static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) {
    PyObject *method, *result=NULL;
    method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name);
    if (unlikely(!method))
        return -1;
    result = method;
#if CYTHON_COMPILING_IN_CPYTHON
    if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type)))
    {
        PyMethodDescrObject *descr = (PyMethodDescrObject*) method;
        target->func = descr->d_method->ml_meth;
        target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST);
    } 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 && !__Pyx_IgnoreException(PyExc_AttributeError)) {
            return -1;
        }
#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);
            result = unbound_method;
        }
    }
#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    if (unlikely(target->method)) {
        Py_DECREF(result);
    } else
#endif
    target->method = result;
    return 0;
}

/* CallUnboundCMethod0 */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) {
    int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc);
    if (likely(was_initialized == 2 && cfunc->func)) {
        if (likely(cfunc->flag == METH_NOARGS))
            return __Pyx_CallCFunction(cfunc, self, NULL);
        if (likely(cfunc->flag == METH_FASTCALL))
            return __Pyx_CallCFunctionFast(cfunc, self, NULL, 0);
        if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS))
            return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, NULL, 0, NULL);
        if (likely(cfunc->flag == (METH_VARARGS | METH_KEYWORDS)))
            return __Pyx_CallCFunctionWithKeywords(cfunc, self, __pyx_mstate_global->__pyx_empty_tuple, NULL);
        if (cfunc->flag == METH_VARARGS)
            return __Pyx_CallCFunction(cfunc, self, __pyx_mstate_global->__pyx_empty_tuple);
        return __Pyx__CallUnboundCMethod0(cfunc, self);
    }
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    else if (unlikely(was_initialized == 1)) {
        __Pyx_CachedCFunction tmp_cfunc = {
#ifndef __cplusplus
            0
#endif
        };
        tmp_cfunc.type = cfunc->type;
        tmp_cfunc.method_name = cfunc->method_name;
        return __Pyx__CallUnboundCMethod0(&tmp_cfunc, self);
    }
#endif
    PyObject *result = __Pyx__CallUnboundCMethod0(cfunc, self);
    __Pyx_CachedCFunction_SetFinishedInitializing(cfunc);
    return result;
}
#endif
static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) {
    PyObject *result;
    if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
    result = __Pyx_PyObject_CallOneArg(cfunc->method, self);
    return result;
}

/* py_dict_items (used by OwnedDictNext) */
static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d) {
    return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_items, d);
}

/* py_dict_values (used by OwnedDictNext) */
static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d) {
    return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_values, d);
}

/* OwnedDictNext (used by PyVectorcallFastCallDict) */
#if CYTHON_AVOID_BORROWED_REFS
static int __Pyx_PyDict_NextRef(PyObject *p, PyObject **ppos, PyObject **pkey, PyObject **pvalue) {
    PyObject *next = NULL;
    if (!*ppos) {
        if (pvalue) {
            PyObject *dictview = pkey ? __Pyx_PyDict_Items(p) : __Pyx_PyDict_Values(p);
            if (unlikely(!dictview)) goto bad;
            *ppos = PyObject_GetIter(dictview);
            Py_DECREF(dictview);
        } else {
            *ppos = PyObject_GetIter(p);
        }
        if (unlikely(!*ppos)) goto bad;
    }
    next = PyIter_Next(*ppos);
    if (!next) {
        if (PyErr_Occurred()) goto bad;
        return 0;
    }
    if (pkey && pvalue) {
        *pkey = __Pyx_PySequence_ITEM(next, 0);
        if (unlikely(*pkey)) goto bad;
        *pvalue = __Pyx_PySequence_ITEM(next, 1);
        if (unlikely(*pvalue)) goto bad;
        Py_DECREF(next);
    } else if (pkey) {
        *pkey = next;
    } else {
        assert(pvalue);
        *pvalue = next;
    }
    return 1;
  bad:
    Py_XDECREF(next);
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000
    PyErr_FormatUnraisable("Exception ignored in __Pyx_PyDict_NextRef");
#else
    PyErr_WriteUnraisable(__pyx_mstate_global->__pyx_n_u_Pyx_PyDict_NextRef);
#endif
    if (pkey) *pkey = NULL;
    if (pvalue) *pvalue = NULL;
    return 0;
}
#else // !CYTHON_AVOID_BORROWED_REFS
static int __Pyx_PyDict_NextRef(PyObject *p, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue) {
    int result = PyDict_Next(p, ppos, pkey, pvalue);
    if (likely(result == 1)) {
        if (pkey) Py_INCREF(*pkey);
        if (pvalue) Py_INCREF(*pvalue);
    }
    return result;
}
#endif

/* PyVectorcallFastCallDict (used by CythonFunctionShared) */
#if CYTHON_VECTORCALL
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;
    #if CYTHON_AVOID_BORROWED_REFS
    PyObject *pos;
    #else
    Py_ssize_t pos;
    #endif
    size_t j;
    PyObject *key, *value;
    unsigned long keys_are_strings;
    #if !CYTHON_ASSUME_SAFE_SIZE
    Py_ssize_t nkw = PyDict_Size(kw);
    if (unlikely(nkw == -1)) return NULL;
    #else
    Py_ssize_t nkw = PyDict_GET_SIZE(kw);
    #endif
    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 = 0;
    i = 0;
    keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS;
    while (__Pyx_PyDict_NextRef(kw, &pos, &key, &value)) {
        keys_are_strings &=
        #if CYTHON_COMPILING_IN_LIMITED_API
            PyType_GetFlags(Py_TYPE(key));
        #else
            Py_TYPE(key)->tp_flags;
        #endif
        #if !CYTHON_ASSUME_SAFE_MACROS
        if (unlikely(PyTuple_SetItem(kwnames, i, key) < 0)) goto cleanup;
        #else
        PyTuple_SET_ITEM(kwnames, i, key);
        #endif
        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:
    #if CYTHON_AVOID_BORROWED_REFS
    Py_DECREF(pos);
    #endif
    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)
{
    Py_ssize_t kw_size =
        likely(kw == NULL) ?
        0 :
#if !CYTHON_ASSUME_SAFE_SIZE
        PyDict_Size(kw);
#else
        PyDict_GET_SIZE(kw);
#endif
    if (kw_size == 0) {
        return vc(func, args, nargs, NULL);
    }
#if !CYTHON_ASSUME_SAFE_SIZE
    else if (unlikely(kw_size == -1)) {
        return NULL;
    }
#endif
    return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw);
}
#endif

/* CythonFunctionShared (used by CythonFunction) */
static PyObject *
__Pyx_CyFunction_get_doc_locked(__pyx_CyFunctionObject *op)
{
    if (unlikely(op->func_doc == NULL)) {
#if CYTHON_COMPILING_IN_LIMITED_API
        const char *doc = op->func_methoddef->ml_doc;
#else
        const char *doc = ((PyCFunctionObject*)op)->m_ml->ml_doc;
#endif
        if (doc) {
            op->func_doc = PyUnicode_FromString(doc);
            if (unlikely(op->func_doc == NULL))
                return NULL;
        } else {
            Py_INCREF(Py_None);
            return Py_None;
        }
    }
    Py_INCREF(op->func_doc);
    return op->func_doc;
}
static PyObject *
__Pyx_CyFunction_get_doc(PyObject *op_in, void *closure) {
    PyObject *result;
    __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
    CYTHON_UNUSED_VAR(closure);
    __Pyx_BEGIN_CRITICAL_SECTION(op_in);
    result = __Pyx_CyFunction_get_doc_locked(op);
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static int
__Pyx_CyFunction_set_doc(PyObject *op_in, PyObject *value, void *context)
{
    __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
    CYTHON_UNUSED_VAR(context);
    if (value == NULL) {
        value = Py_None;
    }
    Py_INCREF(value);
    __Pyx_BEGIN_CRITICAL_SECTION(op_in);
    __Pyx_Py_XDECREF_SET(op->func_doc, value);
    __Pyx_END_CRITICAL_SECTION();
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_name_locked(__pyx_CyFunctionObject *op)
{
    if (unlikely(op->func_name == NULL)) {
#if CYTHON_COMPILING_IN_LIMITED_API
        const char *name = op->func_methoddef->ml_name;
#else
        const char *name = ((PyCFunctionObject*)op)->m_ml->ml_name;
#endif
        op->func_name = PyUnicode_InternFromString(name);
        if (unlikely(op->func_name == NULL))
            return NULL;
    }
    Py_INCREF(op->func_name);
    return op->func_name;
}
static PyObject *
__Pyx_CyFunction_get_name(PyObject *op, void *context)
{
    PyObject *result = NULL;
    CYTHON_UNUSED_VAR(context);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    result = __Pyx_CyFunction_get_name_locked(__Pyx_as_CyFunctionObject(op));
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static int
__Pyx_CyFunction_set_name(PyObject *op_in, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (unlikely(value == NULL || !PyUnicode_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__name__ must be set to a string object");
        return -1;
    }
    __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
    Py_INCREF(value);
    __Pyx_BEGIN_CRITICAL_SECTION(op_in);
    __Pyx_Py_XDECREF_SET(op->func_name, value);
    __Pyx_END_CRITICAL_SECTION();
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_qualname(PyObject *op_in, void *context)
{
    CYTHON_UNUSED_VAR(context);
    __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
    PyObject *result;
    __Pyx_BEGIN_CRITICAL_SECTION(op_in);
    Py_INCREF(op->func_qualname);
    result = op->func_qualname;
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static int
__Pyx_CyFunction_set_qualname(PyObject *op_in, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (unlikely(value == NULL || !PyUnicode_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__qualname__ must be set to a string object");
        return -1;
    }
    __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
    Py_INCREF(value);
    __Pyx_BEGIN_CRITICAL_SECTION(op_in);
    __Pyx_Py_XDECREF_SET(op->func_qualname, value);
    __Pyx_END_CRITICAL_SECTION();
    return 0;
}
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
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;
}
#endif
static PyObject *
__Pyx_CyFunction_get_globals(PyObject *op_in, void *context)
{
    CYTHON_UNUSED_VAR(context);
    __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
    Py_INCREF(op->func_globals);
    return op->func_globals;
}
static PyObject *
__Pyx_CyFunction_get_closure(PyObject *op, void *context)
{
    CYTHON_UNUSED_VAR(op);
    CYTHON_UNUSED_VAR(context);
    Py_INCREF(Py_None);
    return Py_None;
}
static PyObject *
__Pyx_CyFunction_get_code(PyObject *op_in, void *context)
{
    __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
    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, PyObject *op_obj) {
    int result = 0;
    PyObject *res = op->defaults_getter(op_obj);
    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(PyObject *op_in, PyObject* value, void *context) {
    __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
    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_BEGIN_CRITICAL_SECTION(op_in);
    __Pyx_Py_XDECREF_SET(op->defaults_tuple, value);
    __Pyx_END_CRITICAL_SECTION();
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_defaults_locked(PyObject *op_in) {
    __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
    PyObject* result = op->defaults_tuple;
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (unlikely(__Pyx_CyFunction_init_defaults(op, op_in) < 0)) return NULL;
            result = op->defaults_tuple;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static PyObject *
__Pyx_CyFunction_get_defaults(PyObject *op, void *context) {
    PyObject* result = NULL;
    CYTHON_UNUSED_VAR(context);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    result = __Pyx_CyFunction_get_defaults_locked(op);
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static int
__Pyx_CyFunction_set_kwdefaults(PyObject *op_in, PyObject* value, void *context) {
    __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
    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_BEGIN_CRITICAL_SECTION(op_in);
    __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value);
    __Pyx_END_CRITICAL_SECTION();
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_kwdefaults_locked(PyObject *op_in) {
    __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
    PyObject* result = op->defaults_kwdict;
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (unlikely(__Pyx_CyFunction_init_defaults(op, op_in) < 0)) return NULL;
            result = op->defaults_kwdict;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static PyObject *
__Pyx_CyFunction_get_kwdefaults(PyObject *op, void *context) {
    PyObject* result;
    CYTHON_UNUSED_VAR(context);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    result = __Pyx_CyFunction_get_kwdefaults_locked(op);
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static int __Pyx_CyFunction_set_annotate_in_dict_if_exists(PyObject *op_in, PyObject *value);
static int
__Pyx_CyFunction_set_annotations(PyObject *op_in, 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;
    }
    __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
    Py_XINCREF(value);
    __Pyx_BEGIN_CRITICAL_SECTION(op_in);
    __Pyx_Py_XDECREF_SET(op->func_annotations, value);
    __Pyx_END_CRITICAL_SECTION();
    if (unlikely(__Pyx_CyFunction_set_annotate_in_dict_if_exists(op_in, Py_None) < 0)) return -1;
    return 0;
}
static int
__Pyx_CyFunction_get_dict_if_exists(PyObject *op_in, PyObject **dict) {
    /* Return 1 if the function dict exists, 0 otherwise.  This cannot fail:
     * _PyObject_GetDictPtr() may clear errors internally, but never reports them. */
#if CYTHON_COMPILING_IN_PYPY
    *dict = PyObject_GenericGetDict(op_in, NULL);
#elif CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX < 0x030C0000
    *dict = __Pyx_as_CyFunctionObject(op_in)->func_dict;
#else
    PyObject **dictptr = _PyObject_GetDictPtr(op_in);
    *dict = likely(dictptr) ? *dictptr : NULL;
#endif
    return *dict ? 1 : 0;
}
static int
__Pyx_CyFunction_get_annotate_from_dict_if_exists(PyObject *op_in, PyObject **annotate) {
    PyObject *dict;
    int dict_found;
    *annotate = NULL;
    dict_found = __Pyx_CyFunction_get_dict_if_exists(op_in, &dict);
    if (!dict_found) return 0;
    return __Pyx_PyDict_GetItemRef(dict, __pyx_mstate_global->__pyx_n_u_annotate, annotate);
}
static int
__Pyx_CyFunction_set_annotate_in_dict_if_exists(PyObject *op_in, PyObject *value) {
    PyObject *dict;
    int dict_found;
    dict_found = __Pyx_CyFunction_get_dict_if_exists(op_in, &dict);
    if (!dict_found) return 0;
    if (value) {
        return PyDict_SetItem(dict, __pyx_mstate_global->__pyx_n_u_annotate, value);
    } else {
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000
        return PyDict_Pop(dict, __pyx_mstate_global->__pyx_n_u_annotate, NULL);
#else
        int result = PyDict_Contains(dict, __pyx_mstate_global->__pyx_n_u_annotate);
        if (result == 1) {
            result = PyDict_DelItem(dict, __pyx_mstate_global->__pyx_n_u_annotate);
        }
        return result;
#endif
    }
}
static int
__Pyx_CyFunction_set_annotate_in_dict(PyObject *op_in, PyObject *value) {
    PyObject *dict;
    int result;
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
    dict = __Pyx_CyFunction_get_dict(__Pyx_as_CyFunctionObject(op_in), NULL);
#else
    dict = PyObject_GenericGetDict(op_in, NULL);
#endif
    if (unlikely(!dict)) return -1;
    result = PyDict_SetItem(dict, __pyx_mstate_global->__pyx_n_u_annotate, value);
    Py_DECREF(dict);
    return result;
}
static PyObject *
__Pyx_CyFunction_get_annotations_locked(__pyx_CyFunctionObject *op) {
    PyObject* result = op->func_annotations;
    if (unlikely(!result)) {
        result = PyDict_New();
        if (unlikely(!result)) return NULL;
        op->func_annotations = result;
    }
    Py_INCREF(result);
    return result;
}
static PyObject *
__Pyx_CyFunction_get_annotations(PyObject *op_in, void *context) {
    PyObject *annotate = NULL;
    PyObject *result = NULL;
    __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
    CYTHON_UNUSED_VAR(context);
    __Pyx_BEGIN_CRITICAL_SECTION(op_in);
    result = __Pyx_XNewRef(op->func_annotations);
    __Pyx_END_CRITICAL_SECTION();
    if (result) return result;
    if (unlikely(__Pyx_CyFunction_get_annotate_from_dict_if_exists(op_in, &annotate) < 0)) return NULL;
    if (!annotate || annotate == Py_None) {
        Py_XDECREF(annotate);
        __Pyx_BEGIN_CRITICAL_SECTION(op_in);
        result = __Pyx_CyFunction_get_annotations_locked(op);
        __Pyx_END_CRITICAL_SECTION();
        return result;
    }
    PyObject *format = PyLong_FromLong(1L);  // annotationlib.Format.VALUE
    if (likely(format)) {
        if (!Py_EnterRecursiveCall(" cyfunction __annotations__.__get__")) {
            result = __Pyx_PyObject_CallOneArg(annotate, format);
            Py_LeaveRecursiveCall();
            Py_DECREF(format);
        }
    }
    Py_DECREF(annotate);
    if (unlikely(!result)) return NULL;
    if (unlikely(!PyDict_Check(result))) {
        PyErr_SetString(PyExc_TypeError, "__annotate__ must return a dict");
        Py_DECREF(result);
        return NULL;
    }
    __Pyx_BEGIN_CRITICAL_SECTION(op_in);
    __Pyx_Py_XDECREF_SET(op->func_annotations, __Pyx_NewRef(result));
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static PyObject *__Pyx_CyFunction_annotate_impl(PyObject *self, PyObject *arg) {
    CYTHON_UNUSED_VAR(arg);
    if (unlikely(!self)) {
        PyErr_SetString(PyExc_SystemError, "cython __annotate__ called without 'self' argument");
        return NULL;
    }
    PyObject *result;
    if (Py_EnterRecursiveCall(" in cyfunction annotate")) {
        return NULL;
    }
    result = __Pyx_CyFunction_get_annotations(self, NULL);
    Py_LeaveRecursiveCall();
    return result;
}
static PyObject *
__Pyx_CyFunction_get_annotate(PyObject *op_in, void *context);
static int
__Pyx_CyFunction_set_annotate(PyObject *op_in, PyObject* value, void *context) {
    CYTHON_UNUSED_VAR(context);
    if (value == NULL) {
        PyErr_SetString(PyExc_TypeError, "__annotate__ cannot be deleted");
        return -1;
    }
    if (unlikely(value != Py_None && !PyCallable_Check(value))) {
        PyErr_SetString(PyExc_TypeError, "__annotate__ must be callable or None");
        return -1;
    }
    if (unlikely(__Pyx_TypeCheck(value, &PyCFunction_Type))) {
#if !CYTHON_ASSUME_SAFE_MACROS && !CYTHON_COMPILING_IN_PYPY
        PyCFunction cfunction = PyCFunction_GetFunction(value);
        if (unlikely(!cfunction)) return -1;
        PyObject *value_self = PyCFunction_GetSelf(value);
        if (unlikely(!value_self && PyErr_Occurred())) return -1;
#else
        PyCFunction cfunction = PyCFunction_GET_FUNCTION(value);
        PyObject *value_self = PyCFunction_GET_SELF(value);
#endif
        if (cfunction == __Pyx_CyFunction_annotate_impl && value_self == op_in) {
            return __Pyx_CyFunction_set_annotate_in_dict_if_exists(op_in, NULL);
        }
    }
    if (value != Py_None) {
        __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
        __Pyx_BEGIN_CRITICAL_SECTION(op_in);
        Py_CLEAR(op->func_annotations);
        __Pyx_END_CRITICAL_SECTION();
    }
    return __Pyx_CyFunction_set_annotate_in_dict(op_in, value);
}
#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
static PyObject *
__Pyx_CyFunction_get_is_coroutine_value(__pyx_CyFunctionObject *op) {
    int is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE;
    if (is_coroutine) {
        PyObject *is_coroutine_value, *module, *fromlist, *marker = __pyx_mstate_global->__pyx_n_u_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(fromlist);
            return NULL;
        }
#endif
        module = PyImport_ImportModuleLevelObject(__pyx_mstate_global->__pyx_n_u_asyncio_coroutines, NULL, NULL, fromlist, 0);
        Py_DECREF(fromlist);
        if (unlikely(!module)) {
            goto ignore_or_error;
        }
        is_coroutine_value = __Pyx_PyObject_GetAttrStr(module, marker);
        Py_DECREF(module);
        if (likely(is_coroutine_value)) {
            return is_coroutine_value;
        }
ignore_or_error:
        if (!__Pyx_IgnoreException(PyExc_Exception)) {
            return NULL;
        }
    }
    return __Pyx_PyBool_FromLong(is_coroutine);
}
static PyObject *
__Pyx_CyFunction_get_is_coroutine(PyObject *op_in, void *context) {
    __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
    PyObject *result;
    CYTHON_UNUSED_VAR(context);
    if (op->func_is_coroutine) {
        return __Pyx_NewRef(op->func_is_coroutine);
    }
    result = __Pyx_CyFunction_get_is_coroutine_value(op);
    if (unlikely(!result))
        return NULL;
    __Pyx_BEGIN_CRITICAL_SECTION(op_in);
    if (op->func_is_coroutine) {
        Py_DECREF(result);
        result = __Pyx_NewRef(op->func_is_coroutine);
    } else {
        op->func_is_coroutine = __Pyx_NewRef(result);
    }
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
#endif
static void __Pyx_CyFunction_raise_argument_count_error(PyObject *func, const char* message, Py_ssize_t size) {
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL);
    if (!py_name) return;
    PyErr_Format(PyExc_TypeError,
        "%.200S() %s (%" CYTHON_FORMAT_SSIZE_T "d given)",
        py_name, message, size);
    Py_DECREF(py_name);
#else
    const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name;
    PyErr_Format(PyExc_TypeError,
        "%.200s() %s (%" CYTHON_FORMAT_SSIZE_T "d given)",
        name, message, size);
#endif
}
static void __Pyx_CyFunction_raise_type_error(PyObject *func, const char* message) {
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL);
    if (!py_name) return;
    PyErr_Format(PyExc_TypeError,
        "%.200S() %s",
        py_name, message);
    Py_DECREF(py_name);
#else
    const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name;
    PyErr_Format(PyExc_TypeError,
        "%.200s() %s",
        name, message);
#endif
}
#if CYTHON_COMPILING_IN_LIMITED_API
static PyObject *
__Pyx_CyFunction_get_module(PyObject *op_in, void *context) {
    CYTHON_UNUSED_VAR(context);
    __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
    Py_INCREF(op->func_module);
    return op->func_module;
}
static int
__Pyx_CyFunction_set_module(PyObject *op_in, PyObject* value, void *context) {
    CYTHON_UNUSED_VAR(context);
    __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
    if (value == NULL) {
        value = Py_None;
    }
    Py_INCREF(value);
    PyObject *old = op->func_module;
    op->func_module = value;
    Py_DECREF(old);
    return 0;
}
#endif
static PyGetSetDef __pyx_CyFunction_getsets[] = {
    {"func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {"__doc__",  (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {"func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {"__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {"__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
    {"func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)PyObject_GenericSetDict, 0, 0},
    {"__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)PyObject_GenericSetDict, 0, 0},
#else
    {"func_dict", (getter)PyObject_GenericGetDict, (setter)PyObject_GenericSetDict, 0, 0},
    {"__dict__", (getter)PyObject_GenericGetDict, (setter)PyObject_GenericSetDict, 0, 0},
#endif
    {"func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {"__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {"func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {"__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {"func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {"__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {"func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {"__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {"__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
    {"__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
    {"__annotate__", (getter)__Pyx_CyFunction_get_annotate, (setter)__Pyx_CyFunction_set_annotate, 0, 0},
#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
    {"_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0},
#endif
#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
    {"__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0},
#endif
#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
    {"__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict),
        __PYX_SHARED_RELATIVE_OFFSET | READONLY, 0},
#endif
#if CYTHON_VECTORCALL
#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
    {"__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall),
        __PYX_SHARED_RELATIVE_OFFSET | READONLY, 0},
#else
    {"__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0},
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
    {"__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist),
        __PYX_SHARED_RELATIVE_OFFSET | READONLY, 0},
#else
    {"__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0},
#endif
#endif
    {0, 0, 0,  0, 0}
};
static PyObject *
__Pyx_CyFunction_reduce(PyObject *m_in, PyObject *args)
{
    PyObject *result = NULL;
    __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(m_in);
    CYTHON_UNUSED_VAR(args);
    __Pyx_BEGIN_CRITICAL_SECTION(m_in);
    Py_INCREF(m->func_qualname);
    result = m->func_qualname;
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static PyMethodDef __pyx_CyFunction_methods[] = {
    {"__annotate_cython__", __Pyx_CyFunction_annotate_impl, METH_O,
        "Placeholder __annotate__ function to allow 'functools.wraps' to work "
        "on Cython functions."},
    {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_NOARGS, 0},
    {0, 0, 0, 0}
};
static PyObject *
__Pyx_CyFunction_get_annotate(PyObject *op_in, void *context) {
    PyObject *annotate = NULL;
    CYTHON_UNUSED_VAR(context);
    if (unlikely(__Pyx_CyFunction_get_annotate_from_dict_if_exists(op_in, &annotate) < 0)) return NULL;
    if (annotate) return annotate;
    PyObject *method = PyCFunction_New(
        &__pyx_CyFunction_methods[0],
        op_in);
    return method;
}
#if 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(PyObject *op_in,
                                       PyMethodDef *ml, int flags, PyObject* qualname,
                                       PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
    __pyx_CyFunctionObject* op = __Pyx_as_CyFunctionObject(op_in);
#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_methoddef = ml;
    Py_INCREF(module);
    op->func_module = module;
#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
#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
    op->func_dict = NULL;
#endif
    op->func_name = NULL;
    Py_INCREF(qualname);
    op->func_qualname = qualname;
    op->func_doc = NULL;
#if 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 = NULL;
    op->defaults_tuple = NULL;
    op->defaults_kwdict = NULL;
    op->defaults_getter = NULL;
    op->func_annotations = NULL;
#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
    op->func_is_coroutine = NULL;
#endif
#if CYTHON_VECTORCALL
    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_in);
        return NULL;
    }
#endif
    return op_in;
}
static int __Pyx__CyFunction_clear(__pyx_CyFunctionObject *m)
{
    Py_CLEAR(m->func_closure);
#if CYTHON_COMPILING_IN_LIMITED_API
    Py_CLEAR(m->func_module);
#else
    Py_CLEAR(((PyCFunctionObject*)m)->m_module);
#endif
#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
    Py_CLEAR(m->func_dict);
#elif PY_VERSION_HEX < 0x030d0000
    _PyObject_ClearManagedDict((PyObject*)m);
#else
    PyObject_ClearManagedDict((PyObject*)m);
#endif
    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
    Py_CLEAR(m->func_classobj);
#else
    {
        PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class;
        ((PyCMethodObject *) (m))->mm_class = NULL;
        Py_XDECREF(cls);
    }
#endif
    Py_CLEAR(m->defaults_tuple);
    Py_CLEAR(m->defaults_kwdict);
    Py_CLEAR(m->func_annotations);
#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
    Py_CLEAR(m->func_is_coroutine);
#endif
    Py_CLEAR(m->defaults);
    return 0;
}
static int
__Pyx_CyFunction_clear(PyObject *m)
{
    return __Pyx__CyFunction_clear(__Pyx_as_CyFunctionObject(m));
}
static void __Pyx__CyFunction_dealloc(PyObject *m)
{
    __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(m);
    if (__Pyx_CyFunction_weakreflist(cyfunc) != NULL)
        PyObject_ClearWeakRefs(m);
    __Pyx__CyFunction_clear(cyfunc);
    __Pyx_PyHeapTypeObject_GC_Del(m);
}
static void __Pyx_CyFunction_dealloc(PyObject *m)
{
    PyObject_GC_UnTrack(m);
    __Pyx__CyFunction_dealloc(m);
}
static int __Pyx_CyFunction_traverse(PyObject *m_in, visitproc visit, void *arg)
{
    __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(m_in);
    {
        int e = __Pyx_call_type_traverse(m_in, 1, visit, arg);
        if (e) return e;
    }
    Py_VISIT(m->func_closure);
#if CYTHON_COMPILING_IN_LIMITED_API
    Py_VISIT(m->func_module);
#else
    Py_VISIT(((PyCFunctionObject*)m)->m_module);
#endif
#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
    Py_VISIT(m->func_dict);
#else
    {
        int e =
#if PY_VERSION_HEX < 0x030d0000
            _PyObject_VisitManagedDict
#else
            PyObject_VisitManagedDict
#endif
                ((PyObject*)m, visit, arg);
        if (e != 0) return e;
    }
#endif
    __Pyx_VISIT_CONST(m->func_name);
    __Pyx_VISIT_CONST(m->func_qualname);
    Py_VISIT(m->func_doc);
    Py_VISIT(m->func_globals);
    __Pyx_VISIT_CONST(m->func_code);
    Py_VISIT(__Pyx__CyFunction_GetClassObj(m));
    Py_VISIT(m->defaults_tuple);
    Py_VISIT(m->defaults_kwdict);
    Py_VISIT(m->func_annotations);
#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
    Py_VISIT(m->func_is_coroutine);
#endif
    Py_VISIT(m->defaults);
    return 0;
}
static PyObject*
__Pyx_CyFunction_repr(PyObject *op_in)
{
    __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
    PyObject *repr;
    __Pyx_BEGIN_CRITICAL_SECTION(op_in);
    repr = PyUnicode_FromFormat("<cyfunction %U at %p>",
                                op->func_qualname, (void *)op);
    __Pyx_END_CRITICAL_SECTION();
    return repr;
}
static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
#if CYTHON_COMPILING_IN_LIMITED_API
    __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
    PyCFunction meth = cyfunc->func_methoddef->ml_meth;
    int flags = cyfunc->func_methoddef->ml_flags;
#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(*)(void))meth)(self, arg, kw);
    case METH_NOARGS:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
#if CYTHON_ASSUME_SAFE_SIZE
            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);
            __Pyx_CyFunction_raise_argument_count_error(
                func,
                "takes no arguments", size);
            return NULL;
        }
        break;
    case METH_O:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
#if CYTHON_ASSUME_SAFE_SIZE
            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;
            }
            __Pyx_CyFunction_raise_argument_count_error(
                func,
                "takes exactly one argument", size);
            return NULL;
        }
        break;
    default:
        PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
        return NULL;
    }
    __Pyx_CyFunction_raise_type_error(
        func, "takes no keyword arguments");
    return NULL;
}
static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyObject *result;
    result = __Pyx_CyFunction_CallMethod(func, func, arg, kw);
    return result;
}
static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
    PyObject *result;
    __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
#if CYTHON_VECTORCALL
     __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc);
    if (vc) {
#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
        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_SIZE
        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);
            PyErr_Format(PyExc_TypeError,
                         "unbound method %.200S() needs an argument",
                         cyfunc->func_qualname);
            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_VECTORCALL
static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(PyObject *func, __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)) {
            __Pyx_CyFunction_raise_type_error(
                func, "needs an argument");
            return -1;
        }
        ret = 1;
    }
    if (unlikely(kwnames) && unlikely(__Pyx_PyTuple_GET_SIZE(kwnames))) {
        __Pyx_CyFunction_raise_type_error(
            func, "takes no keyword arguments");
        return -1;
    }
    return ret;
}
static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
{
    __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
    PyObject *self;
#if CYTHON_COMPILING_IN_LIMITED_API
    PyCFunction meth = cyfunc->func_methoddef->ml_meth;
    if (unlikely(!meth)) return NULL;
#else
    PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
#endif
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(func, cyfunc, nargs, kwnames)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
        self = func;
        break;
    default:
        return NULL;
    }
    if (unlikely(nargs != 0)) {
        __Pyx_CyFunction_raise_argument_count_error(
            func, "takes no arguments", nargs);
        return NULL;
    }
    return meth(self, NULL);
}
static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
{
    __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
    PyObject *self;
#if CYTHON_COMPILING_IN_LIMITED_API
    PyCFunction meth = cyfunc->func_methoddef->ml_meth;
    if (unlikely(!meth)) return NULL;
#else
    PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
#endif
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(func, cyfunc, nargs, kwnames)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
        self = func;
        break;
    default:
        return NULL;
    }
    if (unlikely(nargs != 1)) {
        __Pyx_CyFunction_raise_argument_count_error(
            func, "takes exactly one argument", nargs);
        return NULL;
    }
    return 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_as_CyFunctionObject(func);
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
    PyObject *self;
#if CYTHON_COMPILING_IN_LIMITED_API
    PyCFunction meth = cyfunc->func_methoddef->ml_meth;
    if (unlikely(!meth)) return NULL;
#else
    PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
#endif
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(func, cyfunc, nargs, NULL)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
        self = func;
        break;
    default:
        return NULL;
    }
    return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))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_as_CyFunctionObject(func);
    PyTypeObject *cls = (PyTypeObject *) __Pyx__CyFunction_GetClassObj(cyfunc);
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
    PyObject *self;
#if CYTHON_COMPILING_IN_LIMITED_API
    PyCFunction meth = cyfunc->func_methoddef->ml_meth;
    if (unlikely(!meth)) return NULL;
#else
    PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
#endif
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(func, cyfunc, nargs, NULL)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
        self = func;
        break;
    default:
        return NULL;
    }
    #if PY_VERSION_HEX < 0x030e00A6
    size_t nargs_value = (size_t) nargs;
    #else
    Py_ssize_t nargs_value = nargs;
    #endif
    return ((__Pyx_PyCMethod)(void(*)(void))meth)(self, cls, args, nargs_value, kwnames);
}
#endif
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",
    __PYX_SHARED_SIZEOF(__pyx_CyFunctionObject),
    0,
#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR
    Py_TPFLAGS_METHOD_DESCRIPTOR |
#endif
#if CYTHON_VECTORCALL
#if defined(Py_TPFLAGS_HAVE_VECTORCALL)
    Py_TPFLAGS_HAVE_VECTORCALL |
#elif defined(_Py_TPFLAGS_HAVE_VECTORCALL)
    _Py_TPFLAGS_HAVE_VECTORCALL |
#endif
#endif // CYTHON_VECTORCALL
#if PY_VERSION_HEX >= 0x030C0000 && !CYTHON_COMPILING_IN_LIMITED_API
    Py_TPFLAGS_MANAGED_DICT |
#endif
    Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION |
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
    __pyx_CyFunctionType_slots
};
static int __pyx_CyFunction_init(PyObject *module) {
    __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module);
    mstate->__pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(
        mstate->__pyx_CommonTypesMetaclassType, module, &__pyx_CyFunctionType_spec, NULL);
    if (unlikely(mstate->__pyx_CyFunctionType == NULL)) {
        return -1;
    }
    return 0;
}

/* CythonFunction */
static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname,
                                      PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
    (void)&__Pyx_Get_CyFunction_Type;
    PyObject *op = __Pyx_CyFunction_Init(
        PyObject_GC_New(PyObject, __pyx_mstate_global->__pyx_CyFunctionType),
        ml, flags, qualname, closure, module, globals, code
    );
    if (likely(op)) {
        PyObject_GC_Track(op);
    }
    return op;
}
static PyTypeObject *__Pyx_Get_CyFunction_Type(void) {
    PyTypeObject *tp = __pyx_mstate_global->__pyx_CyFunctionType;
    Py_INCREF((PyObject*)tp);
    return tp;
}

/* decode_c_string */
static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
         const char* cstring, Py_ssize_t start, Py_ssize_t stop,
         const char* encoding, const char* errors,
         PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
    Py_ssize_t length;
    if (unlikely((start < 0) | (stop < 0))) {
        size_t slen = strlen(cstring);
        if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) {
            PyErr_SetString(PyExc_OverflowError,
                            "c-string too long to convert to Python");
            return NULL;
        }
        length = (Py_ssize_t) slen;
        if (start < 0) {
            start += length;
            if (start < 0)
                start = 0;
        }
        if (stop < 0)
            stop += length;
    }
    if (unlikely(stop <= start))
        return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_unicode);
    length = stop - start;
    cstring += start;
    if (decode_func) {
        return decode_func(cstring, length, errors);
    } else {
        return PyUnicode_Decode(cstring, length, encoding, errors);
    }
}

/* FormatTypeName (used by RaiseErrorWithObjectType1) */
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
static __Pyx_TypeName
__Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp)
{
    PyObject *module = NULL, *name = NULL, *result = NULL;
    #if __PYX_LIMITED_VERSION_HEX < 0x030b0000
    name = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
                                               __pyx_mstate_global->__pyx_n_u_qualname);
    #else
    name = PyType_GetQualName(tp);
    #endif
    if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) goto bad;
    module = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
                                               __pyx_mstate_global->__pyx_n_u_module);
    if (unlikely(module == NULL) || unlikely(!PyUnicode_Check(module))) goto bad;
    if (PyUnicode_CompareWithASCIIString(module, "builtins") == 0) {
        result = name;
        name = NULL;
        goto done;
    }
    result = PyUnicode_FromFormat("%U.%U", module, name);
    if (unlikely(result == NULL)) goto bad;
  done:
    Py_XDECREF(name);
    Py_XDECREF(module);
    return result;
  bad:
    PyErr_Clear();
    if (name) {
        result = name;
        name = NULL;
    } else {
        result = __Pyx_NewRef(__pyx_mstate_global->__pyx_kp_u_);
    }
    goto done;
}
#endif

/* RaiseErrorWithObjectType1 (used by RaiseUnexpectedTypeError) */
static void __Pyx_RaiseErrorWithType1(PyObject* exc_type, const char* message, const char *arg, PyTypeObject *type_obj) {
    __Pyx_TypeName type_name = __Pyx_PyType_GetFullyQualifiedName(type_obj);
    #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
    if (unlikely(!type_name)) return;
    #endif
    PyErr_Format(exc_type, message, arg, type_name);
    __Pyx_DECREF_TypeName(type_name);
}

/* RaiseUnexpectedTypeError */
static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj) {
    __Pyx_RaiseTypeErrorWithObjectType1(
        "Expected %.42s, got " __Pyx_FMT_TYPENAME,
        expected, obj);
    return 0;
}

/* HasAttr (used by ImportImpl) */
#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
    PyObject *r;
    if (unlikely(!PyUnicode_Check(n))) {
        PyErr_SetString(PyExc_TypeError,
                        "hasattr(): attribute name must be string");
        return -1;
    }
    r = __Pyx_PyObject_GetAttrStrNoError(o, n);
    if (!r) {
        return (unlikely(PyErr_Occurred())) ? -1 : 0;
    } else {
        Py_DECREF(r);
        return 1;
    }
}
#endif

/* TupleOrListFromArrayImpl (used by ListFromArray) */
CYTHON_UNUSED static PyObject *
__Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) {
    PyObject *res = PyList_New(n);
    if (unlikely(res == NULL)) return NULL;
    #if CYTHON_COMPILING_IN_CPYTHON
    __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n);
    #else
    Py_ssize_t i;
    for (i = 0; i < n; i++) {
        Py_INCREF(src[i]);
        if (unlikely(__Pyx_PyList_SET_ITEM(res, i, src[i]) < (0))) {
            Py_DECREF(res);
            return NULL;
        }
    }
    #endif
    return res;
}

/* ImportImpl (used by Import) */
static int __Pyx__Import_GetModule(PyObject *qualname, PyObject **module) {
    PyObject *imported_module = PyImport_GetModule(qualname);
    if (unlikely(!imported_module)) {
        *module = NULL;
        if (PyErr_Occurred()) {
            return -1;
        }
        return 0;
    }
    *module = imported_module;
    return 1;
}
static int __Pyx__Import_Lookup(PyObject *qualname, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject **module) {
    PyObject *imported_module;
    PyObject *top_level_package_name;
    Py_ssize_t i;
    int status, module_found;
    Py_ssize_t dot_index;
    module_found = __Pyx__Import_GetModule(qualname, &imported_module);
    if (unlikely(!module_found || module_found == -1)) {
        *module = NULL;
        return module_found;
    }
    if (imported_names) {
        for (i = 0; i < len_imported_names; i++) {
            PyObject *imported_name = imported_names[i];
#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
            int has_imported_attribute = PyObject_HasAttr(imported_module, imported_name);
#else
            int has_imported_attribute = PyObject_HasAttrWithError(imported_module, imported_name);
            if (unlikely(has_imported_attribute == -1)) goto error;
#endif
            if (!has_imported_attribute) {
                goto not_found;
            }
        }
        *module = imported_module;
        return 1;
    }
    dot_index = PyUnicode_FindChar(qualname, '.', 0, PY_SSIZE_T_MAX, 1);
    if (dot_index == -1) {
        *module = imported_module;
        return 1;
    }
    if (unlikely(dot_index == -2)) goto error;
    top_level_package_name = PyUnicode_Substring(qualname, 0, dot_index);
    if (unlikely(!top_level_package_name)) goto error;
    Py_DECREF(imported_module);
    status = __Pyx__Import_GetModule(top_level_package_name, module);
    Py_DECREF(top_level_package_name);
    return status;
error:
    Py_DECREF(imported_module);
    *module = NULL;
    return -1;
not_found:
    Py_DECREF(imported_module);
    *module = NULL;
    return 0;
}
static PyObject *__Pyx__Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, PyObject *moddict, int level) {
    PyObject *module = 0;
    PyObject *empty_dict = 0;
    PyObject *from_list = 0;
    int module_found;
    if (!qualname) {
        qualname = name;
    }
    module_found = __Pyx__Import_Lookup(qualname, imported_names, len_imported_names, &module);
    if (likely(module_found == 1)) {
        return module;
    } else if (unlikely(module_found == -1)) {
        return NULL;
    }
    #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030f00a6
    empty_dict = PyFrozenDict_New(NULL);
    #else
    empty_dict = PyDict_New();
    #endif
    if (unlikely(!empty_dict))
        goto bad;
    if (imported_names) {
        from_list = __Pyx_PyList_FromArray(imported_names, len_imported_names);
        if (unlikely(!from_list))
            goto bad;
    }
    if (level == -1) {
        const char* package_sep = strchr(__Pyx_MODULE_NAME, '.');
        if (package_sep != (0)) {
            module = PyImport_ImportModuleLevelObject(
                name, moddict, empty_dict, from_list, 1);
            if (unlikely(!module)) {
                if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError)))
                    goto bad;
                PyErr_Clear();
            }
        }
        level = 0;
    }
    if (!module) {
        module = PyImport_ImportModuleLevelObject(
            name, moddict, empty_dict, from_list, level);
    }
bad:
    Py_XDECREF(from_list);
    Py_XDECREF(empty_dict);
    return module;
}

/* Import */
static PyObject *__Pyx_Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, int level) {
    return __Pyx__Import(name, imported_names, len_imported_names, qualname, __pyx_mstate_global->__pyx_d, level);
}

/* PyObjectFastCallMethod */
#if !CYTHON_VECTORCALL
static PyObject *__Pyx_PyObject_FastCallMethod(PyObject *name, PyObject *const *args, size_t nargsf) {
    PyObject *result;
    switch (__Pyx_PyVectorcall_NARGS(nargsf)) {
        case 1:
            return PyObject_CallMethodObjArgs(args[0], name, NULL);
        case 2:
            return PyObject_CallMethodObjArgs(args[0], name, args[1], NULL);
        case 3:
            return PyObject_CallMethodObjArgs(args[0], name, args[1], args[2], NULL);
        case 4:
            return PyObject_CallMethodObjArgs(args[0], name, args[1], args[2], args[3], NULL);
        case 5:
            return PyObject_CallMethodObjArgs(args[0], name, args[1], args[2], args[3], args[4], NULL);
    }
    PyObject *attr = PyObject_GetAttr(args[0], name);
    if (unlikely(!attr))
        return NULL;
    result = __Pyx_PyObject_FastCall(attr, args+1, nargsf - 1);
    Py_DECREF(attr);
    return result;
}
#endif

/* PyFrozenDict (used by DictGetItem) */
#if CYTHON_COMPILING_IN_LIMITED_API
static CYTHON_INLINE PyObject* __Pyx__PyFrozenDict_New(PyObject* frozendict_type, PyObject* it) {
    return PyObject_CallFunctionObjArgs(frozendict_type, it, NULL);
}
#endif

/* DictGetItem */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
    PyObject *value;
    if (unlikely(__Pyx_PyDict_GetItemRef(d, key, &value) == 0)) { // no value, no error
        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 value;
}
#endif

/* ListAppendAndDecrefInternal (used by ListAppend) */
#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
static CYTHON_INLINE void __Pyx__ListComp_AppendAndDecref(PyObject* list, Py_ssize_t len, PyObject* x) {
    PyList_SET_ITEM(list, len, x);
    Py_SET_SIZE(list, len + 1);
}
#endif

/* ListAppend */
#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
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);
        __Pyx__ListComp_AppendAndDecref(list, len, x);
        return 0;
    }
    return PyList_Append(list, x);
}
#endif

/* WriteUnraisableException */
static void __Pyx_WriteUnraisable(const char *name, int clineno,
                                  int lineno, const char *filename,
                                  int full_traceback, int nogil) {
    PyObject *old_exc, *old_val, *old_tb;
    PyObject *ctx;
    __Pyx_PyThreadState_declare
    PyGILState_STATE state;
    if (nogil)
        state = PyGILState_Ensure();
    else state = (PyGILState_STATE)0;
    CYTHON_UNUSED_VAR(clineno);
    CYTHON_UNUSED_VAR(lineno);
    CYTHON_UNUSED_VAR(filename);
    CYTHON_MAYBE_UNUSED_VAR(nogil);
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
    if (full_traceback) {
        Py_XINCREF(old_exc);
        Py_XINCREF(old_val);
        Py_XINCREF(old_tb);
        __Pyx_ErrRestore(old_exc, old_val, old_tb);
        PyErr_PrintEx(0);
    }
    ctx = PyUnicode_FromString(name);
    __Pyx_ErrRestore(old_exc, old_val, old_tb);
    if (!ctx) {
        PyErr_WriteUnraisable(Py_None);
    } else {
        PyErr_WriteUnraisable(ctx);
        Py_DECREF(ctx);
    }
    if (nogil)
        PyGILState_Release(state);
}

/* PyObjectFormatAndDecref */
static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f) {
    if (unlikely(!s)) return NULL;
    if (likely(PyUnicode_CheckExact(s))) return s;
    return __Pyx_PyObject_FormatAndDecref(s, f);
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f) {
    PyObject *result;
    if (unlikely(!s)) return NULL;
    result = PyObject_Format(s, f);
    Py_DECREF(s);
    return result;
}

/* JoinPyUnicode */
static PyObject* __Pyx_PyUnicode_Join(PyObject** values, Py_ssize_t value_count, Py_ssize_t result_ulength, int kind) {
#if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH && CYTHON_USE_UNICODE_INTERNALS
    PyObject *result_uval;
    int result_ukind, kind_shift;
    Py_ssize_t i, char_pos;
    void *result_udata;
    static const Py_UCS4 max_char[5] = {0x7fU, 0xffU, 0xffffU, 0xffffU, 0x10ffffU};
    assert (kind >= 0);
    if (kind > PyUnicode_4BYTE_KIND) kind = PyUnicode_4BYTE_KIND;
    result_uval = PyUnicode_New(result_ulength, max_char[kind]);
    if (unlikely(!result_uval)) return NULL;
    kind_shift = kind >> 1;  // 0, 1, 2
    result_ukind = 1 << kind_shift;  // 1, 2, 4
    result_udata = PyUnicode_DATA(result_uval);
    assert(kind_shift == 2 || kind_shift == 1 || kind_shift == 0);
    if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - result_ulength < 0))
        goto overflow;
    char_pos = 0;
    for (i=0; i < value_count; i++) {
        int ukind;
        Py_ssize_t ulength;
        void *udata;
        PyObject *uval = values[i];
        if (__Pyx_PyUnicode_READY(uval) == (-1))
            goto bad;
        ulength = __Pyx_PyUnicode_GET_LENGTH(uval);
        #if !CYTHON_ASSUME_SAFE_SIZE
        if (unlikely(ulength < 0)) goto bad;
        #endif
        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 (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 || 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
    Py_ssize_t i;
    PyObject *result = NULL;
    PyObject *value_tuple = PyTuple_New(value_count);
    if (unlikely(!value_tuple)) return NULL;
    CYTHON_UNUSED_VAR(kind);
    CYTHON_UNUSED_VAR(result_ulength);
    for (i=0; i<value_count; i++) {
        Py_INCREF(values[i]);
        if (__Pyx_PyTuple_SET_ITEM(value_tuple, i, values[i]) != (0)) goto bad;
    }
    result = PyUnicode_Join(__pyx_mstate_global->__pyx_empty_unicode, value_tuple);
bad:
    Py_DECREF(value_tuple);
    return result;
#endif
}

/* RaiseArgTupleInvalid */
static void __Pyx_RaiseArgtupleInvalid(
    const char* func_name,
    int exact,
    Py_ssize_t num_min,
    Py_ssize_t num_max,
    Py_ssize_t num_found)
{
    Py_ssize_t num_expected;
    const char *more_or_less;
    if (num_found < num_min) {
        num_expected = num_min;
        more_or_less = "at least";
    } else {
        num_expected = num_max;
        more_or_less = "at most";
    }
    if (exact) {
        more_or_less = "exactly";
    }
    PyErr_Format(PyExc_TypeError,
                 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
                 func_name, more_or_less, num_expected,
                 (num_expected == 1) ? "" : "s", num_found);
}

/* RejectKeywords */
static void __Pyx_RejectKeywords(const char* function_name, PyObject *kwds) {
    PyObject *key = NULL;
    if (CYTHON_VECTORCALL && likely(PyTuple_Check(kwds))) {
        key = __Pyx_PySequence_ITEM(kwds, 0);
    } else {
#if CYTHON_AVOID_BORROWED_REFS
        PyObject *pos = NULL;
#else
        Py_ssize_t pos = 0;
#endif
#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
        if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return;
#endif
        __Pyx_PyDict_NextRef(kwds, &pos, &key, NULL);
#if CYTHON_AVOID_BORROWED_REFS
        Py_XDECREF(pos);
#endif
    }
    if (likely(key)) {
        PyErr_Format(PyExc_TypeError,
            "%s() got an unexpected keyword argument '%U'",
            function_name, key);
        Py_DECREF(key);
    }
}

/* GetAttr3 */
#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
        return NULL;
    __Pyx_PyErr_Clear();
    Py_INCREF(d);
    return d;
}
#endif
static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
    PyObject *r;
#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
    int res = PyObject_GetOptionalAttr(o, n, &r);
    return (res != 0) ? r : __Pyx_NewRef(d);
#else
  #if CYTHON_USE_TYPE_SLOTS
    if (likely(PyUnicode_Check(n))) {
        r = __Pyx_PyObject_GetAttrStrNoError(o, n);
        if (unlikely(!r) && likely(!PyErr_Occurred())) {
            r = __Pyx_NewRef(d);
        }
        return r;
    }
  #endif
    r = PyObject_GetAttr(o, n);
    return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
#endif
}

/* PyDictVersioning (used by GetModuleGlobalName) */
#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_COMPILING_IN_LIMITED_API
    if (unlikely(!__pyx_m)) {
        if (!PyErr_Occurred())
            PyErr_SetNone(PyExc_NameError);
        return NULL;
    }
    result = PyObject_GetAttr(__pyx_m, name);
    if (likely(result)) {
        return result;
    }
    if (!__Pyx_IgnoreException(PyExc_Exception)) {
        return NULL; // BaseException
    }
#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
    if (unlikely(__Pyx_PyDict_GetItemRef(__pyx_mstate_global->__pyx_d, name, &result) == -1)) {
        if (!__Pyx_IgnoreException(PyExc_Exception)) {
            return NULL; // BaseException
        }
    }
    __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return result;
    }
#else
    result = _PyDict_GetItem_KnownHash(__pyx_mstate_global->__pyx_d, name, ((PyASCIIObject *) name)->hash);
    __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return __Pyx_NewRef(result);
    }
    PyObject *exc = PyErr_Occurred();
    if (unlikely(exc) && !__Pyx_IgnoreGivenException(exc, PyExc_Exception)) {
        return NULL; // BaseException
    }
#endif
    return __Pyx_GetBuiltinName(name);
}

/* RaiseDoubleKeywords (used by ParseKeywordsImpl) */
static void __Pyx_RaiseDoubleKeywordsError(
    const char* func_name,
    PyObject* kw_name)
{
    PyErr_Format(PyExc_TypeError,
        "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
}

/* CallUnboundCMethod2 */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) {
    int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc);
    if (likely(was_initialized == 2 && cfunc->func)) {
        PyObject *args[2] = {arg1, arg2};
        if (cfunc->flag == METH_FASTCALL) {
            return __Pyx_CallCFunctionFast(cfunc, self, args, 2);
        }
        if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS))
            return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, 2, NULL);
    }
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    else if (unlikely(was_initialized == 1)) {
        __Pyx_CachedCFunction tmp_cfunc = {
#ifndef __cplusplus
            0
#endif
        };
        tmp_cfunc.type = cfunc->type;
        tmp_cfunc.method_name = cfunc->method_name;
        return __Pyx__CallUnboundCMethod2(&tmp_cfunc, self, arg1, arg2);
    }
#endif
    PyObject *result = __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2);
    __Pyx_CachedCFunction_SetFinishedInitializing(cfunc);
    return result;
}
#endif
static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){
    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)) {
        PyObject *result = NULL;
        PyObject *args = PyTuple_New(2);
        if (unlikely(!args)) return NULL;
        Py_INCREF(arg1);
        PyTuple_SET_ITEM(args, 0, arg1);
        Py_INCREF(arg2);
        PyTuple_SET_ITEM(args, 1, arg2);
        if (cfunc->flag & METH_KEYWORDS)
            result = __Pyx_CallCFunctionWithKeywords(cfunc, self, args, NULL);
        else
            result = __Pyx_CallCFunction(cfunc, self, args);
        Py_DECREF(args);
        return result;
    }
#endif
    {
        PyObject *args[4] = {NULL, self, arg1, arg2};
        return __Pyx_PyObject_FastCall(cfunc->method, args+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
    }
}

/* ParseKeywordsImpl (used by ParseKeywords) */
static int __Pyx_ValidateDuplicatePosArgs(
    PyObject *kwds,
    PyObject ** const argnames[],
    PyObject ** const *first_kw_arg,
    const char* function_name)
{
    PyObject ** const *name = argnames;
    while (name != first_kw_arg) {
        PyObject *key = **name;
        int found = PyDict_Contains(kwds, key);
        if (unlikely(found)) {
            if (found == 1) __Pyx_RaiseDoubleKeywordsError(function_name, key);
            goto bad;
        }
        name++;
    }
    return 0;
bad:
    return -1;
}
#if CYTHON_USE_UNICODE_INTERNALS
static CYTHON_INLINE int __Pyx_UnicodeKeywordsEqual(PyObject *s1, PyObject *s2) {
    int kind;
    Py_ssize_t len = PyUnicode_GET_LENGTH(s1);
    if (len != PyUnicode_GET_LENGTH(s2)) return 0;
    kind = PyUnicode_KIND(s1);
    if (kind != PyUnicode_KIND(s2)) return 0;
    const void *data1 = PyUnicode_DATA(s1);
    const void *data2 = PyUnicode_DATA(s2);
    return (memcmp(data1, data2, (size_t) len * (size_t) kind) == 0);
}
#endif
static int __Pyx_MatchKeywordArg_str(
    PyObject *key,
    PyObject ** const argnames[],
    PyObject ** const *first_kw_arg,
    size_t *index_found,
    const char *function_name)
{
    PyObject ** const *name;
    #if CYTHON_USE_UNICODE_INTERNALS
    Py_hash_t key_hash = ((PyASCIIObject*)key)->hash;
    if (unlikely(key_hash == -1)) {
        key_hash = PyObject_Hash(key);
        if (unlikely(key_hash == -1))
            goto bad;
    }
    #endif
    name = first_kw_arg;
    while (*name) {
        PyObject *name_str = **name;
        #if CYTHON_USE_UNICODE_INTERNALS
        if (key_hash == ((PyASCIIObject*)name_str)->hash && __Pyx_UnicodeKeywordsEqual(name_str, key)) {
            *index_found = (size_t) (name - argnames);
            return 1;
        }
        #else
        #if CYTHON_ASSUME_SAFE_SIZE
        if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key))
        #endif
        {
            int cmp = PyUnicode_Compare(name_str, key);
            if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
            if (cmp == 0) {
                *index_found = (size_t) (name - argnames);
                return 1;
            }
        }
        #endif
        name++;
    }
    name = argnames;
    while (name != first_kw_arg) {
        PyObject *name_str = **name;
        #if CYTHON_USE_UNICODE_INTERNALS
        if (unlikely(key_hash == ((PyASCIIObject*)name_str)->hash)) {
            if (__Pyx_UnicodeKeywordsEqual(name_str, key))
                goto arg_passed_twice;
        }
        #else
        #if CYTHON_ASSUME_SAFE_SIZE
        if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key))
        #endif
        {
            if (unlikely(name_str == key)) goto arg_passed_twice;
            int cmp = PyUnicode_Compare(name_str, key);
            if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
            if (cmp == 0) goto arg_passed_twice;
        }
        #endif
        name++;
    }
    return 0;
arg_passed_twice:
    __Pyx_RaiseDoubleKeywordsError(function_name, key);
    goto bad;
bad:
    return -1;
}
static int __Pyx_MatchKeywordArg_nostr(
    PyObject *key,
    PyObject ** const argnames[],
    PyObject ** const *first_kw_arg,
    size_t *index_found,
    const char *function_name)
{
    PyObject ** const *name;
    if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type;
    name = first_kw_arg;
    while (*name) {
        int cmp = PyObject_RichCompareBool(**name, key, Py_EQ);
        if (cmp == 1) {
            *index_found = (size_t) (name - argnames);
            return 1;
        }
        if (unlikely(cmp == -1)) goto bad;
        name++;
    }
    name = argnames;
    while (name != first_kw_arg) {
        int cmp = PyObject_RichCompareBool(**name, key, Py_EQ);
        if (unlikely(cmp != 0)) {
            if (cmp == 1) goto arg_passed_twice;
            else goto bad;
        }
        name++;
    }
    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;
bad:
    return -1;
}
static CYTHON_INLINE int __Pyx_MatchKeywordArg(
    PyObject *key,
    PyObject ** const argnames[],
    PyObject ** const *first_kw_arg,
    size_t *index_found,
    const char *function_name)
{
    return likely(PyUnicode_CheckExact(key)) ?
        __Pyx_MatchKeywordArg_str(key, argnames, first_kw_arg, index_found, function_name) :
        __Pyx_MatchKeywordArg_nostr(key, argnames, first_kw_arg, index_found, function_name);
}
static void __Pyx_RejectUnknownKeyword(
    PyObject *kwds,
    PyObject ** const argnames[],
    PyObject ** const *first_kw_arg,
    const char *function_name)
{
    #if CYTHON_AVOID_BORROWED_REFS
    PyObject *pos = NULL;
    #else
    Py_ssize_t pos = 0;
    #endif
    PyObject *key = NULL;
    __Pyx_BEGIN_CRITICAL_SECTION(kwds);
    #if CYTHON_AVOID_BORROWED_REFS
    while (__Pyx_PyDict_NextRef(kwds, &pos, &key, NULL))
    #else
    (void) __Pyx_PyDict_NextRef;
    while (PyDict_Next(kwds, &pos, &key, NULL))
    #endif
    {
        PyObject** const *name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (!*name) {
            size_t index_found = 0;
            int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name);
            if (cmp != 1) {
                if (cmp == 0) {
                    PyErr_Format(PyExc_TypeError,
                        "%s() got an unexpected keyword argument '%U'",
                        function_name, key);
                }
                #if CYTHON_AVOID_BORROWED_REFS
                Py_DECREF(key);
                #endif
                break;
            }
        }
        #if CYTHON_AVOID_BORROWED_REFS
        Py_DECREF(key);
        #endif
    }
    __Pyx_END_CRITICAL_SECTION();
    #if CYTHON_AVOID_BORROWED_REFS
    Py_XDECREF(pos);
    #endif
    assert(PyErr_Occurred());
}
static int __Pyx_ParseKeywordDict(
    PyObject *kwds,
    PyObject ** const argnames[],
    PyObject *values[],
    Py_ssize_t num_pos_args,
    Py_ssize_t num_kwargs,
    const char* function_name,
    int ignore_unknown_kwargs)
{
    PyObject** const *name;
    PyObject** const *first_kw_arg = argnames + num_pos_args;
    Py_ssize_t extracted = 0;
#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
    if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return -1;
#endif
    name = first_kw_arg;
    while (*name && num_kwargs > extracted) {
        PyObject * key = **name;
        PyObject *value;
        int found = 0;
        #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
        found = PyDict_GetItemRef(kwds, key, &value);
        #else
        value = PyDict_GetItemWithError(kwds, key);
        if (value) {
            Py_INCREF(value);
            found = 1;
        } else {
            if (unlikely(PyErr_Occurred())) goto bad;
        }
        #endif
        if (found) {
            if (unlikely(found < 0)) goto bad;
            values[name-argnames] = value;
            extracted++;
        }
        name++;
    }
    if (num_kwargs > extracted) {
        if (ignore_unknown_kwargs) {
            if (unlikely(__Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name) == -1))
                goto bad;
        } else {
            __Pyx_RejectUnknownKeyword(kwds, argnames, first_kw_arg, function_name);
            goto bad;
        }
    }
    return 0;
bad:
    return -1;
}
static int __Pyx_ParseKeywordDictToDict(
    PyObject *kwds,
    PyObject ** const argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    const char* function_name)
{
    PyObject** const *name;
    PyObject** const *first_kw_arg = argnames + num_pos_args;
    Py_ssize_t len;
#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
    if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return -1;
#endif
    if (PyDict_Update(kwds2, kwds) < 0) goto bad;
    name = first_kw_arg;
    while (*name) {
        PyObject *key = **name;
        PyObject *value;
#if !CYTHON_COMPILING_IN_LIMITED_API && (PY_VERSION_HEX >= 0x030d00A2 || defined(PyDict_Pop))
        int found = PyDict_Pop(kwds2, key, &value);
        if (found) {
            if (unlikely(found < 0)) goto bad;
            values[name-argnames] = value;
        }
#elif __PYX_LIMITED_VERSION_HEX >= 0x030d0000
        int found = PyDict_GetItemRef(kwds2, key, &value);
        if (found) {
            if (unlikely(found < 0)) goto bad;
            values[name-argnames] = value;
            if (unlikely(PyDict_DelItem(kwds2, key) < 0)) goto bad;
        }
#else
    #if CYTHON_COMPILING_IN_CPYTHON
        value = _PyDict_Pop(kwds2, key, kwds2);
    #else
        value = __Pyx_CallUnboundCMethod2(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_pop, kwds2, key, kwds2);
    #endif
        if (value == kwds2) {
            Py_DECREF(value);
        } else {
            if (unlikely(!value)) goto bad;
            values[name-argnames] = value;
        }
#endif
        name++;
    }
    len = PyDict_Size(kwds2);
    if (len > 0) {
        return __Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name);
    } else if (unlikely(len == -1)) {
        goto bad;
    }
    return 0;
bad:
    return -1;
}
static int __Pyx_ParseKeywordsTuple(
    PyObject *kwds,
    PyObject * const *kwvalues,
    PyObject ** const argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    Py_ssize_t num_kwargs,
    const char* function_name,
    int ignore_unknown_kwargs)
{
    PyObject *key = NULL;
    PyObject** const * name;
    PyObject** const *first_kw_arg = argnames + num_pos_args;
    for (Py_ssize_t pos = 0; pos < num_kwargs; pos++) {
#if CYTHON_AVOID_BORROWED_REFS
        key = __Pyx_PySequence_ITEM(kwds, pos);
#else
        key = __Pyx_PyTuple_GET_ITEM(kwds, pos);
#endif
#if !CYTHON_ASSUME_SAFE_MACROS
        if (unlikely(!key)) goto bad;
#endif
        name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (*name) {
            PyObject *value = kwvalues[pos];
            values[name-argnames] = __Pyx_NewRef(value);
        } else {
            size_t index_found = 0;
            int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name);
            if (cmp == 1) {
                PyObject *value = kwvalues[pos];
                values[index_found] = __Pyx_NewRef(value);
            } else {
                if (unlikely(cmp == -1)) goto bad;
                if (kwds2) {
                    PyObject *value = kwvalues[pos];
                    if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
                } else if (!ignore_unknown_kwargs) {
                    goto invalid_keyword;
                }
            }
        }
        #if CYTHON_AVOID_BORROWED_REFS
        Py_DECREF(key);
        key = NULL;
        #endif
    }
    return 0;
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    goto bad;
bad:
    #if CYTHON_AVOID_BORROWED_REFS
    Py_XDECREF(key);
    #endif
    return -1;
}

/* ParseKeywords */
static int __Pyx_ParseKeywords(
    PyObject *kwds,
    PyObject * const *kwvalues,
    PyObject ** const argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    Py_ssize_t num_kwargs,
    const char* function_name,
    int ignore_unknown_kwargs)
{
    if (CYTHON_VECTORCALL && likely(PyTuple_Check(kwds)))
        return __Pyx_ParseKeywordsTuple(kwds, kwvalues, argnames, kwds2, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs);
    else if (kwds2)
        return __Pyx_ParseKeywordDictToDict(kwds, argnames, kwds2, values, num_pos_args, function_name);
    else
        return __Pyx_ParseKeywordDict(kwds, argnames, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs);
}

/* ArgTypeTestError (used by ArgTypeTest) */
static void __Pyx_ArgTypeError(PyObject *obj, PyTypeObject *type, const char *name, int exact)
{
    __Pyx_TypeName type_name;
    __Pyx_TypeName obj_type_name;
    PyObject *extra_info = __pyx_mstate_global->__pyx_empty_unicode;
    int from_annotation_subclass = 0;
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return;
    } else if (exact == 2) {
        if (__Pyx_TypeCheck(obj, type)) {
            from_annotation_subclass = 1;
            extra_info = __pyx_mstate_global->__pyx_kp_u_Note_that_Cython_is_deliberately;
        }
    }
    type_name = __Pyx_PyType_GetFullyQualifiedName(type);
    #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
    if (unlikely(!type_name)) return;
    #endif
    obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj));
    #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
    if (unlikely(!obj_type_name)) goto obj_type_name_failed;
    #endif
    PyErr_Format(PyExc_TypeError,
        "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME ", got " __Pyx_FMT_TYPENAME ")"
#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
        "%s%U"
#endif
        , name, type_name, obj_type_name
#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
        , (from_annotation_subclass ? ". " : ""), extra_info
#endif
        );
#if __PYX_LIMITED_VERSION_HEX >= 0x030C0000
    if (exact == 2 && from_annotation_subclass) {
        PyObject *res;
        PyObject *vargs[2];
        vargs[0] = PyErr_GetRaisedException();
        vargs[1] = extra_info;
        res = PyObject_VectorcallMethod(__pyx_mstate_global->__pyx_kp_u_add_note, vargs, 2, NULL);
        Py_XDECREF(res);
        PyErr_SetRaisedException(vargs[0]);
    }
#endif
    __Pyx_DECREF_TypeName(obj_type_name);
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
obj_type_name_failed:
#endif
    __Pyx_DECREF_TypeName(type_name);
    return;
}

/* ArgTypeTest */
static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, const char *name, int exact) {
    if (likely(Py_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None))))
        return 1;
    if (!exact && likely(type) && likely(__Pyx_TypeCheck(obj, type)))
        return 1;
    __Pyx_ArgTypeError(obj, type, name, exact);
    return 0;
}

/* pybuiltin_invalid (used by pyint_simplify) */
static void __Pyx_PyBuiltin_Invalid(PyObject *obj, const char *builtin_type_name, const char *argname) {
    __Pyx_TypeName obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj));
    #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
    if (unlikely(!obj_type_name)) return;
    #endif
    if (argname) {
        PyErr_Format(PyExc_TypeError,
            "Argument '%.200s' has incorrect type (expected %.5s, got " __Pyx_FMT_TYPENAME ")",
            argname, builtin_type_name, obj_type_name
        );
    } else {
        PyErr_Format(PyExc_TypeError,
            "Expected %.5s, got " __Pyx_FMT_TYPENAME,
            builtin_type_name, obj_type_name
        );
    }
    __Pyx_DECREF_TypeName(obj_type_name);
}

/* pyint_simplify */
static int __Pyx__PyInt_FromNumber(PyObject **number_var, const char *argname);
static CYTHON_INLINE int __Pyx_PyInt_FromNumber(PyObject **number_var, const char *argname, int accept_none) {
    PyObject *number = *number_var;
    if (likely((accept_none && number == Py_None) || PyLong_CheckExact(number))) {
        return 0;
    }
    return __Pyx__PyInt_FromNumber(number_var, argname);
}
static int __Pyx__PyInt_FromNumber(PyObject **number_var, const char *argname) {
    PyObject *number = *number_var;
    PyObject *int_object;
    if (likely(PyNumber_Check(number))) {
        int_object = PyNumber_Long(number);
        if (unlikely(!int_object)) goto bad;
    } else {
        __Pyx_PyBuiltin_Invalid(number, "int", argname);
        goto bad;
    }
    *number_var = int_object;
    Py_DECREF(number);
    return 0;
bad:
    *number_var = NULL;
    Py_DECREF(number);
    return -1;
}

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

/* decode_c_bytes (used by decode_cpp_string) */
static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes(
         const char* cstring, Py_ssize_t length, Py_ssize_t start, Py_ssize_t stop,
         const char* encoding, const char* errors,
         PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
    if (unlikely((start < 0) | (stop < 0))) {
        if (start < 0) {
            start += length;
            if (start < 0)
                start = 0;
        }
        if (stop < 0)
            stop += length;
    }
    if (stop > length)
        stop = length;
    if (unlikely(stop <= start))
        return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_unicode);
    length = stop - start;
    cstring += start;
    if (decode_func) {
        return decode_func(cstring, length, errors);
    } else {
        return PyUnicode_Decode(cstring, length, encoding, errors);
    }
}

/* UnicodeConcatInPlace */
# if CYTHON_COMPILING_IN_CPYTHON
static int
__Pyx_unicode_modifiable(PyObject *unicode, int unsafe_shared)
{
    if (!__Pyx_IS_UNIQUELY_REFERENCED(unicode, unsafe_shared))
        return 0;
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030F0000
    if (PyUnstable_Unicode_GET_CACHED_HASH(unicode) != -1)
        return 0;
#endif
    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, int unsafe_shared
        #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 (left != right
            && __Pyx_unicode_modifiable(left, unsafe_shared)
            && 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

/* RaiseClosureNameError */
static void __Pyx_RaiseClosureNameError(const char *varname) {
    PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname);
}

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

/* PyLongBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_Fallback___Pyx_PyLong_SubtractObjC(PyObject *op1, PyObject *op2, int inplace) {
    return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2);
}
#if CYTHON_USE_PYLONG_INTERNALS
static PyObject* __Pyx_Unpacked___Pyx_PyLong_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(inplace);
    CYTHON_UNUSED_VAR(zerodivision_check);
    const long b = intval;
    long a;
    const PY_LONG_LONG llb = intval;
    PY_LONG_LONG lla;
    if (unlikely(__Pyx_PyLong_IsZero(op1))) {
        return PyLong_FromLong(-intval);
    }
    const int is_positive = __Pyx_PyLong_IsPos(op1);
    const digit* digits = __Pyx_PyLong_Digits(op1);
    const Py_ssize_t size = __Pyx_PyLong_DigitCount(op1);
    if (likely(size == 1)) {
        a = (long) digits[0];
        if (!is_positive) a *= -1;
    } else {
        if (size == 2 && 8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
            a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
            if (!is_positive) a *= -1;
            goto calculate_long;
        } else if (size == 2 && 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]));
            if (!is_positive) lla *= -1;
            goto calculate_long_long;
        } else
        if (size == 3 && 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]));
            if (!is_positive) a *= -1;
            goto calculate_long;
        } else if (size == 3 && 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]));
            if (!is_positive) lla *= -1;
            goto calculate_long_long;
        } else
        if (size == 4 && 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]));
            if (!is_positive) a *= -1;
            goto calculate_long;
        } else if (size == 4 && 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]));
            if (!is_positive) lla *= -1;
            goto calculate_long_long;
        } else
        {}
        return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
    }
    calculate_long:
        {
            long x;
            x = a - b;
            return PyLong_FromLong(x);
        }
    calculate_long_long:
        {
            PY_LONG_LONG llx;
            llx = lla - llb;
            return PyLong_FromLongLong(llx);
        }
    
}
#endif
static PyObject* __Pyx_Float___Pyx_PyLong_SubtractObjC(PyObject *float_val, long intval, int zerodivision_check) {
    CYTHON_UNUSED_VAR(zerodivision_check);
    const long b = intval;
    double a = __Pyx_PyFloat_AS_DOUBLE(float_val);
        double result;
        
        result = ((double)a) - (double)b;
        return PyFloat_FromDouble(result);
}
static CYTHON_INLINE PyObject* __Pyx_PyLong_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_UNUSED_VAR(zerodivision_check);
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        return __Pyx_Unpacked___Pyx_PyLong_SubtractObjC(op1, op2, intval, inplace, zerodivision_check);
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        return __Pyx_Float___Pyx_PyLong_SubtractObjC(op1, intval, zerodivision_check);
    }
    return __Pyx_Fallback___Pyx_PyLong_SubtractObjC(op1, op2, inplace);
}
#endif

/* GetTopmostException (used by SaveResetException) */
#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 >= 0x030C0000
    local_value = tstate->current_exception;
    tstate->current_exception = 0;
  #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
#elif __PYX_LIMITED_VERSION_HEX >= 0x030C0000
    local_value = PyErr_GetRaisedException();
#else
    PyErr_Fetch(&local_type, &local_value, &local_tb);
#endif
#if __PYX_LIMITED_VERSION_HEX >= 0x030C0000
    if (likely(local_value)) {
        local_type = (PyObject*) Py_TYPE(local_value);
        Py_INCREF(local_type);
        local_tb = PyException_GetTraceback(local_value);
    }
#else
    PyErr_NormalizeException(&local_type, &local_value, &local_tb);
#if CYTHON_FAST_THREAD_STATE
    if (unlikely(tstate->curexc_type))
#else
    if (unlikely(PyErr_Occurred()))
#endif
        goto bad;
    if (local_tb) {
        if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
            goto bad;
    }
#endif // __PYX_LIMITED_VERSION_HEX >= 0x030C0000
    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);
#elif __PYX_LIMITED_VERSION_HEX >= 0x030b0000
    PyErr_SetHandledException(local_value);
    Py_XDECREF(local_value);
    Py_XDECREF(local_type);
    Py_XDECREF(local_tb);
#else
    PyErr_SetExcInfo(local_type, local_value, local_tb);
#endif
    return 0;
#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
bad:
    *type = 0;
    *value = 0;
    *tb = 0;
    Py_XDECREF(local_type);
    Py_XDECREF(local_value);
    Py_XDECREF(local_tb);
    return -1;
#endif
}

/* PyLongBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_Fallback___Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2, int inplace) {
    return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
}
#if CYTHON_USE_PYLONG_INTERNALS
static PyObject* __Pyx_Unpacked___Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(inplace);
    CYTHON_UNUSED_VAR(zerodivision_check);
    const long b = intval;
    long a;
    const PY_LONG_LONG llb = intval;
    PY_LONG_LONG lla;
    if (unlikely(__Pyx_PyLong_IsZero(op1))) {
        return __Pyx_NewRef(op2);
    }
    const int is_positive = __Pyx_PyLong_IsPos(op1);
    const digit* digits = __Pyx_PyLong_Digits(op1);
    const Py_ssize_t size = __Pyx_PyLong_DigitCount(op1);
    if (likely(size == 1)) {
        a = (long) digits[0];
        if (!is_positive) a *= -1;
    } else {
        if (size == 2 && 8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
            a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
            if (!is_positive) a *= -1;
            goto calculate_long;
        } else if (size == 2 && 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]));
            if (!is_positive) lla *= -1;
            goto calculate_long_long;
        } else
        if (size == 3 && 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]));
            if (!is_positive) a *= -1;
            goto calculate_long;
        } else if (size == 3 && 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]));
            if (!is_positive) lla *= -1;
            goto calculate_long_long;
        } else
        if (size == 4 && 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]));
            if (!is_positive) a *= -1;
            goto calculate_long;
        } else if (size == 4 && 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]));
            if (!is_positive) lla *= -1;
            goto calculate_long_long;
        } else
        {}
        return PyLong_Type.tp_as_number->nb_add(op1, op2);
    }
    calculate_long:
        {
            long x;
            x = a + b;
            return PyLong_FromLong(x);
        }
    calculate_long_long:
        {
            PY_LONG_LONG llx;
            llx = lla + llb;
            return PyLong_FromLongLong(llx);
        }
    
}
#endif
static PyObject* __Pyx_Float___Pyx_PyLong_AddObjC(PyObject *float_val, long intval, int zerodivision_check) {
    CYTHON_UNUSED_VAR(zerodivision_check);
    const long b = intval;
    double a = __Pyx_PyFloat_AS_DOUBLE(float_val);
        double result;
        
        result = ((double)a) + (double)b;
        return PyFloat_FromDouble(result);
}
static CYTHON_INLINE PyObject* __Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_UNUSED_VAR(zerodivision_check);
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        return __Pyx_Unpacked___Pyx_PyLong_AddObjC(op1, op2, intval, inplace, zerodivision_check);
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        return __Pyx_Float___Pyx_PyLong_AddObjC(op1, intval, zerodivision_check);
    }
    return __Pyx_Fallback___Pyx_PyLong_AddObjC(op1, op2, inplace);
}
#endif

/* PyObjectVectorcallKwds (used by PyObjectVectorcallMethodKwds) */
#if CYTHON_VECTORCALL
CYTHON_UNUSED static int __Pyx_CheckVectorcallKwarg(PyObject *kwnames, Py_ssize_t i) {
    PyObject *key = __Pyx_PyTuple_GET_ITEM(kwnames, i);
#if !CYTHON_ASSUME_SAFE_MACROS
    if (unlikely(!key)) return -1;
#endif
    if (unlikely(!PyUnicode_Check(key))) {
        PyErr_SetString(PyExc_TypeError, "keywords must be strings");
        return -1;
    }
    return 0;
}
#else
CYTHON_UNUSED static PyObject *__Pyx_MakeKwargDict(PyObject **keys, PyObject **values, Py_ssize_t n) {
    PyObject *out = PyDict_New();
    if (unlikely(!out)) return NULL;
    for (Py_ssize_t i=0; i<n; ++i) {
        if (unlikely(PyDict_SetItem(out, keys[i], values[i]) < 0)) {
            Py_DECREF(out);
            return NULL;
        }
    }
    return out;
}
CYTHON_UNUSED static int __Pyx_CheckVectorcallKwarg(PyObject **kwnames, Py_ssize_t i) {
    PyObject *key = kwnames[i];
    if (unlikely(!PyUnicode_Check(key))) {
        PyErr_SetString(PyExc_TypeError, "keywords must be strings");
        return -1;
    }
    return 0;
}
#endif

/* PyObjectVectorcallMethodKwds */
#if !CYTHON_VECTORCALL
static PyObject *__Pyx_Object_VectorcallMethodKwds(PyObject *name, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
    PyObject *result;
    PyObject *obj = PyObject_GetAttr(args[0], name);
    if (unlikely(!obj))
        return NULL;
    result = __Pyx_Object_VectorcallKwds(obj, args+1, nargsf-1, kwnames);
    Py_DECREF(obj);
    return result;
}
#endif

/* PyObjectCompare */
#ifndef __Pyx_DEFINED_PyObject_CompareFloatIntBoolGt
#define __Pyx_DEFINED_PyObject_CompareFloatIntBoolGt
static int __Pyx_PyObject_CompareFloatIntBoolGt(PyObject *op1, PyObject *op2) {
    double float_op1 = __Pyx_PyFloat_AS_DOUBLE(op1);
    #if !CYTHON_ASSUME_SAFE_MACROS
    if (unlikely(float_op1 == -1. && PyErr_Occurred())) return -1;
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (__Pyx_PyLong_IsCompact(op2)) {
        Py_ssize_t iop2 = __Pyx_PyLong_CompactValue(op2);
        if (float_op1 > ((double)iop2)) goto __pyx_return_true; else goto __pyx_return_false;
    }
    if (unlikely(!isfinite(float_op1))) {
        if (float_op1 > 0.0) goto __pyx_return_true; else goto __pyx_return_false;
    } else {
        int sign2 = __Pyx_PyLong_Sign(op2);
        if (float_op1 >= 0.) {
            if (sign2 < 0) goto __pyx_return_true;
            if (float_op1 < (double) (1L << PyLong_SHIFT)) goto __pyx_return_false;
        } else {
            if (sign2 > 0) goto __pyx_return_false;
            if (float_op1 > -(double) (1L << PyLong_SHIFT)) goto __pyx_return_true;
        }
    }
    #else
    if (unlikely(!isfinite(float_op1))) {
        if (float_op1 > 0.0) goto __pyx_return_true; else goto __pyx_return_false;
    } else {
        int overflow2;
        long iop2 = PyLong_AsLongAndOverflow(op2, &overflow2);
        if (likely(!overflow2)) {
            if ((long long) iop2 >= (1LL << 53)) {
                overflow2 = 1;
            } else if ((long long) iop2 <= - (1LL << 53)) {
                overflow2 = -1;
            } else {
                if (float_op1 > ((double) iop2)) goto __pyx_return_true; else goto __pyx_return_false;
            }
        }
        if (overflow2 > 0) {
            if (float_op1 < ((double) (1LL << 53))) goto __pyx_return_false;
        } else {
            if (float_op1 > - ((double) (1LL << 53))) goto __pyx_return_true;
        }
    }
    #endif
    return __Pyx_PyObject_RichCompareBool(op1, op2, Py_GT);
__pyx_return_true:
    return 1;
__pyx_return_false:
    return 0;
}
#endif
#if CYTHON_USE_PYLONG_INTERNALS
#ifndef __Pyx_DEFINED_PyObject_CompareIntIntBoolGt
#define __Pyx_DEFINED_PyObject_CompareIntIntBoolGt
static int __Pyx_PyObject_CompareIntIntBoolGt(PyObject *op1, PyObject *op2) {
    Py_ssize_t cmp = __Pyx_PyLong_CompareSignAndSize(op1, op2);
    if (cmp == 0) {
        Py_ssize_t size = __Pyx_PyLong_DigitCount(op1);
        if (size > 0) {
            const digit* digits1 = __Pyx_PyLong_Digits(op1);
            const digit* digits2 = __Pyx_PyLong_Digits(op2);
            if (size == 1) {
                cmp = (Py_ssize_t) digits1[0] - (Py_ssize_t) digits2[0];
            } else if ((size == 2) && (8 * sizeof(Py_ssize_t) >= 2 * PyLong_SHIFT)) {
                cmp = (Py_ssize_t) (((((size_t)digits1[1]) << PyLong_SHIFT) | (size_t)digits1[0])) - (Py_ssize_t) (((((size_t)digits2[1]) << PyLong_SHIFT) | (size_t)digits2[0]));
            } else {
                for (Py_ssize_t i=size-1; i >= 0 && !cmp; --i) {
                    cmp = (Py_ssize_t) digits1[i] - (Py_ssize_t) digits2[i];
                }
            }
        }
        if (cmp == 0) return 0;
        if (__Pyx_PyLong_IsNeg(op1)) cmp = -cmp;
    }
    return (cmp > 0);
}
#endif
#ifndef __Pyx_DEFINED_PyObject_CompareIntIntBoolGt
#define __Pyx_DEFINED_PyObject_CompareIntIntBoolGt
static CYTHON_INLINE PyObject* __Pyx_PyObject_CompareIntIntGt(PyObject *op1, PyObject *op2) {
    int result = __Pyx_PyObject_CompareIntIntBoolGt(op1, op2);
    if (unlikely(result == -1)) return NULL;
    return __Pyx_NewRef(result ? Py_True : Py_False);
}
#endif
#else
#ifndef __Pyx_DEFINED_PyObject_CompareIntIntBoolGt
#define __Pyx_DEFINED_PyObject_CompareIntIntBoolGt
static int __Pyx_PyObject_CompareIntIntBoolGt(PyObject *op1, PyObject *op2) {
    int overflow1, overflow2;
    long long iop1 = PyLong_AsLongLongAndOverflow(op1, &overflow1);
    long long iop2 = PyLong_AsLongLongAndOverflow(op2, &overflow2);
    if (likely(!(overflow1 | overflow2))) {
        if (iop1 > iop2) goto __pyx_return_true; else goto __pyx_return_false;
    } else if (overflow1 != overflow2) {
        if (overflow1 > overflow2) goto __pyx_return_true; else goto __pyx_return_false;
    } else {
        return __Pyx_PyObject_RichCompareBool(op1, op2, Py_GT);
    }
__pyx_return_true:
    return 1;
__pyx_return_false:
    return 0;
}
#endif
#endif
static CYTHON_INLINE int __Pyx_PyObject_CompareBoolGt_object_int(PyObject *op1, PyObject *op2, int pyop) {
    CYTHON_UNUSED_VAR(pyop);
    if (unlikely(op2 == Py_None)) {
        goto __pyx_richcmp;
    }
    if (op1 == op2) goto __pyx_return_false;
    if (PyFloat_CheckExact(op1)) {
        if (likely(op2 != Py_None)) {
            return __Pyx_PyObject_CompareFloatIntBoolGt(op1, op2);
        }
        goto __pyx_richcmp;
    }
    if (likely(PyLong_CheckExact(op1))) {
        if (op1 == op2) goto __pyx_return_false;
        if (likely(op2 != Py_None)) {
            return __Pyx_PyObject_CompareIntIntBoolGt(op1, op2);
        }
        goto __pyx_richcmp;
    }
    if ((0)) goto __pyx_richcmp;
    if ((0)) goto __pyx_return_true;
    if ((0)) goto __pyx_return_false;
__pyx_richcmp:
    return __Pyx_PyObject_RichCompareBool(op1, op2, Py_GT);
__pyx_return_true:
    return 1;
__pyx_return_false:
    return 0;
}

/* IterFinish (used by dict_iter_common) */
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;
}

/* PyObjectCallMethod0 (used by dict_iter_common) */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
#if CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || !CYTHON_COMPILING_IN_LIMITED_API)
    return PyObject_VectorcallMethod(method_name, &obj, 1 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
#elif CYTHON_COMPILING_IN_LIMITED_API
    return PyObject_CallMethodObjArgs(obj, method_name, NULL);
#else
    return PyObject_CallMethodNoArgs(obj, method_name);
#endif
}

/* RaiseNeedMoreValuesToUnpack (used by UnpackTuple2) */
static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
    PyErr_Format(PyExc_ValueError,
                 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
                 index, (index == 1) ? "" : "s");
}

/* RaiseTooManyValuesToUnpack (used by UnpackItemEndCheck) */
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
    PyErr_Format(PyExc_ValueError,
                 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
}

/* UnpackItemEndCheck (used by UnpackTuple2) */
static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
    if (unlikely(retval)) {
        Py_DECREF(retval);
        __Pyx_RaiseTooManyValuesError(expected);
        return -1;
    }
    return __Pyx_IterFinish();
}

/* RaiseNoneIterError (used by UnpackTupleError) */
static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
}

/* UnpackTupleError (used by UnpackTuple2) */
static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) {
    if (t == Py_None) {
      __Pyx_RaiseNoneNotIterableError();
    } else {
      Py_ssize_t size = __Pyx_PyTuple_GET_SIZE(t);
 #if !CYTHON_ASSUME_SAFE_SIZE
      if (unlikely(size < 0)) return;
 #endif
      if (size < index) {
        __Pyx_RaiseNeedMoreValuesError(size);
      } else {
        __Pyx_RaiseTooManyValuesError(index);
      }
    }
}

/* UnpackTuple2 (used by dict_iter_common) */
static CYTHON_INLINE int __Pyx_unpack_tuple2(
        PyObject* tuple, PyObject** value1, PyObject** value2, int is_tuple, int has_known_size, int decref_tuple) {
    if (likely(is_tuple || PyTuple_Check(tuple))) {
        Py_ssize_t size;
        if (has_known_size) {
            return __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple);
        }
        size = __Pyx_PyTuple_GET_SIZE(tuple);
        if (likely(size == 2)) {
            return __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple);
        }
        if (size >= 0) {
            __Pyx_UnpackTupleError(tuple, 2);
        }
        return -1;
    } else {
        return __Pyx_unpack_tuple2_generic(tuple, value1, value2, has_known_size, decref_tuple);
    }
}
static CYTHON_INLINE int __Pyx_unpack_tuple2_exact(
        PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int decref_tuple) {
    PyObject *value1 = NULL, *value2 = NULL;
#if CYTHON_AVOID_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS
    value1 = __Pyx_PySequence_ITEM(tuple, 0);  if (unlikely(!value1)) goto bad;
    value2 = __Pyx_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_AVOID_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS
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_common (used by dict_iter) */
static PyObject *__Pyx_dict_call_to_get_iterable(PyObject* iterable, PyObject* method_name) {
    PyObject* iter;
    iterable = __Pyx_PyObject_CallMethod0(iterable, method_name);
    if (!iterable)
        return NULL;
#if !CYTHON_AVOID_BORROWED_REFS
    if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable))
        return iterable;
#endif
    iter = PyObject_GetIter(iterable);
    Py_DECREF(iterable);
    return iter;
}
#if !CYTHON_AVOID_BORROWED_REFS
static CYTHON_INLINE int __Pyx_dict_iter_next_source_is_dict(
        PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos,
        PyObject** pkey, PyObject** pvalue, PyObject** pitem) {
    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);
        #if CYTHON_ASSUME_SAFE_MACROS
        PyTuple_SET_ITEM(tuple, 0, key);
        PyTuple_SET_ITEM(tuple, 1, value);
        #else
        if (unlikely(PyTuple_SetItem(tuple, 0, key) < 0)) {
            Py_DECREF(value);
            Py_DECREF(tuple);
            return -1;
        }
        if (unlikely(PyTuple_SetItem(tuple, 1, value) < 0)) {
            Py_DECREF(tuple);
            return -1;
        }
        #endif
        *pitem = tuple;
    } else {
        if (pkey) {
            Py_INCREF(key);
            *pkey = key;
        }
        if (pvalue) {
            Py_INCREF(value);
            *pvalue = value;
        }
    }
    return 1;
}
#endif
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_AVOID_BORROWED_REFS
    if (source_is_dict) {
        int result;
#if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_BEGIN_CRITICAL_SECTION(iter_obj);
#endif
        result = __Pyx_dict_iter_next_source_is_dict(iter_obj, orig_length, ppos, pkey, pvalue, pitem);
#if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_END_CRITICAL_SECTION();
#endif
        return result;
    } else if (PyTuple_CheckExact(iter_obj)) {
        Py_ssize_t pos = *ppos;
        Py_ssize_t tuple_size = __Pyx_PyTuple_GET_SIZE(iter_obj);
        #if !CYTHON_ASSUME_SAFE_SIZE
        if (unlikely(tuple_size < 0)) return -1;
        #endif
        if (unlikely(pos >= tuple_size)) return 0;
        *ppos = pos + 1;
        #if CYTHON_ASSUME_SAFE_MACROS
        next_item = PyTuple_GET_ITEM(iter_obj, pos);
        #else
        next_item = PyTuple_GetItem(iter_obj, pos);
        if (unlikely(!next_item)) return -1;
        #endif
        Py_INCREF(next_item);
    } else if (PyList_CheckExact(iter_obj)) {
        Py_ssize_t pos = *ppos;
        Py_ssize_t list_size = __Pyx_PyList_GET_SIZE(iter_obj);
        #if !CYTHON_ASSUME_SAFE_SIZE
        if (unlikely(list_size < 0)) return -1;
        #endif
        if (unlikely(pos >= list_size)) return 0;
        *ppos = pos + 1;
        next_item = __Pyx_PyList_GET_ITEM_REF(iter_obj, pos, __Pyx_ReferenceSharing_OwnStrongReference);
        if (unlikely(!next_item)) return -1;
    } 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;
}

/* dict_iter */
static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name,
                                                   Py_ssize_t* p_orig_length, int* p_source_is_dict) {
    is_dict = is_dict || likely(__Pyx_PyAnyDict_CheckExact(iterable));
    *p_source_is_dict = is_dict;
#if !CYTHON_AVOID_BORROWED_REFS
    if (is_dict) {
        *p_orig_length = PyDict_Size(iterable);
        Py_INCREF(iterable);
        return iterable;
    }
#endif
    *p_orig_length = 0;
    if (method_name) {
        return __Pyx_dict_call_to_get_iterable(iterable, method_name);
    } else {
        return PyObject_GetIter(iterable);
    }
}

/* AllocateExtensionType */
static PyObject *__Pyx_AllocateExtensionType(PyTypeObject *t, int is_final) {
    if (is_final || likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
        allocfunc alloc_func = __Pyx_PyType_GetSlot(t, tp_alloc, allocfunc);
        return alloc_func(t, 0);
    } else {
        newfunc tp_new = __Pyx_PyType_TryGetSlot(&PyBaseObject_Type, tp_new, newfunc);
    #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
        if (!tp_new) {
            PyObject *new_str = PyUnicode_FromString("__new__");
            if (likely(new_str)) {
                PyObject *o = PyObject_CallMethodObjArgs((PyObject *)&PyBaseObject_Type, new_str, t, NULL);
                Py_DECREF(new_str);
                return o;
            } else
                return NULL;
        } else
    #endif
        return tp_new(t, __pyx_mstate_global->__pyx_empty_tuple, 0);
    }
}

/* CallSlotAsVectorcallUnpackDict (used by CallSlotAsVectorcall) */
static CYTHON_INLINE int __Pyx_CallSlotAsVectorcallUnpackDict(Py_ssize_t args_size, PyObject *keys_dict, PyObject **args, PyObject *kwnames) {
    Py_ssize_t pos = 0, i = 0;
    PyObject *key, *value;
    while (PyDict_Next(keys_dict, &pos, &key, &value)) {
        Py_INCREF(value);
        args[args_size+i] = value;
        Py_INCREF(key);
        if (unlikely(__Pyx_PyTuple_SET_ITEM(kwnames, i, key) == -1)) {
            return -1;
        }
        ++i;
    }
    return 0;
}

/* CallSlotAsVectorcall */
#if CYTHON_VECTORCALL_TPNEW
static PyObject * __Pyx_CallTpnewAsVectorcall(__Pyx_tpnewvectorcallfunc f, PyTypeObject* o, PyObject *a, PyObject *k) {
    Py_ssize_t k_size = k ? __Pyx_PyDict_GET_SIZE(k) : 0;
#if !CYTHON_ASSUME_SAFE_SIZE
    if (unlikely(k_size < 0)) return NULL;
#endif
    Py_ssize_t a_size = __Pyx_PyTuple_GET_SIZE(a);
#if !CYTHON_ASSUME_SAFE_SIZE
    if (unlikely(a_size < 0)) return NULL;
#endif
#if CYTHON_ASSUME_SAFE_MACROS
    if (k_size == 0) {
        return f(o, &PyTuple_GET_ITEM(a, 0), a_size, NULL);
    }
#else
    if (k_size == 0 && a_size == 0) {
        return f(o, NULL, 0, NULL);
    }
#endif
    PyObject *stack_args[5];
    PyObject **args = stack_args;
    Py_ssize_t maxnargs = PY_SSIZE_T_MAX / sizeof(PyObject*) - 1;
    if (a_size > maxnargs - k_size) {
        PyErr_NoMemory();
        return NULL;
    }
    Py_ssize_t total_size = a_size + k_size;
    if (total_size > 5) {
        args = (PyObject**)PyMem_Malloc(((size_t)total_size)*sizeof(PyObject*));
        if (unlikely(!args)) {
            PyErr_NoMemory();
            return NULL;
        }
    }
    PyObject * result = NULL;
    PyObject *kwnames = NULL;
    int unpack_dict_result;
    Py_ssize_t i = 0;
    for (; i < a_size; ++i) {
        args[i] = __Pyx_PyTuple_GET_ITEM(a, i);
#if !CYTHON_ASSUME_SAFE_MACROS
        if (unlikely(!args[i])) goto cleanup;
#endif
    }
#if !CYTHON_ASSUME_SAFE_MACROS
    if (k)  // There's a specific shortcut earlier for ASSUME_SAFE_MACROS with no keywords
#endif
    {
        kwnames = PyTuple_New(k_size);
        if (unlikely(!kwnames)) goto cleanup;
        __Pyx_BEGIN_CRITICAL_SECTION(k);
        unpack_dict_result = __Pyx_CallSlotAsVectorcallUnpackDict(a_size, k, args, kwnames);
        __Pyx_END_CRITICAL_SECTION();
        if (unlikely(unpack_dict_result == -1)) goto cleanup;
    }
    result = f(o, args, a_size, kwnames);
  cleanup:
    Py_XDECREF(kwnames);
    for (i=a_size; i<total_size; ++i) {
        Py_XDECREF(args[i]);
    }
    if (args != stack_args) {
        PyMem_Free(args);
    }
    return result;
}
#endif

/* RaiseErrorWithObjectType (used by CallNewInitFromVectorcall) */
static void __Pyx_RaiseErrorWithType(PyObject* exc_type, const char* message, PyTypeObject *type_obj) {
    __Pyx_TypeName type_name = __Pyx_PyType_GetFullyQualifiedName(type_obj);
    #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
    if (unlikely(!type_name)) return;
    #endif
    PyErr_Format(exc_type, message, type_name);
    __Pyx_DECREF_TypeName(type_name);
}

/* CallNewInitFromVectorcall */
#if CYTHON_VECTORCALL_TPNEW
static PyObject *__Pyx_CallNewInitFromVectorcall(PyTypeObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
    newfunc tp_new = __Pyx_PyType_GetSlot(t, tp_new, newfunc);
    if (unlikely(!tp_new)) {
        __Pyx_RaiseErrorWithType(PyExc_TypeError, "cannot create " __Pyx_FMT_TYPENAME " instances", t);
        return NULL;
    }
    Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(nargsf);
    PyObject *result = NULL, *args_tuple = NULL, *kwds_dict = NULL;
    Py_ssize_t kw_size = kwnames ? __Pyx_PyTuple_GET_SIZE(kwnames) : 0;
#if !CYTHON_ASSUME_SAFE_SIZE
    if (unlikely(kw_size == -1)) {
        return NULL;
    }
#endif
    if (kw_size) {
        kwds_dict = __Pyx_PyDict_NewPresized(kw_size);
        if (unlikely(!kwds_dict)) {
            return NULL;
        }
        for (Py_ssize_t i=0; i<kw_size; ++i) {
            PyObject *v = args[nargs + i];
            PyObject *k = __Pyx_PyTuple_GET_ITEM(kwnames, i);
#if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely(!k)) {
                goto end;
            }
#endif
            if (unlikely(PyDict_SetItem(kwds_dict, k, v) < 0)) {
                goto end;
            }
        }
    }
    if (nargs) {
        args_tuple = __Pyx_PyTuple_FromArray(args, nargs);
        if (unlikely(!args_tuple)) {
            goto end;
        }
    } else {
        args_tuple = __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple);
    }
    result = tp_new(t, args_tuple, kwds_dict);
    if (unlikely(!result)) {
        goto end;
    }
    if (PyObject_TypeCheck(result, t)) {
        initproc tp_init = __Pyx_PyObject_GetSlot(result, tp_init, initproc);
        if (tp_init && unlikely(tp_init(result, args_tuple, kwds_dict) < 0)) {
            Py_CLEAR(result);
        }
    }
  end:
    Py_XDECREF(args_tuple);
    Py_XDECREF(kwds_dict);
    return result;
}
#endif

/* CallSlotAsVectorcall */
#if CYTHON_VECTORCALL_TPNEW
static int __Pyx_CallTpinitAsVectorcall(__Pyx_tpinitvectorcallfunc f, PyObject* o, PyObject *a, PyObject *k) {
    Py_ssize_t k_size = k ? __Pyx_PyDict_GET_SIZE(k) : 0;
#if !CYTHON_ASSUME_SAFE_SIZE
    if (unlikely(k_size < 0)) return -1;
#endif
    Py_ssize_t a_size = __Pyx_PyTuple_GET_SIZE(a);
#if !CYTHON_ASSUME_SAFE_SIZE
    if (unlikely(a_size < 0)) return -1;
#endif
#if CYTHON_ASSUME_SAFE_MACROS
    if (k_size == 0) {
        return f(o, &PyTuple_GET_ITEM(a, 0), a_size, NULL);
    }
#else
    if (k_size == 0 && a_size == 0) {
        return f(o, NULL, 0, NULL);
    }
#endif
    PyObject *stack_args[5];
    PyObject **args = stack_args;
    Py_ssize_t maxnargs = PY_SSIZE_T_MAX / sizeof(PyObject*) - 1;
    if (a_size > maxnargs - k_size) {
        PyErr_NoMemory();
        return -1;
    }
    Py_ssize_t total_size = a_size + k_size;
    if (total_size > 5) {
        args = (PyObject**)PyMem_Malloc(((size_t)total_size)*sizeof(PyObject*));
        if (unlikely(!args)) {
            PyErr_NoMemory();
            return -1;
        }
    }
    int result = -1;
    PyObject *kwnames = NULL;
    int unpack_dict_result;
    Py_ssize_t i = 0;
    for (; i < a_size; ++i) {
        args[i] = __Pyx_PyTuple_GET_ITEM(a, i);
#if !CYTHON_ASSUME_SAFE_MACROS
        if (unlikely(!args[i])) goto cleanup;
#endif
    }
#if !CYTHON_ASSUME_SAFE_MACROS
    if (k)  // There's a specific shortcut earlier for ASSUME_SAFE_MACROS with no keywords
#endif
    {
        kwnames = PyTuple_New(k_size);
        if (unlikely(!kwnames)) goto cleanup;
        __Pyx_BEGIN_CRITICAL_SECTION(k);
        unpack_dict_result = __Pyx_CallSlotAsVectorcallUnpackDict(a_size, k, args, kwnames);
        __Pyx_END_CRITICAL_SECTION();
        if (unlikely(unpack_dict_result == -1)) goto cleanup;
    }
    result = f(o, args, a_size, kwnames);
  cleanup:
    Py_XDECREF(kwnames);
    for (i=a_size; i<total_size; ++i) {
        Py_XDECREF(args[i]);
    }
    if (args != stack_args) {
        PyMem_Free(args);
    }
    return result;
}
#endif

/* GetTypeDictOffset (used by ValidateBasesTuple) */
#if !CYTHON_USE_TYPE_SLOTS
CYTHON_UNUSED static Py_ssize_t __Pyx_GetTypeDictOffset(PyObject *tp, int require_cython_valid_result) {
    PyObject *tp_dictoffset_o;
    Py_ssize_t tp_dictoffset;
    tp_dictoffset_o = PyObject_GetAttrString(tp, "__dictoffset__");
    if (unlikely(!tp_dictoffset_o)) return -1;
    tp_dictoffset = PyLong_AsSsize_t(tp_dictoffset_o);
    Py_DECREF(tp_dictoffset_o);
    if (unlikely(require_cython_valid_result && tp_dictoffset == 0)) {
        PyErr_SetString(
            PyExc_TypeError,
            "'type' doesn't have a dictoffset");
        return -1;
    } else if (unlikely(require_cython_valid_result && tp_dictoffset < 0)) {
        PyErr_SetString(
            PyExc_TypeError,
            "'type' has an unexpected negative dictoffset. "
            "Please report this as Cython bug");
        return -1;
    }
    return tp_dictoffset;
}
#endif

/* ValidateBasesTuple (used by PyType_Ready) */
#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS
static int __Pyx_validate_bases_tuple(const char *type_name, int has_dictoffset, PyObject *bases) {
    Py_ssize_t i, n;
#if CYTHON_ASSUME_SAFE_SIZE
    n = PyTuple_GET_SIZE(bases);
#else
    n = PyTuple_Size(bases);
    if (unlikely(n < 0)) return -1;
#endif
    if (!has_dictoffset) {
        PyObject *b;
#if CYTHON_AVOID_BORROWED_REFS
        b = PySequence_GetItem(bases, 0);
        if (!b) return -1;
#elif CYTHON_ASSUME_SAFE_MACROS
        b = PyTuple_GET_ITEM(bases, 0);
#else
        b = PyTuple_GetItem(bases, 0);
        if (!b) return -1;
#endif
#if CYTHON_USE_TYPE_SLOTS
        has_dictoffset = ((PyTypeObject*)b)->tp_dictoffset != 0;
#else
        Py_ssize_t dictoffset = __Pyx_GetTypeDictOffset(b, 0);
        has_dictoffset = dictoffset != 0;
#endif
#if CYTHON_AVOID_BORROWED_REFS
        Py_DECREF(b);
#endif
#if !CYTHON_USE_TYPE_SLOTS
        if (dictoffset == -1 && PyErr_Occurred()) return -1;
#endif
    }
    for (i = 1; i < n; i++)
    {
        PyTypeObject *b;
#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
        b = (PyTypeObject*) b0;
        if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE))
        {
            __Pyx_RaiseErrorWithType(
                PyExc_TypeError, "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b);
#if CYTHON_AVOID_BORROWED_REFS
            Py_DECREF(b0);
#endif
            return -1;
        }
        if (!has_dictoffset)
        {
            Py_ssize_t b_dictoffset = 0;
#if CYTHON_USE_TYPE_SLOTS
            b_dictoffset = b->tp_dictoffset;
#else
            b_dictoffset = __Pyx_GetTypeDictOffset((PyObject*)b, 0);
            if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return;
#endif
            if (b_dictoffset) {
                __Pyx_RaiseErrorWithType1(
                    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);
#if !CYTHON_USE_TYPE_SLOTS
              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 */
CYTHON_UNUSED static int __Pyx_PyType_HasMultipleInheritance(PyTypeObject *t) {
    while (t) {
        PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*);
        if (bases) {
            return 1;
        }
        t = __Pyx_PyType_GetSlot(t, tp_base, PyTypeObject*);
    }
    return 0;
}
static int __Pyx_PyType_Ready(PyTypeObject *t) {
#if CYTHON_USE_TYPE_SPECS || !CYTHON_COMPILING_IN_CPYTHON
    (void)__Pyx_PyObject_CallMethod0;
#if CYTHON_USE_TYPE_SPECS
    (void)__Pyx_validate_bases_tuple;
#endif
    return PyType_Ready(t);
#else
    int r;
    if (!__Pyx_PyType_HasMultipleInheritance(t)) {
        return PyType_Ready(t);
    }
    PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*);
    if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset != 0, bases) == -1))
        return -1;
    {
        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 (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) &&\
                !CYTHON_COMPILING_IN_GRAAL
        gc = PyImport_GetModule(__pyx_mstate_global->__pyx_kp_u_gc);
        #endif
        if (unlikely(!gc)) gc = PyImport_Import(__pyx_mstate_global->__pyx_kp_u_gc);
        if (unlikely(!gc)) return -1;
        py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__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_mstate_global->__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
        r = PyType_Ready(t);
        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_mstate_global->__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
    }
    return r;
#endif
}

/* LimitedApiGetTypeTypeDict (used by DelItemOnTypeDict) */
#if CYTHON_COMPILING_IN_LIMITED_API
static PyObject *__Pyx_GetTypeTypeDict(PyTypeObject *tp) {
    static Py_ssize_t tp_dictoffset = 0;
    if (unlikely(tp_dictoffset == 0)) {
        tp_dictoffset = __Pyx_GetTypeDictOffset((PyObject*)(&PyType_Type), 1);
        if (unlikely(tp_dictoffset == -1 && PyErr_Occurred())) {
            tp_dictoffset = 0; // try again next time?
            return NULL;
        }
    }
    return *(PyObject**)((char*)tp + tp_dictoffset);
}
#endif

/* DelItemOnTypeDict (used by SetupReduce) */
static int __Pyx__DelItemOnTypeDict(PyTypeObject *tp, PyObject *k) {
    int result;
    PyObject *tp_dict;
#if CYTHON_COMPILING_IN_LIMITED_API
    tp_dict = __Pyx_GetTypeTypeDict(tp);
    if (unlikely(!tp_dict)) return -1;
#else
    tp_dict = tp->tp_dict;
#endif
    result = PyDict_DelItem(tp_dict, k);
    if (likely(!result)) PyType_Modified(tp);
    return result;
}

/* SetItemOnTypeDict (used by SetupReduce) */
static int __Pyx__SetItemOnTypeDict(PyTypeObject *tp, PyObject *k, PyObject *v) {
    int result;
    PyObject *tp_dict;
#if CYTHON_COMPILING_IN_LIMITED_API
    tp_dict = __Pyx_GetTypeTypeDict(tp);
    if (unlikely(!tp_dict)) return -1;
#else
    tp_dict = tp->tp_dict;
#endif
    result = PyDict_SetItem(tp_dict, k, v);
    if (likely(!result)) {
        PyType_Modified(tp);
        if (unlikely(PyObject_HasAttr(v, __pyx_mstate_global->__pyx_n_u_set_name))) {
            PyObject *setNameResult = PyObject_CallMethodObjArgs(v, __pyx_mstate_global->__pyx_n_u_set_name,  (PyObject *) tp, k, NULL);
            if (!setNameResult) return -1;
            Py_DECREF(setNameResult);
        }
    }
    return result;
}

/* SetupReduce */
static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
  int ret;
  PyObject *name_attr;
  name_attr = __Pyx_PyObject_GetAttrStrNoError(meth, __pyx_mstate_global->__pyx_n_u_name);
  if (likely(name_attr)) {
      ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
  } else {
      ret = -1;
  }
  if (unlikely(ret < 0) && __Pyx_IgnoreException(PyExc_Exception)) {
      ret = 0;  // But BaseException is still propagated.
  }
  Py_XDECREF(name_attr);
  return ret;
}
static PyObject *__Pyx_setup_reduce_get_reduce_attribute(PyObject *type_obj, PyObject *name, int allow_not_present) {
#if CYTHON_USE_PYTYPE_LOOKUP
    CYTHON_UNUSED_VAR(allow_not_present);
    return _PyType_Lookup((PyTypeObject*)type_obj, name);
#else
    if (allow_not_present) {
        return __Pyx_PyObject_GetAttrStrNoError(type_obj, name);
    } else {
        return __Pyx_PyObject_GetAttrStr(type_obj, name);
    }
#endif
}
static int __Pyx_setup_reduce(PyObject* type_obj) {
    int ret = 0;
    PyObject *object_reduce = NULL;
    PyObject *object_getstate = NULL;
    PyObject *object_reduce_ex = NULL;
    PyObject *reduce = NULL;
    PyObject *reduce_ex = NULL;
    PyObject *reduce_cython = NULL;
    PyObject *setstate = NULL;
    PyObject *setstate_cython = NULL;
    PyObject *getstate = NULL;
    getstate = __Pyx_setup_reduce_get_reduce_attribute(type_obj, __pyx_mstate_global->__pyx_n_u_getstate, 1);
    if (!getstate && PyErr_Occurred()) {
        goto __PYX_BAD;
    }
    if (getstate) {
        object_getstate = __Pyx_setup_reduce_get_reduce_attribute((PyObject*)&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_getstate, 1);
        if (!object_getstate && PyErr_Occurred()) {
            goto __PYX_BAD;
        }
        if (object_getstate != getstate) {
            goto __PYX_GOOD;
        }
    }
    object_reduce_ex = __Pyx_setup_reduce_get_reduce_attribute((PyObject*)&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_reduce_ex, 0);
    if (unlikely(!object_reduce_ex)) goto __PYX_BAD;
    reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_mstate_global->__pyx_n_u_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
    if (reduce_ex == object_reduce_ex) {
        object_reduce = __Pyx_setup_reduce_get_reduce_attribute((PyObject*)&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_reduce, 0);
        if (!object_reduce) goto __PYX_BAD;
        reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_mstate_global->__pyx_n_u_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
        int try_to_replace_reduce = (reduce == object_reduce);
        if (!try_to_replace_reduce) {
            try_to_replace_reduce = __Pyx_setup_reduce_is_named(reduce, __pyx_mstate_global->__pyx_n_u_reduce_cython);
            if (unlikely(try_to_replace_reduce < 0)) {
                goto __PYX_BAD;
            }
        }
        if (try_to_replace_reduce) {
            reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_mstate_global->__pyx_n_u_reduce_cython);
            if (likely(reduce_cython)) {
                ret = __Pyx_SetItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
                ret = __Pyx_DelItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
            } else if (reduce == object_reduce || PyErr_Occurred()) {
                goto __PYX_BAD;
            }
            setstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_mstate_global->__pyx_n_u_setstate);
            int try_to_replace_setstate;
            if (!setstate) {
                PyObject *exc = PyErr_Occurred();
                if (exc && !__Pyx_IgnoreGivenException(exc, PyExc_Exception)) {
                    goto __PYX_BAD;
                }
                try_to_replace_setstate = 1;
            } else {
                try_to_replace_setstate = __Pyx_setup_reduce_is_named(setstate, __pyx_mstate_global->__pyx_n_u_setstate_cython);
                if (unlikely(try_to_replace_setstate < 0)) {
                    goto __PYX_BAD;
                }
            }
            if (try_to_replace_setstate) {
                setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_mstate_global->__pyx_n_u_setstate_cython);
                if (likely(setstate_cython)) {
                    ret = __Pyx_SetItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
                    ret = __Pyx_DelItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
                } else if (!setstate || PyErr_Occurred()) {
                    goto __PYX_BAD;
                }
            }
            PyType_Modified((PyTypeObject*)type_obj);
        }
    }
    goto __PYX_GOOD;
__PYX_BAD:
    if (!PyErr_Occurred()) {
        __Pyx_RaiseErrorWithType(
            PyExc_RuntimeError,
            "Unable to initialize pickling for " __Pyx_FMT_TYPENAME,
            (PyTypeObject*)type_obj);
    }
    ret = -1;
__PYX_GOOD:
#if !CYTHON_USE_PYTYPE_LOOKUP
    Py_XDECREF(object_reduce);
    Py_XDECREF(object_reduce_ex);
    Py_XDECREF(object_getstate);
    Py_XDECREF(getstate);
#endif
    Py_XDECREF(reduce);
    Py_XDECREF(reduce_ex);
    Py_XDECREF(reduce_cython);
    Py_XDECREF(setstate);
    Py_XDECREF(setstate_cython);
    return ret;
}

/* TypeImport */
#ifndef __PYX_HAVE_RT_ImportType_3_3_0
#define __PYX_HAVE_RT_ImportType_3_3_0
static PyTypeObject *__Pyx_ImportType_3_3_0(PyObject *module, const char *module_name, const char *class_name,
    size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_3_0 check_size)
{
    PyObject *result = 0;
    Py_ssize_t basicsize;
    Py_ssize_t itemsize;
#if defined(Py_LIMITED_API) || (defined(CYTHON_COMPILING_IN_LIMITED_API) && CYTHON_COMPILING_IN_LIMITED_API)
    PyObject *py_basicsize;
    PyObject *py_itemsize;
#endif
    result = PyObject_GetAttrString(module, class_name);
    if (!result)
        goto bad;
    if (!PyType_Check(result)) {
        PyErr_Format(PyExc_TypeError,
            "%.200s.%.200s is not a type object",
            module_name, class_name);
        goto bad;
    }
#if !( defined(Py_LIMITED_API) || (defined(CYTHON_COMPILING_IN_LIMITED_API) && CYTHON_COMPILING_IN_LIMITED_API) )
    basicsize = ((PyTypeObject *)result)->tp_basicsize;
    itemsize = ((PyTypeObject *)result)->tp_itemsize;
#else
    if (size == 0) {
        return (PyTypeObject *)result;
    }
    py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
    if (!py_basicsize)
        goto bad;
    basicsize = PyLong_AsSsize_t(py_basicsize);
    Py_DECREF(py_basicsize);
    py_basicsize = 0;
    if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
        goto bad;
    py_itemsize = PyObject_GetAttrString(result, "__itemsize__");
    if (!py_itemsize)
        goto bad;
    itemsize = PyLong_AsSsize_t(py_itemsize);
    Py_DECREF(py_itemsize);
    py_itemsize = 0;
    if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred())
        goto bad;
#endif
    if (itemsize) {
        if (size % alignment) {
            alignment = size % alignment;
        }
        if (itemsize < (Py_ssize_t)alignment)
            itemsize = (Py_ssize_t)alignment;
    }
    if ((size_t)(basicsize + itemsize) < size) {
        PyErr_Format(PyExc_ValueError,
            "%.200s.%.200s size changed, may indicate binary incompatibility. "
            "Expected %zd from C header, got %zd from PyObject",
            module_name, class_name, size, basicsize+itemsize);
        goto bad;
    }
    if (check_size == __Pyx_ImportType_CheckSize_Error_3_3_0 &&
            ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) {
        PyErr_Format(PyExc_ValueError,
            "%.200s.%.200s size changed, may indicate binary incompatibility. "
            "Expected %zd from C header, got %zd-%zd from PyObject",
            module_name, class_name, size, basicsize, basicsize+itemsize);
        goto bad;
    }
    else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_3_0 && (size_t)basicsize > size) {
        if (PyErr_WarnFormat(NULL, 0,
                "%.200s.%.200s size changed, may indicate binary incompatibility. "
                "Expected %zd from C header, got %zd from PyObject",
                module_name, class_name, size, basicsize) < 0) {
            goto bad;
        }
    }
    return (PyTypeObject *)result;
bad:
    Py_XDECREF(result);
    return NULL;
}
#endif

/* 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_mstate_global->__pyx_kp_u__15);
        if (unlikely(!module_dot)) { goto modbad; }
        full_name = PyUnicode_Concat(module_dot, name);
        if (unlikely(!full_name)) { goto modbad; }
        #if (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM  < 0x07030400) ||\
                CYTHON_COMPILING_IN_GRAAL
        {
            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, "cannot import name %S", name);
    }
    return value;
}

/* GetNameInClass */
static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name) {
    PyObject *result;
    PyObject *dict;
    assert(PyType_Check(nmspace));
#if CYTHON_USE_TYPE_SLOTS
    dict = ((PyTypeObject*)nmspace)->tp_dict;
    Py_XINCREF(dict);
#else
    dict = PyObject_GetAttr(nmspace, __pyx_mstate_global->__pyx_n_u_dict);
#endif
    if (likely(dict)) {
        result = PyObject_GetItem(dict, name);
        Py_DECREF(dict);
        if (result) {
            return result;
        }
    }
    if (!__Pyx_IgnoreException(PyExc_Exception)) {
        return NULL; // BaseException
    }
    __Pyx_GetModuleGlobalNameUncached(result, name);
    return result;
}

/* CLineInTraceback (used by AddTraceback) */
#if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
#define __Pyx_PyProbablyModule_GetDict(o) __Pyx_XNewRef(PyModule_GetDict(o))
#elif !CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
#define __Pyx_PyProbablyModule_GetDict(o) PyObject_GenericGetDict(o, NULL);
#else
PyObject* __Pyx_PyProbablyModule_GetDict(PyObject *o) {
    PyObject **dict_ptr = _PyObject_GetDictPtr(o);
    return dict_ptr ? __Pyx_XNewRef(*dict_ptr) : NULL;
}
#endif
static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) {
    PyObject *use_cline = NULL;
    PyObject *ptype, *pvalue, *ptraceback;
    PyObject *cython_runtime_dict;
    CYTHON_MAYBE_UNUSED_VAR(tstate);
    if (unlikely(!__pyx_mstate_global->__pyx_cython_runtime)) {
        return c_line;
    }
    __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
    cython_runtime_dict = __Pyx_PyProbablyModule_GetDict(__pyx_mstate_global->__pyx_cython_runtime);
    if (likely(cython_runtime_dict)) {
        __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
            use_cline, cython_runtime_dict,
            __Pyx_PyDict_SetDefault(cython_runtime_dict, __pyx_mstate_global->__pyx_n_u_cline_in_traceback, Py_False))
    }
    if (use_cline == NULL || use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
        c_line = 0;
    }
    Py_XDECREF(use_cline);
    Py_XDECREF(cython_runtime_dict);
    __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
    return c_line;
}
#endif

/* CodeObjectCache (used by AddTraceback) */
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 __Pyx_CachedCodeObjectType *__pyx__find_code_object(struct __Pyx_CodeObjectCache *code_cache, int code_line) {
    __Pyx_CachedCodeObjectType* code_object;
    int pos;
    if (unlikely(!code_line) || unlikely(!code_cache->entries)) {
        return NULL;
    }
    pos = __pyx_bisect_code_objects(code_cache->entries, code_cache->count, code_line);
    if (unlikely(pos >= code_cache->count) || unlikely(code_cache->entries[pos].code_line != code_line)) {
        return NULL;
    }
    code_object = code_cache->entries[pos].code_object;
    Py_INCREF(code_object);
    return code_object;
}
static __Pyx_CachedCodeObjectType *__pyx_find_code_object(int code_line) {
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS
    (void)__pyx__find_code_object;
    return NULL; // Most implementation should have atomics. But otherwise, don't make it thread-safe, just miss.
#else
    struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache;
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    __pyx_nonatomic_int_type old_count = __pyx_atomic_incr_acq_rel(&code_cache->accessor_count);
    if (old_count < 0) {
        __pyx_atomic_decr_acq_rel(&code_cache->accessor_count);
        return NULL;
    }
#endif
    __Pyx_CachedCodeObjectType *result = __pyx__find_code_object(code_cache, code_line);
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    __pyx_atomic_decr_acq_rel(&code_cache->accessor_count);
#endif
    return result;
#endif
}
static void __pyx__insert_code_object(struct __Pyx_CodeObjectCache *code_cache, int code_line, __Pyx_CachedCodeObjectType* code_object)
{
    int pos, i;
    __Pyx_CodeObjectCacheEntry* entries = code_cache->entries;
    if (unlikely(!code_line)) {
        return;
    }
    if (unlikely(!entries)) {
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
        if (likely(entries)) {
            code_cache->entries = entries;
            code_cache->max_count = 64;
            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(code_cache->entries, code_cache->count, code_line);
    if ((pos < code_cache->count) && unlikely(code_cache->entries[pos].code_line == code_line)) {
        __Pyx_CachedCodeObjectType* tmp = entries[pos].code_object;
        entries[pos].code_object = code_object;
        Py_INCREF(code_object);
        Py_DECREF(tmp);
        return;
    }
    if (code_cache->count == code_cache->max_count) {
        int new_max = code_cache->max_count + 64;
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
            code_cache->entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
        if (unlikely(!entries)) {
            return;
        }
        code_cache->entries = entries;
        code_cache->max_count = new_max;
    }
    for (i=code_cache->count; i>pos; i--) {
        entries[i] = entries[i-1];
    }
    entries[pos].code_line = code_line;
    entries[pos].code_object = code_object;
    code_cache->count++;
    Py_INCREF(code_object);
}
static void __pyx_insert_code_object(int code_line, __Pyx_CachedCodeObjectType* code_object) {
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS
    (void)__pyx__insert_code_object;
    return; // Most implementation should have atomics. But otherwise, don't make it thread-safe, just fail.
#else
    struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache;
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    __pyx_nonatomic_int_type expected = 0;
    if (!__pyx_atomic_int_cmp_exchange(&code_cache->accessor_count, &expected, INT_MIN)) {
        return;
    }
#endif
    __pyx__insert_code_object(code_cache, code_line, code_object);
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    __pyx_atomic_sub(&code_cache->accessor_count, INT_MIN);
#endif
#endif
}

/* AddTraceback */
#include "compile.h"
#include "frameobject.h"
#include "traceback.h"
#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION)
  #ifndef Py_BUILD_CORE
    #define Py_BUILD_CORE 1
  #endif
  #include "internal/pycore_frame.h"
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict,
                                                       PyObject *firstlineno, PyObject *name) {
    PyObject *replace = NULL;
    if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL;
    if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL;
    replace = PyObject_GetAttrString(code, "replace");
    if (likely(replace)) {
        PyObject *result = PyObject_Call(replace, __pyx_mstate_global->__pyx_empty_tuple, scratch_dict);
        Py_DECREF(replace);
        return result;
    }
    return NULL;
}
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) {
        c_line = __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line);
    }
    __Pyx_PyErr_FetchException(&exc_type, &exc_value, &exc_traceback);
    code_object = __pyx_find_code_object(c_line ? -c_line : py_line);
    if (!code_object) {
        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;
        if (c_line) {
            py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        } else {
            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;
        __pyx_insert_code_object(c_line ? -c_line : py_line, code_object);
    } else {
        dict = PyDict_New();
    }
    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:
    __Pyx_PyErr_RestoreException(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 (c_line) {
        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;
    }
    py_code = PyCode_NewEmpty(filename, funcname, py_line);
    Py_XDECREF(py_funcname);
    return py_code;
bad:
    Py_XDECREF(py_funcname);
    return NULL;
}
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyFrameObject *py_frame = 0;
    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_mstate_global->__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

/* PyObjectCallMethod1 */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
#if CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || !CYTHON_COMPILING_IN_LIMITED_API)
    PyObject *args[2] = {obj, arg};
    return PyObject_VectorcallMethod(method_name, args, 2 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
#elif CYTHON_COMPILING_IN_LIMITED_API
    return PyObject_CallMethodObjArgs(obj, method_name, arg, NULL);
#else
    return PyObject_CallMethodOneArg(obj, method_name, arg);
#endif
}

/* CheckUnpickleChecksumError */
static void __Pyx_RaiseUnpickleChecksumError(long checksum, long checksum1, long checksum2, long checksum3, const char *members) {
    PyObject *pickle_module = PyImport_ImportModule("pickle");
    if (unlikely(!pickle_module)) return;
    PyObject *pickle_error = PyObject_GetAttrString(pickle_module, "PickleError");
    Py_DECREF(pickle_module);
    if (unlikely(!pickle_error)) return;
    if (checksum2 == checksum1) {
        PyErr_Format(pickle_error, "Incompatible checksums (0x%x vs (0x%x) = (%s))",
            checksum, checksum1, members);
    } else if (checksum3 == checksum2) {
        PyErr_Format(pickle_error, "Incompatible checksums (0x%x vs (0x%x, 0x%x) = (%s))",
            checksum, checksum1, checksum2, members);
    } else {
        PyErr_Format(pickle_error, "Incompatible checksums (0x%x vs (0x%x, 0x%x, 0x%x) = (%s))",
            checksum, checksum1, checksum2, checksum3, members);
    }
    Py_DECREF(pickle_error);
}

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

/* UpdateUnpickledDict */
static int __Pyx__UpdateUnpickledDict(PyObject *obj, PyObject *state, Py_ssize_t index) {
    PyObject *state_dict = __Pyx_PySequence_ITEM(state, index);
    if (unlikely(!state_dict)) {
        return -1;
    }
    int non_empty = PyObject_IsTrue(state_dict);
    if (non_empty == 0) {
        Py_DECREF(state_dict);
        return 0;
    } else if (unlikely(non_empty == -1)) {
        return -1;
    }
    PyObject *dict;
    #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
    dict = PyObject_GetAttrString(obj, "__dict__");
    #else
    dict = PyObject_GenericGetDict(obj, NULL);
    #endif
    if (unlikely(!dict)) {
        Py_DECREF(state_dict);
        return -1;
    }
    int result;
    if (likely(PyDict_CheckExact(dict))) {
        result = PyDict_Update(dict, state_dict);
    } else {
        PyObject *obj_result = __Pyx_PyObject_CallMethod1(dict, __pyx_mstate_global->__pyx_n_u_update, state_dict);
        if (likely(obj_result)) {
            Py_DECREF(obj_result);
            result = 0;
        } else {
            result = -1;
        }
    }
    Py_DECREF(state_dict);
    Py_DECREF(dict);
    return result;
}
static int __Pyx_UpdateUnpickledDict(PyObject *obj, PyObject *state, Py_ssize_t index) {
    Py_ssize_t state_size = __Pyx_PyTuple_GET_SIZE(state);
    #if !CYTHON_ASSUME_SAFE_SIZE
    if (unlikely(state_size == -1)) return -1;
    #endif
    if (state_size <= index) {
        return 0;
    }
    return __Pyx__UpdateUnpickledDict(obj, state, index);
}

/* CheckUnpickleChecksum */
static int __Pyx_CheckUnpickleChecksum(long checksum, long checksum1, long checksum2, long checksum3, const char *members) {
    int found = 0;
    found |= checksum1 == checksum;
    found |= checksum2 == checksum;
    found |= checksum3 == checksum;
    if (likely(found))
        return 0;
    __Pyx_RaiseUnpickleChecksumError(checksum, checksum1, checksum2, checksum3, members);
    return -1;
}

/* CIntFromPy */
static int __Pyx_LargePyLong___Pyx_PyLong_As_int(PyObject *x);
static int __Pyx_raise_neg_overflow___Pyx_PyLong_As_int(void) {
    const char* type_name = "int";
    PyErr_Format(PyExc_OverflowError,
        "can't convert negative value to %.200s", type_name);
    return (int) -1;
}
static int __Pyx_raise_overflow___Pyx_PyLong_As_int(void) {
    const char* type_name = "int";
    PyErr_Format(PyExc_OverflowError,
        "value too large to convert to %.200s", type_name);
    return (int) -1;
}
static CYTHON_INLINE int __Pyx_PyULong___Pyx_PyLong_As_int(PyObject *x) {
    const int is_unsigned = 1;
#if CYTHON_USE_PYLONG_INTERNALS
    {
        const digit* digits = __Pyx_PyLong_Digits(x);
        const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
        if (size == 2 && (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]));
            }
        } else
        if (size == 3 && (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]));
            }
        } else
        if (size == 4 && (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]));
            }
        } else
        {}
    }
#elif 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))
    } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) {
        __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
    }
    return __Pyx_LargePyLong___Pyx_PyLong_As_int(x);
raise_neg_overflow:
    return __Pyx_raise_neg_overflow___Pyx_PyLong_As_int();
raise_overflow:
    return __Pyx_raise_overflow___Pyx_PyLong_As_int();
}
static CYTHON_INLINE int __Pyx_PySLong___Pyx_PyLong_As_int(PyObject *x) {
    const int is_unsigned = 0;
#if CYTHON_USE_PYLONG_INTERNALS
    if (__Pyx_PyLong_IsNeg(x)) {
        const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
        const digit* digits = __Pyx_PyLong_Digits(x);
        if (size == 2 && (8 * sizeof(int) > 1 * PyLong_SHIFT)) {
            if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
                long ival = - (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                __PYX_VERIFY_RETURN_INT(int, long, ival)
            } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
                return (int) (((int) -1) * (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
            }
        } else
        if (size == 3 && (8 * sizeof(int) > 2 * PyLong_SHIFT)) {
            if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
                long ival = - (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                __PYX_VERIFY_RETURN_INT(int, long, ival)
            } 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])));
            }
        } else
        if (size == 4 && (8 * sizeof(int) > 3 * PyLong_SHIFT)) {
            if ((8 * sizeof(long) > 4 * PyLong_SHIFT)) {
                long ival = - (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                __PYX_VERIFY_RETURN_INT(int, long, ival)
            } 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])));
            }
        } else
        {}
    } else {
        const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
        const digit* digits = __Pyx_PyLong_Digits(x);
        if (size == 2 && (8 * sizeof(int) > 1 * PyLong_SHIFT)) {
            if ((8 * sizeof(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]));
            }
        } else
        if (size == 3 && (8 * sizeof(int) > 2 * PyLong_SHIFT)) {
            if ((8 * sizeof(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]));
            }
        } else
        if (size == 4 && (8 * sizeof(int) > 3 * PyLong_SHIFT)) {
            if ((8 * sizeof(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]));
            }
        } else
        {}
    }
#endif
    #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
    if ((sizeof(int) <= sizeof(int)) && (sizeof(int) < sizeof(long))) {
        __PYX_VERIFY_RETURN_INT_EXC(int, int, PyLong_AsInt(x))
    } else
    #endif
    if ((sizeof(int) <= sizeof(long))) {
        __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
    } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) {
        __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
    }
    return __Pyx_LargePyLong___Pyx_PyLong_As_int(x);
raise_neg_overflow:
    return __Pyx_raise_neg_overflow___Pyx_PyLong_As_int();
raise_overflow:
    return __Pyx_raise_overflow___Pyx_PyLong_As_int();
}
static int __Pyx_LargePyLong___Pyx_PyLong_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;
    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);
    if ((0)) goto raise_overflow;
#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);
        PyErr_SetString(PyExc_OverflowError,
            "can't convert negative value to int");
        return (int) -1;
    } 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:
    return __Pyx_raise_overflow___Pyx_PyLong_As_int();
}
static CYTHON_INLINE int __Pyx_PyLong___Pyx_PyLong_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 (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
        #endif
        {
            return __Pyx_PyULong___Pyx_PyLong_As_int(x);
        }
    } else {
        #if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else
        #endif
        {
            return __Pyx_PySLong___Pyx_PyLong_As_int(x);
        }
    }
#if CYTHON_USE_PYLONG_INTERNALS
raise_neg_overflow:
    return __Pyx_raise_neg_overflow___Pyx_PyLong_As_int();
raise_overflow:
    return __Pyx_raise_overflow___Pyx_PyLong_As_int();
#endif
}
static int __Pyx_NonPyLong___Pyx_PyLong_As_int(PyObject *x) {
    int val;
    PyObject *tmp = __Pyx_PyNumber_Long(x);
    if (!tmp) return (int) -1;
    val = __Pyx_PyLong_As_int(tmp);
    Py_DECREF(tmp);
    return val;
}
static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *x) {
    if (likely(PyLong_Check(x))) {
        return __Pyx_PyLong___Pyx_PyLong_As_int(x);
    } else {
        return __Pyx_NonPyLong___Pyx_PyLong_As_int(x);
    }
}

/* CIntFromPy */
static uint16_t __Pyx_LargePyLong___Pyx_PyLong_As_uint16_t(PyObject *x);
static uint16_t __Pyx_raise_neg_overflow___Pyx_PyLong_As_uint16_t(void) {
    const char* type_name = "uint16_t";
    PyErr_Format(PyExc_OverflowError,
        "can't convert negative value to %.200s", type_name);
    return (uint16_t) -1;
}
static uint16_t __Pyx_raise_overflow___Pyx_PyLong_As_uint16_t(void) {
    const char* type_name = "uint16_t";
    PyErr_Format(PyExc_OverflowError,
        "value too large to convert to %.200s", type_name);
    return (uint16_t) -1;
}
static CYTHON_INLINE uint16_t __Pyx_PyULong___Pyx_PyLong_As_uint16_t(PyObject *x) {
    const int is_unsigned = 1;
#if CYTHON_USE_PYLONG_INTERNALS
    {
        const digit* digits = __Pyx_PyLong_Digits(x);
        const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
        if (size == 2 && (8 * sizeof(uint16_t) > 1 * PyLong_SHIFT)) {
            if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                __PYX_VERIFY_RETURN_INT(uint16_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
            } else if ((8 * sizeof(uint16_t) >= 2 * PyLong_SHIFT)) {
                return (uint16_t) (((((uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0]));
            }
        } else
        if (size == 3 && (8 * sizeof(uint16_t) > 2 * PyLong_SHIFT)) {
            if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                __PYX_VERIFY_RETURN_INT(uint16_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
            } else if ((8 * sizeof(uint16_t) >= 3 * PyLong_SHIFT)) {
                return (uint16_t) (((((((uint16_t)digits[2]) << PyLong_SHIFT) | (uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0]));
            }
        } else
        if (size == 4 && (8 * sizeof(uint16_t) > 3 * PyLong_SHIFT)) {
            if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                __PYX_VERIFY_RETURN_INT(uint16_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
            } else if ((8 * sizeof(uint16_t) >= 4 * PyLong_SHIFT)) {
                return (uint16_t) (((((((((uint16_t)digits[3]) << PyLong_SHIFT) | (uint16_t)digits[2]) << PyLong_SHIFT) | (uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0]));
            }
        } else
        {}
    }
#elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
    if (unlikely(Py_SIZE(x) < 0)) {
        goto raise_neg_overflow;
    }
#else
    {
        int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
        if (unlikely(result < 0))
            return (uint16_t) -1;
        if (unlikely(result == 1))
            goto raise_neg_overflow;
    }
#endif
    if ((sizeof(uint16_t) <= sizeof(unsigned long))) {
        __PYX_VERIFY_RETURN_INT_EXC(uint16_t, unsigned long, PyLong_AsUnsignedLong(x))
    } else if ((sizeof(uint16_t) <= sizeof(unsigned PY_LONG_LONG))) {
        __PYX_VERIFY_RETURN_INT_EXC(uint16_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
    }
    return __Pyx_LargePyLong___Pyx_PyLong_As_uint16_t(x);
raise_neg_overflow:
    return __Pyx_raise_neg_overflow___Pyx_PyLong_As_uint16_t();
raise_overflow:
    return __Pyx_raise_overflow___Pyx_PyLong_As_uint16_t();
}
static CYTHON_INLINE uint16_t __Pyx_PySLong___Pyx_PyLong_As_uint16_t(PyObject *x) {
    const int is_unsigned = 0;
#if CYTHON_USE_PYLONG_INTERNALS
    if (__Pyx_PyLong_IsNeg(x)) {
        const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
        const digit* digits = __Pyx_PyLong_Digits(x);
        if (size == 2 && (8 * sizeof(uint16_t) > 1 * PyLong_SHIFT)) {
            if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
                long ival = - (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                __PYX_VERIFY_RETURN_INT(uint16_t, long, ival)
            } else if ((8 * sizeof(uint16_t) - 1 > 2 * PyLong_SHIFT)) {
                return (uint16_t) (((uint16_t) -1) * (((((uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0])));
            }
        } else
        if (size == 3 && (8 * sizeof(uint16_t) > 2 * PyLong_SHIFT)) {
            if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
                long ival = - (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                __PYX_VERIFY_RETURN_INT(uint16_t, long, ival)
            } else if ((8 * sizeof(uint16_t) - 1 > 3 * PyLong_SHIFT)) {
                return (uint16_t) (((uint16_t) -1) * (((((((uint16_t)digits[2]) << PyLong_SHIFT) | (uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0])));
            }
        } else
        if (size == 4 && (8 * sizeof(uint16_t) > 3 * PyLong_SHIFT)) {
            if ((8 * sizeof(long) > 4 * PyLong_SHIFT)) {
                long ival = - (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                __PYX_VERIFY_RETURN_INT(uint16_t, long, ival)
            } else if ((8 * sizeof(uint16_t) - 1 > 4 * PyLong_SHIFT)) {
                return (uint16_t) (((uint16_t) -1) * (((((((((uint16_t)digits[3]) << PyLong_SHIFT) | (uint16_t)digits[2]) << PyLong_SHIFT) | (uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0])));
            }
        } else
        {}
    } else {
        const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
        const digit* digits = __Pyx_PyLong_Digits(x);
        if (size == 2 && (8 * sizeof(uint16_t) > 1 * PyLong_SHIFT)) {
            if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
                __PYX_VERIFY_RETURN_INT(uint16_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
            } else if ((8 * sizeof(uint16_t) - 1 > 2 * PyLong_SHIFT)) {
                return (uint16_t) (((((uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0]));
            }
        } else
        if (size == 3 && (8 * sizeof(uint16_t) > 2 * PyLong_SHIFT)) {
            if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
                __PYX_VERIFY_RETURN_INT(uint16_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
            } else if ((8 * sizeof(uint16_t) - 1 > 3 * PyLong_SHIFT)) {
                return (uint16_t) (((((((uint16_t)digits[2]) << PyLong_SHIFT) | (uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0]));
            }
        } else
        if (size == 4 && (8 * sizeof(uint16_t) > 3 * PyLong_SHIFT)) {
            if ((8 * sizeof(long) > 4 * PyLong_SHIFT)) {
                __PYX_VERIFY_RETURN_INT(uint16_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
            } else if ((8 * sizeof(uint16_t) - 1 > 4 * PyLong_SHIFT)) {
                return (uint16_t) (((((((((uint16_t)digits[3]) << PyLong_SHIFT) | (uint16_t)digits[2]) << PyLong_SHIFT) | (uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0]));
            }
        } else
        {}
    }
#endif
    #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
    if ((sizeof(uint16_t) <= sizeof(int)) && (sizeof(int) < sizeof(long))) {
        __PYX_VERIFY_RETURN_INT_EXC(uint16_t, int, PyLong_AsInt(x))
    } else
    #endif
    if ((sizeof(uint16_t) <= sizeof(long))) {
        __PYX_VERIFY_RETURN_INT_EXC(uint16_t, long, PyLong_AsLong(x))
    } else if ((sizeof(uint16_t) <= sizeof(PY_LONG_LONG))) {
        __PYX_VERIFY_RETURN_INT_EXC(uint16_t, PY_LONG_LONG, PyLong_AsLongLong(x))
    }
    return __Pyx_LargePyLong___Pyx_PyLong_As_uint16_t(x);
raise_neg_overflow:
    return __Pyx_raise_neg_overflow___Pyx_PyLong_As_uint16_t();
raise_overflow:
    return __Pyx_raise_overflow___Pyx_PyLong_As_uint16_t();
}
static uint16_t __Pyx_LargePyLong___Pyx_PyLong_As_uint16_t(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const uint16_t neg_one = (uint16_t) -1, const_zero = (uint16_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    uint16_t val;
    int ret = -1;
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
    Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
        x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
    if (unlikely(bytes_copied == -1)) {
    } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
        goto raise_overflow;
    } else {
        ret = 0;
    }
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
    int one = 1; int is_little = (int)*(unsigned char *)&one;
    unsigned char *bytes = (unsigned char *)&val;
    ret = _PyLong_AsByteArray((PyLongObject *)x,
                                bytes, sizeof(val),
                                is_little, !is_unsigned);
    if ((0)) goto raise_overflow;
#else
    PyObject *v;
    PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
    int bits, remaining_bits, is_negative = 0;
    int chunk_size = (sizeof(long) < 8) ? 30 : 62;
    if (likely(PyLong_CheckExact(x))) {
        v = __Pyx_NewRef(x);
    } else {
        v = PyNumber_Long(x);
        if (unlikely(!v)) return (uint16_t) -1;
        assert(PyLong_CheckExact(v));
    }
    {
        int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
        if (unlikely(result < 0)) {
            Py_DECREF(v);
            return (uint16_t) -1;
        }
        is_negative = result == 1;
    }
    if (is_unsigned && unlikely(is_negative)) {
        Py_DECREF(v);
        PyErr_SetString(PyExc_OverflowError,
            "can't convert negative value to uint16_t");
        return (uint16_t) -1;
    } else if (is_negative) {
        stepval = PyNumber_Invert(v);
        Py_DECREF(v);
        if (unlikely(!stepval))
            return (uint16_t) -1;
    } else {
        stepval = v;
    }
    v = NULL;
    val = (uint16_t) 0;
    mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
    shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
    for (bits = 0; bits < (int) sizeof(uint16_t) * 8 - chunk_size; bits += chunk_size) {
        PyObject *tmp, *digit;
        long idigit;
        digit = PyNumber_And(stepval, mask);
        if (unlikely(!digit)) goto done;
        idigit = PyLong_AsLong(digit);
        Py_DECREF(digit);
        if (unlikely(idigit < 0)) goto done;
        val |= ((uint16_t) idigit) << bits;
        tmp = PyNumber_Rshift(stepval, shift);
        if (unlikely(!tmp)) goto done;
        Py_DECREF(stepval); stepval = tmp;
    }
    Py_DECREF(shift); shift = NULL;
    Py_DECREF(mask); mask = NULL;
    {
        long idigit = PyLong_AsLong(stepval);
        if (unlikely(idigit < 0)) goto done;
        remaining_bits = ((int) sizeof(uint16_t) * 8) - bits - (is_unsigned ? 0 : 1);
        if (unlikely(idigit >= (1L << remaining_bits)))
            goto raise_overflow;
        val |= ((uint16_t) idigit) << bits;
    }
    if (!is_unsigned) {
        if (unlikely(val & (((uint16_t) 1) << (sizeof(uint16_t) * 8 - 1))))
            goto raise_overflow;
        if (is_negative)
            val = ~val;
    }
    ret = 0;
done:
    Py_XDECREF(shift);
    Py_XDECREF(mask);
    Py_XDECREF(stepval);
#endif
    if (unlikely(ret))
        return (uint16_t) -1;
    return val;
raise_overflow:
    return __Pyx_raise_overflow___Pyx_PyLong_As_uint16_t();
}
static CYTHON_INLINE uint16_t __Pyx_PyLong___Pyx_PyLong_As_uint16_t(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const uint16_t neg_one = (uint16_t) -1, const_zero = (uint16_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        #if CYTHON_USE_PYLONG_INTERNALS
        if (unlikely(__Pyx_PyLong_IsNeg(x))) {
            goto raise_neg_overflow;
        } else if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(uint16_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else
        #endif
        {
            return __Pyx_PyULong___Pyx_PyLong_As_uint16_t(x);
        }
    } else {
        #if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(uint16_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else
        #endif
        {
            return __Pyx_PySLong___Pyx_PyLong_As_uint16_t(x);
        }
    }
#if CYTHON_USE_PYLONG_INTERNALS
raise_neg_overflow:
    return __Pyx_raise_neg_overflow___Pyx_PyLong_As_uint16_t();
raise_overflow:
    return __Pyx_raise_overflow___Pyx_PyLong_As_uint16_t();
#endif
}
static uint16_t __Pyx_NonPyLong___Pyx_PyLong_As_uint16_t(PyObject *x) {
    uint16_t val;
    PyObject *tmp = __Pyx_PyNumber_Long(x);
    if (!tmp) return (uint16_t) -1;
    val = __Pyx_PyLong_As_uint16_t(tmp);
    Py_DECREF(tmp);
    return val;
}
static CYTHON_INLINE uint16_t __Pyx_PyLong_As_uint16_t(PyObject *x) {
    if (likely(PyLong_Check(x))) {
        return __Pyx_PyLong___Pyx_PyLong_As_uint16_t(x);
    } else {
        return __Pyx_NonPyLong___Pyx_PyLong_As_uint16_t(x);
    }
}

/* CIntFromPy */
static unsigned short __Pyx_LargePyLong___Pyx_PyLong_As_unsigned_short(PyObject *x);
static unsigned short __Pyx_raise_neg_overflow___Pyx_PyLong_As_unsigned_short(void) {
    const char* type_name = "unsigned short";
    PyErr_Format(PyExc_OverflowError,
        "can't convert negative value to %.200s", type_name);
    return (unsigned short) -1;
}
static unsigned short __Pyx_raise_overflow___Pyx_PyLong_As_unsigned_short(void) {
    const char* type_name = "unsigned short";
    PyErr_Format(PyExc_OverflowError,
        "value too large to convert to %.200s", type_name);
    return (unsigned short) -1;
}
static CYTHON_INLINE unsigned short __Pyx_PyULong___Pyx_PyLong_As_unsigned_short(PyObject *x) {
    const int is_unsigned = 1;
#if CYTHON_USE_PYLONG_INTERNALS
    {
        const digit* digits = __Pyx_PyLong_Digits(x);
        const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
        if (size == 2 && (8 * sizeof(unsigned short) > 1 * PyLong_SHIFT)) {
            if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                __PYX_VERIFY_RETURN_INT(unsigned short, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
            } else if ((8 * sizeof(unsigned short) >= 2 * PyLong_SHIFT)) {
                return (unsigned short) (((((unsigned short)digits[1]) << PyLong_SHIFT) | (unsigned short)digits[0]));
            }
        } else
        if (size == 3 && (8 * sizeof(unsigned short) > 2 * PyLong_SHIFT)) {
            if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                __PYX_VERIFY_RETURN_INT(unsigned short, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
            } else if ((8 * sizeof(unsigned short) >= 3 * PyLong_SHIFT)) {
                return (unsigned short) (((((((unsigned short)digits[2]) << PyLong_SHIFT) | (unsigned short)digits[1]) << PyLong_SHIFT) | (unsigned short)digits[0]));
            }
        } else
        if (size == 4 && (8 * sizeof(unsigned short) > 3 * PyLong_SHIFT)) {
            if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                __PYX_VERIFY_RETURN_INT(unsigned short, 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(unsigned short) >= 4 * PyLong_SHIFT)) {
                return (unsigned short) (((((((((unsigned short)digits[3]) << PyLong_SHIFT) | (unsigned short)digits[2]) << PyLong_SHIFT) | (unsigned short)digits[1]) << PyLong_SHIFT) | (unsigned short)digits[0]));
            }
        } else
        {}
    }
#elif 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 (unsigned short) -1;
        if (unlikely(result == 1))
            goto raise_neg_overflow;
    }
#endif
    if ((sizeof(unsigned short) <= sizeof(unsigned long))) {
        __PYX_VERIFY_RETURN_INT_EXC(unsigned short, unsigned long, PyLong_AsUnsignedLong(x))
    } else if ((sizeof(unsigned short) <= sizeof(unsigned PY_LONG_LONG))) {
        __PYX_VERIFY_RETURN_INT_EXC(unsigned short, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
    }
    return __Pyx_LargePyLong___Pyx_PyLong_As_unsigned_short(x);
raise_neg_overflow:
    return __Pyx_raise_neg_overflow___Pyx_PyLong_As_unsigned_short();
raise_overflow:
    return __Pyx_raise_overflow___Pyx_PyLong_As_unsigned_short();
}
static CYTHON_INLINE unsigned short __Pyx_PySLong___Pyx_PyLong_As_unsigned_short(PyObject *x) {
    const int is_unsigned = 0;
#if CYTHON_USE_PYLONG_INTERNALS
    if (__Pyx_PyLong_IsNeg(x)) {
        const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
        const digit* digits = __Pyx_PyLong_Digits(x);
        if (size == 2 && (8 * sizeof(unsigned short) > 1 * PyLong_SHIFT)) {
            if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
                long ival = - (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                __PYX_VERIFY_RETURN_INT(unsigned short, long, ival)
            } else if ((8 * sizeof(unsigned short) - 1 > 2 * PyLong_SHIFT)) {
                return (unsigned short) (((unsigned short) -1) * (((((unsigned short)digits[1]) << PyLong_SHIFT) | (unsigned short)digits[0])));
            }
        } else
        if (size == 3 && (8 * sizeof(unsigned short) > 2 * PyLong_SHIFT)) {
            if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
                long ival = - (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                __PYX_VERIFY_RETURN_INT(unsigned short, long, ival)
            } else if ((8 * sizeof(unsigned short) - 1 > 3 * PyLong_SHIFT)) {
                return (unsigned short) (((unsigned short) -1) * (((((((unsigned short)digits[2]) << PyLong_SHIFT) | (unsigned short)digits[1]) << PyLong_SHIFT) | (unsigned short)digits[0])));
            }
        } else
        if (size == 4 && (8 * sizeof(unsigned short) > 3 * PyLong_SHIFT)) {
            if ((8 * sizeof(long) > 4 * PyLong_SHIFT)) {
                long ival = - (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                __PYX_VERIFY_RETURN_INT(unsigned short, long, ival)
            } else if ((8 * sizeof(unsigned short) - 1 > 4 * PyLong_SHIFT)) {
                return (unsigned short) (((unsigned short) -1) * (((((((((unsigned short)digits[3]) << PyLong_SHIFT) | (unsigned short)digits[2]) << PyLong_SHIFT) | (unsigned short)digits[1]) << PyLong_SHIFT) | (unsigned short)digits[0])));
            }
        } else
        {}
    } else {
        const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
        const digit* digits = __Pyx_PyLong_Digits(x);
        if (size == 2 && (8 * sizeof(unsigned short) > 1 * PyLong_SHIFT)) {
            if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
                __PYX_VERIFY_RETURN_INT(unsigned short, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
            } else if ((8 * sizeof(unsigned short) - 1 > 2 * PyLong_SHIFT)) {
                return (unsigned short) (((((unsigned short)digits[1]) << PyLong_SHIFT) | (unsigned short)digits[0]));
            }
        } else
        if (size == 3 && (8 * sizeof(unsigned short) > 2 * PyLong_SHIFT)) {
            if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
                __PYX_VERIFY_RETURN_INT(unsigned short, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
            } else if ((8 * sizeof(unsigned short) - 1 > 3 * PyLong_SHIFT)) {
                return (unsigned short) (((((((unsigned short)digits[2]) << PyLong_SHIFT) | (unsigned short)digits[1]) << PyLong_SHIFT) | (unsigned short)digits[0]));
            }
        } else
        if (size == 4 && (8 * sizeof(unsigned short) > 3 * PyLong_SHIFT)) {
            if ((8 * sizeof(long) > 4 * PyLong_SHIFT)) {
                __PYX_VERIFY_RETURN_INT(unsigned short, 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(unsigned short) - 1 > 4 * PyLong_SHIFT)) {
                return (unsigned short) (((((((((unsigned short)digits[3]) << PyLong_SHIFT) | (unsigned short)digits[2]) << PyLong_SHIFT) | (unsigned short)digits[1]) << PyLong_SHIFT) | (unsigned short)digits[0]));
            }
        } else
        {}
    }
#endif
    #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
    if ((sizeof(unsigned short) <= sizeof(int)) && (sizeof(int) < sizeof(long))) {
        __PYX_VERIFY_RETURN_INT_EXC(unsigned short, int, PyLong_AsInt(x))
    } else
    #endif
    if ((sizeof(unsigned short) <= sizeof(long))) {
        __PYX_VERIFY_RETURN_INT_EXC(unsigned short, long, PyLong_AsLong(x))
    } else if ((sizeof(unsigned short) <= sizeof(PY_LONG_LONG))) {
        __PYX_VERIFY_RETURN_INT_EXC(unsigned short, PY_LONG_LONG, PyLong_AsLongLong(x))
    }
    return __Pyx_LargePyLong___Pyx_PyLong_As_unsigned_short(x);
raise_neg_overflow:
    return __Pyx_raise_neg_overflow___Pyx_PyLong_As_unsigned_short();
raise_overflow:
    return __Pyx_raise_overflow___Pyx_PyLong_As_unsigned_short();
}
static unsigned short __Pyx_LargePyLong___Pyx_PyLong_As_unsigned_short(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const unsigned short neg_one = (unsigned short) -1, const_zero = (unsigned short) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    unsigned short 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);
    if ((0)) goto raise_overflow;
#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 (unsigned short) -1;
        assert(PyLong_CheckExact(v));
    }
    {
        int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
        if (unlikely(result < 0)) {
            Py_DECREF(v);
            return (unsigned short) -1;
        }
        is_negative = result == 1;
    }
    if (is_unsigned && unlikely(is_negative)) {
        Py_DECREF(v);
        PyErr_SetString(PyExc_OverflowError,
            "can't convert negative value to unsigned short");
        return (unsigned short) -1;
    } else if (is_negative) {
        stepval = PyNumber_Invert(v);
        Py_DECREF(v);
        if (unlikely(!stepval))
            return (unsigned short) -1;
    } else {
        stepval = v;
    }
    v = NULL;
    val = (unsigned short) 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(unsigned short) * 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 |= ((unsigned short) 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(unsigned short) * 8) - bits - (is_unsigned ? 0 : 1);
        if (unlikely(idigit >= (1L << remaining_bits)))
            goto raise_overflow;
        val |= ((unsigned short) idigit) << bits;
    }
    if (!is_unsigned) {
        if (unlikely(val & (((unsigned short) 1) << (sizeof(unsigned short) * 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 (unsigned short) -1;
    return val;
raise_overflow:
    return __Pyx_raise_overflow___Pyx_PyLong_As_unsigned_short();
}
static CYTHON_INLINE unsigned short __Pyx_PyLong___Pyx_PyLong_As_unsigned_short(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const unsigned short neg_one = (unsigned short) -1, const_zero = (unsigned short) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    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(unsigned short, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else
        #endif
        {
            return __Pyx_PyULong___Pyx_PyLong_As_unsigned_short(x);
        }
    } else {
        #if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(unsigned short, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else
        #endif
        {
            return __Pyx_PySLong___Pyx_PyLong_As_unsigned_short(x);
        }
    }
#if CYTHON_USE_PYLONG_INTERNALS
raise_neg_overflow:
    return __Pyx_raise_neg_overflow___Pyx_PyLong_As_unsigned_short();
raise_overflow:
    return __Pyx_raise_overflow___Pyx_PyLong_As_unsigned_short();
#endif
}
static unsigned short __Pyx_NonPyLong___Pyx_PyLong_As_unsigned_short(PyObject *x) {
    unsigned short val;
    PyObject *tmp = __Pyx_PyNumber_Long(x);
    if (!tmp) return (unsigned short) -1;
    val = __Pyx_PyLong_As_unsigned_short(tmp);
    Py_DECREF(tmp);
    return val;
}
static CYTHON_INLINE unsigned short __Pyx_PyLong_As_unsigned_short(PyObject *x) {
    if (likely(PyLong_Check(x))) {
        return __Pyx_PyLong___Pyx_PyLong_As_unsigned_short(x);
    } else {
        return __Pyx_NonPyLong___Pyx_PyLong_As_unsigned_short(x);
    }
}

/* CIntFromPy */
static uint64_t __Pyx_LargePyLong___Pyx_PyLong_As_uint64_t(PyObject *x);
static uint64_t __Pyx_raise_neg_overflow___Pyx_PyLong_As_uint64_t(void) {
    const char* type_name = "uint64_t";
    PyErr_Format(PyExc_OverflowError,
        "can't convert negative value to %.200s", type_name);
    return (uint64_t) -1;
}
static uint64_t __Pyx_raise_overflow___Pyx_PyLong_As_uint64_t(void) {
    const char* type_name = "uint64_t";
    PyErr_Format(PyExc_OverflowError,
        "value too large to convert to %.200s", type_name);
    return (uint64_t) -1;
}
static CYTHON_INLINE uint64_t __Pyx_PyULong___Pyx_PyLong_As_uint64_t(PyObject *x) {
    const int is_unsigned = 1;
#if CYTHON_USE_PYLONG_INTERNALS
    {
        const digit* digits = __Pyx_PyLong_Digits(x);
        const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
        if (size == 2 && (8 * sizeof(uint64_t) > 1 * PyLong_SHIFT)) {
            if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
            } else if ((8 * sizeof(uint64_t) >= 2 * PyLong_SHIFT)) {
                return (uint64_t) (((((uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0]));
            }
        } else
        if (size == 3 && (8 * sizeof(uint64_t) > 2 * PyLong_SHIFT)) {
            if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
            } else if ((8 * sizeof(uint64_t) >= 3 * PyLong_SHIFT)) {
                return (uint64_t) (((((((uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0]));
            }
        } else
        if (size == 4 && (8 * sizeof(uint64_t) > 3 * PyLong_SHIFT)) {
            if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
            } else if ((8 * sizeof(uint64_t) >= 4 * PyLong_SHIFT)) {
                return (uint64_t) (((((((((uint64_t)digits[3]) << PyLong_SHIFT) | (uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0]));
            }
        } else
        {}
    }
#elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
    if (unlikely(Py_SIZE(x) < 0)) {
        goto raise_neg_overflow;
    }
#else
    {
        int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
        if (unlikely(result < 0))
            return (uint64_t) -1;
        if (unlikely(result == 1))
            goto raise_neg_overflow;
    }
#endif
    if ((sizeof(uint64_t) <= sizeof(unsigned long))) {
        __PYX_VERIFY_RETURN_INT_EXC(uint64_t, unsigned long, PyLong_AsUnsignedLong(x))
    } else if ((sizeof(uint64_t) <= sizeof(unsigned PY_LONG_LONG))) {
        __PYX_VERIFY_RETURN_INT_EXC(uint64_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
    }
    return __Pyx_LargePyLong___Pyx_PyLong_As_uint64_t(x);
raise_neg_overflow:
    return __Pyx_raise_neg_overflow___Pyx_PyLong_As_uint64_t();
raise_overflow:
    return __Pyx_raise_overflow___Pyx_PyLong_As_uint64_t();
}
static CYTHON_INLINE uint64_t __Pyx_PySLong___Pyx_PyLong_As_uint64_t(PyObject *x) {
    const int is_unsigned = 0;
#if CYTHON_USE_PYLONG_INTERNALS
    if (__Pyx_PyLong_IsNeg(x)) {
        const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
        const digit* digits = __Pyx_PyLong_Digits(x);
        if (size == 2 && (8 * sizeof(uint64_t) > 1 * PyLong_SHIFT)) {
            if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
                long ival = - (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                __PYX_VERIFY_RETURN_INT(uint64_t, long, ival)
            } else if ((8 * sizeof(uint64_t) - 1 > 2 * PyLong_SHIFT)) {
                return (uint64_t) (((uint64_t) -1) * (((((uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0])));
            }
        } else
        if (size == 3 && (8 * sizeof(uint64_t) > 2 * PyLong_SHIFT)) {
            if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
                long ival = - (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                __PYX_VERIFY_RETURN_INT(uint64_t, long, ival)
            } else if ((8 * sizeof(uint64_t) - 1 > 3 * PyLong_SHIFT)) {
                return (uint64_t) (((uint64_t) -1) * (((((((uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0])));
            }
        } else
        if (size == 4 && (8 * sizeof(uint64_t) > 3 * PyLong_SHIFT)) {
            if ((8 * sizeof(long) > 4 * PyLong_SHIFT)) {
                long ival = - (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                __PYX_VERIFY_RETURN_INT(uint64_t, long, ival)
            } else if ((8 * sizeof(uint64_t) - 1 > 4 * PyLong_SHIFT)) {
                return (uint64_t) (((uint64_t) -1) * (((((((((uint64_t)digits[3]) << PyLong_SHIFT) | (uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0])));
            }
        } else
        {}
    } else {
        const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
        const digit* digits = __Pyx_PyLong_Digits(x);
        if (size == 2 && (8 * sizeof(uint64_t) > 1 * PyLong_SHIFT)) {
            if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
                __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
            } else if ((8 * sizeof(uint64_t) - 1 > 2 * PyLong_SHIFT)) {
                return (uint64_t) (((((uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0]));
            }
        } else
        if (size == 3 && (8 * sizeof(uint64_t) > 2 * PyLong_SHIFT)) {
            if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
                __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
            } else if ((8 * sizeof(uint64_t) - 1 > 3 * PyLong_SHIFT)) {
                return (uint64_t) (((((((uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0]));
            }
        } else
        if (size == 4 && (8 * sizeof(uint64_t) > 3 * PyLong_SHIFT)) {
            if ((8 * sizeof(long) > 4 * PyLong_SHIFT)) {
                __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
            } else if ((8 * sizeof(uint64_t) - 1 > 4 * PyLong_SHIFT)) {
                return (uint64_t) (((((((((uint64_t)digits[3]) << PyLong_SHIFT) | (uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0]));
            }
        } else
        {}
    }
#endif
    #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
    if ((sizeof(uint64_t) <= sizeof(int)) && (sizeof(int) < sizeof(long))) {
        __PYX_VERIFY_RETURN_INT_EXC(uint64_t, int, PyLong_AsInt(x))
    } else
    #endif
    if ((sizeof(uint64_t) <= sizeof(long))) {
        __PYX_VERIFY_RETURN_INT_EXC(uint64_t, long, PyLong_AsLong(x))
    } else if ((sizeof(uint64_t) <= sizeof(PY_LONG_LONG))) {
        __PYX_VERIFY_RETURN_INT_EXC(uint64_t, PY_LONG_LONG, PyLong_AsLongLong(x))
    }
    return __Pyx_LargePyLong___Pyx_PyLong_As_uint64_t(x);
raise_neg_overflow:
    return __Pyx_raise_neg_overflow___Pyx_PyLong_As_uint64_t();
raise_overflow:
    return __Pyx_raise_overflow___Pyx_PyLong_As_uint64_t();
}
static uint64_t __Pyx_LargePyLong___Pyx_PyLong_As_uint64_t(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const uint64_t neg_one = (uint64_t) -1, const_zero = (uint64_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    uint64_t val;
    int ret = -1;
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
    Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
        x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
    if (unlikely(bytes_copied == -1)) {
    } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
        goto raise_overflow;
    } else {
        ret = 0;
    }
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
    int one = 1; int is_little = (int)*(unsigned char *)&one;
    unsigned char *bytes = (unsigned char *)&val;
    ret = _PyLong_AsByteArray((PyLongObject *)x,
                                bytes, sizeof(val),
                                is_little, !is_unsigned);
    if ((0)) goto raise_overflow;
#else
    PyObject *v;
    PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
    int bits, remaining_bits, is_negative = 0;
    int chunk_size = (sizeof(long) < 8) ? 30 : 62;
    if (likely(PyLong_CheckExact(x))) {
        v = __Pyx_NewRef(x);
    } else {
        v = PyNumber_Long(x);
        if (unlikely(!v)) return (uint64_t) -1;
        assert(PyLong_CheckExact(v));
    }
    {
        int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
        if (unlikely(result < 0)) {
            Py_DECREF(v);
            return (uint64_t) -1;
        }
        is_negative = result == 1;
    }
    if (is_unsigned && unlikely(is_negative)) {
        Py_DECREF(v);
        PyErr_SetString(PyExc_OverflowError,
            "can't convert negative value to uint64_t");
        return (uint64_t) -1;
    } else if (is_negative) {
        stepval = PyNumber_Invert(v);
        Py_DECREF(v);
        if (unlikely(!stepval))
            return (uint64_t) -1;
    } else {
        stepval = v;
    }
    v = NULL;
    val = (uint64_t) 0;
    mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
    shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
    for (bits = 0; bits < (int) sizeof(uint64_t) * 8 - chunk_size; bits += chunk_size) {
        PyObject *tmp, *digit;
        long idigit;
        digit = PyNumber_And(stepval, mask);
        if (unlikely(!digit)) goto done;
        idigit = PyLong_AsLong(digit);
        Py_DECREF(digit);
        if (unlikely(idigit < 0)) goto done;
        val |= ((uint64_t) idigit) << bits;
        tmp = PyNumber_Rshift(stepval, shift);
        if (unlikely(!tmp)) goto done;
        Py_DECREF(stepval); stepval = tmp;
    }
    Py_DECREF(shift); shift = NULL;
    Py_DECREF(mask); mask = NULL;
    {
        long idigit = PyLong_AsLong(stepval);
        if (unlikely(idigit < 0)) goto done;
        remaining_bits = ((int) sizeof(uint64_t) * 8) - bits - (is_unsigned ? 0 : 1);
        if (unlikely(idigit >= (1L << remaining_bits)))
            goto raise_overflow;
        val |= ((uint64_t) idigit) << bits;
    }
    if (!is_unsigned) {
        if (unlikely(val & (((uint64_t) 1) << (sizeof(uint64_t) * 8 - 1))))
            goto raise_overflow;
        if (is_negative)
            val = ~val;
    }
    ret = 0;
done:
    Py_XDECREF(shift);
    Py_XDECREF(mask);
    Py_XDECREF(stepval);
#endif
    if (unlikely(ret))
        return (uint64_t) -1;
    return val;
raise_overflow:
    return __Pyx_raise_overflow___Pyx_PyLong_As_uint64_t();
}
static CYTHON_INLINE uint64_t __Pyx_PyLong___Pyx_PyLong_As_uint64_t(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const uint64_t neg_one = (uint64_t) -1, const_zero = (uint64_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        #if CYTHON_USE_PYLONG_INTERNALS
        if (unlikely(__Pyx_PyLong_IsNeg(x))) {
            goto raise_neg_overflow;
        } else if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(uint64_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else
        #endif
        {
            return __Pyx_PyULong___Pyx_PyLong_As_uint64_t(x);
        }
    } else {
        #if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(uint64_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else
        #endif
        {
            return __Pyx_PySLong___Pyx_PyLong_As_uint64_t(x);
        }
    }
#if CYTHON_USE_PYLONG_INTERNALS
raise_neg_overflow:
    return __Pyx_raise_neg_overflow___Pyx_PyLong_As_uint64_t();
raise_overflow:
    return __Pyx_raise_overflow___Pyx_PyLong_As_uint64_t();
#endif
}
static uint64_t __Pyx_NonPyLong___Pyx_PyLong_As_uint64_t(PyObject *x) {
    uint64_t val;
    PyObject *tmp = __Pyx_PyNumber_Long(x);
    if (!tmp) return (uint64_t) -1;
    val = __Pyx_PyLong_As_uint64_t(tmp);
    Py_DECREF(tmp);
    return val;
}
static CYTHON_INLINE uint64_t __Pyx_PyLong_As_uint64_t(PyObject *x) {
    if (likely(PyLong_Check(x))) {
        return __Pyx_PyLong___Pyx_PyLong_As_uint64_t(x);
    } else {
        return __Pyx_NonPyLong___Pyx_PyLong_As_uint64_t(x);
    }
}

/* CIntFromPy */
static unsigned int __Pyx_LargePyLong___Pyx_PyLong_As_unsigned_int(PyObject *x);
static unsigned int __Pyx_raise_neg_overflow___Pyx_PyLong_As_unsigned_int(void) {
    const char* type_name = "unsigned int";
    PyErr_Format(PyExc_OverflowError,
        "can't convert negative value to %.200s", type_name);
    return (unsigned int) -1;
}
static unsigned int __Pyx_raise_overflow___Pyx_PyLong_As_unsigned_int(void) {
    const char* type_name = "unsigned int";
    PyErr_Format(PyExc_OverflowError,
        "value too large to convert to %.200s", type_name);
    return (unsigned int) -1;
}
static CYTHON_INLINE unsigned int __Pyx_PyULong___Pyx_PyLong_As_unsigned_int(PyObject *x) {
    const int is_unsigned = 1;
#if CYTHON_USE_PYLONG_INTERNALS
    {
        const digit* digits = __Pyx_PyLong_Digits(x);
        const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
        if (size == 2 && (8 * sizeof(unsigned int) > 1 * PyLong_SHIFT)) {
            if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
            } else if ((8 * sizeof(unsigned int) >= 2 * PyLong_SHIFT)) {
                return (unsigned int) (((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]));
            }
        } else
        if (size == 3 && (8 * sizeof(unsigned int) > 2 * PyLong_SHIFT)) {
            if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
            } else if ((8 * sizeof(unsigned int) >= 3 * PyLong_SHIFT)) {
                return (unsigned int) (((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]));
            }
        } else
        if (size == 4 && (8 * sizeof(unsigned int) > 3 * PyLong_SHIFT)) {
            if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                __PYX_VERIFY_RETURN_INT(unsigned 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(unsigned int) >= 4 * PyLong_SHIFT)) {
                return (unsigned int) (((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]));
            }
        } else
        {}
    }
#elif 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 (unsigned int) -1;
        if (unlikely(result == 1))
            goto raise_neg_overflow;
    }
#endif
    if ((sizeof(unsigned int) <= sizeof(unsigned long))) {
        __PYX_VERIFY_RETURN_INT_EXC(unsigned int, unsigned long, PyLong_AsUnsignedLong(x))
    } else if ((sizeof(unsigned int) <= sizeof(unsigned PY_LONG_LONG))) {
        __PYX_VERIFY_RETURN_INT_EXC(unsigned int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
    }
    return __Pyx_LargePyLong___Pyx_PyLong_As_unsigned_int(x);
raise_neg_overflow:
    return __Pyx_raise_neg_overflow___Pyx_PyLong_As_unsigned_int();
raise_overflow:
    return __Pyx_raise_overflow___Pyx_PyLong_As_unsigned_int();
}
static CYTHON_INLINE unsigned int __Pyx_PySLong___Pyx_PyLong_As_unsigned_int(PyObject *x) {
    const int is_unsigned = 0;
#if CYTHON_USE_PYLONG_INTERNALS
    if (__Pyx_PyLong_IsNeg(x)) {
        const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
        const digit* digits = __Pyx_PyLong_Digits(x);
        if (size == 2 && (8 * sizeof(unsigned int) > 1 * PyLong_SHIFT)) {
            if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
                long ival = - (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                __PYX_VERIFY_RETURN_INT(unsigned int, long, ival)
            } else if ((8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT)) {
                return (unsigned int) (((unsigned int) -1) * (((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
            }
        } else
        if (size == 3 && (8 * sizeof(unsigned int) > 2 * PyLong_SHIFT)) {
            if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
                long ival = - (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                __PYX_VERIFY_RETURN_INT(unsigned int, long, ival)
            } else if ((8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT)) {
                return (unsigned int) (((unsigned int) -1) * (((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
            }
        } else
        if (size == 4 && (8 * sizeof(unsigned int) > 3 * PyLong_SHIFT)) {
            if ((8 * sizeof(long) > 4 * PyLong_SHIFT)) {
                long ival = - (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                __PYX_VERIFY_RETURN_INT(unsigned int, long, ival)
            } else if ((8 * sizeof(unsigned int) - 1 > 4 * PyLong_SHIFT)) {
                return (unsigned int) (((unsigned int) -1) * (((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
            }
        } else
        {}
    } else {
        const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
        const digit* digits = __Pyx_PyLong_Digits(x);
        if (size == 2 && (8 * sizeof(unsigned int) > 1 * PyLong_SHIFT)) {
            if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
                __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
            } else if ((8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT)) {
                return (unsigned int) (((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]));
            }
        } else
        if (size == 3 && (8 * sizeof(unsigned int) > 2 * PyLong_SHIFT)) {
            if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
                __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
            } else if ((8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT)) {
                return (unsigned int) (((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]));
            }
        } else
        if (size == 4 && (8 * sizeof(unsigned int) > 3 * PyLong_SHIFT)) {
            if ((8 * sizeof(long) > 4 * PyLong_SHIFT)) {
                __PYX_VERIFY_RETURN_INT(unsigned 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(unsigned int) - 1 > 4 * PyLong_SHIFT)) {
                return (unsigned int) (((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]));
            }
        } else
        {}
    }
#endif
    #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
    if ((sizeof(unsigned int) <= sizeof(int)) && (sizeof(int) < sizeof(long))) {
        __PYX_VERIFY_RETURN_INT_EXC(unsigned int, int, PyLong_AsInt(x))
    } else
    #endif
    if ((sizeof(unsigned int) <= sizeof(long))) {
        __PYX_VERIFY_RETURN_INT_EXC(unsigned int, long, PyLong_AsLong(x))
    } else if ((sizeof(unsigned int) <= sizeof(PY_LONG_LONG))) {
        __PYX_VERIFY_RETURN_INT_EXC(unsigned int, PY_LONG_LONG, PyLong_AsLongLong(x))
    }
    return __Pyx_LargePyLong___Pyx_PyLong_As_unsigned_int(x);
raise_neg_overflow:
    return __Pyx_raise_neg_overflow___Pyx_PyLong_As_unsigned_int();
raise_overflow:
    return __Pyx_raise_overflow___Pyx_PyLong_As_unsigned_int();
}
static unsigned int __Pyx_LargePyLong___Pyx_PyLong_As_unsigned_int(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const unsigned int neg_one = (unsigned int) -1, const_zero = (unsigned int) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    unsigned 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);
    if ((0)) goto raise_overflow;
#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 (unsigned int) -1;
        assert(PyLong_CheckExact(v));
    }
    {
        int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
        if (unlikely(result < 0)) {
            Py_DECREF(v);
            return (unsigned int) -1;
        }
        is_negative = result == 1;
    }
    if (is_unsigned && unlikely(is_negative)) {
        Py_DECREF(v);
        PyErr_SetString(PyExc_OverflowError,
            "can't convert negative value to unsigned int");
        return (unsigned int) -1;
    } else if (is_negative) {
        stepval = PyNumber_Invert(v);
        Py_DECREF(v);
        if (unlikely(!stepval))
            return (unsigned int) -1;
    } else {
        stepval = v;
    }
    v = NULL;
    val = (unsigned 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(unsigned 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 |= ((unsigned 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(unsigned int) * 8) - bits - (is_unsigned ? 0 : 1);
        if (unlikely(idigit >= (1L << remaining_bits)))
            goto raise_overflow;
        val |= ((unsigned int) idigit) << bits;
    }
    if (!is_unsigned) {
        if (unlikely(val & (((unsigned int) 1) << (sizeof(unsigned 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 (unsigned int) -1;
    return val;
raise_overflow:
    return __Pyx_raise_overflow___Pyx_PyLong_As_unsigned_int();
}
static CYTHON_INLINE unsigned int __Pyx_PyLong___Pyx_PyLong_As_unsigned_int(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const unsigned int neg_one = (unsigned int) -1, const_zero = (unsigned int) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    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(unsigned int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else
        #endif
        {
            return __Pyx_PyULong___Pyx_PyLong_As_unsigned_int(x);
        }
    } else {
        #if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(unsigned int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else
        #endif
        {
            return __Pyx_PySLong___Pyx_PyLong_As_unsigned_int(x);
        }
    }
#if CYTHON_USE_PYLONG_INTERNALS
raise_neg_overflow:
    return __Pyx_raise_neg_overflow___Pyx_PyLong_As_unsigned_int();
raise_overflow:
    return __Pyx_raise_overflow___Pyx_PyLong_As_unsigned_int();
#endif
}
static unsigned int __Pyx_NonPyLong___Pyx_PyLong_As_unsigned_int(PyObject *x) {
    unsigned int val;
    PyObject *tmp = __Pyx_PyNumber_Long(x);
    if (!tmp) return (unsigned int) -1;
    val = __Pyx_PyLong_As_unsigned_int(tmp);
    Py_DECREF(tmp);
    return val;
}
static CYTHON_INLINE unsigned int __Pyx_PyLong_As_unsigned_int(PyObject *x) {
    if (likely(PyLong_Check(x))) {
        return __Pyx_PyLong___Pyx_PyLong_As_unsigned_int(x);
    } else {
        return __Pyx_NonPyLong___Pyx_PyLong_As_unsigned_int(x);
    }
}

/* CIntFromPy */
static long __Pyx_LargePyLong___Pyx_PyLong_As_long(PyObject *x);
static long __Pyx_raise_neg_overflow___Pyx_PyLong_As_long(void) {
    const char* type_name = "long";
    PyErr_Format(PyExc_OverflowError,
        "can't convert negative value to %.200s", type_name);
    return (long) -1;
}
static long __Pyx_raise_overflow___Pyx_PyLong_As_long(void) {
    const char* type_name = "long";
    PyErr_Format(PyExc_OverflowError,
        "value too large to convert to %.200s", type_name);
    return (long) -1;
}
static CYTHON_INLINE long __Pyx_PyULong___Pyx_PyLong_As_long(PyObject *x) {
    const int is_unsigned = 1;
#if CYTHON_USE_PYLONG_INTERNALS
    {
        const digit* digits = __Pyx_PyLong_Digits(x);
        const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
        if (size == 2 && (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]));
            }
        } else
        if (size == 3 && (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]));
            }
        } else
        if (size == 4 && (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]));
            }
        } else
        {}
    }
#elif 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))
    } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) {
        __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
    }
    return __Pyx_LargePyLong___Pyx_PyLong_As_long(x);
raise_neg_overflow:
    return __Pyx_raise_neg_overflow___Pyx_PyLong_As_long();
raise_overflow:
    return __Pyx_raise_overflow___Pyx_PyLong_As_long();
}
static CYTHON_INLINE long __Pyx_PySLong___Pyx_PyLong_As_long(PyObject *x) {
    const int is_unsigned = 0;
#if CYTHON_USE_PYLONG_INTERNALS
    if (__Pyx_PyLong_IsNeg(x)) {
        const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
        const digit* digits = __Pyx_PyLong_Digits(x);
        if (size == 2 && (8 * sizeof(long) > 1 * PyLong_SHIFT)) {
            if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
                long ival = - (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                __PYX_VERIFY_RETURN_INT(long, long, ival)
            } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
                return (long) (((long) -1) * (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
            }
        } else
        if (size == 3 && (8 * sizeof(long) > 2 * PyLong_SHIFT)) {
            if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
                long ival = - (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                __PYX_VERIFY_RETURN_INT(long, long, ival)
            } 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])));
            }
        } else
        if (size == 4 && (8 * sizeof(long) > 3 * PyLong_SHIFT)) {
            if ((8 * sizeof(long) > 4 * PyLong_SHIFT)) {
                long ival = - (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                __PYX_VERIFY_RETURN_INT(long, long, ival)
            } 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])));
            }
        } else
        {}
    } else {
        const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
        const digit* digits = __Pyx_PyLong_Digits(x);
        if (size == 2 && (8 * sizeof(long) > 1 * PyLong_SHIFT)) {
            if ((8 * sizeof(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]));
            }
        } else
        if (size == 3 && (8 * sizeof(long) > 2 * PyLong_SHIFT)) {
            if ((8 * sizeof(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]));
            }
        } else
        if (size == 4 && (8 * sizeof(long) > 3 * PyLong_SHIFT)) {
            if ((8 * sizeof(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]));
            }
        } else
        {}
    }
#endif
    #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
    if ((sizeof(long) <= sizeof(int)) && (sizeof(int) < sizeof(long))) {
        __PYX_VERIFY_RETURN_INT_EXC(long, int, PyLong_AsInt(x))
    } else
    #endif
    if ((sizeof(long) <= sizeof(long))) {
        __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
    } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) {
        __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
    }
    return __Pyx_LargePyLong___Pyx_PyLong_As_long(x);
raise_neg_overflow:
    return __Pyx_raise_neg_overflow___Pyx_PyLong_As_long();
raise_overflow:
    return __Pyx_raise_overflow___Pyx_PyLong_As_long();
}
static long __Pyx_LargePyLong___Pyx_PyLong_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;
    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);
    if ((0)) goto raise_overflow;
#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);
        PyErr_SetString(PyExc_OverflowError,
            "can't convert negative value to long");
        return (long) -1;
    } 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:
    return __Pyx_raise_overflow___Pyx_PyLong_As_long();
}
static CYTHON_INLINE long __Pyx_PyLong___Pyx_PyLong_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 (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
        #endif
        {
            return __Pyx_PyULong___Pyx_PyLong_As_long(x);
        }
    } else {
        #if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else
        #endif
        {
            return __Pyx_PySLong___Pyx_PyLong_As_long(x);
        }
    }
#if CYTHON_USE_PYLONG_INTERNALS
raise_neg_overflow:
    return __Pyx_raise_neg_overflow___Pyx_PyLong_As_long();
raise_overflow:
    return __Pyx_raise_overflow___Pyx_PyLong_As_long();
#endif
}
static long __Pyx_NonPyLong___Pyx_PyLong_As_long(PyObject *x) {
    long val;
    PyObject *tmp = __Pyx_PyNumber_Long(x);
    if (!tmp) return (long) -1;
    val = __Pyx_PyLong_As_long(tmp);
    Py_DECREF(tmp);
    return val;
}
static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *x) {
    if (likely(PyLong_Check(x))) {
        return __Pyx_PyLong___Pyx_PyLong_As_long(x);
    } else {
        return __Pyx_NonPyLong___Pyx_PyLong_As_long(x);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_unsigned_int(unsigned int value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const unsigned int neg_one = (unsigned int) -1, const_zero = (unsigned int) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(unsigned int) < sizeof(long)) {
            return PyLong_FromLong((long) value);
        } else if (sizeof(unsigned int) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#if !CYTHON_COMPILING_IN_PYPY
        } else if (sizeof(unsigned int) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(unsigned int) <= sizeof(long)) {
            return PyLong_FromLong((long) value);
        } else if (sizeof(unsigned int) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        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(unsigned int),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *result = NULL, *kwds = NULL;
        PyObject *py_bytes = NULL, *order_str = NULL, *from_bytes_str = NULL;;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(unsigned int));
        if (!py_bytes) goto limited_bad;
        from_bytes_str = PyUnicode_FromStringAndSize("from_bytes", 10);
        if (!from_bytes_str) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        {
            PyObject *args[] = { (PyObject*)&PyLong_Type, py_bytes, order_str, Py_True };
            if (!is_unsigned) {
                PyObject *signed_str = PyUnicode_FromStringAndSize("signed", 6);
                if (!signed_str) goto limited_bad;
#if CYTHON_VECTORCALL
                kwds = PyTuple_Pack(1, signed_str);
#else
                {
                    PyObject *keys[] = {signed_str};
                    PyObject *values[] = {Py_True};
                    kwds = __Pyx_MakeKwargDict(keys, values, 1);
                }
#endif
                Py_DECREF(signed_str);
                if (unlikely(!kwds)) goto limited_bad;
            }
            result = __Pyx_Object_VectorcallMethodKwds(from_bytes_str, args, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
        }
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes_str);
        return result;
#endif
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_uint16_t(uint16_t value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const uint16_t neg_one = (uint16_t) -1, const_zero = (uint16_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(uint16_t) < sizeof(long)) {
            return PyLong_FromLong((long) value);
        } else if (sizeof(uint16_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#if !CYTHON_COMPILING_IN_PYPY
        } else if (sizeof(uint16_t) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(uint16_t) <= sizeof(long)) {
            return PyLong_FromLong((long) value);
        } else if (sizeof(uint16_t) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        unsigned char *bytes = (unsigned char *)&value;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
        if (is_unsigned) {
            return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
        } else {
            return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
        }
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        int one = 1; int little = (int)*(unsigned char *)&one;
        return _PyLong_FromByteArray(bytes, sizeof(uint16_t),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *result = NULL, *kwds = NULL;
        PyObject *py_bytes = NULL, *order_str = NULL, *from_bytes_str = NULL;;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(uint16_t));
        if (!py_bytes) goto limited_bad;
        from_bytes_str = PyUnicode_FromStringAndSize("from_bytes", 10);
        if (!from_bytes_str) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        {
            PyObject *args[] = { (PyObject*)&PyLong_Type, py_bytes, order_str, Py_True };
            if (!is_unsigned) {
                PyObject *signed_str = PyUnicode_FromStringAndSize("signed", 6);
                if (!signed_str) goto limited_bad;
#if CYTHON_VECTORCALL
                kwds = PyTuple_Pack(1, signed_str);
#else
                {
                    PyObject *keys[] = {signed_str};
                    PyObject *values[] = {Py_True};
                    kwds = __Pyx_MakeKwargDict(keys, values, 1);
                }
#endif
                Py_DECREF(signed_str);
                if (unlikely(!kwds)) goto limited_bad;
            }
            result = __Pyx_Object_VectorcallMethodKwds(from_bytes_str, args, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
        }
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes_str);
        return result;
#endif
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_unsigned_short(unsigned short value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const unsigned short neg_one = (unsigned short) -1, const_zero = (unsigned short) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(unsigned short) < sizeof(long)) {
            return PyLong_FromLong((long) value);
        } else if (sizeof(unsigned short) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#if !CYTHON_COMPILING_IN_PYPY
        } else if (sizeof(unsigned short) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(unsigned short) <= sizeof(long)) {
            return PyLong_FromLong((long) value);
        } else if (sizeof(unsigned short) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        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(unsigned short),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *result = NULL, *kwds = NULL;
        PyObject *py_bytes = NULL, *order_str = NULL, *from_bytes_str = NULL;;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(unsigned short));
        if (!py_bytes) goto limited_bad;
        from_bytes_str = PyUnicode_FromStringAndSize("from_bytes", 10);
        if (!from_bytes_str) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        {
            PyObject *args[] = { (PyObject*)&PyLong_Type, py_bytes, order_str, Py_True };
            if (!is_unsigned) {
                PyObject *signed_str = PyUnicode_FromStringAndSize("signed", 6);
                if (!signed_str) goto limited_bad;
#if CYTHON_VECTORCALL
                kwds = PyTuple_Pack(1, signed_str);
#else
                {
                    PyObject *keys[] = {signed_str};
                    PyObject *values[] = {Py_True};
                    kwds = __Pyx_MakeKwargDict(keys, values, 1);
                }
#endif
                Py_DECREF(signed_str);
                if (unlikely(!kwds)) goto limited_bad;
            }
            result = __Pyx_Object_VectorcallMethodKwds(from_bytes_str, args, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
        }
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes_str);
        return result;
#endif
    }
}

/* CIntFromPy */
static uint8_t __Pyx_LargePyLong___Pyx_PyLong_As_uint8_t(PyObject *x);
static uint8_t __Pyx_raise_neg_overflow___Pyx_PyLong_As_uint8_t(void) {
    const char* type_name = "uint8_t";
    PyErr_Format(PyExc_OverflowError,
        "can't convert negative value to %.200s", type_name);
    return (uint8_t) -1;
}
static uint8_t __Pyx_raise_overflow___Pyx_PyLong_As_uint8_t(void) {
    const char* type_name = "uint8_t";
    PyErr_Format(PyExc_OverflowError,
        "value too large to convert to %.200s", type_name);
    return (uint8_t) -1;
}
static CYTHON_INLINE uint8_t __Pyx_PyULong___Pyx_PyLong_As_uint8_t(PyObject *x) {
    const int is_unsigned = 1;
#if CYTHON_USE_PYLONG_INTERNALS
    {
        const digit* digits = __Pyx_PyLong_Digits(x);
        const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
        if (size == 2 && (8 * sizeof(uint8_t) > 1 * PyLong_SHIFT)) {
            if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
            } else if ((8 * sizeof(uint8_t) >= 2 * PyLong_SHIFT)) {
                return (uint8_t) (((((uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]));
            }
        } else
        if (size == 3 && (8 * sizeof(uint8_t) > 2 * PyLong_SHIFT)) {
            if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
            } else if ((8 * sizeof(uint8_t) >= 3 * PyLong_SHIFT)) {
                return (uint8_t) (((((((uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]));
            }
        } else
        if (size == 4 && (8 * sizeof(uint8_t) > 3 * PyLong_SHIFT)) {
            if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
            } else if ((8 * sizeof(uint8_t) >= 4 * PyLong_SHIFT)) {
                return (uint8_t) (((((((((uint8_t)digits[3]) << PyLong_SHIFT) | (uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]));
            }
        } else
        {}
    }
#elif 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 (uint8_t) -1;
        if (unlikely(result == 1))
            goto raise_neg_overflow;
    }
#endif
    if ((sizeof(uint8_t) <= sizeof(unsigned long))) {
        __PYX_VERIFY_RETURN_INT_EXC(uint8_t, unsigned long, PyLong_AsUnsignedLong(x))
    } else if ((sizeof(uint8_t) <= sizeof(unsigned PY_LONG_LONG))) {
        __PYX_VERIFY_RETURN_INT_EXC(uint8_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
    }
    return __Pyx_LargePyLong___Pyx_PyLong_As_uint8_t(x);
raise_neg_overflow:
    return __Pyx_raise_neg_overflow___Pyx_PyLong_As_uint8_t();
raise_overflow:
    return __Pyx_raise_overflow___Pyx_PyLong_As_uint8_t();
}
static CYTHON_INLINE uint8_t __Pyx_PySLong___Pyx_PyLong_As_uint8_t(PyObject *x) {
    const int is_unsigned = 0;
#if CYTHON_USE_PYLONG_INTERNALS
    if (__Pyx_PyLong_IsNeg(x)) {
        const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
        const digit* digits = __Pyx_PyLong_Digits(x);
        if (size == 2 && (8 * sizeof(uint8_t) > 1 * PyLong_SHIFT)) {
            if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
                long ival = - (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                __PYX_VERIFY_RETURN_INT(uint8_t, long, ival)
            } else if ((8 * sizeof(uint8_t) - 1 > 2 * PyLong_SHIFT)) {
                return (uint8_t) (((uint8_t) -1) * (((((uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])));
            }
        } else
        if (size == 3 && (8 * sizeof(uint8_t) > 2 * PyLong_SHIFT)) {
            if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
                long ival = - (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                __PYX_VERIFY_RETURN_INT(uint8_t, long, ival)
            } else if ((8 * sizeof(uint8_t) - 1 > 3 * PyLong_SHIFT)) {
                return (uint8_t) (((uint8_t) -1) * (((((((uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])));
            }
        } else
        if (size == 4 && (8 * sizeof(uint8_t) > 3 * PyLong_SHIFT)) {
            if ((8 * sizeof(long) > 4 * PyLong_SHIFT)) {
                long ival = - (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                __PYX_VERIFY_RETURN_INT(uint8_t, long, ival)
            } else if ((8 * sizeof(uint8_t) - 1 > 4 * PyLong_SHIFT)) {
                return (uint8_t) (((uint8_t) -1) * (((((((((uint8_t)digits[3]) << PyLong_SHIFT) | (uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])));
            }
        } else
        {}
    } else {
        const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
        const digit* digits = __Pyx_PyLong_Digits(x);
        if (size == 2 && (8 * sizeof(uint8_t) > 1 * PyLong_SHIFT)) {
            if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
                __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
            } else if ((8 * sizeof(uint8_t) - 1 > 2 * PyLong_SHIFT)) {
                return (uint8_t) (((((uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]));
            }
        } else
        if (size == 3 && (8 * sizeof(uint8_t) > 2 * PyLong_SHIFT)) {
            if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
                __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
            } else if ((8 * sizeof(uint8_t) - 1 > 3 * PyLong_SHIFT)) {
                return (uint8_t) (((((((uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]));
            }
        } else
        if (size == 4 && (8 * sizeof(uint8_t) > 3 * PyLong_SHIFT)) {
            if ((8 * sizeof(long) > 4 * PyLong_SHIFT)) {
                __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
            } else if ((8 * sizeof(uint8_t) - 1 > 4 * PyLong_SHIFT)) {
                return (uint8_t) (((((((((uint8_t)digits[3]) << PyLong_SHIFT) | (uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]));
            }
        } else
        {}
    }
#endif
    #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
    if ((sizeof(uint8_t) <= sizeof(int)) && (sizeof(int) < sizeof(long))) {
        __PYX_VERIFY_RETURN_INT_EXC(uint8_t, int, PyLong_AsInt(x))
    } else
    #endif
    if ((sizeof(uint8_t) <= sizeof(long))) {
        __PYX_VERIFY_RETURN_INT_EXC(uint8_t, long, PyLong_AsLong(x))
    } else if ((sizeof(uint8_t) <= sizeof(PY_LONG_LONG))) {
        __PYX_VERIFY_RETURN_INT_EXC(uint8_t, PY_LONG_LONG, PyLong_AsLongLong(x))
    }
    return __Pyx_LargePyLong___Pyx_PyLong_As_uint8_t(x);
raise_neg_overflow:
    return __Pyx_raise_neg_overflow___Pyx_PyLong_As_uint8_t();
raise_overflow:
    return __Pyx_raise_overflow___Pyx_PyLong_As_uint8_t();
}
static uint8_t __Pyx_LargePyLong___Pyx_PyLong_As_uint8_t(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const uint8_t neg_one = (uint8_t) -1, const_zero = (uint8_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    uint8_t val;
    int ret = -1;
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
    Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
        x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
    if (unlikely(bytes_copied == -1)) {
    } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
        goto raise_overflow;
    } else {
        ret = 0;
    }
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
    int one = 1; int is_little = (int)*(unsigned char *)&one;
    unsigned char *bytes = (unsigned char *)&val;
    ret = _PyLong_AsByteArray((PyLongObject *)x,
                                bytes, sizeof(val),
                                is_little, !is_unsigned);
    if ((0)) goto raise_overflow;
#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 (uint8_t) -1;
        assert(PyLong_CheckExact(v));
    }
    {
        int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
        if (unlikely(result < 0)) {
            Py_DECREF(v);
            return (uint8_t) -1;
        }
        is_negative = result == 1;
    }
    if (is_unsigned && unlikely(is_negative)) {
        Py_DECREF(v);
        PyErr_SetString(PyExc_OverflowError,
            "can't convert negative value to uint8_t");
        return (uint8_t) -1;
    } else if (is_negative) {
        stepval = PyNumber_Invert(v);
        Py_DECREF(v);
        if (unlikely(!stepval))
            return (uint8_t) -1;
    } else {
        stepval = v;
    }
    v = NULL;
    val = (uint8_t) 0;
    mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
    shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
    for (bits = 0; bits < (int) sizeof(uint8_t) * 8 - chunk_size; bits += chunk_size) {
        PyObject *tmp, *digit;
        long idigit;
        digit = PyNumber_And(stepval, mask);
        if (unlikely(!digit)) goto done;
        idigit = PyLong_AsLong(digit);
        Py_DECREF(digit);
        if (unlikely(idigit < 0)) goto done;
        val |= ((uint8_t) idigit) << bits;
        tmp = PyNumber_Rshift(stepval, shift);
        if (unlikely(!tmp)) goto done;
        Py_DECREF(stepval); stepval = tmp;
    }
    Py_DECREF(shift); shift = NULL;
    Py_DECREF(mask); mask = NULL;
    {
        long idigit = PyLong_AsLong(stepval);
        if (unlikely(idigit < 0)) goto done;
        remaining_bits = ((int) sizeof(uint8_t) * 8) - bits - (is_unsigned ? 0 : 1);
        if (unlikely(idigit >= (1L << remaining_bits)))
            goto raise_overflow;
        val |= ((uint8_t) idigit) << bits;
    }
    if (!is_unsigned) {
        if (unlikely(val & (((uint8_t) 1) << (sizeof(uint8_t) * 8 - 1))))
            goto raise_overflow;
        if (is_negative)
            val = ~val;
    }
    ret = 0;
done:
    Py_XDECREF(shift);
    Py_XDECREF(mask);
    Py_XDECREF(stepval);
#endif
    if (unlikely(ret))
        return (uint8_t) -1;
    return val;
raise_overflow:
    return __Pyx_raise_overflow___Pyx_PyLong_As_uint8_t();
}
static CYTHON_INLINE uint8_t __Pyx_PyLong___Pyx_PyLong_As_uint8_t(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const uint8_t neg_one = (uint8_t) -1, const_zero = (uint8_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        #if CYTHON_USE_PYLONG_INTERNALS
        if (unlikely(__Pyx_PyLong_IsNeg(x))) {
            goto raise_neg_overflow;
        } else if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(uint8_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else
        #endif
        {
            return __Pyx_PyULong___Pyx_PyLong_As_uint8_t(x);
        }
    } else {
        #if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(uint8_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else
        #endif
        {
            return __Pyx_PySLong___Pyx_PyLong_As_uint8_t(x);
        }
    }
#if CYTHON_USE_PYLONG_INTERNALS
raise_neg_overflow:
    return __Pyx_raise_neg_overflow___Pyx_PyLong_As_uint8_t();
raise_overflow:
    return __Pyx_raise_overflow___Pyx_PyLong_As_uint8_t();
#endif
}
static uint8_t __Pyx_NonPyLong___Pyx_PyLong_As_uint8_t(PyObject *x) {
    uint8_t val;
    PyObject *tmp = __Pyx_PyNumber_Long(x);
    if (!tmp) return (uint8_t) -1;
    val = __Pyx_PyLong_As_uint8_t(tmp);
    Py_DECREF(tmp);
    return val;
}
static CYTHON_INLINE uint8_t __Pyx_PyLong_As_uint8_t(PyObject *x) {
    if (likely(PyLong_Check(x))) {
        return __Pyx_PyLong___Pyx_PyLong_As_uint8_t(x);
    } else {
        return __Pyx_NonPyLong___Pyx_PyLong_As_uint8_t(x);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_uint64_t(uint64_t value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const uint64_t neg_one = (uint64_t) -1, const_zero = (uint64_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(uint64_t) < sizeof(long)) {
            return PyLong_FromLong((long) value);
        } else if (sizeof(uint64_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#if !CYTHON_COMPILING_IN_PYPY
        } else if (sizeof(uint64_t) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(uint64_t) <= sizeof(long)) {
            return PyLong_FromLong((long) value);
        } else if (sizeof(uint64_t) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        unsigned char *bytes = (unsigned char *)&value;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
        if (is_unsigned) {
            return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
        } else {
            return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
        }
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        int one = 1; int little = (int)*(unsigned char *)&one;
        return _PyLong_FromByteArray(bytes, sizeof(uint64_t),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *result = NULL, *kwds = NULL;
        PyObject *py_bytes = NULL, *order_str = NULL, *from_bytes_str = NULL;;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(uint64_t));
        if (!py_bytes) goto limited_bad;
        from_bytes_str = PyUnicode_FromStringAndSize("from_bytes", 10);
        if (!from_bytes_str) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        {
            PyObject *args[] = { (PyObject*)&PyLong_Type, py_bytes, order_str, Py_True };
            if (!is_unsigned) {
                PyObject *signed_str = PyUnicode_FromStringAndSize("signed", 6);
                if (!signed_str) goto limited_bad;
#if CYTHON_VECTORCALL
                kwds = PyTuple_Pack(1, signed_str);
#else
                {
                    PyObject *keys[] = {signed_str};
                    PyObject *values[] = {Py_True};
                    kwds = __Pyx_MakeKwargDict(keys, values, 1);
                }
#endif
                Py_DECREF(signed_str);
                if (unlikely(!kwds)) goto limited_bad;
            }
            result = __Pyx_Object_VectorcallMethodKwds(from_bytes_str, args, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
        }
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes_str);
        return result;
#endif
    }
}

/* CIntFromPy */
static uint32_t __Pyx_LargePyLong___Pyx_PyLong_As_uint32_t(PyObject *x);
static uint32_t __Pyx_raise_neg_overflow___Pyx_PyLong_As_uint32_t(void) {
    const char* type_name = "uint32_t";
    PyErr_Format(PyExc_OverflowError,
        "can't convert negative value to %.200s", type_name);
    return (uint32_t) -1;
}
static uint32_t __Pyx_raise_overflow___Pyx_PyLong_As_uint32_t(void) {
    const char* type_name = "uint32_t";
    PyErr_Format(PyExc_OverflowError,
        "value too large to convert to %.200s", type_name);
    return (uint32_t) -1;
}
static CYTHON_INLINE uint32_t __Pyx_PyULong___Pyx_PyLong_As_uint32_t(PyObject *x) {
    const int is_unsigned = 1;
#if CYTHON_USE_PYLONG_INTERNALS
    {
        const digit* digits = __Pyx_PyLong_Digits(x);
        const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
        if (size == 2 && (8 * sizeof(uint32_t) > 1 * PyLong_SHIFT)) {
            if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
            } else if ((8 * sizeof(uint32_t) >= 2 * PyLong_SHIFT)) {
                return (uint32_t) (((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]));
            }
        } else
        if (size == 3 && (8 * sizeof(uint32_t) > 2 * PyLong_SHIFT)) {
            if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
            } else if ((8 * sizeof(uint32_t) >= 3 * PyLong_SHIFT)) {
                return (uint32_t) (((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]));
            }
        } else
        if (size == 4 && (8 * sizeof(uint32_t) > 3 * PyLong_SHIFT)) {
            if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
            } else if ((8 * sizeof(uint32_t) >= 4 * PyLong_SHIFT)) {
                return (uint32_t) (((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]));
            }
        } else
        {}
    }
#elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
    if (unlikely(Py_SIZE(x) < 0)) {
        goto raise_neg_overflow;
    }
#else
    {
        int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
        if (unlikely(result < 0))
            return (uint32_t) -1;
        if (unlikely(result == 1))
            goto raise_neg_overflow;
    }
#endif
    if ((sizeof(uint32_t) <= sizeof(unsigned long))) {
        __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned long, PyLong_AsUnsignedLong(x))
    } else if ((sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG))) {
        __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
    }
    return __Pyx_LargePyLong___Pyx_PyLong_As_uint32_t(x);
raise_neg_overflow:
    return __Pyx_raise_neg_overflow___Pyx_PyLong_As_uint32_t();
raise_overflow:
    return __Pyx_raise_overflow___Pyx_PyLong_As_uint32_t();
}
static CYTHON_INLINE uint32_t __Pyx_PySLong___Pyx_PyLong_As_uint32_t(PyObject *x) {
    const int is_unsigned = 0;
#if CYTHON_USE_PYLONG_INTERNALS
    if (__Pyx_PyLong_IsNeg(x)) {
        const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
        const digit* digits = __Pyx_PyLong_Digits(x);
        if (size == 2 && (8 * sizeof(uint32_t) > 1 * PyLong_SHIFT)) {
            if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
                long ival = - (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                __PYX_VERIFY_RETURN_INT(uint32_t, long, ival)
            } else if ((8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT)) {
                return (uint32_t) (((uint32_t) -1) * (((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])));
            }
        } else
        if (size == 3 && (8 * sizeof(uint32_t) > 2 * PyLong_SHIFT)) {
            if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
                long ival = - (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                __PYX_VERIFY_RETURN_INT(uint32_t, long, ival)
            } else if ((8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT)) {
                return (uint32_t) (((uint32_t) -1) * (((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])));
            }
        } else
        if (size == 4 && (8 * sizeof(uint32_t) > 3 * PyLong_SHIFT)) {
            if ((8 * sizeof(long) > 4 * PyLong_SHIFT)) {
                long ival = - (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                __PYX_VERIFY_RETURN_INT(uint32_t, long, ival)
            } else if ((8 * sizeof(uint32_t) - 1 > 4 * PyLong_SHIFT)) {
                return (uint32_t) (((uint32_t) -1) * (((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])));
            }
        } else
        {}
    } else {
        const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
        const digit* digits = __Pyx_PyLong_Digits(x);
        if (size == 2 && (8 * sizeof(uint32_t) > 1 * PyLong_SHIFT)) {
            if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
                __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
            } else if ((8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT)) {
                return (uint32_t) (((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]));
            }
        } else
        if (size == 3 && (8 * sizeof(uint32_t) > 2 * PyLong_SHIFT)) {
            if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
                __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
            } else if ((8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT)) {
                return (uint32_t) (((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]));
            }
        } else
        if (size == 4 && (8 * sizeof(uint32_t) > 3 * PyLong_SHIFT)) {
            if ((8 * sizeof(long) > 4 * PyLong_SHIFT)) {
                __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
            } else if ((8 * sizeof(uint32_t) - 1 > 4 * PyLong_SHIFT)) {
                return (uint32_t) (((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]));
            }
        } else
        {}
    }
#endif
    #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
    if ((sizeof(uint32_t) <= sizeof(int)) && (sizeof(int) < sizeof(long))) {
        __PYX_VERIFY_RETURN_INT_EXC(uint32_t, int, PyLong_AsInt(x))
    } else
    #endif
    if ((sizeof(uint32_t) <= sizeof(long))) {
        __PYX_VERIFY_RETURN_INT_EXC(uint32_t, long, PyLong_AsLong(x))
    } else if ((sizeof(uint32_t) <= sizeof(PY_LONG_LONG))) {
        __PYX_VERIFY_RETURN_INT_EXC(uint32_t, PY_LONG_LONG, PyLong_AsLongLong(x))
    }
    return __Pyx_LargePyLong___Pyx_PyLong_As_uint32_t(x);
raise_neg_overflow:
    return __Pyx_raise_neg_overflow___Pyx_PyLong_As_uint32_t();
raise_overflow:
    return __Pyx_raise_overflow___Pyx_PyLong_As_uint32_t();
}
static uint32_t __Pyx_LargePyLong___Pyx_PyLong_As_uint32_t(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    uint32_t val;
    int ret = -1;
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
    Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
        x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
    if (unlikely(bytes_copied == -1)) {
    } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
        goto raise_overflow;
    } else {
        ret = 0;
    }
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
    int one = 1; int is_little = (int)*(unsigned char *)&one;
    unsigned char *bytes = (unsigned char *)&val;
    ret = _PyLong_AsByteArray((PyLongObject *)x,
                                bytes, sizeof(val),
                                is_little, !is_unsigned);
    if ((0)) goto raise_overflow;
#else
    PyObject *v;
    PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
    int bits, remaining_bits, is_negative = 0;
    int chunk_size = (sizeof(long) < 8) ? 30 : 62;
    if (likely(PyLong_CheckExact(x))) {
        v = __Pyx_NewRef(x);
    } else {
        v = PyNumber_Long(x);
        if (unlikely(!v)) return (uint32_t) -1;
        assert(PyLong_CheckExact(v));
    }
    {
        int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
        if (unlikely(result < 0)) {
            Py_DECREF(v);
            return (uint32_t) -1;
        }
        is_negative = result == 1;
    }
    if (is_unsigned && unlikely(is_negative)) {
        Py_DECREF(v);
        PyErr_SetString(PyExc_OverflowError,
            "can't convert negative value to uint32_t");
        return (uint32_t) -1;
    } else if (is_negative) {
        stepval = PyNumber_Invert(v);
        Py_DECREF(v);
        if (unlikely(!stepval))
            return (uint32_t) -1;
    } else {
        stepval = v;
    }
    v = NULL;
    val = (uint32_t) 0;
    mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
    shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
    for (bits = 0; bits < (int) sizeof(uint32_t) * 8 - chunk_size; bits += chunk_size) {
        PyObject *tmp, *digit;
        long idigit;
        digit = PyNumber_And(stepval, mask);
        if (unlikely(!digit)) goto done;
        idigit = PyLong_AsLong(digit);
        Py_DECREF(digit);
        if (unlikely(idigit < 0)) goto done;
        val |= ((uint32_t) idigit) << bits;
        tmp = PyNumber_Rshift(stepval, shift);
        if (unlikely(!tmp)) goto done;
        Py_DECREF(stepval); stepval = tmp;
    }
    Py_DECREF(shift); shift = NULL;
    Py_DECREF(mask); mask = NULL;
    {
        long idigit = PyLong_AsLong(stepval);
        if (unlikely(idigit < 0)) goto done;
        remaining_bits = ((int) sizeof(uint32_t) * 8) - bits - (is_unsigned ? 0 : 1);
        if (unlikely(idigit >= (1L << remaining_bits)))
            goto raise_overflow;
        val |= ((uint32_t) idigit) << bits;
    }
    if (!is_unsigned) {
        if (unlikely(val & (((uint32_t) 1) << (sizeof(uint32_t) * 8 - 1))))
            goto raise_overflow;
        if (is_negative)
            val = ~val;
    }
    ret = 0;
done:
    Py_XDECREF(shift);
    Py_XDECREF(mask);
    Py_XDECREF(stepval);
#endif
    if (unlikely(ret))
        return (uint32_t) -1;
    return val;
raise_overflow:
    return __Pyx_raise_overflow___Pyx_PyLong_As_uint32_t();
}
static CYTHON_INLINE uint32_t __Pyx_PyLong___Pyx_PyLong_As_uint32_t(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        #if CYTHON_USE_PYLONG_INTERNALS
        if (unlikely(__Pyx_PyLong_IsNeg(x))) {
            goto raise_neg_overflow;
        } else if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(uint32_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else
        #endif
        {
            return __Pyx_PyULong___Pyx_PyLong_As_uint32_t(x);
        }
    } else {
        #if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(uint32_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else
        #endif
        {
            return __Pyx_PySLong___Pyx_PyLong_As_uint32_t(x);
        }
    }
#if CYTHON_USE_PYLONG_INTERNALS
raise_neg_overflow:
    return __Pyx_raise_neg_overflow___Pyx_PyLong_As_uint32_t();
raise_overflow:
    return __Pyx_raise_overflow___Pyx_PyLong_As_uint32_t();
#endif
}
static uint32_t __Pyx_NonPyLong___Pyx_PyLong_As_uint32_t(PyObject *x) {
    uint32_t val;
    PyObject *tmp = __Pyx_PyNumber_Long(x);
    if (!tmp) return (uint32_t) -1;
    val = __Pyx_PyLong_As_uint32_t(tmp);
    Py_DECREF(tmp);
    return val;
}
static CYTHON_INLINE uint32_t __Pyx_PyLong_As_uint32_t(PyObject *x) {
    if (likely(PyLong_Check(x))) {
        return __Pyx_PyLong___Pyx_PyLong_As_uint32_t(x);
    } else {
        return __Pyx_NonPyLong___Pyx_PyLong_As_uint32_t(x);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyLong_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 PyLong_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#if !CYTHON_COMPILING_IN_PYPY
        } 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 PyLong_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        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 *result = NULL, *kwds = NULL;
        PyObject *py_bytes = NULL, *order_str = NULL, *from_bytes_str = NULL;;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long));
        if (!py_bytes) goto limited_bad;
        from_bytes_str = PyUnicode_FromStringAndSize("from_bytes", 10);
        if (!from_bytes_str) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        {
            PyObject *args[] = { (PyObject*)&PyLong_Type, py_bytes, order_str, Py_True };
            if (!is_unsigned) {
                PyObject *signed_str = PyUnicode_FromStringAndSize("signed", 6);
                if (!signed_str) goto limited_bad;
#if CYTHON_VECTORCALL
                kwds = PyTuple_Pack(1, signed_str);
#else
                {
                    PyObject *keys[] = {signed_str};
                    PyObject *values[] = {Py_True};
                    kwds = __Pyx_MakeKwargDict(keys, values, 1);
                }
#endif
                Py_DECREF(signed_str);
                if (unlikely(!kwds)) goto limited_bad;
            }
            result = __Pyx_Object_VectorcallMethodKwds(from_bytes_str, args, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
        }
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes_str);
        return result;
#endif
    }
}

/* GetRuntimeVersion */
#if __PYX_LIMITED_VERSION_HEX < 0x030b0000
void __Pyx_init_runtime_version(void) {
    if (__Pyx_cached_runtime_version == 0) {
        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;
        }
        __Pyx_cached_runtime_version = version;
    }
}
#endif
static unsigned long __Pyx_get_runtime_version(void) {
#if __PYX_LIMITED_VERSION_HEX >= 0x030b0000
    return Py_Version & ~0xFFUL;
#else
    return __Pyx_cached_runtime_version;
#endif
}

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

/* NewCodeObj */
#if CYTHON_COMPILING_IN_LIMITED_API
    static 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;
        #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 <= 10) {
            result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOOO", 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, "iiiiiiOOOOOOOiOOOO", 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 (!result) {
            PyObject *exc_type, *exc_value, *exc_tb;
            PyErr_Fetch(&exc_type, &exc_value, &exc_tb);
            if (PyErr_WarnFormat(
                    PyExc_RuntimeWarning, 1,
                    "Code object creation failed in Cython module: %S\nTry recompiling with a more recent version of Cython.",
                    exc_value ? exc_value : exc_type) == 0) {
                result = Py_None;
                Py_INCREF(result);
            }
            Py_DECREF(exc_type);
            Py_XDECREF(exc_value);
            Py_XDECREF(exc_tb);
        }
        return result;
    }
#elif PY_VERSION_HEX >= 0x030B0000
  static 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;
    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, __pyx_mstate_global->__pyx_empty_bytes);
    #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030c00A1
    if (likely(result))
        result->_co_firsttraceable = 0;
    #endif
    return result;
  }
#elif !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
static PyObject* __Pyx_PyCode_New(
        const __Pyx_PyCode_New_function_description descr,
        PyObject * const *varnames,
        PyObject *filename,
        PyObject *funcname,
        PyObject *line_table,
        PyObject *tuple_dedup_map
) {
    PyObject *code_obj = NULL, *varnames_tuple_dedup = NULL, *code_bytes = NULL;
    Py_ssize_t var_count = (Py_ssize_t) descr.nlocals;
    PyObject *varnames_tuple = PyTuple_New(var_count);
    if (unlikely(!varnames_tuple)) return NULL;
    for (Py_ssize_t i=0; i < var_count; i++) {
        Py_INCREF(varnames[i]);
        if (__Pyx_PyTuple_SET_ITEM(varnames_tuple, i, varnames[i]) != (0)) goto done;
    }
    #if CYTHON_COMPILING_IN_LIMITED_API
    varnames_tuple_dedup = PyDict_GetItem(tuple_dedup_map, varnames_tuple);
    if (!varnames_tuple_dedup) {
        if (unlikely(PyDict_SetItem(tuple_dedup_map, varnames_tuple, varnames_tuple) < 0)) goto done;
        varnames_tuple_dedup = varnames_tuple;
    }
    #else
    varnames_tuple_dedup = PyDict_SetDefault(tuple_dedup_map, varnames_tuple, varnames_tuple);
    if (unlikely(!varnames_tuple_dedup)) goto done;
    #endif
    #if CYTHON_AVOID_BORROWED_REFS
    Py_INCREF(varnames_tuple_dedup);
    #endif
    if (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table != NULL && !CYTHON_COMPILING_IN_GRAAL) {
        Py_ssize_t line_table_length = __Pyx_PyBytes_GET_SIZE(line_table);
        #if !CYTHON_ASSUME_SAFE_SIZE
        if (unlikely(line_table_length == -1)) goto done;
        #endif
        Py_ssize_t code_len = (line_table_length * 2 + 4) & ~3LL;
        code_bytes = PyBytes_FromStringAndSize(NULL, code_len);
        if (unlikely(!code_bytes)) goto done;
        char* c_code_bytes = PyBytes_AsString(code_bytes);
        if (unlikely(!c_code_bytes)) goto done;
        memset(c_code_bytes, 0, (size_t) code_len);
    }
    code_obj = (PyObject*) __Pyx__PyCode_New(
        (int) descr.argcount,
        (int) descr.num_posonly_args,
        (int) descr.num_kwonly_args,
        (int) descr.nlocals,
        0,
        (int) descr.flags,
        code_bytes ? code_bytes : __pyx_mstate_global->__pyx_empty_bytes,
        __pyx_mstate_global->__pyx_empty_tuple,
        __pyx_mstate_global->__pyx_empty_tuple,
        varnames_tuple_dedup,
        __pyx_mstate_global->__pyx_empty_tuple,
        __pyx_mstate_global->__pyx_empty_tuple,
        filename,
        funcname,
        (int) descr.first_line,
        (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table) ? line_table : __pyx_mstate_global->__pyx_empty_bytes
    );
done:
    Py_XDECREF(code_bytes);
    #if CYTHON_AVOID_BORROWED_REFS
    Py_XDECREF(varnames_tuple_dedup);
    #endif
    Py_DECREF(varnames_tuple);
    return code_obj;
}

/* DecompressString */
CYTHON_UNUSED
static CYTHON_SMALL_CODE PyObject *__Pyx_DecompressString(const char *s, Py_ssize_t length, int algo) {
#ifdef __Pyx_DecompressString_UNUSED
    CYTHON_UNUSED_VAR(s);
    CYTHON_UNUSED_VAR(length);
    CYTHON_UNUSED_VAR(algo);
    return NULL;
#else
    PyObject *module = NULL, *decompress, *compressed_bytes, *decompressed;
    const char* module_name = algo == 3 ? "compression.zstd" : algo == 2 ? "bz2" : "zlib";
    PyObject *methodname = PyUnicode_FromString("decompress");
    if (unlikely(!methodname)) return NULL;
    #if __PYX_LIMITED_VERSION_HEX >= 0x030e0000
    if (algo == 3) {
        PyObject *fromlist = Py_BuildValue("[O]", methodname);
        if (unlikely(!fromlist)) goto bad;
        module = PyImport_ImportModuleLevel("compression.zstd", NULL, NULL, fromlist, 0);
        Py_DECREF(fromlist);
    } else
    #endif
        module = PyImport_ImportModule(module_name);
    if (unlikely(!module)) goto import_failed;
    decompress = PyObject_GetAttr(module, methodname);
    if (unlikely(!decompress)) goto import_failed;
    {
        #ifdef __cplusplus
            char *memview_bytes = const_cast<char*>(s);
        #else
            #if defined(__clang__)
              #pragma clang diagnostic push
              #pragma clang diagnostic ignored "-Wcast-qual"
            #elif !defined(__INTEL_COMPILER) && defined(__GNUC__)
              #pragma GCC diagnostic push
              #pragma GCC diagnostic ignored "-Wcast-qual"
            #endif
            char *memview_bytes = (char*) s;
            #if defined(__clang__)
              #pragma clang diagnostic pop
            #elif !defined(__INTEL_COMPILER) && defined(__GNUC__)
              #pragma GCC diagnostic pop
            #endif
        #endif
        #if CYTHON_COMPILING_IN_LIMITED_API && !defined(PyBUF_READ)
        int memview_flags = 0x100;
        #else
        int memview_flags = PyBUF_READ;
        #endif
        compressed_bytes = PyMemoryView_FromMemory(memview_bytes, length, memview_flags);
    }
    if (unlikely(!compressed_bytes)) {
        Py_DECREF(decompress);
        goto bad;
    }
    decompressed = PyObject_CallFunctionObjArgs(decompress, compressed_bytes, NULL);
    Py_DECREF(compressed_bytes);
    Py_DECREF(decompress);
    Py_DECREF(module);
    Py_DECREF(methodname);
    return decompressed;
import_failed:
    PyErr_Format(PyExc_ImportError,
        "Failed to import '%.20s.decompress' - cannot initialise module strings. "
        "String compression was configured with the C macro 'CYTHON_COMPRESS_STRINGS=%d'.",
        module_name, algo);
bad:
    Py_XDECREF(module);
    Py_DECREF(methodname);
    return NULL;
#endif
}

/* DecompressString_LZSS */
#ifndef __Pyx_DecompressString_LZSS_UNUSED
CYTHON_UNUSED
static CYTHON_SMALL_CODE size_t __pyx_lzss_decompress(const uint8_t* src, uint8_t* dst, size_t dst_len) {
    size_t pos = 0, out_pos = 0;
    while (1) {
        uint32_t flags = src[pos++] | 0xFF00;
        while (flags & 0x100) {
            if (flags & 1) {
                dst[out_pos++] = src[pos++];
            } else {
                uint32_t lo = src[pos++], hi = src[pos++];
                uint32_t end_offset_of_last_occurrence, match_length;
                if (!(lo & 0x80)) {
                    end_offset_of_last_occurrence = lo;
                    match_length = hi;
                } else if (!(hi & 0x80)) {
                    end_offset_of_last_occurrence = 0x80 + (((hi << 2) & 0x180) | (lo & 0x7F));
                    match_length = hi & 0x1F;
                } else {
                    end_offset_of_last_occurrence = 0x80 + ((hi & 0x7F) << 7 | (lo & 0x7F));
                    match_length = src[pos++];
                }
                match_length += 3;
                size_t ref_pos = out_pos - end_offset_of_last_occurrence - match_length;
                memcpy(dst + out_pos, dst + ref_pos, match_length);
                out_pos += match_length;
            }
            if (out_pos >= dst_len) return pos;
            flags >>= 1;
        }
    }
}
#endif
static CYTHON_SMALL_CODE PyObject *__Pyx_DecompressString_LZSS(const char *s, size_t compressed_length, size_t uncompressed_length) {
#ifdef __Pyx_DecompressString_LZSS_UNUSED
    CYTHON_UNUSED_VAR(s);
    CYTHON_UNUSED_VAR(compressed_length);
    CYTHON_UNUSED_VAR(uncompressed_length);
    return NULL;
#else
    PyObject *result;
    unsigned char *result_data;
    size_t src_length;
    result = PyBytes_FromStringAndSize(NULL, (Py_ssize_t) uncompressed_length);
    if (unlikely(!result)) return NULL;
    result_data = __Pyx_PyBytes_AsWritableUString(result);
    if (unlikely(!result_data)) goto bad;
    src_length = __pyx_lzss_decompress((const uint8_t*) s, result_data, uncompressed_length);
    if (unlikely(src_length != compressed_length)) goto decompression_failed;
    return result;
decompression_failed:
    PyErr_SetString(PyExc_RuntimeError, "LZSS string data decompression failed");
bad:
    Py_DECREF(result);
    return NULL;
#endif
}

#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_UTF8
static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
    if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
#if CYTHON_COMPILING_IN_LIMITED_API
    {
        const char* result;
        Py_ssize_t unicode_length;
        CYTHON_MAYBE_UNUSED_VAR(unicode_length); // only for __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
        #if __PYX_LIMITED_VERSION_HEX < 0x030A0000
        if (unlikely(PyArg_Parse(o, "s#", &result, length) < 0)) return NULL;
        #else
        result = PyUnicode_AsUTF8AndSize(o, length);
        #endif
        #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
        unicode_length = PyUnicode_GetLength(o);
        if (unlikely(unicode_length < 0)) return NULL;
        if (unlikely(unicode_length != *length)) {
            PyUnicode_AsASCIIString(o);
            return NULL;
        }
        #endif
        return result;
    }
#else
#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_UTF8
    if (PyUnicode_Check(o)) {
        return __Pyx_PyUnicode_AsStringAndSize(o, length);
    } else
#endif
    if (PyByteArray_Check(o)) {
#if (CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS) || (CYTHON_COMPILING_IN_PYPY && (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)))
        *length = PyByteArray_GET_SIZE(o);
        return PyByteArray_AS_STRING(o);
#else
        *length = PyByteArray_Size(o);
        if (*length == -1) return NULL;
        return PyByteArray_AsString(o);
#endif
    } else
    {
        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_LongWrongResultType(PyObject* result) {
    __Pyx_TypeName result_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(result));
    #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
    if (unlikely(!result_type_name)) goto bad;
    #endif
    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);
            goto bad;
        }
        __Pyx_DECREF_TypeName(result_type_name);
        return result;
    }
    PyErr_Format(PyExc_TypeError,
                 "__int__ returned non-int (type " __Pyx_FMT_TYPENAME ")",
                 result_type_name);
    __Pyx_DECREF_TypeName(result_type_name);
bad:
    Py_DECREF(result);
    return NULL;
}
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x) {
#if CYTHON_USE_TYPE_SLOTS
  PyNumberMethods *m;
#endif
  PyObject *res = NULL;
  if (likely(PyLong_Check(x)))
      return __Pyx_NewRef(x);
#if CYTHON_USE_TYPE_SLOTS
  m = Py_TYPE(x)->tp_as_number;
  if (likely(m && m->nb_int)) {
      res = m->nb_int(x);
  }
#else
  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
      res = PyNumber_Long(x);
  }
#endif
  if (likely(res)) {
      if (unlikely(!PyLong_CheckExact(res))) {
          return __Pyx_PyNumber_LongWrongResultType(res);
      }
  }
  else if (!PyErr_Occurred()) {
      PyErr_SetString(PyExc_TypeError,
                      "an integer is required");
  }
  return res;
}
static CYTHON_INLINE Py_ssize_t __Pyx_PyLong_AsSsize_t(PyObject* b) {
    #if CYTHON_USE_PYLONG_INTERNALS
    Py_ssize_t ival;
    const Py_ssize_t size = __Pyx_PyLong_DigitCount(b);
    const int is_neg = __Pyx_PyLong_IsNeg(b);
    const digit* digits = __Pyx_PyLong_Digits(b);
    if (size == 0) return 0;
    #if SIZEOF_SIZE_T * 8 > 1 * PyLong_SHIFT
    if (size == 1) {
        ival = (Py_ssize_t) (((size_t)digits[0]));
    } else
    #endif
    #if SIZEOF_SIZE_T * 8 > 2 * PyLong_SHIFT
    if (size == 2) {
        ival = (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
    } else
    #endif
    #if SIZEOF_SIZE_T * 8 > 3 * PyLong_SHIFT
    if (size == 3) {
        ival = (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
    } else
    #endif
    #if SIZEOF_SIZE_T * 8 > 4 * PyLong_SHIFT
    if (size == 4) {
        ival = (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]));
    } else
    #endif
        return PyLong_AsSsize_t(b);
    return is_neg ? -ival : ival;
    #else
    return PyLong_AsSsize_t(b);
    #endif
}
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
    if (likely(PyLong_Check(b))) {
        return __Pyx_PyLong_AsSsize_t(b);
    } else {
        Py_ssize_t ival;
        PyObject *x = PyNumber_Index(b);
        if (unlikely(!x)) return -1;
        ival = __Pyx_PyLong_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);
  } else {
    Py_ssize_t ival;
    PyObject *x;
    x = PyNumber_Index(o);
    if (!x) return -1;
    ival = PyLong_AsLong(x);
    Py_DECREF(x);
    return ival;
  }
}
static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(int b) {
    CYTHON_UNUSED_VAR(b);
    return __Pyx_NewRef(Py_None);
}
static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
  return __Pyx_NewRef(b ? Py_True: Py_False);
}
static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(size_t ival) {
    return PyLong_FromSize_t(ival);
}


/* MultiPhaseInitModuleState */
#if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE
#ifndef CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
#if (CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX >= 0x030C0000)
  #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 1
#else
  #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 0
#endif
#endif
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE && !CYTHON_ATOMICS
#error "Module state with PEP489 requires atomics. Currently that's one of\
 C11, C++11, gcc atomic intrinsics or MSVC atomic intrinsics"
#endif
#if !CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
#define __Pyx_ModuleStateLookup_Lock()
#define __Pyx_ModuleStateLookup_Unlock()
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000
static PyMutex __Pyx_ModuleStateLookup_mutex = {0};
#define __Pyx_ModuleStateLookup_Lock() PyMutex_Lock(&__Pyx_ModuleStateLookup_mutex)
#define __Pyx_ModuleStateLookup_Unlock() PyMutex_Unlock(&__Pyx_ModuleStateLookup_mutex)
#elif defined(__cplusplus) && __cplusplus >= 201103L
#include <mutex>
static std::mutex __Pyx_ModuleStateLookup_mutex;
#define __Pyx_ModuleStateLookup_Lock() __Pyx_ModuleStateLookup_mutex.lock()
#define __Pyx_ModuleStateLookup_Unlock() __Pyx_ModuleStateLookup_mutex.unlock()
#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ > 201112L) && !defined(__STDC_NO_THREADS__)
#include <threads.h>
static mtx_t __Pyx_ModuleStateLookup_mutex;
static once_flag __Pyx_ModuleStateLookup_mutex_once_flag = ONCE_FLAG_INIT;
static void __Pyx_ModuleStateLookup_initialize_mutex(void) {
    mtx_init(&__Pyx_ModuleStateLookup_mutex, mtx_plain);
}
#define __Pyx_ModuleStateLookup_Lock()\
  call_once(&__Pyx_ModuleStateLookup_mutex_once_flag, __Pyx_ModuleStateLookup_initialize_mutex);\
  mtx_lock(&__Pyx_ModuleStateLookup_mutex)
#define __Pyx_ModuleStateLookup_Unlock() mtx_unlock(&__Pyx_ModuleStateLookup_mutex)
#elif defined(HAVE_PTHREAD_H)
#include <pthread.h>
static pthread_mutex_t __Pyx_ModuleStateLookup_mutex = PTHREAD_MUTEX_INITIALIZER;
#define __Pyx_ModuleStateLookup_Lock() pthread_mutex_lock(&__Pyx_ModuleStateLookup_mutex)
#define __Pyx_ModuleStateLookup_Unlock() pthread_mutex_unlock(&__Pyx_ModuleStateLookup_mutex)
#elif defined(_WIN32)
#include <Windows.h>  // synchapi.h on its own doesn't work
static SRWLOCK __Pyx_ModuleStateLookup_mutex = SRWLOCK_INIT;
#define __Pyx_ModuleStateLookup_Lock() AcquireSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex)
#define __Pyx_ModuleStateLookup_Unlock() ReleaseSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex)
#else
#error "No suitable lock available for CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE.\
 Requires C standard >= C11, or C++ standard >= C++11,\
 or pthreads, or the Windows 32 API, or Python >= 3.13."
#endif
typedef struct {
    int64_t id;
    PyObject *module;
} __Pyx_InterpreterIdAndModule;
typedef struct {
    char interpreter_id_as_index;
    Py_ssize_t count;
    Py_ssize_t allocated;
    __Pyx_InterpreterIdAndModule table[1];
} __Pyx_ModuleStateLookupData;
#define __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE 32
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
static __pyx_atomic_int_type __Pyx_ModuleStateLookup_read_counter = 0;
#endif
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
static __pyx_atomic_ptr_type __Pyx_ModuleStateLookup_data = 0;
#else
static __Pyx_ModuleStateLookupData* __Pyx_ModuleStateLookup_data = NULL;
#endif
static __Pyx_InterpreterIdAndModule* __Pyx_State_FindModuleStateLookupTableLowerBound(
        __Pyx_InterpreterIdAndModule* table,
        Py_ssize_t count,
        int64_t interpreterId) {
    __Pyx_InterpreterIdAndModule* begin = table;
    __Pyx_InterpreterIdAndModule* end = begin + count;
    if (begin->id == interpreterId) {
        return begin;
    }
    while ((end - begin) > __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) {
        __Pyx_InterpreterIdAndModule* halfway = begin + (end - begin)/2;
        if (halfway->id == interpreterId) {
            return halfway;
        }
        if (halfway->id < interpreterId) {
            begin = halfway;
        } else {
            end = halfway;
        }
    }
    for (; begin < end; ++begin) {
        if (begin->id >= interpreterId) return begin;
    }
    return begin;
}
static PyObject *__Pyx_State_FindModule(CYTHON_UNUSED void* dummy) {
    int64_t interpreter_id = PyInterpreterState_GetID(PyInterpreterState_Get());
    if (interpreter_id == -1) return NULL;
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
    __Pyx_ModuleStateLookupData* data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data);
    {
        __pyx_atomic_incr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
        if (likely(data)) {
            __Pyx_ModuleStateLookupData* new_data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_acquire(&__Pyx_ModuleStateLookup_data);
            if (likely(data == new_data)) {
                goto read_finished;
            }
        }
        __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
        __Pyx_ModuleStateLookup_Lock();
        __pyx_atomic_incr_relaxed(&__Pyx_ModuleStateLookup_read_counter);
        data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data);
        __Pyx_ModuleStateLookup_Unlock();
    }
  read_finished:;
#else
    __Pyx_ModuleStateLookupData* data = __Pyx_ModuleStateLookup_data;
#endif
    __Pyx_InterpreterIdAndModule* found = NULL;
    if (unlikely(!data)) goto end;
    if (data->interpreter_id_as_index) {
        if (interpreter_id < data->count) {
            found = data->table+interpreter_id;
        }
    } else {
        found = __Pyx_State_FindModuleStateLookupTableLowerBound(
            data->table, data->count, interpreter_id);
    }
  end:
    {
        PyObject *result=NULL;
        if (found && found->id == interpreter_id) {
            result = found->module;
        }
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
        __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
#endif
        return result;
    }
}
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
static void __Pyx_ModuleStateLookup_wait_until_no_readers(void) {
    while (__pyx_atomic_load(&__Pyx_ModuleStateLookup_read_counter) != 0);
}
#else
#define __Pyx_ModuleStateLookup_wait_until_no_readers()
#endif
static int __Pyx_State_AddModuleInterpIdAsIndex(__Pyx_ModuleStateLookupData **old_data, PyObject* module, int64_t interpreter_id) {
    Py_ssize_t to_allocate = (*old_data)->allocated;
    while (to_allocate <= interpreter_id) {
        if (to_allocate == 0) to_allocate = 1;
        else to_allocate *= 2;
    }
    __Pyx_ModuleStateLookupData *new_data = *old_data;
    if (to_allocate != (*old_data)->allocated) {
         new_data = (__Pyx_ModuleStateLookupData *)realloc(
            *old_data,
            sizeof(__Pyx_ModuleStateLookupData)+(to_allocate-1)*sizeof(__Pyx_InterpreterIdAndModule));
        if (!new_data) {
            PyErr_NoMemory();
            return -1;
        }
        for (Py_ssize_t i = new_data->allocated; i < to_allocate; ++i) {
            new_data->table[i].id = i;
            new_data->table[i].module = NULL;
        }
        new_data->allocated = to_allocate;
    }
    new_data->table[interpreter_id].module = module;
    if (new_data->count < interpreter_id+1) {
        new_data->count = interpreter_id+1;
    }
    *old_data = new_data;
    return 0;
}
static void __Pyx_State_ConvertFromInterpIdAsIndex(__Pyx_ModuleStateLookupData *data) {
    __Pyx_InterpreterIdAndModule *read = data->table;
    __Pyx_InterpreterIdAndModule *write = data->table;
    __Pyx_InterpreterIdAndModule *end = read + data->count;
    for (; read<end; ++read) {
        if (read->module) {
            write->id = read->id;
            write->module = read->module;
            ++write;
        }
    }
    data->count = write - data->table;
    for (; write<end; ++write) {
        write->id = 0;
        write->module = NULL;
    }
    data->interpreter_id_as_index = 0;
}
static int __Pyx_State_AddModule(PyObject* module, CYTHON_UNUSED void* dummy) {
    int64_t interpreter_id = PyInterpreterState_GetID(PyInterpreterState_Get());
    if (interpreter_id == -1) return -1;
    int result = 0;
    __Pyx_ModuleStateLookup_Lock();
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
    __Pyx_ModuleStateLookupData *old_data = (__Pyx_ModuleStateLookupData *)
            __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0);
#else
    __Pyx_ModuleStateLookupData *old_data = __Pyx_ModuleStateLookup_data;
#endif
    __Pyx_ModuleStateLookupData *new_data = old_data;
    if (!new_data) {
        new_data = (__Pyx_ModuleStateLookupData *)calloc(1, sizeof(__Pyx_ModuleStateLookupData));
        if (!new_data) {
            result = -1;
            PyErr_NoMemory();
            goto end;
        }
        new_data->allocated = 1;
        new_data->interpreter_id_as_index = 1;
    }
    __Pyx_ModuleStateLookup_wait_until_no_readers();
    if (new_data->interpreter_id_as_index) {
        if (interpreter_id < __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) {
            result = __Pyx_State_AddModuleInterpIdAsIndex(&new_data, module, interpreter_id);
            goto end;
        }
        __Pyx_State_ConvertFromInterpIdAsIndex(new_data);
    }
    {
        Py_ssize_t insert_at = 0;
        {
            __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound(
                new_data->table, new_data->count, interpreter_id);
            assert(lower_bound);
            insert_at = lower_bound - new_data->table;
            if (unlikely(insert_at < new_data->count && lower_bound->id == interpreter_id)) {
                lower_bound->module = module;
                goto end;  // already in table, nothing more to do
            }
        }
        if (new_data->count+1 >= new_data->allocated) {
            Py_ssize_t to_allocate = (new_data->count+1)*2;
            new_data =
                (__Pyx_ModuleStateLookupData*)realloc(
                    new_data,
                    sizeof(__Pyx_ModuleStateLookupData) +
                    (to_allocate-1)*sizeof(__Pyx_InterpreterIdAndModule));
            if (!new_data) {
                result = -1;
                new_data = old_data;
                PyErr_NoMemory();
                goto end;
            }
            new_data->allocated = to_allocate;
        }
        ++new_data->count;
        int64_t last_id = interpreter_id;
        PyObject *last_module = module;
        for (Py_ssize_t i=insert_at; i<new_data->count; ++i) {
            int64_t current_id = new_data->table[i].id;
            new_data->table[i].id = last_id;
            last_id = current_id;
            PyObject *current_module = new_data->table[i].module;
            new_data->table[i].module = last_module;
            last_module = current_module;
        }
    }
  end:
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
    __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, new_data);
#else
    __Pyx_ModuleStateLookup_data = new_data;
#endif
    __Pyx_ModuleStateLookup_Unlock();
    return result;
}
static int __Pyx_State_RemoveModule(CYTHON_UNUSED void* dummy) {
    int64_t interpreter_id = PyInterpreterState_GetID(PyInterpreterState_Get());
    if (interpreter_id == -1) return -1;
    __Pyx_ModuleStateLookup_Lock();
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
    __Pyx_ModuleStateLookupData *data = (__Pyx_ModuleStateLookupData *)
            __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0);
#else
    __Pyx_ModuleStateLookupData *data = __Pyx_ModuleStateLookup_data;
#endif
    if (data->interpreter_id_as_index) {
        if (interpreter_id < data->count) {
            data->table[interpreter_id].module = NULL;
        }
        goto done;
    }
    {
        __Pyx_ModuleStateLookup_wait_until_no_readers();
        __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound(
            data->table, data->count, interpreter_id);
        if (!lower_bound) goto done;
        if (lower_bound->id != interpreter_id) goto done;
        __Pyx_InterpreterIdAndModule *end = data->table+data->count;
        for (;lower_bound<end-1; ++lower_bound) {
            lower_bound->id = (lower_bound+1)->id;
            lower_bound->module = (lower_bound+1)->module;
        }
    }
    --data->count;
    if (data->count == 0) {
        free(data);
        data = NULL;
    }
  done:
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
    __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, data);
#else
    __Pyx_ModuleStateLookup_data = data;
#endif
    __Pyx_ModuleStateLookup_Unlock();
    return 0;
}
#endif

/* #### Code section: utility_code_pragmas_end ### */
#ifdef _MSC_VER
#pragma warning( pop )
#endif



/* #### Code section: end ### */
#endif /* Py_PYTHON_H */
