/* Generated by Cython 0.29.30 */

/* BEGIN: Cython Metadata
{
    "distutils": {
        "depends": [],
        "name": "_element_graph",
        "sources": [
            "_element_graph.pyx"
        ]
    },
    "module_name": "_element_graph"
}
END: Cython Metadata */

#ifndef PY_SSIZE_T_CLEAN
#define PY_SSIZE_T_CLEAN
#endif /* PY_SSIZE_T_CLEAN */
#include "Python.h"
#ifndef Py_PYTHON_H
    #error Python headers needed to compile C extensions, please install development version of Python.
#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
    #error Cython requires Python 2.6+ or Python 3.3+.
#else
#define CYTHON_ABI "0_29_30"
#define CYTHON_HEX_VERSION 0x001D1EF0
#define CYTHON_FUTURE_DIVISION 1
#include <stddef.h>
#ifndef offsetof
  #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif
#if !defined(WIN32) && !defined(MS_WINDOWS)
  #ifndef __stdcall
    #define __stdcall
  #endif
  #ifndef __cdecl
    #define __cdecl
  #endif
  #ifndef __fastcall
    #define __fastcall
  #endif
#endif
#ifndef DL_IMPORT
  #define DL_IMPORT(t) t
#endif
#ifndef DL_EXPORT
  #define DL_EXPORT(t) t
#endif
#define __PYX_COMMA ,
#ifndef HAVE_LONG_LONG
  #if PY_VERSION_HEX >= 0x02070000
    #define HAVE_LONG_LONG
  #endif
#endif
#ifndef PY_LONG_LONG
  #define PY_LONG_LONG LONG_LONG
#endif
#ifndef Py_HUGE_VAL
  #define Py_HUGE_VAL HUGE_VAL
#endif
#ifdef PYPY_VERSION
  #define CYTHON_COMPILING_IN_PYPY 1
  #define CYTHON_COMPILING_IN_PYSTON 0
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #undef CYTHON_USE_TYPE_SLOTS
  #define CYTHON_USE_TYPE_SLOTS 0
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #if PY_VERSION_HEX < 0x03050000
    #undef CYTHON_USE_ASYNC_SLOTS
    #define CYTHON_USE_ASYNC_SLOTS 0
  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
    #define CYTHON_USE_ASYNC_SLOTS 1
  #endif
  #undef CYTHON_USE_PYLIST_INTERNALS
  #define CYTHON_USE_PYLIST_INTERNALS 0
  #undef CYTHON_USE_UNICODE_INTERNALS
  #define CYTHON_USE_UNICODE_INTERNALS 0
  #undef CYTHON_USE_UNICODE_WRITER
  #define CYTHON_USE_UNICODE_WRITER 0
  #undef CYTHON_USE_PYLONG_INTERNALS
  #define CYTHON_USE_PYLONG_INTERNALS 0
  #undef CYTHON_AVOID_BORROWED_REFS
  #define CYTHON_AVOID_BORROWED_REFS 1
  #undef CYTHON_ASSUME_SAFE_MACROS
  #define CYTHON_ASSUME_SAFE_MACROS 0
  #undef CYTHON_UNPACK_METHODS
  #define CYTHON_UNPACK_METHODS 0
  #undef CYTHON_FAST_THREAD_STATE
  #define CYTHON_FAST_THREAD_STATE 0
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #undef CYTHON_PEP489_MULTI_PHASE_INIT
  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
  #undef CYTHON_USE_TP_FINALIZE
  #define CYTHON_USE_TP_FINALIZE 0
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 0
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_HEX >= 0x07030900)
  #endif
#elif defined(PYSTON_VERSION)
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_PYSTON 1
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #ifndef CYTHON_USE_TYPE_SLOTS
    #define CYTHON_USE_TYPE_SLOTS 1
  #endif
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #undef CYTHON_USE_ASYNC_SLOTS
  #define CYTHON_USE_ASYNC_SLOTS 0
  #undef CYTHON_USE_PYLIST_INTERNALS
  #define CYTHON_USE_PYLIST_INTERNALS 0
  #ifndef CYTHON_USE_UNICODE_INTERNALS
    #define CYTHON_USE_UNICODE_INTERNALS 1
  #endif
  #undef CYTHON_USE_UNICODE_WRITER
  #define CYTHON_USE_UNICODE_WRITER 0
  #undef CYTHON_USE_PYLONG_INTERNALS
  #define CYTHON_USE_PYLONG_INTERNALS 0
  #ifndef CYTHON_AVOID_BORROWED_REFS
    #define CYTHON_AVOID_BORROWED_REFS 0
  #endif
  #ifndef CYTHON_ASSUME_SAFE_MACROS
    #define CYTHON_ASSUME_SAFE_MACROS 1
  #endif
  #ifndef CYTHON_UNPACK_METHODS
    #define CYTHON_UNPACK_METHODS 1
  #endif
  #undef CYTHON_FAST_THREAD_STATE
  #define CYTHON_FAST_THREAD_STATE 0
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #undef CYTHON_PEP489_MULTI_PHASE_INIT
  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
  #undef CYTHON_USE_TP_FINALIZE
  #define CYTHON_USE_TP_FINALIZE 0
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 0
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
  #endif
#else
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_PYSTON 0
  #define CYTHON_COMPILING_IN_CPYTHON 1
  #ifndef CYTHON_USE_TYPE_SLOTS
    #define CYTHON_USE_TYPE_SLOTS 1
  #endif
  #if PY_VERSION_HEX < 0x02070000
    #undef CYTHON_USE_PYTYPE_LOOKUP
    #define CYTHON_USE_PYTYPE_LOOKUP 0
  #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
    #define CYTHON_USE_PYTYPE_LOOKUP 1
  #endif
  #if PY_MAJOR_VERSION < 3
    #undef CYTHON_USE_ASYNC_SLOTS
    #define CYTHON_USE_ASYNC_SLOTS 0
  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
    #define CYTHON_USE_ASYNC_SLOTS 1
  #endif
  #if PY_VERSION_HEX < 0x02070000
    #undef CYTHON_USE_PYLONG_INTERNALS
    #define CYTHON_USE_PYLONG_INTERNALS 0
  #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
    #define CYTHON_USE_PYLONG_INTERNALS 1
  #endif
  #ifndef CYTHON_USE_PYLIST_INTERNALS
    #define CYTHON_USE_PYLIST_INTERNALS 1
  #endif
  #ifndef CYTHON_USE_UNICODE_INTERNALS
    #define CYTHON_USE_UNICODE_INTERNALS 1
  #endif
  #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2
    #undef CYTHON_USE_UNICODE_WRITER
    #define CYTHON_USE_UNICODE_WRITER 0
  #elif !defined(CYTHON_USE_UNICODE_WRITER)
    #define CYTHON_USE_UNICODE_WRITER 1
  #endif
  #ifndef CYTHON_AVOID_BORROWED_REFS
    #define CYTHON_AVOID_BORROWED_REFS 0
  #endif
  #ifndef CYTHON_ASSUME_SAFE_MACROS
    #define CYTHON_ASSUME_SAFE_MACROS 1
  #endif
  #ifndef CYTHON_UNPACK_METHODS
    #define CYTHON_UNPACK_METHODS 1
  #endif
  #if PY_VERSION_HEX >= 0x030B00A4
    #undef CYTHON_FAST_THREAD_STATE
    #define CYTHON_FAST_THREAD_STATE 0
  #elif !defined(CYTHON_FAST_THREAD_STATE)
    #define CYTHON_FAST_THREAD_STATE 1
  #endif
  #ifndef CYTHON_FAST_PYCALL
    #define CYTHON_FAST_PYCALL (PY_VERSION_HEX < 0x030A0000)
  #endif
  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
    #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
  #endif
  #ifndef CYTHON_USE_TP_FINALIZE
    #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
  #endif
  #ifndef CYTHON_USE_DICT_VERSIONS
    #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
  #endif
  #if PY_VERSION_HEX >= 0x030B00A4
    #undef CYTHON_USE_EXC_INFO_STACK
    #define CYTHON_USE_EXC_INFO_STACK 0
  #elif !defined(CYTHON_USE_EXC_INFO_STACK)
    #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
  #endif
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
  #endif
#endif
#if !defined(CYTHON_FAST_PYCCALL)
#define CYTHON_FAST_PYCCALL  (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
#endif
#if CYTHON_USE_PYLONG_INTERNALS
  #if PY_MAJOR_VERSION < 3
    #include "longintrepr.h"
  #endif
  #undef SHIFT
  #undef BASE
  #undef MASK
  #ifdef SIZEOF_VOID_P
    enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
  #endif
#endif
#ifndef __has_attribute
  #define __has_attribute(x) 0
#endif
#ifndef __has_cpp_attribute
  #define __has_cpp_attribute(x) 0
#endif
#ifndef CYTHON_RESTRICT
  #if defined(__GNUC__)
    #define CYTHON_RESTRICT __restrict__
  #elif defined(_MSC_VER) && _MSC_VER >= 1400
    #define CYTHON_RESTRICT __restrict
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define CYTHON_RESTRICT restrict
  #else
    #define CYTHON_RESTRICT
  #endif
#endif
#ifndef CYTHON_UNUSED
# if defined(__GNUC__)
#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
#     define CYTHON_UNUSED __attribute__ ((__unused__))
#   else
#     define CYTHON_UNUSED
#   endif
# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
#   define CYTHON_UNUSED __attribute__ ((__unused__))
# else
#   define CYTHON_UNUSED
# endif
#endif
#ifndef CYTHON_MAYBE_UNUSED_VAR
#  if defined(__cplusplus)
     template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
#  else
#    define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
#  endif
#endif
#ifndef CYTHON_NCP_UNUSED
# if CYTHON_COMPILING_IN_CPYTHON
#  define CYTHON_NCP_UNUSED
# else
#  define CYTHON_NCP_UNUSED CYTHON_UNUSED
# endif
#endif
#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
#ifdef _MSC_VER
    #ifndef _MSC_STDINT_H_
        #if _MSC_VER < 1300
           typedef unsigned char     uint8_t;
           typedef unsigned int      uint32_t;
        #else
           typedef unsigned __int8   uint8_t;
           typedef unsigned __int32  uint32_t;
        #endif
    #endif
#else
   #include <stdint.h>
#endif
#ifndef CYTHON_FALLTHROUGH
  #if defined(__cplusplus) && __cplusplus >= 201103L
    #if __has_cpp_attribute(fallthrough)
      #define CYTHON_FALLTHROUGH [[fallthrough]]
    #elif __has_cpp_attribute(clang::fallthrough)
      #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
    #elif __has_cpp_attribute(gnu::fallthrough)
      #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
    #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

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

#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
  #define Py_OptimizeFlag 0
#endif
#define __PYX_BUILD_PY_SSIZE_T "n"
#define CYTHON_FORMAT_SSIZE_T "z"
#if PY_MAJOR_VERSION < 3
  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  #define __Pyx_DefaultClassType PyClass_Type
#else
  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
  #define __Pyx_DefaultClassType PyType_Type
#if PY_VERSION_HEX >= 0x030B00A1
    static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, 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 *kwds=NULL, *argcount=NULL, *posonlyargcount=NULL, *kwonlyargcount=NULL;
        PyObject *nlocals=NULL, *stacksize=NULL, *flags=NULL, *replace=NULL, *call_result=NULL, *empty=NULL;
        const char *fn_cstr=NULL;
        const char *name_cstr=NULL;
        PyCodeObject* co=NULL;
        PyObject *type, *value, *traceback;
        PyErr_Fetch(&type, &value, &traceback);
        if (!(kwds=PyDict_New())) goto end;
        if (!(argcount=PyLong_FromLong(a))) goto end;
        if (PyDict_SetItemString(kwds, "co_argcount", argcount) != 0) goto end;
        if (!(posonlyargcount=PyLong_FromLong(0))) goto end;
        if (PyDict_SetItemString(kwds, "co_posonlyargcount", posonlyargcount) != 0) goto end;
        if (!(kwonlyargcount=PyLong_FromLong(k))) goto end;
        if (PyDict_SetItemString(kwds, "co_kwonlyargcount", kwonlyargcount) != 0) goto end;
        if (!(nlocals=PyLong_FromLong(l))) goto end;
        if (PyDict_SetItemString(kwds, "co_nlocals", nlocals) != 0) goto end;
        if (!(stacksize=PyLong_FromLong(s))) goto end;
        if (PyDict_SetItemString(kwds, "co_stacksize", stacksize) != 0) goto end;
        if (!(flags=PyLong_FromLong(f))) goto end;
        if (PyDict_SetItemString(kwds, "co_flags", flags) != 0) goto end;
        if (PyDict_SetItemString(kwds, "co_code", code) != 0) goto end;
        if (PyDict_SetItemString(kwds, "co_consts", c) != 0) goto end;
        if (PyDict_SetItemString(kwds, "co_names", n) != 0) goto end;
        if (PyDict_SetItemString(kwds, "co_varnames", v) != 0) goto end;
        if (PyDict_SetItemString(kwds, "co_freevars", fv) != 0) goto end;
        if (PyDict_SetItemString(kwds, "co_cellvars", cell) != 0) goto end;
        if (PyDict_SetItemString(kwds, "co_linetable", lnos) != 0) goto end;
        if (!(fn_cstr=PyUnicode_AsUTF8AndSize(fn, NULL))) goto end;
        if (!(name_cstr=PyUnicode_AsUTF8AndSize(name, NULL))) goto end;
        if (!(co = PyCode_NewEmpty(fn_cstr, name_cstr, fline))) goto end;
        if (!(replace = PyObject_GetAttrString((PyObject*)co, "replace"))) goto cleanup_code_too;
        if (!(empty = PyTuple_New(0))) goto cleanup_code_too; // unfortunately __pyx_empty_tuple isn't available here
        if (!(call_result = PyObject_Call(replace, empty, kwds))) goto cleanup_code_too;
        Py_XDECREF((PyObject*)co);
        co = (PyCodeObject*)call_result;
        call_result = NULL;
        if (0) {
            cleanup_code_too:
            Py_XDECREF((PyObject*)co);
            co = NULL;
        }
        end:
        Py_XDECREF(kwds);
        Py_XDECREF(argcount);
        Py_XDECREF(posonlyargcount);
        Py_XDECREF(kwonlyargcount);
        Py_XDECREF(nlocals);
        Py_XDECREF(stacksize);
        Py_XDECREF(replace);
        Py_XDECREF(call_result);
        Py_XDECREF(empty);
        if (type) {
            PyErr_Restore(type, value, traceback);
        }
        return co;
    }
#else
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#endif
  #define __Pyx_DefaultClassType PyType_Type
#endif
#ifndef Py_TPFLAGS_CHECKTYPES
  #define Py_TPFLAGS_CHECKTYPES 0
#endif
#ifndef Py_TPFLAGS_HAVE_INDEX
  #define Py_TPFLAGS_HAVE_INDEX 0
#endif
#ifndef Py_TPFLAGS_HAVE_NEWBUFFER
  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
#ifndef Py_TPFLAGS_HAVE_FINALIZE
  #define Py_TPFLAGS_HAVE_FINALIZE 0
#endif
#ifndef METH_STACKLESS
  #define METH_STACKLESS 0
#endif
#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
  #ifndef METH_FASTCALL
     #define METH_FASTCALL 0x80
  #endif
  typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
  typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
                                                          Py_ssize_t nargs, PyObject *kwnames);
#else
  #define __Pyx_PyCFunctionFast _PyCFunctionFast
  #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
#endif
#if CYTHON_FAST_PYCCALL
#define __Pyx_PyFastCFunction_Check(func)\
    ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
#else
#define __Pyx_PyFastCFunction_Check(func) 0
#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_CPYTHON && PY_VERSION_HEX < 0x030400A1
  #define PyMem_RawMalloc(n)           PyMem_Malloc(n)
  #define PyMem_RawRealloc(p, n)       PyMem_Realloc(p, n)
  #define PyMem_RawFree(p)             PyMem_Free(p)
#endif
#if CYTHON_COMPILING_IN_PYSTON
  #define __Pyx_PyCode_HasFreeVars(co)  PyCode_HasFreeVars(co)
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
#else
  #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno)  (frame)->f_lineno = (lineno)
#endif
#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
  #define __Pyx_PyThreadState_Current PyThreadState_GET()
#elif PY_VERSION_HEX >= 0x03060000
  #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
#elif PY_VERSION_HEX >= 0x03000000
  #define __Pyx_PyThreadState_Current PyThreadState_GET()
#else
  #define __Pyx_PyThreadState_Current _PyThreadState_Current
#endif
#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
#include "pythread.h"
#define Py_tss_NEEDS_INIT 0
typedef int Py_tss_t;
static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
  *key = PyThread_create_key();
  return 0;
}
static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
  Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
  *key = Py_tss_NEEDS_INIT;
  return key;
}
static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
  PyObject_Free(key);
}
static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
  return *key != Py_tss_NEEDS_INIT;
}
static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
  PyThread_delete_key(*key);
  *key = Py_tss_NEEDS_INIT;
}
static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
  return PyThread_set_key_value(*key, value);
}
static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
  return PyThread_get_key_value(*key);
}
#endif
#if 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
#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
#else
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
#define __Pyx_PyDict_GetItemStr(dict, name)  _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
#else
#define __Pyx_PyDict_GetItemStr(dict, name)  PyDict_GetItem(dict, name)
#endif
#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
  #define CYTHON_PEP393_ENABLED 1
  #if defined(PyUnicode_IS_READY)
  #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ?\
                                              0 : _PyUnicode_Ready((PyObject *)(op)))
  #else
  #define __Pyx_PyUnicode_READY(op)       (0)
  #endif
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   PyUnicode_MAX_CHAR_VALUE(u)
  #define __Pyx_PyUnicode_KIND(u)         PyUnicode_KIND(u)
  #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
  #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
  #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  PyUnicode_WRITE(k, d, i, ch)
  #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE)
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
  #else
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
  #endif
  #else
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_LENGTH(u))
  #endif
#else
  #define CYTHON_PEP393_ENABLED 0
  #define PyUnicode_1BYTE_KIND  1
  #define PyUnicode_2BYTE_KIND  2
  #define PyUnicode_4BYTE_KIND  4
  #define __Pyx_PyUnicode_READY(op)       (0)
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_SIZE(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
  #define __Pyx_PyUnicode_KIND(u)         (sizeof(Py_UNICODE))
  #define __Pyx_PyUnicode_DATA(u)         ((void*)PyUnicode_AS_UNICODE(u))
  #define __Pyx_PyUnicode_READ(k, d, i)   ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
  #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_SIZE(u))
#endif
#if CYTHON_COMPILING_IN_PYPY
  #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
#else
  #define __Pyx_PyUnicode_Concat(a, b)      PyUnicode_Concat(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
      PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
  #define PyUnicode_Contains(u, s)  PySequence_Contains(u, s)
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
  #define PyByteArray_Check(obj)  PyObject_TypeCheck(obj, &PyByteArray_Type)
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
  #define PyObject_Format(obj, fmt)  PyObject_CallMethod(obj, "__format__", "O", fmt)
#endif
#define __Pyx_PyString_FormatSafe(a, b)   ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
#define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyString_Format(a, b)  PyUnicode_Format(a, b)
#else
  #define __Pyx_PyString_Format(a, b)  PyString_Format(a, b)
#endif
#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
  #define PyObject_ASCII(o)            PyObject_Repr(o)
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBaseString_Type            PyUnicode_Type
  #define PyStringObject               PyUnicodeObject
  #define PyString_Type                PyUnicode_Type
  #define PyString_Check               PyUnicode_Check
  #define PyString_CheckExact          PyUnicode_CheckExact
#ifndef PyObject_Unicode
  #define PyObject_Unicode             PyObject_Str
#endif
#endif
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
#else
  #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
#endif
#ifndef PySet_CheckExact
  #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
#endif
#if PY_VERSION_HEX >= 0x030900A4
  #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
  #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
#else
  #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
  #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
#endif
#if CYTHON_ASSUME_SAFE_MACROS
  #define __Pyx_PySequence_SIZE(seq)  Py_SIZE(seq)
#else
  #define __Pyx_PySequence_SIZE(seq)  PySequence_Size(seq)
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyIntObject                  PyLongObject
  #define PyInt_Type                   PyLong_Type
  #define PyInt_Check(op)              PyLong_Check(op)
  #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
  #define PyInt_FromString             PyLong_FromString
  #define PyInt_FromUnicode            PyLong_FromUnicode
  #define PyInt_FromLong               PyLong_FromLong
  #define PyInt_FromSize_t             PyLong_FromSize_t
  #define PyInt_FromSsize_t            PyLong_FromSsize_t
  #define PyInt_AsLong                 PyLong_AsLong
  #define PyInt_AS_LONG                PyLong_AS_LONG
  #define PyInt_AsSsize_t              PyLong_AsSsize_t
  #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
  #define PyNumber_Int                 PyNumber_Long
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBoolObject                 PyLongObject
#endif
#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
  #ifndef PyUnicode_InternFromString
    #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
  #endif
#endif
#if PY_VERSION_HEX < 0x030200A4
  typedef long Py_hash_t;
  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
  #define __Pyx_PyInt_AsHash_t   __Pyx_PyIndex_AsHash_t
#else
  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
  #define __Pyx_PyInt_AsHash_t   __Pyx_PyIndex_AsSsize_t
#endif
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
#else
  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
#endif
#if CYTHON_USE_ASYNC_SLOTS
  #if PY_VERSION_HEX >= 0x030500B1
    #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
    #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
  #else
    #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
  #endif
#else
  #define __Pyx_PyType_AsAsync(obj) NULL
#endif
#ifndef __Pyx_PyAsyncMethodsStruct
    typedef struct {
        unaryfunc am_await;
        unaryfunc am_aiter;
        unaryfunc am_anext;
    } __Pyx_PyAsyncMethodsStruct;
#endif

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

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

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

#define __PYX_HAVE___element_graph
#define __PYX_HAVE_API___element_graph
/* Early includes */
#include <string.h>
#include <stdio.h>
#include "numpy/arrayobject.h"
#include "numpy/ndarrayobject.h"
#include "numpy/ndarraytypes.h"
#include "numpy/arrayscalars.h"
#include "numpy/ufuncobject.h"

    /* NumPy API declarations from "numpy/__init__.pxd" */
    
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */

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

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

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


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

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

/* Header.proto */
#if !defined(CYTHON_CCOMPLEX)
  #if defined(__cplusplus)
    #define CYTHON_CCOMPLEX 1
  #elif defined(_Complex_I)
    #define CYTHON_CCOMPLEX 1
  #else
    #define CYTHON_CCOMPLEX 0
  #endif
#endif
#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    #include <complex>
  #else
    #include <complex.h>
  #endif
#endif
#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
  #undef _Complex_I
  #define _Complex_I 1.0fj
#endif


static const char *__pyx_f[] = {
  "_element_graph.pyx",
  "stringsource",
  "__init__.pxd",
  "type.pxd",
};

/* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":690
 * # in Cython to enable them only on the right systems.
 * 
 * ctypedef npy_int8       int8_t             # <<<<<<<<<<<<<<
 * ctypedef npy_int16      int16_t
 * ctypedef npy_int32      int32_t
 */
typedef npy_int8 __pyx_t_5numpy_int8_t;

/* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":691
 * 
 * ctypedef npy_int8       int8_t
 * ctypedef npy_int16      int16_t             # <<<<<<<<<<<<<<
 * ctypedef npy_int32      int32_t
 * ctypedef npy_int64      int64_t
 */
typedef npy_int16 __pyx_t_5numpy_int16_t;

/* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":692
 * ctypedef npy_int8       int8_t
 * ctypedef npy_int16      int16_t
 * ctypedef npy_int32      int32_t             # <<<<<<<<<<<<<<
 * ctypedef npy_int64      int64_t
 * #ctypedef npy_int96      int96_t
 */
typedef npy_int32 __pyx_t_5numpy_int32_t;

/* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":693
 * ctypedef npy_int16      int16_t
 * ctypedef npy_int32      int32_t
 * ctypedef npy_int64      int64_t             # <<<<<<<<<<<<<<
 * #ctypedef npy_int96      int96_t
 * #ctypedef npy_int128     int128_t
 */
typedef npy_int64 __pyx_t_5numpy_int64_t;

/* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":697
 * #ctypedef npy_int128     int128_t
 * 
 * ctypedef npy_uint8      uint8_t             # <<<<<<<<<<<<<<
 * ctypedef npy_uint16     uint16_t
 * ctypedef npy_uint32     uint32_t
 */
typedef npy_uint8 __pyx_t_5numpy_uint8_t;

/* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":698
 * 
 * ctypedef npy_uint8      uint8_t
 * ctypedef npy_uint16     uint16_t             # <<<<<<<<<<<<<<
 * ctypedef npy_uint32     uint32_t
 * ctypedef npy_uint64     uint64_t
 */
typedef npy_uint16 __pyx_t_5numpy_uint16_t;

/* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":699
 * ctypedef npy_uint8      uint8_t
 * ctypedef npy_uint16     uint16_t
 * ctypedef npy_uint32     uint32_t             # <<<<<<<<<<<<<<
 * ctypedef npy_uint64     uint64_t
 * #ctypedef npy_uint96     uint96_t
 */
typedef npy_uint32 __pyx_t_5numpy_uint32_t;

/* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":700
 * ctypedef npy_uint16     uint16_t
 * ctypedef npy_uint32     uint32_t
 * ctypedef npy_uint64     uint64_t             # <<<<<<<<<<<<<<
 * #ctypedef npy_uint96     uint96_t
 * #ctypedef npy_uint128    uint128_t
 */
typedef npy_uint64 __pyx_t_5numpy_uint64_t;

/* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":704
 * #ctypedef npy_uint128    uint128_t
 * 
 * ctypedef npy_float32    float32_t             # <<<<<<<<<<<<<<
 * ctypedef npy_float64    float64_t
 * #ctypedef npy_float80    float80_t
 */
typedef npy_float32 __pyx_t_5numpy_float32_t;

/* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":705
 * 
 * ctypedef npy_float32    float32_t
 * ctypedef npy_float64    float64_t             # <<<<<<<<<<<<<<
 * #ctypedef npy_float80    float80_t
 * #ctypedef npy_float128   float128_t
 */
typedef npy_float64 __pyx_t_5numpy_float64_t;

/* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":714
 * # The int types are mapped a bit surprising --
 * # numpy.int corresponds to 'l' and numpy.long to 'q'
 * ctypedef npy_long       int_t             # <<<<<<<<<<<<<<
 * ctypedef npy_longlong   long_t
 * ctypedef npy_longlong   longlong_t
 */
typedef npy_long __pyx_t_5numpy_int_t;

/* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":715
 * # numpy.int corresponds to 'l' and numpy.long to 'q'
 * ctypedef npy_long       int_t
 * ctypedef npy_longlong   long_t             # <<<<<<<<<<<<<<
 * ctypedef npy_longlong   longlong_t
 * 
 */
typedef npy_longlong __pyx_t_5numpy_long_t;

/* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":716
 * ctypedef npy_long       int_t
 * ctypedef npy_longlong   long_t
 * ctypedef npy_longlong   longlong_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_ulong      uint_t
 */
typedef npy_longlong __pyx_t_5numpy_longlong_t;

/* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":718
 * ctypedef npy_longlong   longlong_t
 * 
 * ctypedef npy_ulong      uint_t             # <<<<<<<<<<<<<<
 * ctypedef npy_ulonglong  ulong_t
 * ctypedef npy_ulonglong  ulonglong_t
 */
typedef npy_ulong __pyx_t_5numpy_uint_t;

/* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":719
 * 
 * ctypedef npy_ulong      uint_t
 * ctypedef npy_ulonglong  ulong_t             # <<<<<<<<<<<<<<
 * ctypedef npy_ulonglong  ulonglong_t
 * 
 */
typedef npy_ulonglong __pyx_t_5numpy_ulong_t;

/* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":720
 * ctypedef npy_ulong      uint_t
 * ctypedef npy_ulonglong  ulong_t
 * ctypedef npy_ulonglong  ulonglong_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_intp       intp_t
 */
typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;

/* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":722
 * ctypedef npy_ulonglong  ulonglong_t
 * 
 * ctypedef npy_intp       intp_t             # <<<<<<<<<<<<<<
 * ctypedef npy_uintp      uintp_t
 * 
 */
typedef npy_intp __pyx_t_5numpy_intp_t;

/* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":723
 * 
 * ctypedef npy_intp       intp_t
 * ctypedef npy_uintp      uintp_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_double     float_t
 */
typedef npy_uintp __pyx_t_5numpy_uintp_t;

/* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":725
 * ctypedef npy_uintp      uintp_t
 * 
 * ctypedef npy_double     float_t             # <<<<<<<<<<<<<<
 * ctypedef npy_double     double_t
 * ctypedef npy_longdouble longdouble_t
 */
typedef npy_double __pyx_t_5numpy_float_t;

/* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":726
 * 
 * ctypedef npy_double     float_t
 * ctypedef npy_double     double_t             # <<<<<<<<<<<<<<
 * ctypedef npy_longdouble longdouble_t
 * 
 */
typedef npy_double __pyx_t_5numpy_double_t;

/* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":727
 * ctypedef npy_double     float_t
 * ctypedef npy_double     double_t
 * ctypedef npy_longdouble longdouble_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_cfloat      cfloat_t
 */
typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
/* Declarations.proto */
#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    typedef ::std::complex< float > __pyx_t_float_complex;
  #else
    typedef float _Complex __pyx_t_float_complex;
  #endif
#else
    typedef struct { float real, imag; } __pyx_t_float_complex;
#endif
static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);

/* Declarations.proto */
#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    typedef ::std::complex< double > __pyx_t_double_complex;
  #else
    typedef double _Complex __pyx_t_double_complex;
  #endif
#else
    typedef struct { double real, imag; } __pyx_t_double_complex;
#endif
static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);


/*--- Type declarations ---*/
struct __pyx_obj_14_element_graph_ElementGraph;
struct __pyx_obj_14_element_graph_Element;

/* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":729
 * ctypedef npy_longdouble longdouble_t
 * 
 * ctypedef npy_cfloat      cfloat_t             # <<<<<<<<<<<<<<
 * ctypedef npy_cdouble     cdouble_t
 * ctypedef npy_clongdouble clongdouble_t
 */
typedef npy_cfloat __pyx_t_5numpy_cfloat_t;

/* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":730
 * 
 * ctypedef npy_cfloat      cfloat_t
 * ctypedef npy_cdouble     cdouble_t             # <<<<<<<<<<<<<<
 * ctypedef npy_clongdouble clongdouble_t
 * 
 */
typedef npy_cdouble __pyx_t_5numpy_cdouble_t;

/* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":731
 * ctypedef npy_cfloat      cfloat_t
 * ctypedef npy_cdouble     cdouble_t
 * ctypedef npy_clongdouble clongdouble_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_cdouble     complex_t
 */
typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;

/* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":733
 * ctypedef npy_clongdouble clongdouble_t
 * 
 * ctypedef npy_cdouble     complex_t             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew1(a):
 */
typedef npy_cdouble __pyx_t_5numpy_complex_t;
struct __pyx_opt_args_14_element_graph_12ElementGraph_assemble;
struct __pyx_opt_args_14_element_graph_12ElementGraph_remove_bad_assemblies;
struct __pyx_opt_args_14_element_graph_12ElementGraph_find_optimal_path;
struct __pyx_ctuple_int__and_int;
typedef struct __pyx_ctuple_int__and_int __pyx_ctuple_int__and_int;
struct __pyx_ctuple_int__and_int__and_int;
typedef struct __pyx_ctuple_int__and_int__and_int __pyx_ctuple_int__and_int__and_int;

/* "_element_graph.pyx":300
 *             path.bases = sum(path.source_weights)*path.length
 * 
 *     cpdef void assemble(self, float minimum_proportion, simplify=True):             # <<<<<<<<<<<<<<
 *         """Iteratively perform find_optimal_path() on the graph
 *         until the number of novel reads fails to exceed minimum_proportion
 */
struct __pyx_opt_args_14_element_graph_12ElementGraph_assemble {
  int __pyx_n;
  PyObject *simplify;
};

/* "_element_graph.pyx":324
 *             self.remove_bad_assemblies(minimum_proportion)
 * 
 *     cpdef void remove_bad_assemblies(self, minimum_proportion, verbose=False):             # <<<<<<<<<<<<<<
 *         cdef np.ndarray bad_paths
 *         cdef int number_of_paths, i
 */
struct __pyx_opt_args_14_element_graph_12ElementGraph_remove_bad_assemblies {
  int __pyx_n;
  PyObject *verbose;
};

/* "_element_graph.pyx":697
 *         return score
 * 
 *     cpdef Element find_optimal_path(self, float minimum_proportion, bint verbose=False):             # <<<<<<<<<<<<<<
 *         """Traverses the path in a greedy fashion from the heaviest element."""
 *         cdef Element currentPath, e
 */
struct __pyx_opt_args_14_element_graph_12ElementGraph_find_optimal_path {
  int __pyx_n;
  int verbose;
};

/* "_element_graph.pyx":965
 *         return '|{}| {}-{} ({})'.format(''.join(chars),self.left,self.right,strand)
 * 
 *     cdef str span_to_string(self, (int, int) span):             # <<<<<<<<<<<<<<
 *         """Converts a tuple of two ints to a string connected by ':'"""
 *         return '{}:{}'.format(span[0], span[1])
 */
struct __pyx_ctuple_int__and_int {
  int f0;
  int f1;
};

/* "_element_graph.pyx":200
 *             Element element
 *             Py_ssize_t resolve, i, c
 *             (int, int, int) sorttuple             # <<<<<<<<<<<<<<
 * 
 *         zeros = set([element.index for element in self.elements if element.cov == 0])
 */
struct __pyx_ctuple_int__and_int__and_int {
  int f0;
  int f1;
  int f2;
};

/* "_element_graph.pyx":12
 * inf = float('Inf')
 * 
 * cdef class ElementGraph:             # <<<<<<<<<<<<<<
 *     cdef public list elements, paths
 *     cdef public np.ndarray assignments, overlap, end_reachability
 */
struct __pyx_obj_14_element_graph_ElementGraph {
  PyObject_HEAD
  struct __pyx_vtabstruct_14_element_graph_ElementGraph *__pyx_vtab;
  PyObject *elements;
  PyObject *paths;
  PyArrayObject *assignments;
  PyArrayObject *overlap;
  PyArrayObject *end_reachability;
  int number_of_elements;
  int maxIC;
  int max_isos;
  struct __pyx_obj_14_element_graph_Element *emptyPath;
  float bases;
  float input_bases;
  float dead_end_penalty;
  float intron_filter;
  float truncation_filter;
  PyObject *SP;
  PyObject *SM;
  PyObject *EP;
  PyObject *EM;
  PyObject *end_elements;
  PyObject *SPmembers;
  PyObject *SMmembers;
  PyObject *EPmembers;
  PyObject *EMmembers;
  int no_ends;
  int ignore_ends;
  int naive;
  int partial_coverage;
  int allow_incomplete;
};


/* "_element_graph.pyx":882
 * #################################################################################################################################
 * 
 * cdef class Element:             # <<<<<<<<<<<<<<
 *     """Represents a read or collection of reads in a Locus."""
 *     cdef public int index, length, IC, maxIC, left, right, number_of_elements, number_of_members, LM, RM
 */
struct __pyx_obj_14_element_graph_Element {
  PyObject_HEAD
  struct __pyx_vtabstruct_14_element_graph_Element *__pyx_vtab;
  int index;
  int length;
  int IC;
  int maxIC;
  int left;
  int right;
  int number_of_elements;
  int number_of_members;
  int LM;
  int RM;
  char strand;
  float cov;
  float bases;
  float bottleneck_weight;
  float trimmed_bases;
  PyObject *members;
  PyObject *nonmembers;
  PyObject *ingroup;
  PyObject *outgroup;
  PyObject *contains;
  PyObject *contained;
  PyObject *excludes;
  PyObject *includes;
  PyObject *end_indices;
  PyObject *covered_indices;
  PyObject *bottleneck;
  PyObject *assigned_to;
  PyArrayObject *frag_len;
  PyArrayObject *source_weights;
  PyArrayObject *member_weights;
  PyArrayObject *all;
  int complete;
  int s_tag;
  int e_tag;
  int empty;
  int is_spliced;
  int has_gaps;
};



/* "_element_graph.pyx":12
 * inf = float('Inf')
 * 
 * cdef class ElementGraph:             # <<<<<<<<<<<<<<
 *     cdef public list elements, paths
 *     cdef public np.ndarray assignments, overlap, end_reachability
 */

struct __pyx_vtabstruct_14_element_graph_ElementGraph {
  void (*penalize_dead_ends)(struct __pyx_obj_14_element_graph_ElementGraph *, int __pyx_skip_dispatch);
  void (*check_for_full_paths)(struct __pyx_obj_14_element_graph_ElementGraph *, int __pyx_skip_dispatch);
  void (*resolve_containment)(struct __pyx_obj_14_element_graph_ElementGraph *, int __pyx_skip_dispatch);
  void (*zero_element)(struct __pyx_obj_14_element_graph_ElementGraph *, int, int __pyx_skip_dispatch);
  void (*assign_weights)(struct __pyx_obj_14_element_graph_ElementGraph *, int __pyx_skip_dispatch);
  void (*assemble)(struct __pyx_obj_14_element_graph_ElementGraph *, float, int __pyx_skip_dispatch, struct __pyx_opt_args_14_element_graph_12ElementGraph_assemble *__pyx_optional_args);
  void (*remove_bad_assemblies)(struct __pyx_obj_14_element_graph_ElementGraph *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_14_element_graph_12ElementGraph_remove_bad_assemblies *__pyx_optional_args);
  PyArrayObject *(*available_proportion)(struct __pyx_obj_14_element_graph_ElementGraph *, PyArrayObject *, struct __pyx_obj_14_element_graph_Element *, int __pyx_skip_dispatch);
  float (*available_bases)(struct __pyx_obj_14_element_graph_ElementGraph *, PyArrayObject *, struct __pyx_obj_14_element_graph_Element *, int __pyx_skip_dispatch);
  void (*extend_path)(struct __pyx_obj_14_element_graph_ElementGraph *, struct __pyx_obj_14_element_graph_Element *, PyObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_14_element_graph_Element *(*get_heaviest_element)(struct __pyx_obj_14_element_graph_ElementGraph *, int __pyx_skip_dispatch);
  float (*dead_end)(struct __pyx_obj_14_element_graph_ElementGraph *, struct __pyx_obj_14_element_graph_Element *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*generate_extensions)(struct __pyx_obj_14_element_graph_ElementGraph *, struct __pyx_obj_14_element_graph_Element *, int __pyx_skip_dispatch);
  PyObject *(*best_extension)(struct __pyx_obj_14_element_graph_ElementGraph *, struct __pyx_obj_14_element_graph_Element *, PyObject *, float, int __pyx_skip_dispatch);
  float (*calculate_extension_score)(struct __pyx_obj_14_element_graph_ElementGraph *, struct __pyx_obj_14_element_graph_Element *, PyObject *, float, int __pyx_skip_dispatch);
  struct __pyx_obj_14_element_graph_Element *(*find_optimal_path)(struct __pyx_obj_14_element_graph_ElementGraph *, float, int __pyx_skip_dispatch, struct __pyx_opt_args_14_element_graph_12ElementGraph_find_optimal_path *__pyx_optional_args);
  void (*rescue_ends)(struct __pyx_obj_14_element_graph_ElementGraph *, struct __pyx_obj_14_element_graph_Element *, int __pyx_skip_dispatch);
  float (*add_path)(struct __pyx_obj_14_element_graph_ElementGraph *, struct __pyx_obj_14_element_graph_Element *, int __pyx_skip_dispatch);
  void (*remove_paths)(struct __pyx_obj_14_element_graph_ElementGraph *, PyObject *, int __pyx_skip_dispatch);
  PyArrayObject *(*normalize)(struct __pyx_obj_14_element_graph_ElementGraph *, PyArrayObject *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_14_element_graph_ElementGraph *__pyx_vtabptr_14_element_graph_ElementGraph;


/* "_element_graph.pyx":882
 * #################################################################################################################################
 * 
 * cdef class Element:             # <<<<<<<<<<<<<<
 *     """Represents a read or collection of reads in a Locus."""
 *     cdef public int index, length, IC, maxIC, left, right, number_of_elements, number_of_members, LM, RM
 */

struct __pyx_vtabstruct_14_element_graph_Element {
  PyObject *(*span_to_string)(struct __pyx_obj_14_element_graph_Element *, __pyx_ctuple_int__and_int);
  PyObject *(*as_string)(struct __pyx_obj_14_element_graph_Element *, int __pyx_skip_dispatch);
  void (*update)(struct __pyx_obj_14_element_graph_Element *, int __pyx_skip_dispatch);
  PyObject *(*uniqueMembers)(struct __pyx_obj_14_element_graph_Element *, struct __pyx_obj_14_element_graph_Element *, int __pyx_skip_dispatch);
  PyObject *(*uniqueNonmembers)(struct __pyx_obj_14_element_graph_Element *, struct __pyx_obj_14_element_graph_Element *, int __pyx_skip_dispatch);
  int (*uniqueInformation)(struct __pyx_obj_14_element_graph_Element *, struct __pyx_obj_14_element_graph_Element *, int __pyx_skip_dispatch);
  int (*uniqueLength)(struct __pyx_obj_14_element_graph_Element *, struct __pyx_obj_14_element_graph_Element *, int __pyx_skip_dispatch);
  int (*compatible)(struct __pyx_obj_14_element_graph_Element *, struct __pyx_obj_14_element_graph_Element *, int __pyx_skip_dispatch);
  PyObject *(*get_introns)(struct __pyx_obj_14_element_graph_Element *, int __pyx_skip_dispatch);
  PyObject *(*get_exons)(struct __pyx_obj_14_element_graph_Element *, int __pyx_skip_dispatch);
  void (*merge)(struct __pyx_obj_14_element_graph_Element *, struct __pyx_obj_14_element_graph_Element *, PyArrayObject *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_14_element_graph_Element *__pyx_vtabptr_14_element_graph_Element;

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

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

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

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

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

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

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

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

/* GetModuleGlobalName.proto */
#if CYTHON_USE_DICT_VERSIONS
#define __Pyx_GetModuleGlobalName(var, name)  {\
    static PY_UINT64_T __pyx_dict_version = 0;\
    static PyObject *__pyx_dict_cached_value = NULL;\
    (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
        (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
        __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
}
#define __Pyx_GetModuleGlobalNameUncached(var, name)  {\
    PY_UINT64_T __pyx_dict_version;\
    PyObject *__pyx_dict_cached_value;\
    (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
}
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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/* set_iter.proto */
static CYTHON_INLINE PyObject* __Pyx_set_iterator(PyObject* iterable, int is_set,
                                                  Py_ssize_t* p_orig_length, int* p_source_is_set);
static CYTHON_INLINE int __Pyx_set_iter_next(
        PyObject* iter_obj, Py_ssize_t orig_length,
        Py_ssize_t* ppos, PyObject **value,
        int source_is_set);

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

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

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

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

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

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

/* PyThreadStateGet.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyThreadState_declare  PyThreadState *__pyx_tstate;
#define __Pyx_PyThreadState_assign  __pyx_tstate = __Pyx_PyThreadState_Current;
#define __Pyx_PyErr_Occurred()  __pyx_tstate->curexc_type
#else
#define __Pyx_PyThreadState_declare
#define __Pyx_PyThreadState_assign
#define __Pyx_PyErr_Occurred()  PyErr_Occurred()
#endif

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

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

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

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

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

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

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

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

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

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

/* py_dict_values.proto */
static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d);

/* CallUnboundCMethod0.proto */
static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self);
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_CallUnboundCMethod0(cfunc, self)\
    (likely((cfunc)->func) ?\
        (likely((cfunc)->flag == METH_NOARGS) ?  (*((cfunc)->func))(self, NULL) :\
         (PY_VERSION_HEX >= 0x030600B1 && likely((cfunc)->flag == METH_FASTCALL) ?\
            (PY_VERSION_HEX >= 0x030700A0 ?\
                (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0) :\
                (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0, NULL)) :\
          (PY_VERSION_HEX >= 0x030700A0 && (cfunc)->flag == (METH_FASTCALL | METH_KEYWORDS) ?\
            (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0, NULL) :\
            (likely((cfunc)->flag == (METH_VARARGS | METH_KEYWORDS)) ?  ((*(PyCFunctionWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, __pyx_empty_tuple, NULL)) :\
               ((cfunc)->flag == METH_VARARGS ?  (*((cfunc)->func))(self, __pyx_empty_tuple) :\
               __Pyx__CallUnboundCMethod0(cfunc, self)))))) :\
        __Pyx__CallUnboundCMethod0(cfunc, self))
#else
#define __Pyx_CallUnboundCMethod0(cfunc, self)  __Pyx__CallUnboundCMethod0(cfunc, self)
#endif

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

/* py_set_discard.proto */
static CYTHON_INLINE int __Pyx_PySet_Discard(PyObject *set, PyObject *key);

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

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

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

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

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

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

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

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

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

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

/* GetTopmostException.proto */
#if CYTHON_USE_EXC_INFO_STACK
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

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

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

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

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

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

/* TypeImport.proto */
#ifndef __PYX_HAVE_RT_ImportType_proto
#define __PYX_HAVE_RT_ImportType_proto
enum __Pyx_ImportType_CheckSize {
   __Pyx_ImportType_CheckSize_Error = 0,
   __Pyx_ImportType_CheckSize_Warn = 1,
   __Pyx_ImportType_CheckSize_Ignore = 2
};
static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size);
#endif

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

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

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

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

/* FromPyCTupleUtility.proto */
static __pyx_ctuple_int__and_int__and_int __pyx_convert__from_py___pyx_ctuple_int__and_int__and_int(PyObject *);

/* FromPyCTupleUtility.proto */
static __pyx_ctuple_int__and_int __pyx_convert__from_py___pyx_ctuple_int__and_int(PyObject *);

/* RealImag.proto */
#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    #define __Pyx_CREAL(z) ((z).real())
    #define __Pyx_CIMAG(z) ((z).imag())
  #else
    #define __Pyx_CREAL(z) (__real__(z))
    #define __Pyx_CIMAG(z) (__imag__(z))
  #endif
#else
    #define __Pyx_CREAL(z) ((z).real)
    #define __Pyx_CIMAG(z) ((z).imag)
#endif
#if defined(__cplusplus) && CYTHON_CCOMPLEX\
        && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
    #define __Pyx_SET_CREAL(z,x) ((z).real(x))
    #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
#else
    #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
    #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
#endif

/* Arithmetic.proto */
#if CYTHON_CCOMPLEX
    #define __Pyx_c_eq_float(a, b)   ((a)==(b))
    #define __Pyx_c_sum_float(a, b)  ((a)+(b))
    #define __Pyx_c_diff_float(a, b) ((a)-(b))
    #define __Pyx_c_prod_float(a, b) ((a)*(b))
    #define __Pyx_c_quot_float(a, b) ((a)/(b))
    #define __Pyx_c_neg_float(a)     (-(a))
  #ifdef __cplusplus
    #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
    #define __Pyx_c_conj_float(z)    (::std::conj(z))
    #if 1
        #define __Pyx_c_abs_float(z)     (::std::abs(z))
        #define __Pyx_c_pow_float(a, b)  (::std::pow(a, b))
    #endif
  #else
    #define __Pyx_c_is_zero_float(z) ((z)==0)
    #define __Pyx_c_conj_float(z)    (conjf(z))
    #if 1
        #define __Pyx_c_abs_float(z)     (cabsf(z))
        #define __Pyx_c_pow_float(a, b)  (cpowf(a, b))
    #endif
 #endif
#else
    static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
    static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
    #if 1
        static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
        static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
    #endif
#endif

/* Arithmetic.proto */
#if CYTHON_CCOMPLEX
    #define __Pyx_c_eq_double(a, b)   ((a)==(b))
    #define __Pyx_c_sum_double(a, b)  ((a)+(b))
    #define __Pyx_c_diff_double(a, b) ((a)-(b))
    #define __Pyx_c_prod_double(a, b) ((a)*(b))
    #define __Pyx_c_quot_double(a, b) ((a)/(b))
    #define __Pyx_c_neg_double(a)     (-(a))
  #ifdef __cplusplus
    #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
    #define __Pyx_c_conj_double(z)    (::std::conj(z))
    #if 1
        #define __Pyx_c_abs_double(z)     (::std::abs(z))
        #define __Pyx_c_pow_double(a, b)  (::std::pow(a, b))
    #endif
  #else
    #define __Pyx_c_is_zero_double(z) ((z)==0)
    #define __Pyx_c_conj_double(z)    (conj(z))
    #if 1
        #define __Pyx_c_abs_double(z)     (cabs(z))
        #define __Pyx_c_pow_double(a, b)  (cpow(a, b))
    #endif
 #endif
#else
    static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
    static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
    #if 1
        static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
        static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
    #endif
#endif

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

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

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

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

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

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

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value);

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

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

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

static void __pyx_f_14_element_graph_12ElementGraph_penalize_dead_ends(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_14_element_graph_12ElementGraph_check_for_full_paths(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_14_element_graph_12ElementGraph_resolve_containment(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_14_element_graph_12ElementGraph_zero_element(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, int __pyx_v_index, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_14_element_graph_12ElementGraph_assign_weights(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_14_element_graph_12ElementGraph_assemble(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, float __pyx_v_minimum_proportion, int __pyx_skip_dispatch, struct __pyx_opt_args_14_element_graph_12ElementGraph_assemble *__pyx_optional_args); /* proto*/
static void __pyx_f_14_element_graph_12ElementGraph_remove_bad_assemblies(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, PyObject *__pyx_v_minimum_proportion, int __pyx_skip_dispatch, struct __pyx_opt_args_14_element_graph_12ElementGraph_remove_bad_assemblies *__pyx_optional_args); /* proto*/
static PyArrayObject *__pyx_f_14_element_graph_12ElementGraph_available_proportion(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, PyArrayObject *__pyx_v_weights, struct __pyx_obj_14_element_graph_Element *__pyx_v_element, int __pyx_skip_dispatch); /* proto*/
static float __pyx_f_14_element_graph_12ElementGraph_available_bases(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, PyArrayObject *__pyx_v_weights, struct __pyx_obj_14_element_graph_Element *__pyx_v_element, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_14_element_graph_12ElementGraph_extend_path(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, struct __pyx_obj_14_element_graph_Element *__pyx_v_path, PyObject *__pyx_v_extension, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_14_element_graph_Element *__pyx_f_14_element_graph_12ElementGraph_get_heaviest_element(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static float __pyx_f_14_element_graph_12ElementGraph_dead_end(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, struct __pyx_obj_14_element_graph_Element *__pyx_v_path, PyObject *__pyx_v_extension, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_14_element_graph_12ElementGraph_generate_extensions(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, struct __pyx_obj_14_element_graph_Element *__pyx_v_path, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_14_element_graph_12ElementGraph_best_extension(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, struct __pyx_obj_14_element_graph_Element *__pyx_v_path, PyObject *__pyx_v_extensions, float __pyx_v_minimum_proportion, int __pyx_skip_dispatch); /* proto*/
static float __pyx_f_14_element_graph_12ElementGraph_calculate_extension_score(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, struct __pyx_obj_14_element_graph_Element *__pyx_v_path, PyObject *__pyx_v_extension, CYTHON_UNUSED float __pyx_v_minimum_proportion, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_14_element_graph_Element *__pyx_f_14_element_graph_12ElementGraph_find_optimal_path(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, float __pyx_v_minimum_proportion, int __pyx_skip_dispatch, struct __pyx_opt_args_14_element_graph_12ElementGraph_find_optimal_path *__pyx_optional_args); /* proto*/
static void __pyx_f_14_element_graph_12ElementGraph_rescue_ends(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, struct __pyx_obj_14_element_graph_Element *__pyx_v_path, int __pyx_skip_dispatch); /* proto*/
static float __pyx_f_14_element_graph_12ElementGraph_add_path(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, struct __pyx_obj_14_element_graph_Element *__pyx_v_path, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_14_element_graph_12ElementGraph_remove_paths(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, PyObject *__pyx_v_indices, int __pyx_skip_dispatch); /* proto*/
static PyArrayObject *__pyx_f_14_element_graph_12ElementGraph_normalize(CYTHON_UNUSED struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, PyArrayObject *__pyx_v_arr, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_14_element_graph_7Element_span_to_string(CYTHON_UNUSED struct __pyx_obj_14_element_graph_Element *__pyx_v_self, __pyx_ctuple_int__and_int __pyx_v_span); /* proto*/
static PyObject *__pyx_f_14_element_graph_7Element_as_string(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_14_element_graph_7Element_update(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_14_element_graph_7Element_uniqueMembers(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, struct __pyx_obj_14_element_graph_Element *__pyx_v_other, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_14_element_graph_7Element_uniqueNonmembers(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, struct __pyx_obj_14_element_graph_Element *__pyx_v_other, int __pyx_skip_dispatch); /* proto*/
static int __pyx_f_14_element_graph_7Element_uniqueInformation(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, struct __pyx_obj_14_element_graph_Element *__pyx_v_other, int __pyx_skip_dispatch); /* proto*/
static int __pyx_f_14_element_graph_7Element_uniqueLength(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, struct __pyx_obj_14_element_graph_Element *__pyx_v_other, int __pyx_skip_dispatch); /* proto*/
static int __pyx_f_14_element_graph_7Element_compatible(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, struct __pyx_obj_14_element_graph_Element *__pyx_v_other, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_14_element_graph_7Element_get_introns(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_14_element_graph_7Element_get_exons(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_14_element_graph_7Element_merge(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, struct __pyx_obj_14_element_graph_Element *__pyx_v_other, PyArrayObject *__pyx_v_proportion, int __pyx_skip_dispatch); /* proto*/

/* Module declarations from 'cython' */

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

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

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

/* Module declarations from '__builtin__' */

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

/* Module declarations from 'cpython' */

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

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

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

/* Module declarations from 'numpy' */

/* Module declarations from 'numpy' */
static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
static PyTypeObject *__pyx_ptype_5numpy_generic = 0;
static PyTypeObject *__pyx_ptype_5numpy_number = 0;
static PyTypeObject *__pyx_ptype_5numpy_integer = 0;
static PyTypeObject *__pyx_ptype_5numpy_signedinteger = 0;
static PyTypeObject *__pyx_ptype_5numpy_unsignedinteger = 0;
static PyTypeObject *__pyx_ptype_5numpy_inexact = 0;
static PyTypeObject *__pyx_ptype_5numpy_floating = 0;
static PyTypeObject *__pyx_ptype_5numpy_complexfloating = 0;
static PyTypeObject *__pyx_ptype_5numpy_flexible = 0;
static PyTypeObject *__pyx_ptype_5numpy_character = 0;
static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;

/* Module declarations from '_element_graph' */
static PyTypeObject *__pyx_ptype_14_element_graph_ElementGraph = 0;
static PyTypeObject *__pyx_ptype_14_element_graph_Element = 0;
static PyObject *__pyx_f_14_element_graph___pyx_unpickle_ElementGraph__set_state(struct __pyx_obj_14_element_graph_ElementGraph *, PyObject *); /*proto*/
static PyObject *__pyx_f_14_element_graph___pyx_unpickle_Element__set_state(struct __pyx_obj_14_element_graph_Element *, PyObject *); /*proto*/
#define __Pyx_MODULE_NAME "_element_graph"
extern int __pyx_module_is_main__element_graph;
int __pyx_module_is_main__element_graph = 0;

/* Implementation of '_element_graph' */
static PyObject *__pyx_builtin_sum;
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_print;
static PyObject *__pyx_builtin_sorted;
static PyObject *__pyx_builtin_any;
static PyObject *__pyx_builtin_max;
static PyObject *__pyx_builtin_min;
static PyObject *__pyx_builtin_ImportError;
static const char __pyx_k_IC[] = "IC";
static const char __pyx_k__3[] = "_";
static const char __pyx_k__4[] = ",";
static const char __pyx_k__5[] = "{} + {}";
static const char __pyx_k__6[] = " ";
static const char __pyx_k__7[] = "-";
static const char __pyx_k__8[] = ".";
static const char __pyx_k__9[] = "+";
static const char __pyx_k_np[] = "np";
static const char __pyx_k_Inf[] = "Inf";
static const char __pyx_k__10[] = "*";
static const char __pyx_k__11[] = "|{}| {}-{} ({})";
static const char __pyx_k__12[] = "";
static const char __pyx_k__13[] = "{}:{}";
static const char __pyx_k_abs[] = "abs";
static const char __pyx_k_add[] = "add";
static const char __pyx_k_all[] = "all";
static const char __pyx_k_any[] = "any";
static const char __pyx_k_cov[] = "cov";
static const char __pyx_k_get[] = "get";
static const char __pyx_k_inf[] = "inf";
static const char __pyx_k_max[] = "max";
static const char __pyx_k_min[] = "min";
static const char __pyx_k_new[] = "__new__";
static const char __pyx_k_sum[] = "sum";
static const char __pyx_k_axis[] = "axis";
static const char __pyx_k_copy[] = "copy";
static const char __pyx_k_dict[] = "__dict__";
static const char __pyx_k_full[] = "full";
static const char __pyx_k_json[] = "json";
static const char __pyx_k_main[] = "__main__";
static const char __pyx_k_mean[] = "mean";
static const char __pyx_k_name[] = "__name__";
static const char __pyx_k_ones[] = "ones";
static const char __pyx_k_path[] = "path";
static const char __pyx_k_test[] = "__test__";
static const char __pyx_k_array[] = "array";
static const char __pyx_k_bases[] = "bases";
static const char __pyx_k_clear[] = "clear";
static const char __pyx_k_deque[] = "deque";
static const char __pyx_k_dtype[] = "dtype";
static const char __pyx_k_empty[] = "empty";
static const char __pyx_k_index[] = "index";
static const char __pyx_k_int32[] = "int32";
static const char __pyx_k_maxIC[] = "maxIC";
static const char __pyx_k_merge[] = "merge";
static const char __pyx_k_naive[] = "naive";
static const char __pyx_k_numpy[] = "numpy";
static const char __pyx_k_other[] = "other";
static const char __pyx_k_print[] = "print";
static const char __pyx_k_range[] = "range";
static const char __pyx_k_shape[] = "shape";
static const char __pyx_k_union[] = "union";
static const char __pyx_k_where[] = "where";
static const char __pyx_k_zeros[] = "zeros";
static const char __pyx_k_append[] = "append";
static const char __pyx_k_extend[] = "extend";
static const char __pyx_k_format[] = "format";
static const char __pyx_k_import[] = "__import__";
static const char __pyx_k_maxlen[] = "maxlen";
static const char __pyx_k_pickle[] = "pickle";
static const char __pyx_k_reduce[] = "__reduce__";
static const char __pyx_k_sorted[] = "sorted";
static const char __pyx_k_strand[] = "strand";
static const char __pyx_k_update[] = "update";
static const char __pyx_k_values[] = "values";
static const char __pyx_k_Element[] = "Element";
static const char __pyx_k_argsort[] = "argsort";
static const char __pyx_k_discard[] = "discard";
static const char __pyx_k_element[] = "element";
static const char __pyx_k_float32[] = "float32";
static const char __pyx_k_ingroup[] = "ingroup";
static const char __pyx_k_lengths[] = "lengths";
static const char __pyx_k_overlap[] = "overlap";
static const char __pyx_k_popleft[] = "popleft";
static const char __pyx_k_reverse[] = "reverse";
static const char __pyx_k_strands[] = "strands";
static const char __pyx_k_verbose[] = "verbose";
static const char __pyx_k_weights[] = "weights";
static const char __pyx_k_add_path[] = "add_path";
static const char __pyx_k_assemble[] = "assemble";
static const char __pyx_k_complete[] = "complete";
static const char __pyx_k_contains[] = "contains";
static const char __pyx_k_dead_end[] = "dead_end";
static const char __pyx_k_deepcopy[] = "deepcopy";
static const char __pyx_k_excludes[] = "excludes";
static const char __pyx_k_frag_len[] = "frag_len";
static const char __pyx_k_getstate[] = "__getstate__";
static const char __pyx_k_has_gaps[] = "has_gaps";
static const char __pyx_k_includes[] = "includes";
static const char __pyx_k_issubset[] = "issubset";
static const char __pyx_k_keepdims[] = "keepdims";
static const char __pyx_k_max_isos[] = "max_isos";
static const char __pyx_k_outgroup[] = "outgroup";
static const char __pyx_k_pyx_type[] = "__pyx_type";
static const char __pyx_k_setstate[] = "__setstate__";
static const char __pyx_k_simplify[] = "simplify";
static const char __pyx_k_as_string[] = "as_string";
static const char __pyx_k_contained[] = "contained";
static const char __pyx_k_extension[] = "extension";
static const char __pyx_k_get_exons[] = "get_exons";
static const char __pyx_k_normalize[] = "normalize";
static const char __pyx_k_pyx_state[] = "__pyx_state";
static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
static const char __pyx_k_compatible[] = "compatible";
static const char __pyx_k_difference[] = "difference";
static const char __pyx_k_extensions[] = "extensions";
static const char __pyx_k_fill_value[] = "fill_value";
static const char __pyx_k_isdisjoint[] = "isdisjoint";
static const char __pyx_k_logical_or[] = "logical_or";
static const char __pyx_k_membership[] = "membership";
static const char __pyx_k_proportion[] = "proportion";
static const char __pyx_k_pyx_result[] = "__pyx_result";
static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
static const char __pyx_k_ImportError[] = "ImportError";
static const char __pyx_k_PickleError[] = "PickleError";
static const char __pyx_k_assigned_to[] = "assigned_to";
static const char __pyx_k_collections[] = "collections";
static const char __pyx_k_extend_path[] = "extend_path";
static const char __pyx_k_get_introns[] = "get_introns";
static const char __pyx_k_ignore_ends[] = "ignore_ends";
static const char __pyx_k_rescue_ends[] = "rescue_ends";
static const char __pyx_k_ElementGraph[] = "ElementGraph";
static const char __pyx_k_intersection[] = "intersection";
static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
static const char __pyx_k_remove_paths[] = "remove_paths";
static const char __pyx_k_stringsource[] = "stringsource";
static const char __pyx_k_uniqueLength[] = "uniqueLength";
static const char __pyx_k_zero_element[] = "zero_element";
static const char __pyx_k_element_graph[] = "_element_graph";
static const char __pyx_k_intron_filter[] = "intron_filter";
static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
static const char __pyx_k_uniqueMembers[] = "uniqueMembers";
static const char __pyx_k_assign_weights[] = "assign_weights";
static const char __pyx_k_best_extension[] = "best_extension";
static const char __pyx_k_member_weights[] = "member_weights";
static const char __pyx_k_overlap_matrix[] = "overlap_matrix";
static const char __pyx_k_source_weights[] = "source_weights";
static const char __pyx_k_Removing_fusion[] = "Removing {}, fusion.";
static const char __pyx_k_available_bases[] = "available_bases";
static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
static const char __pyx_k_allow_incomplete[] = "allow_incomplete";
static const char __pyx_k_apply_along_axis[] = "apply_along_axis";
static const char __pyx_k_dead_end_penalty[] = "dead_end_penalty";
static const char __pyx_k_partial_coverage[] = "partial_coverage";
static const char __pyx_k_uniqueNonmembers[] = "uniqueNonmembers";
static const char __pyx_k_difference_update[] = "difference_update";
static const char __pyx_k_find_optimal_path[] = "find_optimal_path";
static const char __pyx_k_membership_matrix[] = "membership_matrix";
static const char __pyx_k_truncation_filter[] = "truncation_filter";
static const char __pyx_k_uniqueInformation[] = "uniqueInformation";
static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
static const char __pyx_k_minimum_proportion[] = "minimum_proportion";
static const char __pyx_k_penalize_dead_ends[] = "penalize_dead_ends";
static const char __pyx_k_Removing_incomplete[] = "Removing {}, incomplete.";
static const char __pyx_k_Removing_truncation[] = "Removing {}, truncation.";
static const char __pyx_k_generate_extensions[] = "generate_extensions";
static const char __pyx_k_intersection_update[] = "intersection_update";
static const char __pyx_k_member_weight_array[] = "member_weight_array";
static const char __pyx_k_resolve_containment[] = "resolve_containment";
static const char __pyx_k_source_weight_array[] = "source_weight_array";
static const char __pyx_k_available_proportion[] = "available_proportion";
static const char __pyx_k_check_for_full_paths[] = "check_for_full_paths";
static const char __pyx_k_get_heaviest_element[] = "get_heaviest_element";
static const char __pyx_k_pyx_unpickle_Element[] = "__pyx_unpickle_Element";
static const char __pyx_k_remove_bad_assemblies[] = "remove_bad_assemblies";
static const char __pyx_k_Removing_low_abundance[] = "Removing {}, low abundance.";
static const char __pyx_k_ERROR_incompatible_with[] = "ERROR: {} incompatible with {}";
static const char __pyx_k_Removing_intron_retention[] = "Removing {}, intron retention.";
static const char __pyx_k_calculate_extension_score[] = "calculate_extension_score";
static const char __pyx_k_pyx_unpickle_ElementGraph[] = "__pyx_unpickle_ElementGraph";
static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import";
static const char __pyx_k_Error_Element_is_not_connected_t[] = "Error: Element {} is not connected to Element {}";
static const char __pyx_k_Incompatible_checksums_0x_x_vs_0[] = "Incompatible checksums (0x%x vs (0xb5283f6, 0x714eccd, 0x7829ade) = (EM, EMmembers, EP, EPmembers, SM, SMmembers, SP, SPmembers, allow_incomplete, assignments, bases, dead_end_penalty, elements, emptyPath, end_elements, end_reachability, ignore_ends, input_bases, intron_filter, maxIC, max_isos, naive, no_ends, number_of_elements, overlap, partial_coverage, paths, truncation_filter))";
static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import";
static const char __pyx_k_Incompatible_checksums_0x_x_vs_0_2[] = "Incompatible checksums (0x%x vs (0x45d473d, 0xdc335b6, 0xa50ee75) = (IC, LM, RM, all, assigned_to, bases, bottleneck, bottleneck_weight, complete, contained, contains, cov, covered_indices, e_tag, empty, end_indices, excludes, frag_len, has_gaps, includes, index, ingroup, is_spliced, left, length, maxIC, member_weights, members, nonmembers, number_of_elements, number_of_members, outgroup, right, s_tag, source_weights, strand, trimmed_bases))";
static PyObject *__pyx_kp_u_ERROR_incompatible_with;
static PyObject *__pyx_n_s_Element;
static PyObject *__pyx_n_s_ElementGraph;
static PyObject *__pyx_kp_u_Error_Element_is_not_connected_t;
static PyObject *__pyx_n_s_IC;
static PyObject *__pyx_n_s_ImportError;
static PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0;
static PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0_2;
static PyObject *__pyx_n_u_Inf;
static PyObject *__pyx_n_s_PickleError;
static PyObject *__pyx_kp_u_Removing_fusion;
static PyObject *__pyx_kp_u_Removing_incomplete;
static PyObject *__pyx_kp_u_Removing_intron_retention;
static PyObject *__pyx_kp_u_Removing_low_abundance;
static PyObject *__pyx_kp_u_Removing_truncation;
static PyObject *__pyx_kp_u__10;
static PyObject *__pyx_kp_u__11;
static PyObject *__pyx_kp_u__12;
static PyObject *__pyx_kp_u__13;
static PyObject *__pyx_n_u__3;
static PyObject *__pyx_kp_u__4;
static PyObject *__pyx_kp_u__5;
static PyObject *__pyx_kp_u__6;
static PyObject *__pyx_kp_u__7;
static PyObject *__pyx_kp_u__8;
static PyObject *__pyx_kp_u__9;
static PyObject *__pyx_n_s_abs;
static PyObject *__pyx_n_s_add;
static PyObject *__pyx_n_s_add_path;
static PyObject *__pyx_n_s_all;
static PyObject *__pyx_n_s_allow_incomplete;
static PyObject *__pyx_n_s_any;
static PyObject *__pyx_n_s_append;
static PyObject *__pyx_n_s_apply_along_axis;
static PyObject *__pyx_n_s_argsort;
static PyObject *__pyx_n_s_array;
static PyObject *__pyx_n_s_as_string;
static PyObject *__pyx_n_s_assemble;
static PyObject *__pyx_n_s_assign_weights;
static PyObject *__pyx_n_s_assigned_to;
static PyObject *__pyx_n_s_available_bases;
static PyObject *__pyx_n_s_available_proportion;
static PyObject *__pyx_n_s_axis;
static PyObject *__pyx_n_s_bases;
static PyObject *__pyx_n_s_best_extension;
static PyObject *__pyx_n_s_calculate_extension_score;
static PyObject *__pyx_n_s_check_for_full_paths;
static PyObject *__pyx_n_s_clear;
static PyObject *__pyx_n_s_cline_in_traceback;
static PyObject *__pyx_n_s_collections;
static PyObject *__pyx_n_s_compatible;
static PyObject *__pyx_n_s_complete;
static PyObject *__pyx_n_s_contained;
static PyObject *__pyx_n_s_contains;
static PyObject *__pyx_n_s_copy;
static PyObject *__pyx_n_s_cov;
static PyObject *__pyx_n_s_dead_end;
static PyObject *__pyx_n_s_dead_end_penalty;
static PyObject *__pyx_n_s_deepcopy;
static PyObject *__pyx_n_s_deque;
static PyObject *__pyx_n_s_dict;
static PyObject *__pyx_n_s_difference;
static PyObject *__pyx_n_s_difference_update;
static PyObject *__pyx_n_s_discard;
static PyObject *__pyx_n_s_dtype;
static PyObject *__pyx_n_s_element;
static PyObject *__pyx_n_s_element_graph;
static PyObject *__pyx_n_s_empty;
static PyObject *__pyx_n_s_excludes;
static PyObject *__pyx_n_s_extend;
static PyObject *__pyx_n_s_extend_path;
static PyObject *__pyx_n_s_extension;
static PyObject *__pyx_n_s_extensions;
static PyObject *__pyx_n_s_fill_value;
static PyObject *__pyx_n_s_find_optimal_path;
static PyObject *__pyx_n_s_float32;
static PyObject *__pyx_n_s_format;
static PyObject *__pyx_n_s_frag_len;
static PyObject *__pyx_n_s_full;
static PyObject *__pyx_n_s_generate_extensions;
static PyObject *__pyx_n_s_get;
static PyObject *__pyx_n_s_get_exons;
static PyObject *__pyx_n_s_get_heaviest_element;
static PyObject *__pyx_n_s_get_introns;
static PyObject *__pyx_n_s_getstate;
static PyObject *__pyx_n_s_has_gaps;
static PyObject *__pyx_n_s_ignore_ends;
static PyObject *__pyx_n_s_import;
static PyObject *__pyx_n_s_includes;
static PyObject *__pyx_n_s_index;
static PyObject *__pyx_n_s_inf;
static PyObject *__pyx_n_s_ingroup;
static PyObject *__pyx_n_s_int32;
static PyObject *__pyx_n_s_intersection;
static PyObject *__pyx_n_s_intersection_update;
static PyObject *__pyx_n_s_intron_filter;
static PyObject *__pyx_n_s_isdisjoint;
static PyObject *__pyx_n_s_issubset;
static PyObject *__pyx_n_s_json;
static PyObject *__pyx_n_s_keepdims;
static PyObject *__pyx_n_s_lengths;
static PyObject *__pyx_n_s_logical_or;
static PyObject *__pyx_n_s_main;
static PyObject *__pyx_n_s_max;
static PyObject *__pyx_n_s_maxIC;
static PyObject *__pyx_n_s_max_isos;
static PyObject *__pyx_n_s_maxlen;
static PyObject *__pyx_n_s_mean;
static PyObject *__pyx_n_s_member_weight_array;
static PyObject *__pyx_n_s_member_weights;
static PyObject *__pyx_n_s_membership;
static PyObject *__pyx_n_s_membership_matrix;
static PyObject *__pyx_n_s_merge;
static PyObject *__pyx_n_s_min;
static PyObject *__pyx_n_s_minimum_proportion;
static PyObject *__pyx_n_s_naive;
static PyObject *__pyx_n_s_name;
static PyObject *__pyx_n_s_new;
static PyObject *__pyx_n_s_normalize;
static PyObject *__pyx_n_s_np;
static PyObject *__pyx_n_s_numpy;
static PyObject *__pyx_kp_u_numpy_core_multiarray_failed_to;
static PyObject *__pyx_kp_u_numpy_core_umath_failed_to_impor;
static PyObject *__pyx_n_s_ones;
static PyObject *__pyx_n_s_other;
static PyObject *__pyx_n_s_outgroup;
static PyObject *__pyx_n_s_overlap;
static PyObject *__pyx_n_s_overlap_matrix;
static PyObject *__pyx_n_s_partial_coverage;
static PyObject *__pyx_n_s_path;
static PyObject *__pyx_n_s_penalize_dead_ends;
static PyObject *__pyx_n_s_pickle;
static PyObject *__pyx_n_s_popleft;
static PyObject *__pyx_n_s_print;
static PyObject *__pyx_n_s_proportion;
static PyObject *__pyx_n_s_pyx_PickleError;
static PyObject *__pyx_n_s_pyx_checksum;
static PyObject *__pyx_n_s_pyx_result;
static PyObject *__pyx_n_s_pyx_state;
static PyObject *__pyx_n_s_pyx_type;
static PyObject *__pyx_n_s_pyx_unpickle_Element;
static PyObject *__pyx_n_s_pyx_unpickle_ElementGraph;
static PyObject *__pyx_n_s_pyx_vtable;
static PyObject *__pyx_n_s_range;
static PyObject *__pyx_n_s_reduce;
static PyObject *__pyx_n_s_reduce_cython;
static PyObject *__pyx_n_s_reduce_ex;
static PyObject *__pyx_n_s_remove_bad_assemblies;
static PyObject *__pyx_n_s_remove_paths;
static PyObject *__pyx_n_s_rescue_ends;
static PyObject *__pyx_n_s_resolve_containment;
static PyObject *__pyx_n_s_reverse;
static PyObject *__pyx_n_s_setstate;
static PyObject *__pyx_n_s_setstate_cython;
static PyObject *__pyx_n_s_shape;
static PyObject *__pyx_n_s_simplify;
static PyObject *__pyx_n_s_sorted;
static PyObject *__pyx_n_s_source_weight_array;
static PyObject *__pyx_n_s_source_weights;
static PyObject *__pyx_n_s_strand;
static PyObject *__pyx_n_s_strands;
static PyObject *__pyx_kp_s_stringsource;
static PyObject *__pyx_n_s_sum;
static PyObject *__pyx_n_s_test;
static PyObject *__pyx_n_s_truncation_filter;
static PyObject *__pyx_n_s_union;
static PyObject *__pyx_n_s_uniqueInformation;
static PyObject *__pyx_n_s_uniqueLength;
static PyObject *__pyx_n_s_uniqueMembers;
static PyObject *__pyx_n_s_uniqueNonmembers;
static PyObject *__pyx_n_s_update;
static PyObject *__pyx_n_s_values;
static PyObject *__pyx_n_s_verbose;
static PyObject *__pyx_n_s_weights;
static PyObject *__pyx_n_s_where;
static PyObject *__pyx_n_s_zero_element;
static PyObject *__pyx_n_s_zeros;
static int __pyx_pf_14_element_graph_12ElementGraph___init__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, PyArrayObject *__pyx_v_overlap_matrix, PyArrayObject *__pyx_v_membership_matrix, PyObject *__pyx_v_source_weight_array, PyObject *__pyx_v_member_weight_array, PyObject *__pyx_v_strands, PyObject *__pyx_v_lengths, PyObject *__pyx_v_naive, PyObject *__pyx_v_dead_end_penalty, PyObject *__pyx_v_partial_coverage, PyObject *__pyx_v_ignore_ends, PyObject *__pyx_v_intron_filter, PyObject *__pyx_v_max_isos, PyObject *__pyx_v_allow_incomplete, PyObject *__pyx_v_truncation_filter); /* proto */
static PyObject *__pyx_pf_14_element_graph_12ElementGraph_2penalize_dead_ends(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14_element_graph_12ElementGraph_4check_for_full_paths(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14_element_graph_12ElementGraph_6resolve_containment(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14_element_graph_12ElementGraph_8zero_element(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, int __pyx_v_index); /* proto */
static PyObject *__pyx_pf_14_element_graph_12ElementGraph_10assign_weights(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14_element_graph_12ElementGraph_12assemble(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, float __pyx_v_minimum_proportion, PyObject *__pyx_v_simplify); /* proto */
static PyObject *__pyx_pf_14_element_graph_12ElementGraph_14remove_bad_assemblies(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, PyObject *__pyx_v_minimum_proportion, PyObject *__pyx_v_verbose); /* proto */
static PyObject *__pyx_pf_14_element_graph_12ElementGraph_16available_proportion(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, PyArrayObject *__pyx_v_weights, struct __pyx_obj_14_element_graph_Element *__pyx_v_element); /* proto */
static PyObject *__pyx_pf_14_element_graph_12ElementGraph_18available_bases(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, PyArrayObject *__pyx_v_weights, struct __pyx_obj_14_element_graph_Element *__pyx_v_element); /* proto */
static PyObject *__pyx_pf_14_element_graph_12ElementGraph_20extend_path(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, struct __pyx_obj_14_element_graph_Element *__pyx_v_path, PyObject *__pyx_v_extension); /* proto */
static PyObject *__pyx_pf_14_element_graph_12ElementGraph_22get_heaviest_element(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14_element_graph_12ElementGraph_24dead_end(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, struct __pyx_obj_14_element_graph_Element *__pyx_v_path, PyObject *__pyx_v_extension); /* proto */
static PyObject *__pyx_pf_14_element_graph_12ElementGraph_26generate_extensions(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, struct __pyx_obj_14_element_graph_Element *__pyx_v_path); /* proto */
static PyObject *__pyx_pf_14_element_graph_12ElementGraph_28best_extension(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, struct __pyx_obj_14_element_graph_Element *__pyx_v_path, PyObject *__pyx_v_extensions, float __pyx_v_minimum_proportion); /* proto */
static PyObject *__pyx_pf_14_element_graph_12ElementGraph_30calculate_extension_score(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, struct __pyx_obj_14_element_graph_Element *__pyx_v_path, PyObject *__pyx_v_extension, float __pyx_v_minimum_proportion); /* proto */
static PyObject *__pyx_pf_14_element_graph_12ElementGraph_32find_optimal_path(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, float __pyx_v_minimum_proportion, int __pyx_v_verbose); /* proto */
static PyObject *__pyx_pf_14_element_graph_12ElementGraph_34rescue_ends(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, struct __pyx_obj_14_element_graph_Element *__pyx_v_path); /* proto */
static PyObject *__pyx_pf_14_element_graph_12ElementGraph_36add_path(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, struct __pyx_obj_14_element_graph_Element *__pyx_v_path); /* proto */
static PyObject *__pyx_pf_14_element_graph_12ElementGraph_38remove_paths(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, PyObject *__pyx_v_indices); /* proto */
static PyObject *__pyx_pf_14_element_graph_12ElementGraph_40normalize(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, PyArrayObject *__pyx_v_arr); /* proto */
static PyObject *__pyx_pf_14_element_graph_12ElementGraph_8elements___get__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self); /* proto */
static int __pyx_pf_14_element_graph_12ElementGraph_8elements_2__set__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_14_element_graph_12ElementGraph_8elements_4__del__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14_element_graph_12ElementGraph_5paths___get__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self); /* proto */
static int __pyx_pf_14_element_graph_12ElementGraph_5paths_2__set__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_14_element_graph_12ElementGraph_5paths_4__del__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14_element_graph_12ElementGraph_11assignments___get__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self); /* proto */
static int __pyx_pf_14_element_graph_12ElementGraph_11assignments_2__set__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_14_element_graph_12ElementGraph_11assignments_4__del__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14_element_graph_12ElementGraph_7overlap___get__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self); /* proto */
static int __pyx_pf_14_element_graph_12ElementGraph_7overlap_2__set__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_14_element_graph_12ElementGraph_7overlap_4__del__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14_element_graph_12ElementGraph_16end_reachability___get__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self); /* proto */
static int __pyx_pf_14_element_graph_12ElementGraph_16end_reachability_2__set__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_14_element_graph_12ElementGraph_16end_reachability_4__del__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14_element_graph_12ElementGraph_18number_of_elements___get__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14_element_graph_12ElementGraph_5maxIC___get__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14_element_graph_12ElementGraph_8max_isos___get__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14_element_graph_12ElementGraph_5bases___get__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self); /* proto */
static int __pyx_pf_14_element_graph_12ElementGraph_5bases_2__set__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_14_element_graph_12ElementGraph_11input_bases___get__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self); /* proto */
static int __pyx_pf_14_element_graph_12ElementGraph_11input_bases_2__set__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_14_element_graph_12ElementGraph_16dead_end_penalty___get__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self); /* proto */
static int __pyx_pf_14_element_graph_12ElementGraph_16dead_end_penalty_2__set__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_14_element_graph_12ElementGraph_13intron_filter___get__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self); /* proto */
static int __pyx_pf_14_element_graph_12ElementGraph_13intron_filter_2__set__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_14_element_graph_12ElementGraph_17truncation_filter___get__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self); /* proto */
static int __pyx_pf_14_element_graph_12ElementGraph_17truncation_filter_2__set__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_14_element_graph_12ElementGraph_2SP___get__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self); /* proto */
static int __pyx_pf_14_element_graph_12ElementGraph_2SP_2__set__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_14_element_graph_12ElementGraph_2SP_4__del__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14_element_graph_12ElementGraph_2SM___get__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self); /* proto */
static int __pyx_pf_14_element_graph_12ElementGraph_2SM_2__set__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_14_element_graph_12ElementGraph_2SM_4__del__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14_element_graph_12ElementGraph_2EP___get__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self); /* proto */
static int __pyx_pf_14_element_graph_12ElementGraph_2EP_2__set__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_14_element_graph_12ElementGraph_2EP_4__del__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14_element_graph_12ElementGraph_2EM___get__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self); /* proto */
static int __pyx_pf_14_element_graph_12ElementGraph_2EM_2__set__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_14_element_graph_12ElementGraph_2EM_4__del__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14_element_graph_12ElementGraph_12end_elements___get__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self); /* proto */
static int __pyx_pf_14_element_graph_12ElementGraph_12end_elements_2__set__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_14_element_graph_12ElementGraph_12end_elements_4__del__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14_element_graph_12ElementGraph_9SPmembers___get__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self); /* proto */
static int __pyx_pf_14_element_graph_12ElementGraph_9SPmembers_2__set__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_14_element_graph_12ElementGraph_9SPmembers_4__del__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14_element_graph_12ElementGraph_9SMmembers___get__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self); /* proto */
static int __pyx_pf_14_element_graph_12ElementGraph_9SMmembers_2__set__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_14_element_graph_12ElementGraph_9SMmembers_4__del__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14_element_graph_12ElementGraph_9EPmembers___get__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self); /* proto */
static int __pyx_pf_14_element_graph_12ElementGraph_9EPmembers_2__set__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_14_element_graph_12ElementGraph_9EPmembers_4__del__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14_element_graph_12ElementGraph_9EMmembers___get__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self); /* proto */
static int __pyx_pf_14_element_graph_12ElementGraph_9EMmembers_2__set__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_14_element_graph_12ElementGraph_9EMmembers_4__del__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14_element_graph_12ElementGraph_7no_ends___get__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self); /* proto */
static int __pyx_pf_14_element_graph_12ElementGraph_7no_ends_2__set__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_14_element_graph_12ElementGraph_11ignore_ends___get__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self); /* proto */
static int __pyx_pf_14_element_graph_12ElementGraph_11ignore_ends_2__set__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_14_element_graph_12ElementGraph_5naive___get__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self); /* proto */
static int __pyx_pf_14_element_graph_12ElementGraph_5naive_2__set__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_14_element_graph_12ElementGraph_16partial_coverage___get__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self); /* proto */
static int __pyx_pf_14_element_graph_12ElementGraph_16partial_coverage_2__set__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_14_element_graph_12ElementGraph_16allow_incomplete___get__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self); /* proto */
static int __pyx_pf_14_element_graph_12ElementGraph_16allow_incomplete_2__set__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_14_element_graph_12ElementGraph_42__reduce_cython__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14_element_graph_12ElementGraph_44__setstate_cython__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_14_element_graph_7Element___init__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, int __pyx_v_index, PyArrayObject *__pyx_v_source_weights, PyArrayObject *__pyx_v_member_weights, char __pyx_v_strand, PyArrayObject *__pyx_v_membership, PyArrayObject *__pyx_v_overlap, PyArrayObject *__pyx_v_frag_len, int __pyx_v_maxIC); /* proto */
static PyObject *__pyx_pf_14_element_graph_7Element_2__repr__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14_element_graph_7Element_4as_string(struct __pyx_obj_14_element_graph_Element *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14_element_graph_7Element_6__eq__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_14_element_graph_7Element_8__ne__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_14_element_graph_7Element_10__gt__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_14_element_graph_7Element_12__ge__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_14_element_graph_7Element_14__lt__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_14_element_graph_7Element_16__le__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_14_element_graph_7Element_18__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_14_element_graph_7Element_20update(struct __pyx_obj_14_element_graph_Element *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14_element_graph_7Element_22uniqueMembers(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, struct __pyx_obj_14_element_graph_Element *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_14_element_graph_7Element_24uniqueNonmembers(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, struct __pyx_obj_14_element_graph_Element *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_14_element_graph_7Element_26uniqueInformation(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, struct __pyx_obj_14_element_graph_Element *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_14_element_graph_7Element_28uniqueLength(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, struct __pyx_obj_14_element_graph_Element *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_14_element_graph_7Element_30compatible(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, struct __pyx_obj_14_element_graph_Element *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_14_element_graph_7Element_32get_introns(struct __pyx_obj_14_element_graph_Element *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14_element_graph_7Element_34get_exons(struct __pyx_obj_14_element_graph_Element *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14_element_graph_7Element_36merge(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, struct __pyx_obj_14_element_graph_Element *__pyx_v_other, PyArrayObject *__pyx_v_proportion); /* proto */
static PyObject *__pyx_pf_14_element_graph_7Element_5index___get__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self); /* proto */
static int __pyx_pf_14_element_graph_7Element_5index_2__set__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_14_element_graph_7Element_6length___get__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self); /* proto */
static int __pyx_pf_14_element_graph_7Element_6length_2__set__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_14_element_graph_7Element_2IC___get__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self); /* proto */
static int __pyx_pf_14_element_graph_7Element_2IC_2__set__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_14_element_graph_7Element_5maxIC___get__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self); /* proto */
static int __pyx_pf_14_element_graph_7Element_5maxIC_2__set__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_14_element_graph_7Element_4left___get__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self); /* proto */
static int __pyx_pf_14_element_graph_7Element_4left_2__set__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_14_element_graph_7Element_5right___get__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self); /* proto */
static int __pyx_pf_14_element_graph_7Element_5right_2__set__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_14_element_graph_7Element_18number_of_elements___get__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self); /* proto */
static int __pyx_pf_14_element_graph_7Element_18number_of_elements_2__set__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_14_element_graph_7Element_17number_of_members___get__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self); /* proto */
static int __pyx_pf_14_element_graph_7Element_17number_of_members_2__set__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_14_element_graph_7Element_2LM___get__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self); /* proto */
static int __pyx_pf_14_element_graph_7Element_2LM_2__set__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_14_element_graph_7Element_2RM___get__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self); /* proto */
static int __pyx_pf_14_element_graph_7Element_2RM_2__set__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_14_element_graph_7Element_6strand___get__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self); /* proto */
static int __pyx_pf_14_element_graph_7Element_6strand_2__set__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_14_element_graph_7Element_3cov___get__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self); /* proto */
static int __pyx_pf_14_element_graph_7Element_3cov_2__set__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_14_element_graph_7Element_5bases___get__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self); /* proto */
static int __pyx_pf_14_element_graph_7Element_5bases_2__set__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_14_element_graph_7Element_17bottleneck_weight___get__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self); /* proto */
static int __pyx_pf_14_element_graph_7Element_17bottleneck_weight_2__set__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_14_element_graph_7Element_13trimmed_bases___get__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self); /* proto */
static int __pyx_pf_14_element_graph_7Element_13trimmed_bases_2__set__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_14_element_graph_7Element_7members___get__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self); /* proto */
static int __pyx_pf_14_element_graph_7Element_7members_2__set__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_14_element_graph_7Element_7members_4__del__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14_element_graph_7Element_10nonmembers___get__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self); /* proto */
static int __pyx_pf_14_element_graph_7Element_10nonmembers_2__set__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_14_element_graph_7Element_10nonmembers_4__del__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14_element_graph_7Element_7ingroup___get__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self); /* proto */
static int __pyx_pf_14_element_graph_7Element_7ingroup_2__set__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_14_element_graph_7Element_7ingroup_4__del__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14_element_graph_7Element_8outgroup___get__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self); /* proto */
static int __pyx_pf_14_element_graph_7Element_8outgroup_2__set__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_14_element_graph_7Element_8outgroup_4__del__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14_element_graph_7Element_8contains___get__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self); /* proto */
static int __pyx_pf_14_element_graph_7Element_8contains_2__set__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_14_element_graph_7Element_8contains_4__del__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14_element_graph_7Element_9contained___get__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self); /* proto */
static int __pyx_pf_14_element_graph_7Element_9contained_2__set__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_14_element_graph_7Element_9contained_4__del__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14_element_graph_7Element_8excludes___get__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self); /* proto */
static int __pyx_pf_14_element_graph_7Element_8excludes_2__set__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_14_element_graph_7Element_8excludes_4__del__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14_element_graph_7Element_8includes___get__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self); /* proto */
static int __pyx_pf_14_element_graph_7Element_8includes_2__set__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_14_element_graph_7Element_8includes_4__del__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14_element_graph_7Element_11end_indices___get__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self); /* proto */
static int __pyx_pf_14_element_graph_7Element_11end_indices_2__set__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_14_element_graph_7Element_11end_indices_4__del__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14_element_graph_7Element_15covered_indices___get__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self); /* proto */
static int __pyx_pf_14_element_graph_7Element_15covered_indices_2__set__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_14_element_graph_7Element_15covered_indices_4__del__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14_element_graph_7Element_10bottleneck___get__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self); /* proto */
static int __pyx_pf_14_element_graph_7Element_10bottleneck_2__set__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_14_element_graph_7Element_10bottleneck_4__del__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14_element_graph_7Element_11assigned_to___get__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self); /* proto */
static int __pyx_pf_14_element_graph_7Element_11assigned_to_2__set__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_14_element_graph_7Element_11assigned_to_4__del__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14_element_graph_7Element_8frag_len___get__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self); /* proto */
static int __pyx_pf_14_element_graph_7Element_8frag_len_2__set__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_14_element_graph_7Element_8frag_len_4__del__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14_element_graph_7Element_14source_weights___get__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self); /* proto */
static int __pyx_pf_14_element_graph_7Element_14source_weights_2__set__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_14_element_graph_7Element_14source_weights_4__del__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14_element_graph_7Element_14member_weights___get__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self); /* proto */
static int __pyx_pf_14_element_graph_7Element_14member_weights_2__set__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_14_element_graph_7Element_14member_weights_4__del__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14_element_graph_7Element_3all___get__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self); /* proto */
static int __pyx_pf_14_element_graph_7Element_3all_2__set__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_14_element_graph_7Element_3all_4__del__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14_element_graph_7Element_8complete___get__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self); /* proto */
static int __pyx_pf_14_element_graph_7Element_8complete_2__set__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_14_element_graph_7Element_5s_tag___get__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self); /* proto */
static int __pyx_pf_14_element_graph_7Element_5s_tag_2__set__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_14_element_graph_7Element_5e_tag___get__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self); /* proto */
static int __pyx_pf_14_element_graph_7Element_5e_tag_2__set__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_14_element_graph_7Element_5empty___get__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self); /* proto */
static int __pyx_pf_14_element_graph_7Element_5empty_2__set__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_14_element_graph_7Element_10is_spliced___get__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self); /* proto */
static int __pyx_pf_14_element_graph_7Element_10is_spliced_2__set__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_14_element_graph_7Element_8has_gaps___get__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self); /* proto */
static int __pyx_pf_14_element_graph_7Element_8has_gaps_2__set__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_14_element_graph_7Element_38__reduce_cython__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14_element_graph_7Element_40__setstate_cython__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_14_element_graph___pyx_unpickle_ElementGraph(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_14_element_graph_2__pyx_unpickle_Element(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_14_element_graph_ElementGraph(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_14_element_graph_Element(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_get = {0, &__pyx_n_s_get, 0, 0, 0};
static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_values = {0, &__pyx_n_s_values, 0, 0, 0};
static __Pyx_CachedCFunction __pyx_umethod_PySet_Type_difference = {0, &__pyx_n_s_difference, 0, 0, 0};
static __Pyx_CachedCFunction __pyx_umethod_PySet_Type_difference_update = {0, &__pyx_n_s_difference_update, 0, 0, 0};
static __Pyx_CachedCFunction __pyx_umethod_PySet_Type_intersection_update = {0, &__pyx_n_s_intersection_update, 0, 0, 0};
static __Pyx_CachedCFunction __pyx_umethod_PySet_Type_issubset = {0, &__pyx_n_s_issubset, 0, 0, 0};
static __Pyx_CachedCFunction __pyx_umethod_PySet_Type_update = {0, &__pyx_n_s_update, 0, 0, 0};
static PyObject *__pyx_float__5;
static PyObject *__pyx_float_1_;
static PyObject *__pyx_float_0_1;
static PyObject *__pyx_int_0;
static PyObject *__pyx_int_1;
static PyObject *__pyx_int_2;
static PyObject *__pyx_int_3;
static PyObject *__pyx_int_4;
static PyObject *__pyx_int_10;
static PyObject *__pyx_int_73221949;
static PyObject *__pyx_int_118811853;
static PyObject *__pyx_int_125999838;
static PyObject *__pyx_int_173076085;
static PyObject *__pyx_int_189957110;
static PyObject *__pyx_int_230897078;
static PyObject *__pyx_int_neg_1;
static PyObject *__pyx_slice_;
static PyObject *__pyx_tuple__2;
static PyObject *__pyx_tuple__14;
static PyObject *__pyx_tuple__15;
static PyObject *__pyx_tuple__16;
static PyObject *__pyx_tuple__17;
static PyObject *__pyx_tuple__18;
static PyObject *__pyx_tuple__20;
static PyObject *__pyx_codeobj__19;
static PyObject *__pyx_codeobj__21;
/* Late includes */

/* "_element_graph.pyx":20
 *     cdef public set SP, SM, EP, EM, end_elements, SPmembers, SMmembers, EPmembers, EMmembers
 *     cdef public bint no_ends, ignore_ends, naive, partial_coverage, allow_incomplete
 *     def __init__(self, np.ndarray overlap_matrix, np.ndarray membership_matrix, source_weight_array, member_weight_array, strands, lengths, naive=False, dead_end_penalty=0.1, partial_coverage=True, ignore_ends=False, intron_filter=0.1, max_isos=10, allow_incomplete=False, truncation_filter=.5):             # <<<<<<<<<<<<<<
 *         """Constructs a forward and reverse directed graph from the
 *         connection values (ones) in the overlap matrix.
 */

/* Python wrapper */
static int __pyx_pw_14_element_graph_12ElementGraph_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_14_element_graph_12ElementGraph___init__[] = "Constructs a forward and reverse directed graph from the\n        connection values (ones) in the overlap matrix.\n        Additionally, stores the set of excluded edges for each node as an 'antigraph'\n        ";
#if CYTHON_UPDATE_DESCRIPTOR_DOC
struct wrapperbase __pyx_wrapperbase_14_element_graph_12ElementGraph___init__;
#endif
static int __pyx_pw_14_element_graph_12ElementGraph_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_overlap_matrix = 0;
  PyArrayObject *__pyx_v_membership_matrix = 0;
  PyObject *__pyx_v_source_weight_array = 0;
  PyObject *__pyx_v_member_weight_array = 0;
  PyObject *__pyx_v_strands = 0;
  PyObject *__pyx_v_lengths = 0;
  PyObject *__pyx_v_naive = 0;
  PyObject *__pyx_v_dead_end_penalty = 0;
  PyObject *__pyx_v_partial_coverage = 0;
  PyObject *__pyx_v_ignore_ends = 0;
  PyObject *__pyx_v_intron_filter = 0;
  PyObject *__pyx_v_max_isos = 0;
  PyObject *__pyx_v_allow_incomplete = 0;
  PyObject *__pyx_v_truncation_filter = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_overlap_matrix,&__pyx_n_s_membership_matrix,&__pyx_n_s_source_weight_array,&__pyx_n_s_member_weight_array,&__pyx_n_s_strands,&__pyx_n_s_lengths,&__pyx_n_s_naive,&__pyx_n_s_dead_end_penalty,&__pyx_n_s_partial_coverage,&__pyx_n_s_ignore_ends,&__pyx_n_s_intron_filter,&__pyx_n_s_max_isos,&__pyx_n_s_allow_incomplete,&__pyx_n_s_truncation_filter,0};
    PyObject* values[14] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0};
    values[6] = ((PyObject *)Py_False);
    values[7] = ((PyObject *)__pyx_float_0_1);
    values[8] = ((PyObject *)Py_True);
    values[9] = ((PyObject *)Py_False);
    values[10] = ((PyObject *)__pyx_float_0_1);
    values[11] = ((PyObject *)__pyx_int_10);
    values[12] = ((PyObject *)Py_False);
    values[13] = ((PyObject *)__pyx_float__5);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
        CYTHON_FALLTHROUGH;
        case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
        CYTHON_FALLTHROUGH;
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_overlap_matrix)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_membership_matrix)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 14, 1); __PYX_ERR(0, 20, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_source_weight_array)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 14, 2); __PYX_ERR(0, 20, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_member_weight_array)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 14, 3); __PYX_ERR(0, 20, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_strands)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 14, 4); __PYX_ERR(0, 20, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lengths)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 14, 5); __PYX_ERR(0, 20, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_naive);
          if (value) { values[6] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dead_end_penalty);
          if (value) { values[7] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_partial_coverage);
          if (value) { values[8] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ignore_ends);
          if (value) { values[9] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_intron_filter);
          if (value) { values[10] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_isos);
          if (value) { values[11] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case 12:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allow_incomplete);
          if (value) { values[12] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case 13:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_truncation_filter);
          if (value) { values[13] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 20, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
        CYTHON_FALLTHROUGH;
        case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
        CYTHON_FALLTHROUGH;
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_overlap_matrix = ((PyArrayObject *)values[0]);
    __pyx_v_membership_matrix = ((PyArrayObject *)values[1]);
    __pyx_v_source_weight_array = values[2];
    __pyx_v_member_weight_array = values[3];
    __pyx_v_strands = values[4];
    __pyx_v_lengths = values[5];
    __pyx_v_naive = values[6];
    __pyx_v_dead_end_penalty = values[7];
    __pyx_v_partial_coverage = values[8];
    __pyx_v_ignore_ends = values[9];
    __pyx_v_intron_filter = values[10];
    __pyx_v_max_isos = values[11];
    __pyx_v_allow_incomplete = values[12];
    __pyx_v_truncation_filter = values[13];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 14, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 20, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("_element_graph.ElementGraph.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_overlap_matrix), __pyx_ptype_5numpy_ndarray, 1, "overlap_matrix", 0))) __PYX_ERR(0, 20, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_membership_matrix), __pyx_ptype_5numpy_ndarray, 1, "membership_matrix", 0))) __PYX_ERR(0, 20, __pyx_L1_error)
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph___init__(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self), __pyx_v_overlap_matrix, __pyx_v_membership_matrix, __pyx_v_source_weight_array, __pyx_v_member_weight_array, __pyx_v_strands, __pyx_v_lengths, __pyx_v_naive, __pyx_v_dead_end_penalty, __pyx_v_partial_coverage, __pyx_v_ignore_ends, __pyx_v_intron_filter, __pyx_v_max_isos, __pyx_v_allow_incomplete, __pyx_v_truncation_filter);

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

static int __pyx_pf_14_element_graph_12ElementGraph___init__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, PyArrayObject *__pyx_v_overlap_matrix, PyArrayObject *__pyx_v_membership_matrix, PyObject *__pyx_v_source_weight_array, PyObject *__pyx_v_member_weight_array, PyObject *__pyx_v_strands, PyObject *__pyx_v_lengths, PyObject *__pyx_v_naive, PyObject *__pyx_v_dead_end_penalty, PyObject *__pyx_v_partial_coverage, PyObject *__pyx_v_ignore_ends, PyObject *__pyx_v_intron_filter, PyObject *__pyx_v_max_isos, PyObject *__pyx_v_allow_incomplete, PyObject *__pyx_v_truncation_filter) {
  int __pyx_7genexpr__pyx_v_i;
  struct __pyx_obj_14_element_graph_Element *__pyx_8genexpr1__pyx_v_e = NULL;
  struct __pyx_obj_14_element_graph_Element *__pyx_8genexpr2__pyx_v_e = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  float __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  int __pyx_t_12;
  int __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);
  __Pyx_INCREF(__pyx_v_source_weight_array);

  /* "_element_graph.pyx":27
 *         cdef int e_index, path_index, i
 *         cdef Element e, path, part
 *         self.emptyPath = Element(-1, np.array([0]), np.array([0]), 0, np.array([0]), np.array([0]), np.array([0]), 0)             # <<<<<<<<<<<<<<
 *         self.dead_end_penalty = dead_end_penalty
 *         self.SP, self.SM, self.EP, self.EM = set(), set(), set(), set()
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_int_0);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_int_0);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_int_0);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_int_0);
  __pyx_t_7 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_int_0);
  __pyx_t_8 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
    }
  }
  __pyx_t_6 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = PyTuple_New(8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_INCREF(__pyx_int_neg_1);
  __Pyx_GIVEREF(__pyx_int_neg_1);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_int_neg_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_3);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_int_0);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_7, 4, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_7, 5, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_7, 6, __pyx_t_6);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_t_7, 7, __pyx_int_0);
  __pyx_t_1 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_5 = 0;
  __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_14_element_graph_Element), __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_GIVEREF(__pyx_t_6);
  __Pyx_GOTREF(__pyx_v_self->emptyPath);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->emptyPath));
  __pyx_v_self->emptyPath = ((struct __pyx_obj_14_element_graph_Element *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "_element_graph.pyx":28
 *         cdef Element e, path, part
 *         self.emptyPath = Element(-1, np.array([0]), np.array([0]), 0, np.array([0]), np.array([0]), np.array([0]), 0)
 *         self.dead_end_penalty = dead_end_penalty             # <<<<<<<<<<<<<<
 *         self.SP, self.SM, self.EP, self.EM = set(), set(), set(), set()
 *         self.SPmembers, self.SMmembers, self.EPmembers, self.EMmembers = set(), set(), set(), set()
 */
  __pyx_t_9 = __pyx_PyFloat_AsFloat(__pyx_v_dead_end_penalty); if (unlikely((__pyx_t_9 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 28, __pyx_L1_error)
  __pyx_v_self->dead_end_penalty = __pyx_t_9;

  /* "_element_graph.pyx":29
 *         self.emptyPath = Element(-1, np.array([0]), np.array([0]), 0, np.array([0]), np.array([0]), np.array([0]), 0)
 *         self.dead_end_penalty = dead_end_penalty
 *         self.SP, self.SM, self.EP, self.EM = set(), set(), set(), set()             # <<<<<<<<<<<<<<
 *         self.SPmembers, self.SMmembers, self.EPmembers, self.EMmembers = set(), set(), set(), set()
 *         self.overlap = overlap_matrix
 */
  __pyx_t_6 = PySet_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = PySet_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_5 = PySet_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = PySet_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_6);
  __Pyx_GOTREF(__pyx_v_self->SP);
  __Pyx_DECREF(__pyx_v_self->SP);
  __pyx_v_self->SP = ((PyObject*)__pyx_t_6);
  __pyx_t_6 = 0;
  __Pyx_GIVEREF(__pyx_t_7);
  __Pyx_GOTREF(__pyx_v_self->SM);
  __Pyx_DECREF(__pyx_v_self->SM);
  __pyx_v_self->SM = ((PyObject*)__pyx_t_7);
  __pyx_t_7 = 0;
  __Pyx_GIVEREF(__pyx_t_5);
  __Pyx_GOTREF(__pyx_v_self->EP);
  __Pyx_DECREF(__pyx_v_self->EP);
  __pyx_v_self->EP = ((PyObject*)__pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_GIVEREF(__pyx_t_4);
  __Pyx_GOTREF(__pyx_v_self->EM);
  __Pyx_DECREF(__pyx_v_self->EM);
  __pyx_v_self->EM = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "_element_graph.pyx":30
 *         self.dead_end_penalty = dead_end_penalty
 *         self.SP, self.SM, self.EP, self.EM = set(), set(), set(), set()
 *         self.SPmembers, self.SMmembers, self.EPmembers, self.EMmembers = set(), set(), set(), set()             # <<<<<<<<<<<<<<
 *         self.overlap = overlap_matrix
 *         self.number_of_elements = self.overlap.shape[0]
 */
  __pyx_t_4 = PySet_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PySet_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = PySet_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = PySet_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_4);
  __Pyx_GOTREF(__pyx_v_self->SPmembers);
  __Pyx_DECREF(__pyx_v_self->SPmembers);
  __pyx_v_self->SPmembers = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_GIVEREF(__pyx_t_5);
  __Pyx_GOTREF(__pyx_v_self->SMmembers);
  __Pyx_DECREF(__pyx_v_self->SMmembers);
  __pyx_v_self->SMmembers = ((PyObject*)__pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_GIVEREF(__pyx_t_7);
  __Pyx_GOTREF(__pyx_v_self->EPmembers);
  __Pyx_DECREF(__pyx_v_self->EPmembers);
  __pyx_v_self->EPmembers = ((PyObject*)__pyx_t_7);
  __pyx_t_7 = 0;
  __Pyx_GIVEREF(__pyx_t_6);
  __Pyx_GOTREF(__pyx_v_self->EMmembers);
  __Pyx_DECREF(__pyx_v_self->EMmembers);
  __pyx_v_self->EMmembers = ((PyObject*)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "_element_graph.pyx":31
 *         self.SP, self.SM, self.EP, self.EM = set(), set(), set(), set()
 *         self.SPmembers, self.SMmembers, self.EPmembers, self.EMmembers = set(), set(), set(), set()
 *         self.overlap = overlap_matrix             # <<<<<<<<<<<<<<
 *         self.number_of_elements = self.overlap.shape[0]
 *         self.maxIC = membership_matrix.shape[1]
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_overlap_matrix));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_overlap_matrix));
  __Pyx_GOTREF(__pyx_v_self->overlap);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->overlap));
  __pyx_v_self->overlap = __pyx_v_overlap_matrix;

  /* "_element_graph.pyx":32
 *         self.SPmembers, self.SMmembers, self.EPmembers, self.EMmembers = set(), set(), set(), set()
 *         self.overlap = overlap_matrix
 *         self.number_of_elements = self.overlap.shape[0]             # <<<<<<<<<<<<<<
 *         self.maxIC = membership_matrix.shape[1]
 *         self.naive = naive
 */
  __pyx_v_self->number_of_elements = (__pyx_v_self->overlap->dimensions[0]);

  /* "_element_graph.pyx":33
 *         self.overlap = overlap_matrix
 *         self.number_of_elements = self.overlap.shape[0]
 *         self.maxIC = membership_matrix.shape[1]             # <<<<<<<<<<<<<<
 *         self.naive = naive
 *         self.ignore_ends = ignore_ends
 */
  __pyx_v_self->maxIC = (__pyx_v_membership_matrix->dimensions[1]);

  /* "_element_graph.pyx":34
 *         self.number_of_elements = self.overlap.shape[0]
 *         self.maxIC = membership_matrix.shape[1]
 *         self.naive = naive             # <<<<<<<<<<<<<<
 *         self.ignore_ends = ignore_ends
 *         self.intron_filter = intron_filter
 */
  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_naive); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 34, __pyx_L1_error)
  __pyx_v_self->naive = __pyx_t_10;

  /* "_element_graph.pyx":35
 *         self.maxIC = membership_matrix.shape[1]
 *         self.naive = naive
 *         self.ignore_ends = ignore_ends             # <<<<<<<<<<<<<<
 *         self.intron_filter = intron_filter
 *         self.truncation_filter = truncation_filter
 */
  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_ignore_ends); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 35, __pyx_L1_error)
  __pyx_v_self->ignore_ends = __pyx_t_10;

  /* "_element_graph.pyx":36
 *         self.naive = naive
 *         self.ignore_ends = ignore_ends
 *         self.intron_filter = intron_filter             # <<<<<<<<<<<<<<
 *         self.truncation_filter = truncation_filter
 *         self.partial_coverage = partial_coverage
 */
  __pyx_t_9 = __pyx_PyFloat_AsFloat(__pyx_v_intron_filter); if (unlikely((__pyx_t_9 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 36, __pyx_L1_error)
  __pyx_v_self->intron_filter = __pyx_t_9;

  /* "_element_graph.pyx":37
 *         self.ignore_ends = ignore_ends
 *         self.intron_filter = intron_filter
 *         self.truncation_filter = truncation_filter             # <<<<<<<<<<<<<<
 *         self.partial_coverage = partial_coverage
 *         self.max_isos = max_isos
 */
  __pyx_t_9 = __pyx_PyFloat_AsFloat(__pyx_v_truncation_filter); if (unlikely((__pyx_t_9 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 37, __pyx_L1_error)
  __pyx_v_self->truncation_filter = __pyx_t_9;

  /* "_element_graph.pyx":38
 *         self.intron_filter = intron_filter
 *         self.truncation_filter = truncation_filter
 *         self.partial_coverage = partial_coverage             # <<<<<<<<<<<<<<
 *         self.max_isos = max_isos
 *         self.allow_incomplete = allow_incomplete
 */
  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_partial_coverage); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 38, __pyx_L1_error)
  __pyx_v_self->partial_coverage = __pyx_t_10;

  /* "_element_graph.pyx":39
 *         self.truncation_filter = truncation_filter
 *         self.partial_coverage = partial_coverage
 *         self.max_isos = max_isos             # <<<<<<<<<<<<<<
 *         self.allow_incomplete = allow_incomplete
 *         if self.naive:
 */
  __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_v_max_isos); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 39, __pyx_L1_error)
  __pyx_v_self->max_isos = __pyx_t_11;

  /* "_element_graph.pyx":40
 *         self.partial_coverage = partial_coverage
 *         self.max_isos = max_isos
 *         self.allow_incomplete = allow_incomplete             # <<<<<<<<<<<<<<
 *         if self.naive:
 *                 source_weight_array = np.sum(source_weight_array, axis=1, keepdims=True)
 */
  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_allow_incomplete); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 40, __pyx_L1_error)
  __pyx_v_self->allow_incomplete = __pyx_t_10;

  /* "_element_graph.pyx":41
 *         self.max_isos = max_isos
 *         self.allow_incomplete = allow_incomplete
 *         if self.naive:             # <<<<<<<<<<<<<<
 *                 source_weight_array = np.sum(source_weight_array, axis=1, keepdims=True)
 * 
 */
  __pyx_t_10 = (__pyx_v_self->naive != 0);
  if (__pyx_t_10) {

    /* "_element_graph.pyx":42
 *         self.allow_incomplete = allow_incomplete
 *         if self.naive:
 *                 source_weight_array = np.sum(source_weight_array, axis=1, keepdims=True)             # <<<<<<<<<<<<<<
 * 
 *         self.elements = [Element(
 */
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 42, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_sum); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 42, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 42, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_v_source_weight_array);
    __Pyx_GIVEREF(__pyx_v_source_weight_array);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_source_weight_array);
    __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 42, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_axis, __pyx_int_1) < 0) __PYX_ERR(0, 42, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_keepdims, Py_True) < 0) __PYX_ERR(0, 42, __pyx_L1_error)
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 42, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF_SET(__pyx_v_source_weight_array, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "_element_graph.pyx":41
 *         self.max_isos = max_isos
 *         self.allow_incomplete = allow_incomplete
 *         if self.naive:             # <<<<<<<<<<<<<<
 *                 source_weight_array = np.sum(source_weight_array, axis=1, keepdims=True)
 * 
 */
  }

  /* "_element_graph.pyx":44
 *                 source_weight_array = np.sum(source_weight_array, axis=1, keepdims=True)
 * 
 *         self.elements = [Element(             # <<<<<<<<<<<<<<
 *             i, source_weight_array[i,:], member_weight_array[i,:], strands[i],
 *             membership_matrix[i,:], self.overlap, lengths, self.maxIC
 */
  { /* enter inner scope */
    __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 44, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);

    /* "_element_graph.pyx":47
 *             i, source_weight_array[i,:], member_weight_array[i,:], strands[i],
 *             membership_matrix[i,:], self.overlap, lengths, self.maxIC
 *         ) for i in range(self.number_of_elements)] # Generate an array of Element objects             # <<<<<<<<<<<<<<
 *         self.assignments = np.zeros(shape=self.number_of_elements, dtype=np.int32)
 *         self.paths = []
 */
    __pyx_t_11 = __pyx_v_self->number_of_elements;
    __pyx_t_12 = __pyx_t_11;
    for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
      __pyx_7genexpr__pyx_v_i = __pyx_t_13;

      /* "_element_graph.pyx":45
 * 
 *         self.elements = [Element(
 *             i, source_weight_array[i,:], member_weight_array[i,:], strands[i],             # <<<<<<<<<<<<<<
 *             membership_matrix[i,:], self.overlap, lengths, self.maxIC
 *         ) for i in range(self.number_of_elements)] # Generate an array of Element objects
 */
      __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_7genexpr__pyx_v_i); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 45, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_7genexpr__pyx_v_i); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 45, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 45, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6);
      __Pyx_INCREF(__pyx_slice_);
      __Pyx_GIVEREF(__pyx_slice_);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_slice_);
      __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_source_weight_array, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 45, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_7genexpr__pyx_v_i); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 45, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 45, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_7);
      __Pyx_INCREF(__pyx_slice_);
      __Pyx_GIVEREF(__pyx_slice_);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_slice_);
      __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_member_weight_array, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 45, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_strands, __pyx_7genexpr__pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 45, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);

      /* "_element_graph.pyx":46
 *         self.elements = [Element(
 *             i, source_weight_array[i,:], member_weight_array[i,:], strands[i],
 *             membership_matrix[i,:], self.overlap, lengths, self.maxIC             # <<<<<<<<<<<<<<
 *         ) for i in range(self.number_of_elements)] # Generate an array of Element objects
 *         self.assignments = np.zeros(shape=self.number_of_elements, dtype=np.int32)
 */
      __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_7genexpr__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 46, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 46, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
      __Pyx_INCREF(__pyx_slice_);
      __Pyx_GIVEREF(__pyx_slice_);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_slice_);
      __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_membership_matrix), __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 46, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->maxIC); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 46, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);

      /* "_element_graph.pyx":44
 *                 source_weight_array = np.sum(source_weight_array, axis=1, keepdims=True)
 * 
 *         self.elements = [Element(             # <<<<<<<<<<<<<<
 *             i, source_weight_array[i,:], member_weight_array[i,:], strands[i],
 *             membership_matrix[i,:], self.overlap, lengths, self.maxIC
 */
      __pyx_t_8 = PyTuple_New(8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 44, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_8, 4, __pyx_t_1);
      __Pyx_INCREF(((PyObject *)__pyx_v_self->overlap));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_self->overlap));
      PyTuple_SET_ITEM(__pyx_t_8, 5, ((PyObject *)__pyx_v_self->overlap));
      __Pyx_INCREF(__pyx_v_lengths);
      __Pyx_GIVEREF(__pyx_v_lengths);
      PyTuple_SET_ITEM(__pyx_t_8, 6, __pyx_v_lengths);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_8, 7, __pyx_t_2);
      __pyx_t_5 = 0;
      __pyx_t_6 = 0;
      __pyx_t_7 = 0;
      __pyx_t_3 = 0;
      __pyx_t_1 = 0;
      __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_14_element_graph_Element), __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 44, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 44, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
  } /* exit inner scope */
  __Pyx_GIVEREF(__pyx_t_4);
  __Pyx_GOTREF(__pyx_v_self->elements);
  __Pyx_DECREF(__pyx_v_self->elements);
  __pyx_v_self->elements = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "_element_graph.pyx":48
 *             membership_matrix[i,:], self.overlap, lengths, self.maxIC
 *         ) for i in range(self.number_of_elements)] # Generate an array of Element objects
 *         self.assignments = np.zeros(shape=self.number_of_elements, dtype=np.int32)             # <<<<<<<<<<<<<<
 *         self.paths = []
 *         self.input_bases = sum([e.bases for e in self.elements])
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 48, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 48, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 48, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_self->number_of_elements); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 48, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_shape, __pyx_t_8) < 0) __PYX_ERR(0, 48, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 48, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_int32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 48, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 48, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 48, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 48, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->assignments);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->assignments));
  __pyx_v_self->assignments = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "_element_graph.pyx":49
 *         ) for i in range(self.number_of_elements)] # Generate an array of Element objects
 *         self.assignments = np.zeros(shape=self.number_of_elements, dtype=np.int32)
 *         self.paths = []             # <<<<<<<<<<<<<<
 *         self.input_bases = sum([e.bases for e in self.elements])
 *         self.check_for_full_paths()
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->paths);
  __Pyx_DECREF(__pyx_v_self->paths);
  __pyx_v_self->paths = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "_element_graph.pyx":50
 *         self.assignments = np.zeros(shape=self.number_of_elements, dtype=np.int32)
 *         self.paths = []
 *         self.input_bases = sum([e.bases for e in self.elements])             # <<<<<<<<<<<<<<
 *         self.check_for_full_paths()
 *         self.penalize_dead_ends()
 */
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 50, __pyx_L8_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (unlikely(__pyx_v_self->elements == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(0, 50, __pyx_L8_error)
    }
    __pyx_t_4 = __pyx_v_self->elements; __Pyx_INCREF(__pyx_t_4); __pyx_t_14 = 0;
    for (;;) {
      if (__pyx_t_14 >= PyList_GET_SIZE(__pyx_t_4)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_14); __Pyx_INCREF(__pyx_t_2); __pyx_t_14++; if (unlikely(0 < 0)) __PYX_ERR(0, 50, __pyx_L8_error)
      #else
      __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 50, __pyx_L8_error)
      __Pyx_GOTREF(__pyx_t_2);
      #endif
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_14_element_graph_Element))))) __PYX_ERR(0, 50, __pyx_L8_error)
      __Pyx_XDECREF_SET(__pyx_8genexpr1__pyx_v_e, ((struct __pyx_obj_14_element_graph_Element *)__pyx_t_2));
      __pyx_t_2 = 0;
      __pyx_t_2 = PyFloat_FromDouble(__pyx_8genexpr1__pyx_v_e->bases); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 50, __pyx_L8_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 50, __pyx_L8_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF((PyObject *)__pyx_8genexpr1__pyx_v_e); __pyx_8genexpr1__pyx_v_e = 0;
    goto __pyx_L11_exit_scope;
    __pyx_L8_error:;
    __Pyx_XDECREF((PyObject *)__pyx_8genexpr1__pyx_v_e); __pyx_8genexpr1__pyx_v_e = 0;
    goto __pyx_L1_error;
    __pyx_L11_exit_scope:;
  } /* exit inner scope */
  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_9 = __pyx_PyFloat_AsFloat(__pyx_t_4); if (unlikely((__pyx_t_9 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 50, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_self->input_bases = __pyx_t_9;

  /* "_element_graph.pyx":51
 *         self.paths = []
 *         self.input_bases = sum([e.bases for e in self.elements])
 *         self.check_for_full_paths()             # <<<<<<<<<<<<<<
 *         self.penalize_dead_ends()
 *         self.bases = sum([e.bases for e in self.elements])
 */
  ((struct __pyx_vtabstruct_14_element_graph_ElementGraph *)__pyx_v_self->__pyx_vtab)->check_for_full_paths(__pyx_v_self, 0);

  /* "_element_graph.pyx":52
 *         self.input_bases = sum([e.bases for e in self.elements])
 *         self.check_for_full_paths()
 *         self.penalize_dead_ends()             # <<<<<<<<<<<<<<
 *         self.bases = sum([e.bases for e in self.elements])
 *         if self.bases > 0:
 */
  ((struct __pyx_vtabstruct_14_element_graph_ElementGraph *)__pyx_v_self->__pyx_vtab)->penalize_dead_ends(__pyx_v_self, 0);

  /* "_element_graph.pyx":53
 *         self.check_for_full_paths()
 *         self.penalize_dead_ends()
 *         self.bases = sum([e.bases for e in self.elements])             # <<<<<<<<<<<<<<
 *         if self.bases > 0:
 *             self.resolve_containment()
 */
  { /* enter inner scope */
    __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 53, __pyx_L14_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (unlikely(__pyx_v_self->elements == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(0, 53, __pyx_L14_error)
    }
    __pyx_t_1 = __pyx_v_self->elements; __Pyx_INCREF(__pyx_t_1); __pyx_t_14 = 0;
    for (;;) {
      if (__pyx_t_14 >= PyList_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_14); __Pyx_INCREF(__pyx_t_2); __pyx_t_14++; if (unlikely(0 < 0)) __PYX_ERR(0, 53, __pyx_L14_error)
      #else
      __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 53, __pyx_L14_error)
      __Pyx_GOTREF(__pyx_t_2);
      #endif
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_14_element_graph_Element))))) __PYX_ERR(0, 53, __pyx_L14_error)
      __Pyx_XDECREF_SET(__pyx_8genexpr2__pyx_v_e, ((struct __pyx_obj_14_element_graph_Element *)__pyx_t_2));
      __pyx_t_2 = 0;
      __pyx_t_2 = PyFloat_FromDouble(__pyx_8genexpr2__pyx_v_e->bases); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 53, __pyx_L14_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 53, __pyx_L14_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF((PyObject *)__pyx_8genexpr2__pyx_v_e); __pyx_8genexpr2__pyx_v_e = 0;
    goto __pyx_L17_exit_scope;
    __pyx_L14_error:;
    __Pyx_XDECREF((PyObject *)__pyx_8genexpr2__pyx_v_e); __pyx_8genexpr2__pyx_v_e = 0;
    goto __pyx_L1_error;
    __pyx_L17_exit_scope:;
  } /* exit inner scope */
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 53, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_9 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_9 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 53, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_self->bases = __pyx_t_9;

  /* "_element_graph.pyx":54
 *         self.penalize_dead_ends()
 *         self.bases = sum([e.bases for e in self.elements])
 *         if self.bases > 0:             # <<<<<<<<<<<<<<
 *             self.resolve_containment()
 * 
 */
  __pyx_t_10 = ((__pyx_v_self->bases > 0.0) != 0);
  if (__pyx_t_10) {

    /* "_element_graph.pyx":55
 *         self.bases = sum([e.bases for e in self.elements])
 *         if self.bases > 0:
 *             self.resolve_containment()             # <<<<<<<<<<<<<<
 * 
 *     cpdef void penalize_dead_ends(self):
 */
    ((struct __pyx_vtabstruct_14_element_graph_ElementGraph *)__pyx_v_self->__pyx_vtab)->resolve_containment(__pyx_v_self, 0);

    /* "_element_graph.pyx":54
 *         self.penalize_dead_ends()
 *         self.bases = sum([e.bases for e in self.elements])
 *         if self.bases > 0:             # <<<<<<<<<<<<<<
 *             self.resolve_containment()
 * 
 */
  }

  /* "_element_graph.pyx":20
 *     cdef public set SP, SM, EP, EM, end_elements, SPmembers, SMmembers, EPmembers, EMmembers
 *     cdef public bint no_ends, ignore_ends, naive, partial_coverage, allow_incomplete
 *     def __init__(self, np.ndarray overlap_matrix, np.ndarray membership_matrix, source_weight_array, member_weight_array, strands, lengths, naive=False, dead_end_penalty=0.1, partial_coverage=True, ignore_ends=False, intron_filter=0.1, max_isos=10, allow_incomplete=False, truncation_filter=.5):             # <<<<<<<<<<<<<<
 *         """Constructs a forward and reverse directed graph from the
 *         connection values (ones) in the overlap matrix.
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("_element_graph.ElementGraph.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_8genexpr1__pyx_v_e);
  __Pyx_XDECREF((PyObject *)__pyx_8genexpr2__pyx_v_e);
  __Pyx_XDECREF(__pyx_v_source_weight_array);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_element_graph.pyx":57
 *             self.resolve_containment()
 * 
 *     cpdef void penalize_dead_ends(self):             # <<<<<<<<<<<<<<
 *         """Perform a breadth-first search from all starts and all ends.
 *         The weight of all elements unreachable by each search is multiplied
 */

static PyObject *__pyx_pw_14_element_graph_12ElementGraph_3penalize_dead_ends(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static void __pyx_f_14_element_graph_12ElementGraph_penalize_dead_ends(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, int __pyx_skip_dispatch) {
  struct __pyx_obj_14_element_graph_Element *__pyx_v_element = 0;
  struct __pyx_obj_14_element_graph_Element *__pyx_v_welement = 0;
  PyArrayObject *__pyx_v_reached_from_start = 0;
  PyArrayObject *__pyx_v_reached_from_end = 0;
  float __pyx_v_original_bases;
  int __pyx_v_i;
  int __pyx_v_Sp;
  int __pyx_v_Ep;
  int __pyx_v_Sm;
  int __pyx_v_Em;
  PyObject *__pyx_v_strand = 0;
  PyObject *__pyx_v_queue = NULL;
  PyObject *__pyx_v_v = NULL;
  PyObject *__pyx_v_w = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *(*__pyx_t_8)(PyObject *);
  int __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  int __pyx_t_12;
  int __pyx_t_13;
  int __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  int __pyx_t_16;
  int __pyx_t_17;
  float __pyx_t_18;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("penalize_dead_ends", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_penalize_dead_ends); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_14_element_graph_12ElementGraph_3penalize_dead_ends)) {
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "_element_graph.pyx":66
 *         cdef int i, Sp, Ep, Sm, Em
 *         cdef set strand
 *         self.end_reachability = np.zeros(shape=(4,len(self.elements)), dtype=bool)             # <<<<<<<<<<<<<<
 *         Sp, Ep, Sm, Em = range(4)
 *         queue = deque(maxlen=len(self.elements))
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 66, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 66, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 66, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __pyx_v_self->elements;
  __Pyx_INCREF(__pyx_t_3);
  if (unlikely(__pyx_t_3 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(0, 66, __pyx_L1_error)
  }
  __pyx_t_5 = PyList_GET_SIZE(__pyx_t_3); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 66, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 66, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 66, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_int_4);
  __Pyx_GIVEREF(__pyx_int_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_int_4);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
  __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_shape, __pyx_t_4) < 0) __PYX_ERR(0, 66, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, ((PyObject*)&PyBool_Type)) < 0) __PYX_ERR(0, 66, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 66, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 66, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_4);
  __Pyx_GOTREF(__pyx_v_self->end_reachability);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->end_reachability));
  __pyx_v_self->end_reachability = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "_element_graph.pyx":67
 *         cdef set strand
 *         self.end_reachability = np.zeros(shape=(4,len(self.elements)), dtype=bool)
 *         Sp, Ep, Sm, Em = range(4)             # <<<<<<<<<<<<<<
 *         queue = deque(maxlen=len(self.elements))
 *         strand = set([0,1])
 */
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 67, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
    PyObject* sequence = __pyx_t_4;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 4)) {
      if (size > 4) __Pyx_RaiseTooManyValuesError(4);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 67, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2); 
      __pyx_t_6 = PyTuple_GET_ITEM(sequence, 3); 
    } else {
      __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 2); 
      __pyx_t_6 = PyList_GET_ITEM(sequence, 3); 
    }
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_6);
    #else
    {
      Py_ssize_t i;
      PyObject** temps[4] = {&__pyx_t_1,&__pyx_t_2,&__pyx_t_3,&__pyx_t_6};
      for (i=0; i < 4; i++) {
        PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 67, __pyx_L1_error)
        __Pyx_GOTREF(item);
        *(temps[i]) = item;
      }
    }
    #endif
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else {
    Py_ssize_t index = -1;
    PyObject** temps[4] = {&__pyx_t_1,&__pyx_t_2,&__pyx_t_3,&__pyx_t_6};
    __pyx_t_7 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 67, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
    for (index=0; index < 4; index++) {
      PyObject* item = __pyx_t_8(__pyx_t_7); if (unlikely(!item)) goto __pyx_L3_unpacking_failed;
      __Pyx_GOTREF(item);
      *(temps[index]) = item;
    }
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 4) < 0) __PYX_ERR(0, 67, __pyx_L1_error)
    __pyx_t_8 = NULL;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_8 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 67, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 67, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 67, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 67, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 67, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_Sp = __pyx_t_9;
  __pyx_v_Ep = __pyx_t_10;
  __pyx_v_Sm = __pyx_t_11;
  __pyx_v_Em = __pyx_t_12;

  /* "_element_graph.pyx":68
 *         self.end_reachability = np.zeros(shape=(4,len(self.elements)), dtype=bool)
 *         Sp, Ep, Sm, Em = range(4)
 *         queue = deque(maxlen=len(self.elements))             # <<<<<<<<<<<<<<
 *         strand = set([0,1])
 *         queue.extend(sorted(self.SP))
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_deque); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 68, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 68, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_3 = __pyx_v_self->elements;
  __Pyx_INCREF(__pyx_t_3);
  if (unlikely(__pyx_t_3 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(0, 68, __pyx_L1_error)
  }
  __pyx_t_5 = PyList_GET_SIZE(__pyx_t_3); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 68, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 68, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_maxlen, __pyx_t_3) < 0) __PYX_ERR(0, 68, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 68, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_queue = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "_element_graph.pyx":69
 *         Sp, Ep, Sm, Em = range(4)
 *         queue = deque(maxlen=len(self.elements))
 *         strand = set([0,1])             # <<<<<<<<<<<<<<
 *         queue.extend(sorted(self.SP))
 *         while queue:
 */
  __pyx_t_3 = PySet_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 69, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PySet_Add(__pyx_t_3, __pyx_int_0) < 0) __PYX_ERR(0, 69, __pyx_L1_error)
  if (PySet_Add(__pyx_t_3, __pyx_int_1) < 0) __PYX_ERR(0, 69, __pyx_L1_error)
  __pyx_v_strand = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "_element_graph.pyx":70
 *         queue = deque(maxlen=len(self.elements))
 *         strand = set([0,1])
 *         queue.extend(sorted(self.SP))             # <<<<<<<<<<<<<<
 *         while queue:
 *             v = queue.popleft()
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_queue, __pyx_n_s_extend); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 70, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = __pyx_v_self->SP;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_1 = PySequence_List(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 70, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_13 = PyList_Sort(__pyx_t_4); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(0, 70, __pyx_L1_error)
  __pyx_t_1 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_1, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 70, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "_element_graph.pyx":71
 *         strand = set([0,1])
 *         queue.extend(sorted(self.SP))
 *         while queue:             # <<<<<<<<<<<<<<
 *             v = queue.popleft()
 *             self.end_reachability[Sp, v] = True
 */
  while (1) {
    __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_v_queue); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 71, __pyx_L1_error)
    if (!__pyx_t_14) break;

    /* "_element_graph.pyx":72
 *         queue.extend(sorted(self.SP))
 *         while queue:
 *             v = queue.popleft()             # <<<<<<<<<<<<<<
 *             self.end_reachability[Sp, v] = True
 *             element = self.elements[v]
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_queue, __pyx_n_s_popleft); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 72, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 72, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "_element_graph.pyx":73
 *         while queue:
 *             v = queue.popleft()
 *             self.end_reachability[Sp, v] = True             # <<<<<<<<<<<<<<
 *             element = self.elements[v]
 *             for w in element.outgroup|element.contains:
 */
    __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_Sp); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 73, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 73, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3);
    __Pyx_INCREF(__pyx_v_v);
    __Pyx_GIVEREF(__pyx_v_v);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_v);
    __pyx_t_3 = 0;
    if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_self->end_reachability), __pyx_t_6, Py_True) < 0)) __PYX_ERR(0, 73, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "_element_graph.pyx":74
 *             v = queue.popleft()
 *             self.end_reachability[Sp, v] = True
 *             element = self.elements[v]             # <<<<<<<<<<<<<<
 *             for w in element.outgroup|element.contains:
 *                 if not self.end_reachability[Sp, w]:
 */
    if (unlikely(__pyx_v_self->elements == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 74, __pyx_L1_error)
    }
    __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_self->elements, __pyx_v_v); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 74, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_14_element_graph_Element))))) __PYX_ERR(0, 74, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_element, ((struct __pyx_obj_14_element_graph_Element *)__pyx_t_6));
    __pyx_t_6 = 0;

    /* "_element_graph.pyx":75
 *             self.end_reachability[Sp, v] = True
 *             element = self.elements[v]
 *             for w in element.outgroup|element.contains:             # <<<<<<<<<<<<<<
 *                 if not self.end_reachability[Sp, w]:
 *                     welement = self.elements[w]
 */
    __pyx_t_5 = 0;
    __pyx_t_3 = PyNumber_Or(__pyx_v_element->outgroup, __pyx_v_element->contains); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 75, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_set_iterator(__pyx_t_3, 1, (&__pyx_t_15), (&__pyx_t_12)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 75, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_6);
    __pyx_t_6 = __pyx_t_4;
    __pyx_t_4 = 0;
    while (1) {
      __pyx_t_11 = __Pyx_set_iter_next(__pyx_t_6, __pyx_t_15, &__pyx_t_5, &__pyx_t_4, __pyx_t_12);
      if (unlikely(__pyx_t_11 == 0)) break;
      if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 75, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_XDECREF_SET(__pyx_v_w, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "_element_graph.pyx":76
 *             element = self.elements[v]
 *             for w in element.outgroup|element.contains:
 *                 if not self.end_reachability[Sp, w]:             # <<<<<<<<<<<<<<
 *                     welement = self.elements[w]
 *                     if welement.strand in strand and welement.LM >= element.LM:
 */
      __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_Sp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 76, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 76, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __Pyx_INCREF(__pyx_v_w);
      __Pyx_GIVEREF(__pyx_v_w);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_w);
      __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->end_reachability), __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 76, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 76, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_16 = ((!__pyx_t_14) != 0);
      if (__pyx_t_16) {

        /* "_element_graph.pyx":77
 *             for w in element.outgroup|element.contains:
 *                 if not self.end_reachability[Sp, w]:
 *                     welement = self.elements[w]             # <<<<<<<<<<<<<<
 *                     if welement.strand in strand and welement.LM >= element.LM:
 *                         self.end_reachability[Sp, w] = True
 */
        if (unlikely(__pyx_v_self->elements == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 77, __pyx_L1_error)
        }
        __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_self->elements, __pyx_v_w); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 77, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_14_element_graph_Element))))) __PYX_ERR(0, 77, __pyx_L1_error)
        __Pyx_XDECREF_SET(__pyx_v_welement, ((struct __pyx_obj_14_element_graph_Element *)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "_element_graph.pyx":78
 *                 if not self.end_reachability[Sp, w]:
 *                     welement = self.elements[w]
 *                     if welement.strand in strand and welement.LM >= element.LM:             # <<<<<<<<<<<<<<
 *                         self.end_reachability[Sp, w] = True
 *                         queue.append(w)
 */
        __pyx_t_4 = __Pyx_PyInt_From_char(__pyx_v_welement->strand); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 78, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_14 = (__Pyx_PySet_ContainsTF(__pyx_t_4, __pyx_v_strand, Py_EQ)); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 78, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_17 = (__pyx_t_14 != 0);
        if (__pyx_t_17) {
        } else {
          __pyx_t_16 = __pyx_t_17;
          goto __pyx_L11_bool_binop_done;
        }
        __pyx_t_17 = ((__pyx_v_welement->LM >= __pyx_v_element->LM) != 0);
        __pyx_t_16 = __pyx_t_17;
        __pyx_L11_bool_binop_done:;
        if (__pyx_t_16) {

          /* "_element_graph.pyx":79
 *                     welement = self.elements[w]
 *                     if welement.strand in strand and welement.LM >= element.LM:
 *                         self.end_reachability[Sp, w] = True             # <<<<<<<<<<<<<<
 *                         queue.append(w)
 * 
 */
          __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_Sp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 79, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 79, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
          __Pyx_INCREF(__pyx_v_w);
          __Pyx_GIVEREF(__pyx_v_w);
          PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_w);
          __pyx_t_4 = 0;
          if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_self->end_reachability), __pyx_t_3, Py_True) < 0)) __PYX_ERR(0, 79, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

          /* "_element_graph.pyx":80
 *                     if welement.strand in strand and welement.LM >= element.LM:
 *                         self.end_reachability[Sp, w] = True
 *                         queue.append(w)             # <<<<<<<<<<<<<<
 * 
 *         queue.clear()
 */
          __pyx_t_13 = __Pyx_PyObject_Append(__pyx_v_queue, __pyx_v_w); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(0, 80, __pyx_L1_error)

          /* "_element_graph.pyx":78
 *                 if not self.end_reachability[Sp, w]:
 *                     welement = self.elements[w]
 *                     if welement.strand in strand and welement.LM >= element.LM:             # <<<<<<<<<<<<<<
 *                         self.end_reachability[Sp, w] = True
 *                         queue.append(w)
 */
        }

        /* "_element_graph.pyx":76
 *             element = self.elements[v]
 *             for w in element.outgroup|element.contains:
 *                 if not self.end_reachability[Sp, w]:             # <<<<<<<<<<<<<<
 *                     welement = self.elements[w]
 *                     if welement.strand in strand and welement.LM >= element.LM:
 */
      }
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }

  /* "_element_graph.pyx":82
 *                         queue.append(w)
 * 
 *         queue.clear()             # <<<<<<<<<<<<<<
 *         queue.extend(sorted(self.EP))
 *         while queue:
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_queue, __pyx_n_s_clear); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 82, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 82, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "_element_graph.pyx":83
 * 
 *         queue.clear()
 *         queue.extend(sorted(self.EP))             # <<<<<<<<<<<<<<
 *         while queue:
 *             v = queue.popleft()
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_queue, __pyx_n_s_extend); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 83, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __pyx_v_self->EP;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = PySequence_List(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 83, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_13 = PyList_Sort(__pyx_t_4); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(0, 83, __pyx_L1_error)
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_6 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 83, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "_element_graph.pyx":84
 *         queue.clear()
 *         queue.extend(sorted(self.EP))
 *         while queue:             # <<<<<<<<<<<<<<
 *             v = queue.popleft()
 *             self.end_reachability[Ep, v] = True
 */
  while (1) {
    __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_v_queue); if (unlikely(__pyx_t_16 < 0)) __PYX_ERR(0, 84, __pyx_L1_error)
    if (!__pyx_t_16) break;

    /* "_element_graph.pyx":85
 *         queue.extend(sorted(self.EP))
 *         while queue:
 *             v = queue.popleft()             # <<<<<<<<<<<<<<
 *             self.end_reachability[Ep, v] = True
 *             element = self.elements[v]
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_queue, __pyx_n_s_popleft); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 85, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 85, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "_element_graph.pyx":86
 *         while queue:
 *             v = queue.popleft()
 *             self.end_reachability[Ep, v] = True             # <<<<<<<<<<<<<<
 *             element = self.elements[v]
 *             for w in element.ingroup|element.contains:
 */
    __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_Ep); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 86, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 86, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6);
    __Pyx_INCREF(__pyx_v_v);
    __Pyx_GIVEREF(__pyx_v_v);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_v);
    __pyx_t_6 = 0;
    if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_self->end_reachability), __pyx_t_3, Py_True) < 0)) __PYX_ERR(0, 86, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "_element_graph.pyx":87
 *             v = queue.popleft()
 *             self.end_reachability[Ep, v] = True
 *             element = self.elements[v]             # <<<<<<<<<<<<<<
 *             for w in element.ingroup|element.contains:
 *                 if not self.end_reachability[Ep, w]:
 */
    if (unlikely(__pyx_v_self->elements == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 87, __pyx_L1_error)
    }
    __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_self->elements, __pyx_v_v); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 87, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_14_element_graph_Element))))) __PYX_ERR(0, 87, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_element, ((struct __pyx_obj_14_element_graph_Element *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "_element_graph.pyx":88
 *             self.end_reachability[Ep, v] = True
 *             element = self.elements[v]
 *             for w in element.ingroup|element.contains:             # <<<<<<<<<<<<<<
 *                 if not self.end_reachability[Ep, w]:
 *                     welement = self.elements[w]
 */
    __pyx_t_15 = 0;
    __pyx_t_6 = PyNumber_Or(__pyx_v_element->ingroup, __pyx_v_element->contains); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 88, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = __Pyx_set_iterator(__pyx_t_6, 1, (&__pyx_t_5), (&__pyx_t_12)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 88, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_3);
    __pyx_t_3 = __pyx_t_4;
    __pyx_t_4 = 0;
    while (1) {
      __pyx_t_11 = __Pyx_set_iter_next(__pyx_t_3, __pyx_t_5, &__pyx_t_15, &__pyx_t_4, __pyx_t_12);
      if (unlikely(__pyx_t_11 == 0)) break;
      if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 88, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_XDECREF_SET(__pyx_v_w, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "_element_graph.pyx":89
 *             element = self.elements[v]
 *             for w in element.ingroup|element.contains:
 *                 if not self.end_reachability[Ep, w]:             # <<<<<<<<<<<<<<
 *                     welement = self.elements[w]
 *                     if welement.strand in strand and welement.RM <= element.RM:
 */
      __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_Ep); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 89, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 89, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
      __Pyx_INCREF(__pyx_v_w);
      __Pyx_GIVEREF(__pyx_v_w);
      PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_w);
      __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->end_reachability), __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 89, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_16 < 0)) __PYX_ERR(0, 89, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_17 = ((!__pyx_t_16) != 0);
      if (__pyx_t_17) {

        /* "_element_graph.pyx":90
 *             for w in element.ingroup|element.contains:
 *                 if not self.end_reachability[Ep, w]:
 *                     welement = self.elements[w]             # <<<<<<<<<<<<<<
 *                     if welement.strand in strand and welement.RM <= element.RM:
 *                         self.end_reachability[Ep, w] = True
 */
        if (unlikely(__pyx_v_self->elements == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 90, __pyx_L1_error)
        }
        __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_self->elements, __pyx_v_w); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 90, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_14_element_graph_Element))))) __PYX_ERR(0, 90, __pyx_L1_error)
        __Pyx_XDECREF_SET(__pyx_v_welement, ((struct __pyx_obj_14_element_graph_Element *)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "_element_graph.pyx":91
 *                 if not self.end_reachability[Ep, w]:
 *                     welement = self.elements[w]
 *                     if welement.strand in strand and welement.RM <= element.RM:             # <<<<<<<<<<<<<<
 *                         self.end_reachability[Ep, w] = True
 *                         queue.append(w)
 */
        __pyx_t_4 = __Pyx_PyInt_From_char(__pyx_v_welement->strand); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 91, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_16 = (__Pyx_PySet_ContainsTF(__pyx_t_4, __pyx_v_strand, Py_EQ)); if (unlikely(__pyx_t_16 < 0)) __PYX_ERR(0, 91, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_14 = (__pyx_t_16 != 0);
        if (__pyx_t_14) {
        } else {
          __pyx_t_17 = __pyx_t_14;
          goto __pyx_L19_bool_binop_done;
        }
        __pyx_t_14 = ((__pyx_v_welement->RM <= __pyx_v_element->RM) != 0);
        __pyx_t_17 = __pyx_t_14;
        __pyx_L19_bool_binop_done:;
        if (__pyx_t_17) {

          /* "_element_graph.pyx":92
 *                     welement = self.elements[w]
 *                     if welement.strand in strand and welement.RM <= element.RM:
 *                         self.end_reachability[Ep, w] = True             # <<<<<<<<<<<<<<
 *                         queue.append(w)
 * 
 */
          __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_Ep); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 92, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 92, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
          __Pyx_INCREF(__pyx_v_w);
          __Pyx_GIVEREF(__pyx_v_w);
          PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_w);
          __pyx_t_4 = 0;
          if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_self->end_reachability), __pyx_t_6, Py_True) < 0)) __PYX_ERR(0, 92, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

          /* "_element_graph.pyx":93
 *                     if welement.strand in strand and welement.RM <= element.RM:
 *                         self.end_reachability[Ep, w] = True
 *                         queue.append(w)             # <<<<<<<<<<<<<<
 * 
 *         queue.clear()
 */
          __pyx_t_13 = __Pyx_PyObject_Append(__pyx_v_queue, __pyx_v_w); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(0, 93, __pyx_L1_error)

          /* "_element_graph.pyx":91
 *                 if not self.end_reachability[Ep, w]:
 *                     welement = self.elements[w]
 *                     if welement.strand in strand and welement.RM <= element.RM:             # <<<<<<<<<<<<<<
 *                         self.end_reachability[Ep, w] = True
 *                         queue.append(w)
 */
        }

        /* "_element_graph.pyx":89
 *             element = self.elements[v]
 *             for w in element.ingroup|element.contains:
 *                 if not self.end_reachability[Ep, w]:             # <<<<<<<<<<<<<<
 *                     welement = self.elements[w]
 *                     if welement.strand in strand and welement.RM <= element.RM:
 */
      }
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }

  /* "_element_graph.pyx":95
 *                         queue.append(w)
 * 
 *         queue.clear()             # <<<<<<<<<<<<<<
 *         queue.extend(sorted(self.SM))
 *         strand = set([0,-1])
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_queue, __pyx_n_s_clear); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 95, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 95, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "_element_graph.pyx":96
 * 
 *         queue.clear()
 *         queue.extend(sorted(self.SM))             # <<<<<<<<<<<<<<
 *         strand = set([0,-1])
 *         while queue:
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_queue, __pyx_n_s_extend); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 96, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = __pyx_v_self->SM;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_1 = PySequence_List(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_13 = PyList_Sort(__pyx_t_4); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(0, 96, __pyx_L1_error)
  __pyx_t_1 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_1, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "_element_graph.pyx":97
 *         queue.clear()
 *         queue.extend(sorted(self.SM))
 *         strand = set([0,-1])             # <<<<<<<<<<<<<<
 *         while queue:
 *             v = queue.popleft()
 */
  __pyx_t_3 = PySet_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 97, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PySet_Add(__pyx_t_3, __pyx_int_0) < 0) __PYX_ERR(0, 97, __pyx_L1_error)
  if (PySet_Add(__pyx_t_3, __pyx_int_neg_1) < 0) __PYX_ERR(0, 97, __pyx_L1_error)
  __Pyx_DECREF_SET(__pyx_v_strand, ((PyObject*)__pyx_t_3));
  __pyx_t_3 = 0;

  /* "_element_graph.pyx":98
 *         queue.extend(sorted(self.SM))
 *         strand = set([0,-1])
 *         while queue:             # <<<<<<<<<<<<<<
 *             v = queue.popleft()
 *             self.end_reachability[Sm, v] = True
 */
  while (1) {
    __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_v_queue); if (unlikely(__pyx_t_17 < 0)) __PYX_ERR(0, 98, __pyx_L1_error)
    if (!__pyx_t_17) break;

    /* "_element_graph.pyx":99
 *         strand = set([0,-1])
 *         while queue:
 *             v = queue.popleft()             # <<<<<<<<<<<<<<
 *             self.end_reachability[Sm, v] = True
 *             element = self.elements[v]
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_queue, __pyx_n_s_popleft); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 99, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 99, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "_element_graph.pyx":100
 *         while queue:
 *             v = queue.popleft()
 *             self.end_reachability[Sm, v] = True             # <<<<<<<<<<<<<<
 *             element = self.elements[v]
 *             for w in element.ingroup|element.contains:
 */
    __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_Sm); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 100, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 100, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3);
    __Pyx_INCREF(__pyx_v_v);
    __Pyx_GIVEREF(__pyx_v_v);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_v);
    __pyx_t_3 = 0;
    if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_self->end_reachability), __pyx_t_6, Py_True) < 0)) __PYX_ERR(0, 100, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "_element_graph.pyx":101
 *             v = queue.popleft()
 *             self.end_reachability[Sm, v] = True
 *             element = self.elements[v]             # <<<<<<<<<<<<<<
 *             for w in element.ingroup|element.contains:
 *                 if not self.end_reachability[Sm, w]:
 */
    if (unlikely(__pyx_v_self->elements == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 101, __pyx_L1_error)
    }
    __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_self->elements, __pyx_v_v); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 101, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_14_element_graph_Element))))) __PYX_ERR(0, 101, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_element, ((struct __pyx_obj_14_element_graph_Element *)__pyx_t_6));
    __pyx_t_6 = 0;

    /* "_element_graph.pyx":102
 *             self.end_reachability[Sm, v] = True
 *             element = self.elements[v]
 *             for w in element.ingroup|element.contains:             # <<<<<<<<<<<<<<
 *                 if not self.end_reachability[Sm, w]:
 *                     welement = self.elements[w]
 */
    __pyx_t_5 = 0;
    __pyx_t_3 = PyNumber_Or(__pyx_v_element->ingroup, __pyx_v_element->contains); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 102, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_set_iterator(__pyx_t_3, 1, (&__pyx_t_15), (&__pyx_t_12)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 102, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_6);
    __pyx_t_6 = __pyx_t_4;
    __pyx_t_4 = 0;
    while (1) {
      __pyx_t_11 = __Pyx_set_iter_next(__pyx_t_6, __pyx_t_15, &__pyx_t_5, &__pyx_t_4, __pyx_t_12);
      if (unlikely(__pyx_t_11 == 0)) break;
      if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 102, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_XDECREF_SET(__pyx_v_w, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "_element_graph.pyx":103
 *             element = self.elements[v]
 *             for w in element.ingroup|element.contains:
 *                 if not self.end_reachability[Sm, w]:             # <<<<<<<<<<<<<<
 *                     welement = self.elements[w]
 *                     if welement.strand in strand and welement.RM <= element.RM:
 */
      __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_Sm); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 103, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 103, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __Pyx_INCREF(__pyx_v_w);
      __Pyx_GIVEREF(__pyx_v_w);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_w);
      __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->end_reachability), __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 103, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_17 < 0)) __PYX_ERR(0, 103, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_14 = ((!__pyx_t_17) != 0);
      if (__pyx_t_14) {

        /* "_element_graph.pyx":104
 *             for w in element.ingroup|element.contains:
 *                 if not self.end_reachability[Sm, w]:
 *                     welement = self.elements[w]             # <<<<<<<<<<<<<<
 *                     if welement.strand in strand and welement.RM <= element.RM:
 *                         self.end_reachability[Sm, w] = True
 */
        if (unlikely(__pyx_v_self->elements == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 104, __pyx_L1_error)
        }
        __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_self->elements, __pyx_v_w); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 104, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_14_element_graph_Element))))) __PYX_ERR(0, 104, __pyx_L1_error)
        __Pyx_XDECREF_SET(__pyx_v_welement, ((struct __pyx_obj_14_element_graph_Element *)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "_element_graph.pyx":105
 *                 if not self.end_reachability[Sm, w]:
 *                     welement = self.elements[w]
 *                     if welement.strand in strand and welement.RM <= element.RM:             # <<<<<<<<<<<<<<
 *                         self.end_reachability[Sm, w] = True
 *                         queue.append(w)
 */
        __pyx_t_4 = __Pyx_PyInt_From_char(__pyx_v_welement->strand); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 105, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_17 = (__Pyx_PySet_ContainsTF(__pyx_t_4, __pyx_v_strand, Py_EQ)); if (unlikely(__pyx_t_17 < 0)) __PYX_ERR(0, 105, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_16 = (__pyx_t_17 != 0);
        if (__pyx_t_16) {
        } else {
          __pyx_t_14 = __pyx_t_16;
          goto __pyx_L27_bool_binop_done;
        }
        __pyx_t_16 = ((__pyx_v_welement->RM <= __pyx_v_element->RM) != 0);
        __pyx_t_14 = __pyx_t_16;
        __pyx_L27_bool_binop_done:;
        if (__pyx_t_14) {

          /* "_element_graph.pyx":106
 *                     welement = self.elements[w]
 *                     if welement.strand in strand and welement.RM <= element.RM:
 *                         self.end_reachability[Sm, w] = True             # <<<<<<<<<<<<<<
 *                         queue.append(w)
 * 
 */
          __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_Sm); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 106, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 106, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
          __Pyx_INCREF(__pyx_v_w);
          __Pyx_GIVEREF(__pyx_v_w);
          PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_w);
          __pyx_t_4 = 0;
          if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_self->end_reachability), __pyx_t_3, Py_True) < 0)) __PYX_ERR(0, 106, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

          /* "_element_graph.pyx":107
 *                     if welement.strand in strand and welement.RM <= element.RM:
 *                         self.end_reachability[Sm, w] = True
 *                         queue.append(w)             # <<<<<<<<<<<<<<
 * 
 *         queue.clear()
 */
          __pyx_t_13 = __Pyx_PyObject_Append(__pyx_v_queue, __pyx_v_w); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(0, 107, __pyx_L1_error)

          /* "_element_graph.pyx":105
 *                 if not self.end_reachability[Sm, w]:
 *                     welement = self.elements[w]
 *                     if welement.strand in strand and welement.RM <= element.RM:             # <<<<<<<<<<<<<<
 *                         self.end_reachability[Sm, w] = True
 *                         queue.append(w)
 */
        }

        /* "_element_graph.pyx":103
 *             element = self.elements[v]
 *             for w in element.ingroup|element.contains:
 *                 if not self.end_reachability[Sm, w]:             # <<<<<<<<<<<<<<
 *                     welement = self.elements[w]
 *                     if welement.strand in strand and welement.RM <= element.RM:
 */
      }
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }

  /* "_element_graph.pyx":109
 *                         queue.append(w)
 * 
 *         queue.clear()             # <<<<<<<<<<<<<<
 *         queue.extend(sorted(self.EM))
 *         while queue:
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_queue, __pyx_n_s_clear); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 109, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 109, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "_element_graph.pyx":110
 * 
 *         queue.clear()
 *         queue.extend(sorted(self.EM))             # <<<<<<<<<<<<<<
 *         while queue:
 *             v = queue.popleft()
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_queue, __pyx_n_s_extend); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 110, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __pyx_v_self->EM;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = PySequence_List(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 110, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_13 = PyList_Sort(__pyx_t_4); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(0, 110, __pyx_L1_error)
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_6 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 110, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "_element_graph.pyx":111
 *         queue.clear()
 *         queue.extend(sorted(self.EM))
 *         while queue:             # <<<<<<<<<<<<<<
 *             v = queue.popleft()
 *             self.end_reachability[Em, v] = True
 */
  while (1) {
    __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_v_queue); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 111, __pyx_L1_error)
    if (!__pyx_t_14) break;

    /* "_element_graph.pyx":112
 *         queue.extend(sorted(self.EM))
 *         while queue:
 *             v = queue.popleft()             # <<<<<<<<<<<<<<
 *             self.end_reachability[Em, v] = True
 *             element = self.elements[v]
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_queue, __pyx_n_s_popleft); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 112, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 112, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "_element_graph.pyx":113
 *         while queue:
 *             v = queue.popleft()
 *             self.end_reachability[Em, v] = True             # <<<<<<<<<<<<<<
 *             element = self.elements[v]
 *             for w in element.outgroup|element.contains:
 */
    __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_Em); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 113, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 113, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6);
    __Pyx_INCREF(__pyx_v_v);
    __Pyx_GIVEREF(__pyx_v_v);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_v);
    __pyx_t_6 = 0;
    if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_self->end_reachability), __pyx_t_3, Py_True) < 0)) __PYX_ERR(0, 113, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "_element_graph.pyx":114
 *             v = queue.popleft()
 *             self.end_reachability[Em, v] = True
 *             element = self.elements[v]             # <<<<<<<<<<<<<<
 *             for w in element.outgroup|element.contains:
 *                 if not self.end_reachability[Em, w]:
 */
    if (unlikely(__pyx_v_self->elements == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 114, __pyx_L1_error)
    }
    __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_self->elements, __pyx_v_v); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 114, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_14_element_graph_Element))))) __PYX_ERR(0, 114, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_element, ((struct __pyx_obj_14_element_graph_Element *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "_element_graph.pyx":115
 *             self.end_reachability[Em, v] = True
 *             element = self.elements[v]
 *             for w in element.outgroup|element.contains:             # <<<<<<<<<<<<<<
 *                 if not self.end_reachability[Em, w]:
 *                     welement = self.elements[w]
 */
    __pyx_t_15 = 0;
    __pyx_t_6 = PyNumber_Or(__pyx_v_element->outgroup, __pyx_v_element->contains); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 115, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = __Pyx_set_iterator(__pyx_t_6, 1, (&__pyx_t_5), (&__pyx_t_12)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 115, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_3);
    __pyx_t_3 = __pyx_t_4;
    __pyx_t_4 = 0;
    while (1) {
      __pyx_t_11 = __Pyx_set_iter_next(__pyx_t_3, __pyx_t_5, &__pyx_t_15, &__pyx_t_4, __pyx_t_12);
      if (unlikely(__pyx_t_11 == 0)) break;
      if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 115, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_XDECREF_SET(__pyx_v_w, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "_element_graph.pyx":116
 *             element = self.elements[v]
 *             for w in element.outgroup|element.contains:
 *                 if not self.end_reachability[Em, w]:             # <<<<<<<<<<<<<<
 *                     welement = self.elements[w]
 *                     if welement.strand in strand and welement.LM >= element.LM:
 */
      __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_Em); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 116, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 116, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
      __Pyx_INCREF(__pyx_v_w);
      __Pyx_GIVEREF(__pyx_v_w);
      PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_w);
      __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->end_reachability), __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 116, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 116, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_16 = ((!__pyx_t_14) != 0);
      if (__pyx_t_16) {

        /* "_element_graph.pyx":117
 *             for w in element.outgroup|element.contains:
 *                 if not self.end_reachability[Em, w]:
 *                     welement = self.elements[w]             # <<<<<<<<<<<<<<
 *                     if welement.strand in strand and welement.LM >= element.LM:
 *                         self.end_reachability[Em, w] = True
 */
        if (unlikely(__pyx_v_self->elements == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 117, __pyx_L1_error)
        }
        __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_self->elements, __pyx_v_w); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 117, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_14_element_graph_Element))))) __PYX_ERR(0, 117, __pyx_L1_error)
        __Pyx_XDECREF_SET(__pyx_v_welement, ((struct __pyx_obj_14_element_graph_Element *)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "_element_graph.pyx":118
 *                 if not self.end_reachability[Em, w]:
 *                     welement = self.elements[w]
 *                     if welement.strand in strand and welement.LM >= element.LM:             # <<<<<<<<<<<<<<
 *                         self.end_reachability[Em, w] = True
 *                         queue.append(w)
 */
        __pyx_t_4 = __Pyx_PyInt_From_char(__pyx_v_welement->strand); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 118, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_14 = (__Pyx_PySet_ContainsTF(__pyx_t_4, __pyx_v_strand, Py_EQ)); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 118, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_17 = (__pyx_t_14 != 0);
        if (__pyx_t_17) {
        } else {
          __pyx_t_16 = __pyx_t_17;
          goto __pyx_L35_bool_binop_done;
        }
        __pyx_t_17 = ((__pyx_v_welement->LM >= __pyx_v_element->LM) != 0);
        __pyx_t_16 = __pyx_t_17;
        __pyx_L35_bool_binop_done:;
        if (__pyx_t_16) {

          /* "_element_graph.pyx":119
 *                     welement = self.elements[w]
 *                     if welement.strand in strand and welement.LM >= element.LM:
 *                         self.end_reachability[Em, w] = True             # <<<<<<<<<<<<<<
 *                         queue.append(w)
 * 
 */
          __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_Em); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 119, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 119, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
          __Pyx_INCREF(__pyx_v_w);
          __Pyx_GIVEREF(__pyx_v_w);
          PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_w);
          __pyx_t_4 = 0;
          if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_self->end_reachability), __pyx_t_6, Py_True) < 0)) __PYX_ERR(0, 119, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

          /* "_element_graph.pyx":120
 *                     if welement.strand in strand and welement.LM >= element.LM:
 *                         self.end_reachability[Em, w] = True
 *                         queue.append(w)             # <<<<<<<<<<<<<<
 * 
 *         reached_from_start = np.logical_or(self.end_reachability[Sp,:] , self.end_reachability[Sm,:])
 */
          __pyx_t_13 = __Pyx_PyObject_Append(__pyx_v_queue, __pyx_v_w); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(0, 120, __pyx_L1_error)

          /* "_element_graph.pyx":118
 *                 if not self.end_reachability[Em, w]:
 *                     welement = self.elements[w]
 *                     if welement.strand in strand and welement.LM >= element.LM:             # <<<<<<<<<<<<<<
 *                         self.end_reachability[Em, w] = True
 *                         queue.append(w)
 */
        }

        /* "_element_graph.pyx":116
 *             element = self.elements[v]
 *             for w in element.outgroup|element.contains:
 *                 if not self.end_reachability[Em, w]:             # <<<<<<<<<<<<<<
 *                     welement = self.elements[w]
 *                     if welement.strand in strand and welement.LM >= element.LM:
 */
      }
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }

  /* "_element_graph.pyx":122
 *                         queue.append(w)
 * 
 *         reached_from_start = np.logical_or(self.end_reachability[Sp,:] , self.end_reachability[Sm,:])             # <<<<<<<<<<<<<<
 *         reached_from_end = np.logical_or(self.end_reachability[Ep,:], self.end_reachability[Em,:])
 *         for i in range(len(self.elements)):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 122, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_logical_or); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 122, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_Sp); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 122, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 122, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_6);
  __Pyx_INCREF(__pyx_slice_);
  __Pyx_GIVEREF(__pyx_slice_);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_slice_);
  __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->end_reachability), __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 122, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_Sm); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 122, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 122, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __Pyx_INCREF(__pyx_slice_);
  __Pyx_GIVEREF(__pyx_slice_);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_slice_);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->end_reachability), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 122, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = NULL;
  __pyx_t_12 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_12 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_t_6, __pyx_t_2};
    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 122, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_t_6, __pyx_t_2};
    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 122, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else
  #endif
  {
    __pyx_t_7 = PyTuple_New(2+__pyx_t_12); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 122, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_1) {
      __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); __pyx_t_1 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_12, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_12, __pyx_t_2);
    __pyx_t_6 = 0;
    __pyx_t_2 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 122, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 122, __pyx_L1_error)
  __pyx_v_reached_from_start = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "_element_graph.pyx":123
 * 
 *         reached_from_start = np.logical_or(self.end_reachability[Sp,:] , self.end_reachability[Sm,:])
 *         reached_from_end = np.logical_or(self.end_reachability[Ep,:], self.end_reachability[Em,:])             # <<<<<<<<<<<<<<
 *         for i in range(len(self.elements)):
 *             element = self.elements[i]
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 123, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_logical_or); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 123, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_Ep); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 123, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 123, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4);
  __Pyx_INCREF(__pyx_slice_);
  __Pyx_GIVEREF(__pyx_slice_);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_slice_);
  __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->end_reachability), __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 123, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_Em); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 123, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 123, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
  __Pyx_INCREF(__pyx_slice_);
  __Pyx_GIVEREF(__pyx_slice_);
  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_slice_);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->end_reachability), __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 123, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  __pyx_t_12 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
      __pyx_t_12 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_7)) {
    PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_4, __pyx_t_2};
    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 123, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
    PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_4, __pyx_t_2};
    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 123, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else
  #endif
  {
    __pyx_t_1 = PyTuple_New(2+__pyx_t_12); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 123, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (__pyx_t_6) {
      __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6); __pyx_t_6 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_12, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_12, __pyx_t_2);
    __pyx_t_4 = 0;
    __pyx_t_2 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 123, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 123, __pyx_L1_error)
  __pyx_v_reached_from_end = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "_element_graph.pyx":124
 *         reached_from_start = np.logical_or(self.end_reachability[Sp,:] , self.end_reachability[Sm,:])
 *         reached_from_end = np.logical_or(self.end_reachability[Ep,:], self.end_reachability[Em,:])
 *         for i in range(len(self.elements)):             # <<<<<<<<<<<<<<
 *             element = self.elements[i]
 *             if not reached_from_start[i]:
 */
  __pyx_t_3 = __pyx_v_self->elements;
  __Pyx_INCREF(__pyx_t_3);
  if (unlikely(__pyx_t_3 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(0, 124, __pyx_L1_error)
  }
  __pyx_t_5 = PyList_GET_SIZE(__pyx_t_3); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 124, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_15 = __pyx_t_5;
  for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_15; __pyx_t_12+=1) {
    __pyx_v_i = __pyx_t_12;

    /* "_element_graph.pyx":125
 *         reached_from_end = np.logical_or(self.end_reachability[Ep,:], self.end_reachability[Em,:])
 *         for i in range(len(self.elements)):
 *             element = self.elements[i]             # <<<<<<<<<<<<<<
 *             if not reached_from_start[i]:
 *                 if self.dead_end_penalty == 0:
 */
    if (unlikely(__pyx_v_self->elements == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 125, __pyx_L1_error)
    }
    __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_self->elements, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 125, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_14_element_graph_Element))))) __PYX_ERR(0, 125, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_element, ((struct __pyx_obj_14_element_graph_Element *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "_element_graph.pyx":126
 *         for i in range(len(self.elements)):
 *             element = self.elements[i]
 *             if not reached_from_start[i]:             # <<<<<<<<<<<<<<
 *                 if self.dead_end_penalty == 0:
 *                     self.zero_element(i)
 */
    __pyx_t_3 = __Pyx_GetItemInt(((PyObject *)__pyx_v_reached_from_start), __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 126, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_16 < 0)) __PYX_ERR(0, 126, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_17 = ((!__pyx_t_16) != 0);
    if (__pyx_t_17) {

      /* "_element_graph.pyx":127
 *             element = self.elements[i]
 *             if not reached_from_start[i]:
 *                 if self.dead_end_penalty == 0:             # <<<<<<<<<<<<<<
 *                     self.zero_element(i)
 *                 else:
 */
      __pyx_t_17 = ((__pyx_v_self->dead_end_penalty == 0.0) != 0);
      if (__pyx_t_17) {

        /* "_element_graph.pyx":128
 *             if not reached_from_start[i]:
 *                 if self.dead_end_penalty == 0:
 *                     self.zero_element(i)             # <<<<<<<<<<<<<<
 *                 else:
 *                     element.source_weights *= self.dead_end_penalty
 */
        ((struct __pyx_vtabstruct_14_element_graph_ElementGraph *)__pyx_v_self->__pyx_vtab)->zero_element(__pyx_v_self, __pyx_v_i, 0);

        /* "_element_graph.pyx":127
 *             element = self.elements[i]
 *             if not reached_from_start[i]:
 *                 if self.dead_end_penalty == 0:             # <<<<<<<<<<<<<<
 *                     self.zero_element(i)
 *                 else:
 */
        goto __pyx_L40;
      }

      /* "_element_graph.pyx":130
 *                     self.zero_element(i)
 *                 else:
 *                     element.source_weights *= self.dead_end_penalty             # <<<<<<<<<<<<<<
 *                     element.member_weights *= self.dead_end_penalty
 *                     element.cov *= self.dead_end_penalty
 */
      /*else*/ {
        __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->dead_end_penalty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 130, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_7 = PyNumber_InPlaceMultiply(((PyObject *)__pyx_v_element->source_weights), __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 130, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 130, __pyx_L1_error)
        __Pyx_GIVEREF(__pyx_t_7);
        __Pyx_GOTREF(__pyx_v_element->source_weights);
        __Pyx_DECREF(((PyObject *)__pyx_v_element->source_weights));
        __pyx_v_element->source_weights = ((PyArrayObject *)__pyx_t_7);
        __pyx_t_7 = 0;

        /* "_element_graph.pyx":131
 *                 else:
 *                     element.source_weights *= self.dead_end_penalty
 *                     element.member_weights *= self.dead_end_penalty             # <<<<<<<<<<<<<<
 *                     element.cov *= self.dead_end_penalty
 *                     original_bases = element.bases
 */
        __pyx_t_7 = PyFloat_FromDouble(__pyx_v_self->dead_end_penalty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 131, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_3 = PyNumber_InPlaceMultiply(((PyObject *)__pyx_v_element->member_weights), __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 131, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 131, __pyx_L1_error)
        __Pyx_GIVEREF(__pyx_t_3);
        __Pyx_GOTREF(__pyx_v_element->member_weights);
        __Pyx_DECREF(((PyObject *)__pyx_v_element->member_weights));
        __pyx_v_element->member_weights = ((PyArrayObject *)__pyx_t_3);
        __pyx_t_3 = 0;

        /* "_element_graph.pyx":132
 *                     element.source_weights *= self.dead_end_penalty
 *                     element.member_weights *= self.dead_end_penalty
 *                     element.cov *= self.dead_end_penalty             # <<<<<<<<<<<<<<
 *                     original_bases = element.bases
 *                     element.bases *= self.dead_end_penalty
 */
        __pyx_v_element->cov = (__pyx_v_element->cov * __pyx_v_self->dead_end_penalty);

        /* "_element_graph.pyx":133
 *                     element.member_weights *= self.dead_end_penalty
 *                     element.cov *= self.dead_end_penalty
 *                     original_bases = element.bases             # <<<<<<<<<<<<<<
 *                     element.bases *= self.dead_end_penalty
 *                     self.bases -= original_bases-element.bases
 */
        __pyx_t_18 = __pyx_v_element->bases;
        __pyx_v_original_bases = __pyx_t_18;

        /* "_element_graph.pyx":134
 *                     element.cov *= self.dead_end_penalty
 *                     original_bases = element.bases
 *                     element.bases *= self.dead_end_penalty             # <<<<<<<<<<<<<<
 *                     self.bases -= original_bases-element.bases
 * 
 */
        __pyx_v_element->bases = (__pyx_v_element->bases * __pyx_v_self->dead_end_penalty);

        /* "_element_graph.pyx":135
 *                     original_bases = element.bases
 *                     element.bases *= self.dead_end_penalty
 *                     self.bases -= original_bases-element.bases             # <<<<<<<<<<<<<<
 * 
 *             if not reached_from_end[i]:
 */
        __pyx_v_self->bases = (__pyx_v_self->bases - (__pyx_v_original_bases - __pyx_v_element->bases));
      }
      __pyx_L40:;

      /* "_element_graph.pyx":126
 *         for i in range(len(self.elements)):
 *             element = self.elements[i]
 *             if not reached_from_start[i]:             # <<<<<<<<<<<<<<
 *                 if self.dead_end_penalty == 0:
 *                     self.zero_element(i)
 */
    }

    /* "_element_graph.pyx":137
 *                     self.bases -= original_bases-element.bases
 * 
 *             if not reached_from_end[i]:             # <<<<<<<<<<<<<<
 *                 if self.dead_end_penalty == 0:
 *                     self.zero_element(i)
 */
    __pyx_t_3 = __Pyx_GetItemInt(((PyObject *)__pyx_v_reached_from_end), __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 137, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_17 < 0)) __PYX_ERR(0, 137, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_16 = ((!__pyx_t_17) != 0);
    if (__pyx_t_16) {

      /* "_element_graph.pyx":138
 * 
 *             if not reached_from_end[i]:
 *                 if self.dead_end_penalty == 0:             # <<<<<<<<<<<<<<
 *                     self.zero_element(i)
 *                 else:
 */
      __pyx_t_16 = ((__pyx_v_self->dead_end_penalty == 0.0) != 0);
      if (__pyx_t_16) {

        /* "_element_graph.pyx":139
 *             if not reached_from_end[i]:
 *                 if self.dead_end_penalty == 0:
 *                     self.zero_element(i)             # <<<<<<<<<<<<<<
 *                 else:
 *                     element.source_weights *= self.dead_end_penalty
 */
        ((struct __pyx_vtabstruct_14_element_graph_ElementGraph *)__pyx_v_self->__pyx_vtab)->zero_element(__pyx_v_self, __pyx_v_i, 0);

        /* "_element_graph.pyx":138
 * 
 *             if not reached_from_end[i]:
 *                 if self.dead_end_penalty == 0:             # <<<<<<<<<<<<<<
 *                     self.zero_element(i)
 *                 else:
 */
        goto __pyx_L42;
      }

      /* "_element_graph.pyx":141
 *                     self.zero_element(i)
 *                 else:
 *                     element.source_weights *= self.dead_end_penalty             # <<<<<<<<<<<<<<
 *                     element.member_weights *= self.dead_end_penalty
 *                     element.cov *= self.dead_end_penalty
 */
      /*else*/ {
        __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->dead_end_penalty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 141, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_7 = PyNumber_InPlaceMultiply(((PyObject *)__pyx_v_element->source_weights), __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 141, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 141, __pyx_L1_error)
        __Pyx_GIVEREF(__pyx_t_7);
        __Pyx_GOTREF(__pyx_v_element->source_weights);
        __Pyx_DECREF(((PyObject *)__pyx_v_element->source_weights));
        __pyx_v_element->source_weights = ((PyArrayObject *)__pyx_t_7);
        __pyx_t_7 = 0;

        /* "_element_graph.pyx":142
 *                 else:
 *                     element.source_weights *= self.dead_end_penalty
 *                     element.member_weights *= self.dead_end_penalty             # <<<<<<<<<<<<<<
 *                     element.cov *= self.dead_end_penalty
 *                     original_bases = element.bases
 */
        __pyx_t_7 = PyFloat_FromDouble(__pyx_v_self->dead_end_penalty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 142, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_3 = PyNumber_InPlaceMultiply(((PyObject *)__pyx_v_element->member_weights), __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 142, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 142, __pyx_L1_error)
        __Pyx_GIVEREF(__pyx_t_3);
        __Pyx_GOTREF(__pyx_v_element->member_weights);
        __Pyx_DECREF(((PyObject *)__pyx_v_element->member_weights));
        __pyx_v_element->member_weights = ((PyArrayObject *)__pyx_t_3);
        __pyx_t_3 = 0;

        /* "_element_graph.pyx":143
 *                     element.source_weights *= self.dead_end_penalty
 *                     element.member_weights *= self.dead_end_penalty
 *                     element.cov *= self.dead_end_penalty             # <<<<<<<<<<<<<<
 *                     original_bases = element.bases
 *                     element.bases *= self.dead_end_penalty
 */
        __pyx_v_element->cov = (__pyx_v_element->cov * __pyx_v_self->dead_end_penalty);

        /* "_element_graph.pyx":144
 *                     element.member_weights *= self.dead_end_penalty
 *                     element.cov *= self.dead_end_penalty
 *                     original_bases = element.bases             # <<<<<<<<<<<<<<
 *                     element.bases *= self.dead_end_penalty
 *                     self.bases -= original_bases-element.bases
 */
        __pyx_t_18 = __pyx_v_element->bases;
        __pyx_v_original_bases = __pyx_t_18;

        /* "_element_graph.pyx":145
 *                     element.cov *= self.dead_end_penalty
 *                     original_bases = element.bases
 *                     element.bases *= self.dead_end_penalty             # <<<<<<<<<<<<<<
 *                     self.bases -= original_bases-element.bases
 * 
 */
        __pyx_v_element->bases = (__pyx_v_element->bases * __pyx_v_self->dead_end_penalty);

        /* "_element_graph.pyx":146
 *                     original_bases = element.bases
 *                     element.bases *= self.dead_end_penalty
 *                     self.bases -= original_bases-element.bases             # <<<<<<<<<<<<<<
 * 
 *     cpdef void check_for_full_paths(self):
 */
        __pyx_v_self->bases = (__pyx_v_self->bases - (__pyx_v_original_bases - __pyx_v_element->bases));
      }
      __pyx_L42:;

      /* "_element_graph.pyx":137
 *                     self.bases -= original_bases-element.bases
 * 
 *             if not reached_from_end[i]:             # <<<<<<<<<<<<<<
 *                 if self.dead_end_penalty == 0:
 *                     self.zero_element(i)
 */
    }
  }

  /* "_element_graph.pyx":57
 *             self.resolve_containment()
 * 
 *     cpdef void penalize_dead_ends(self):             # <<<<<<<<<<<<<<
 *         """Perform a breadth-first search from all starts and all ends.
 *         The weight of all elements unreachable by each search is multiplied
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_WriteUnraisable("_element_graph.ElementGraph.penalize_dead_ends", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_element);
  __Pyx_XDECREF((PyObject *)__pyx_v_welement);
  __Pyx_XDECREF((PyObject *)__pyx_v_reached_from_start);
  __Pyx_XDECREF((PyObject *)__pyx_v_reached_from_end);
  __Pyx_XDECREF(__pyx_v_strand);
  __Pyx_XDECREF(__pyx_v_queue);
  __Pyx_XDECREF(__pyx_v_v);
  __Pyx_XDECREF(__pyx_v_w);
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_3penalize_dead_ends(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_14_element_graph_12ElementGraph_2penalize_dead_ends[] = "Perform a breadth-first search from all starts and all ends.\n        The weight of all elements unreachable by each search is multiplied\n        by the dead_end_penalty, for a maximum penalty of dead_end_penalty^2";
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_3penalize_dead_ends(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("penalize_dead_ends (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_2penalize_dead_ends(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self));

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

static PyObject *__pyx_pf_14_element_graph_12ElementGraph_2penalize_dead_ends(struct __pyx_obj_14_element_graph_ElementGraph *__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("penalize_dead_ends", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_14_element_graph_12ElementGraph_penalize_dead_ends(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "_element_graph.pyx":148
 *                     self.bases -= original_bases-element.bases
 * 
 *     cpdef void check_for_full_paths(self):             # <<<<<<<<<<<<<<
 *         """Assign all reads to any existing complete paths"""
 *         cdef Element e, path, part
 */

static PyObject *__pyx_pw_14_element_graph_12ElementGraph_5check_for_full_paths(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static void __pyx_f_14_element_graph_12ElementGraph_check_for_full_paths(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, int __pyx_skip_dispatch) {
  struct __pyx_obj_14_element_graph_Element *__pyx_v_e = 0;
  struct __pyx_obj_14_element_graph_Element *__pyx_v_path = 0;
  struct __pyx_obj_14_element_graph_Element *__pyx_v_part = 0;
  PyArrayObject *__pyx_v_contained = 0;
  Py_ssize_t __pyx_v_path_index;
  PyObject *__pyx_v_i = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *(*__pyx_t_10)(PyObject *);
  PyArrayObject *__pyx_t_11 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("check_for_full_paths", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_check_for_full_paths); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_14_element_graph_12ElementGraph_5check_for_full_paths)) {
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 148, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "_element_graph.pyx":152
 *         cdef Element e, path, part
 *         cdef np.ndarray contained
 *         for e in self.elements:             # <<<<<<<<<<<<<<
 *             if e.strand == 1:
 *                 if e.s_tag:
 */
  if (unlikely(__pyx_v_self->elements == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(0, 152, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_v_self->elements; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 0;
  for (;;) {
    if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_1)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 152, __pyx_L1_error)
    #else
    __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 152, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_14_element_graph_Element))))) __PYX_ERR(0, 152, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_e, ((struct __pyx_obj_14_element_graph_Element *)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "_element_graph.pyx":153
 *         cdef np.ndarray contained
 *         for e in self.elements:
 *             if e.strand == 1:             # <<<<<<<<<<<<<<
 *                 if e.s_tag:
 *                     self.SP.add(e.index)
 */
    switch (__pyx_v_e->strand) {
      case 1:

      /* "_element_graph.pyx":154
 *         for e in self.elements:
 *             if e.strand == 1:
 *                 if e.s_tag:             # <<<<<<<<<<<<<<
 *                     self.SP.add(e.index)
 *                     self.SPmembers.add(e.LM)
 */
      __pyx_t_6 = (__pyx_v_e->s_tag != 0);
      if (__pyx_t_6) {

        /* "_element_graph.pyx":155
 *             if e.strand == 1:
 *                 if e.s_tag:
 *                     self.SP.add(e.index)             # <<<<<<<<<<<<<<
 *                     self.SPmembers.add(e.LM)
 *                 if e.e_tag:
 */
        if (unlikely(__pyx_v_self->SP == Py_None)) {
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add");
          __PYX_ERR(0, 155, __pyx_L1_error)
        }
        __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_e->index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 155, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_7 = PySet_Add(__pyx_v_self->SP, __pyx_t_2); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 155, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "_element_graph.pyx":156
 *                 if e.s_tag:
 *                     self.SP.add(e.index)
 *                     self.SPmembers.add(e.LM)             # <<<<<<<<<<<<<<
 *                 if e.e_tag:
 *                     self.EP.add(e.index)
 */
        if (unlikely(__pyx_v_self->SPmembers == Py_None)) {
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add");
          __PYX_ERR(0, 156, __pyx_L1_error)
        }
        __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_e->LM); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 156, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_7 = PySet_Add(__pyx_v_self->SPmembers, __pyx_t_2); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 156, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "_element_graph.pyx":154
 *         for e in self.elements:
 *             if e.strand == 1:
 *                 if e.s_tag:             # <<<<<<<<<<<<<<
 *                     self.SP.add(e.index)
 *                     self.SPmembers.add(e.LM)
 */
      }

      /* "_element_graph.pyx":157
 *                     self.SP.add(e.index)
 *                     self.SPmembers.add(e.LM)
 *                 if e.e_tag:             # <<<<<<<<<<<<<<
 *                     self.EP.add(e.index)
 *                     self.EPmembers.add(e.RM)
 */
      __pyx_t_6 = (__pyx_v_e->e_tag != 0);
      if (__pyx_t_6) {

        /* "_element_graph.pyx":158
 *                     self.SPmembers.add(e.LM)
 *                 if e.e_tag:
 *                     self.EP.add(e.index)             # <<<<<<<<<<<<<<
 *                     self.EPmembers.add(e.RM)
 *             elif e.strand == -1:
 */
        if (unlikely(__pyx_v_self->EP == Py_None)) {
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add");
          __PYX_ERR(0, 158, __pyx_L1_error)
        }
        __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_e->index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 158, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_7 = PySet_Add(__pyx_v_self->EP, __pyx_t_2); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 158, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "_element_graph.pyx":159
 *                 if e.e_tag:
 *                     self.EP.add(e.index)
 *                     self.EPmembers.add(e.RM)             # <<<<<<<<<<<<<<
 *             elif e.strand == -1:
 *                 if e.s_tag:
 */
        if (unlikely(__pyx_v_self->EPmembers == Py_None)) {
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add");
          __PYX_ERR(0, 159, __pyx_L1_error)
        }
        __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_e->RM); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_7 = PySet_Add(__pyx_v_self->EPmembers, __pyx_t_2); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 159, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "_element_graph.pyx":157
 *                     self.SP.add(e.index)
 *                     self.SPmembers.add(e.LM)
 *                 if e.e_tag:             # <<<<<<<<<<<<<<
 *                     self.EP.add(e.index)
 *                     self.EPmembers.add(e.RM)
 */
      }

      /* "_element_graph.pyx":153
 *         cdef np.ndarray contained
 *         for e in self.elements:
 *             if e.strand == 1:             # <<<<<<<<<<<<<<
 *                 if e.s_tag:
 *                     self.SP.add(e.index)
 */
      break;
      case -1L:

      /* "_element_graph.pyx":161
 *                     self.EPmembers.add(e.RM)
 *             elif e.strand == -1:
 *                 if e.s_tag:             # <<<<<<<<<<<<<<
 *                     self.SM.add(e.index)
 *                     self.SMmembers.add(e.RM)
 */
      __pyx_t_6 = (__pyx_v_e->s_tag != 0);
      if (__pyx_t_6) {

        /* "_element_graph.pyx":162
 *             elif e.strand == -1:
 *                 if e.s_tag:
 *                     self.SM.add(e.index)             # <<<<<<<<<<<<<<
 *                     self.SMmembers.add(e.RM)
 *                 if e.e_tag:
 */
        if (unlikely(__pyx_v_self->SM == Py_None)) {
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add");
          __PYX_ERR(0, 162, __pyx_L1_error)
        }
        __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_e->index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 162, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_7 = PySet_Add(__pyx_v_self->SM, __pyx_t_2); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 162, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "_element_graph.pyx":163
 *                 if e.s_tag:
 *                     self.SM.add(e.index)
 *                     self.SMmembers.add(e.RM)             # <<<<<<<<<<<<<<
 *                 if e.e_tag:
 *                     self.EM.add(e.index)
 */
        if (unlikely(__pyx_v_self->SMmembers == Py_None)) {
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add");
          __PYX_ERR(0, 163, __pyx_L1_error)
        }
        __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_e->RM); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 163, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_7 = PySet_Add(__pyx_v_self->SMmembers, __pyx_t_2); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 163, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "_element_graph.pyx":161
 *                     self.EPmembers.add(e.RM)
 *             elif e.strand == -1:
 *                 if e.s_tag:             # <<<<<<<<<<<<<<
 *                     self.SM.add(e.index)
 *                     self.SMmembers.add(e.RM)
 */
      }

      /* "_element_graph.pyx":164
 *                     self.SM.add(e.index)
 *                     self.SMmembers.add(e.RM)
 *                 if e.e_tag:             # <<<<<<<<<<<<<<
 *                     self.EM.add(e.index)
 *                     self.EMmembers.add(e.LM)
 */
      __pyx_t_6 = (__pyx_v_e->e_tag != 0);
      if (__pyx_t_6) {

        /* "_element_graph.pyx":165
 *                     self.SMmembers.add(e.RM)
 *                 if e.e_tag:
 *                     self.EM.add(e.index)             # <<<<<<<<<<<<<<
 *                     self.EMmembers.add(e.LM)
 *             if e.complete: # A full-length path exists in the input elements
 */
        if (unlikely(__pyx_v_self->EM == Py_None)) {
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add");
          __PYX_ERR(0, 165, __pyx_L1_error)
        }
        __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_e->index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 165, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_7 = PySet_Add(__pyx_v_self->EM, __pyx_t_2); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 165, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "_element_graph.pyx":166
 *                 if e.e_tag:
 *                     self.EM.add(e.index)
 *                     self.EMmembers.add(e.LM)             # <<<<<<<<<<<<<<
 *             if e.complete: # A full-length path exists in the input elements
 *                 path = copy.deepcopy(e)
 */
        if (unlikely(__pyx_v_self->EMmembers == Py_None)) {
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add");
          __PYX_ERR(0, 166, __pyx_L1_error)
        }
        __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_e->LM); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 166, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_7 = PySet_Add(__pyx_v_self->EMmembers, __pyx_t_2); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 166, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "_element_graph.pyx":164
 *                     self.SM.add(e.index)
 *                     self.SMmembers.add(e.RM)
 *                 if e.e_tag:             # <<<<<<<<<<<<<<
 *                     self.EM.add(e.index)
 *                     self.EMmembers.add(e.LM)
 */
      }

      /* "_element_graph.pyx":160
 *                     self.EP.add(e.index)
 *                     self.EPmembers.add(e.RM)
 *             elif e.strand == -1:             # <<<<<<<<<<<<<<
 *                 if e.s_tag:
 *                     self.SM.add(e.index)
 */
      break;
      default: break;
    }

    /* "_element_graph.pyx":167
 *                     self.EM.add(e.index)
 *                     self.EMmembers.add(e.LM)
 *             if e.complete: # A full-length path exists in the input elements             # <<<<<<<<<<<<<<
 *                 path = copy.deepcopy(e)
 *                 path_index = len(self.paths)
 */
    __pyx_t_6 = (__pyx_v_e->complete != 0);
    if (__pyx_t_6) {

      /* "_element_graph.pyx":168
 *                     self.EMmembers.add(e.LM)
 *             if e.complete: # A full-length path exists in the input elements
 *                 path = copy.deepcopy(e)             # <<<<<<<<<<<<<<
 *                 path_index = len(self.paths)
 *                 self.paths.append(path)
 */
      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 168, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_deepcopy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 168, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, ((PyObject *)__pyx_v_e)) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_v_e));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 168, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_14_element_graph_Element))))) __PYX_ERR(0, 168, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_path, ((struct __pyx_obj_14_element_graph_Element *)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "_element_graph.pyx":169
 *             if e.complete: # A full-length path exists in the input elements
 *                 path = copy.deepcopy(e)
 *                 path_index = len(self.paths)             # <<<<<<<<<<<<<<
 *                 self.paths.append(path)
 *                 contained = np.where(self.overlap[:,e.index]==2)[0]
 */
      __pyx_t_2 = __pyx_v_self->paths;
      __Pyx_INCREF(__pyx_t_2);
      if (unlikely(__pyx_t_2 == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
        __PYX_ERR(0, 169, __pyx_L1_error)
      }
      __pyx_t_8 = PyList_GET_SIZE(__pyx_t_2); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 169, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_path_index = __pyx_t_8;

      /* "_element_graph.pyx":170
 *                 path = copy.deepcopy(e)
 *                 path_index = len(self.paths)
 *                 self.paths.append(path)             # <<<<<<<<<<<<<<
 *                 contained = np.where(self.overlap[:,e.index]==2)[0]
 *                 for i in contained:
 */
      if (unlikely(__pyx_v_self->paths == Py_None)) {
        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
        __PYX_ERR(0, 170, __pyx_L1_error)
      }
      __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_self->paths, ((PyObject *)__pyx_v_path)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 170, __pyx_L1_error)

      /* "_element_graph.pyx":171
 *                 path_index = len(self.paths)
 *                 self.paths.append(path)
 *                 contained = np.where(self.overlap[:,e.index]==2)[0]             # <<<<<<<<<<<<<<
 *                 for i in contained:
 *                     path.includes.add(i)
 */
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 171, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_where); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 171, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_e->index); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 171, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 171, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_slice_);
      __Pyx_GIVEREF(__pyx_slice_);
      PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_slice_);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->overlap), __pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 171, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_9 = __Pyx_PyInt_EqObjC(__pyx_t_4, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 171, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_9);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 171, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 171, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 171, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_contained, ((PyArrayObject *)__pyx_t_3));
      __pyx_t_3 = 0;

      /* "_element_graph.pyx":172
 *                 self.paths.append(path)
 *                 contained = np.where(self.overlap[:,e.index]==2)[0]
 *                 for i in contained:             # <<<<<<<<<<<<<<
 *                     path.includes.add(i)
 *                     part = self.elements[i]
 */
      if (likely(PyList_CheckExact(((PyObject *)__pyx_v_contained))) || PyTuple_CheckExact(((PyObject *)__pyx_v_contained))) {
        __pyx_t_3 = ((PyObject *)__pyx_v_contained); __Pyx_INCREF(__pyx_t_3); __pyx_t_8 = 0;
        __pyx_t_10 = NULL;
      } else {
        __pyx_t_8 = -1; __pyx_t_3 = PyObject_GetIter(((PyObject *)__pyx_v_contained)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 172, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_10 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 172, __pyx_L1_error)
      }
      for (;;) {
        if (likely(!__pyx_t_10)) {
          if (likely(PyList_CheckExact(__pyx_t_3))) {
            if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_3)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 172, __pyx_L1_error)
            #else
            __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 172, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            #endif
          } else {
            if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 172, __pyx_L1_error)
            #else
            __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 172, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            #endif
          }
        } else {
          __pyx_t_2 = __pyx_t_10(__pyx_t_3);
          if (unlikely(!__pyx_t_2)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 172, __pyx_L1_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_2);
        }
        __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2);
        __pyx_t_2 = 0;

        /* "_element_graph.pyx":173
 *                 contained = np.where(self.overlap[:,e.index]==2)[0]
 *                 for i in contained:
 *                     path.includes.add(i)             # <<<<<<<<<<<<<<
 *                     part = self.elements[i]
 *                     part.assigned_to.add(path_index)
 */
        if (unlikely(__pyx_v_path->includes == Py_None)) {
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add");
          __PYX_ERR(0, 173, __pyx_L1_error)
        }
        __pyx_t_7 = PySet_Add(__pyx_v_path->includes, __pyx_v_i); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 173, __pyx_L1_error)

        /* "_element_graph.pyx":174
 *                 for i in contained:
 *                     path.includes.add(i)
 *                     part = self.elements[i]             # <<<<<<<<<<<<<<
 *                     part.assigned_to.add(path_index)
 *                     self.assignments[i] += 1
 */
        if (unlikely(__pyx_v_self->elements == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 174, __pyx_L1_error)
        }
        __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_self->elements, __pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 174, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_14_element_graph_Element))))) __PYX_ERR(0, 174, __pyx_L1_error)
        __Pyx_XDECREF_SET(__pyx_v_part, ((struct __pyx_obj_14_element_graph_Element *)__pyx_t_2));
        __pyx_t_2 = 0;

        /* "_element_graph.pyx":175
 *                     path.includes.add(i)
 *                     part = self.elements[i]
 *                     part.assigned_to.add(path_index)             # <<<<<<<<<<<<<<
 *                     self.assignments[i] += 1
 * 
 */
        if (unlikely(__pyx_v_part->assigned_to == Py_None)) {
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add");
          __PYX_ERR(0, 175, __pyx_L1_error)
        }
        __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_path_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 175, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_7 = PySet_Add(__pyx_v_part->assigned_to, __pyx_t_2); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 175, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "_element_graph.pyx":176
 *                     part = self.elements[i]
 *                     part.assigned_to.add(path_index)
 *                     self.assignments[i] += 1             # <<<<<<<<<<<<<<
 * 
 *         self.end_elements = self.SP|self.EP|self.SM|self.EM
 */
        __Pyx_INCREF(((PyObject *)__pyx_v_self->assignments));
        __pyx_t_11 = __pyx_v_self->assignments;
        __Pyx_INCREF(__pyx_v_i);
        __pyx_t_2 = __pyx_v_i;
        __pyx_t_9 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_t_11), __pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 176, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_t_9, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 176, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (unlikely(PyObject_SetItem(((PyObject *)__pyx_t_11), __pyx_t_2, __pyx_t_4) < 0)) __PYX_ERR(0, 176, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;

        /* "_element_graph.pyx":172
 *                 self.paths.append(path)
 *                 contained = np.where(self.overlap[:,e.index]==2)[0]
 *                 for i in contained:             # <<<<<<<<<<<<<<
 *                     path.includes.add(i)
 *                     part = self.elements[i]
 */
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "_element_graph.pyx":167
 *                     self.EM.add(e.index)
 *                     self.EMmembers.add(e.LM)
 *             if e.complete: # A full-length path exists in the input elements             # <<<<<<<<<<<<<<
 *                 path = copy.deepcopy(e)
 *                 path_index = len(self.paths)
 */
    }

    /* "_element_graph.pyx":152
 *         cdef Element e, path, part
 *         cdef np.ndarray contained
 *         for e in self.elements:             # <<<<<<<<<<<<<<
 *             if e.strand == 1:
 *                 if e.s_tag:
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_element_graph.pyx":178
 *                     self.assignments[i] += 1
 * 
 *         self.end_elements = self.SP|self.EP|self.SM|self.EM             # <<<<<<<<<<<<<<
 *         if len(self.end_elements) == 0:
 *             self.no_ends = True
 */
  __pyx_t_1 = PyNumber_Or(__pyx_v_self->SP, __pyx_v_self->EP); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 178, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyNumber_Or(__pyx_t_1, __pyx_v_self->SM); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 178, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_Or(__pyx_t_3, __pyx_v_self->EM); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 178, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->end_elements);
  __Pyx_DECREF(__pyx_v_self->end_elements);
  __pyx_v_self->end_elements = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "_element_graph.pyx":179
 * 
 *         self.end_elements = self.SP|self.EP|self.SM|self.EM
 *         if len(self.end_elements) == 0:             # <<<<<<<<<<<<<<
 *             self.no_ends = True
 *         else:
 */
  __pyx_t_1 = __pyx_v_self->end_elements;
  __Pyx_INCREF(__pyx_t_1);
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(0, 179, __pyx_L1_error)
  }
  __pyx_t_5 = PySet_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 179, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = ((__pyx_t_5 == 0) != 0);
  if (__pyx_t_6) {

    /* "_element_graph.pyx":180
 *         self.end_elements = self.SP|self.EP|self.SM|self.EM
 *         if len(self.end_elements) == 0:
 *             self.no_ends = True             # <<<<<<<<<<<<<<
 *         else:
 *             self.no_ends = False
 */
    __pyx_v_self->no_ends = 1;

    /* "_element_graph.pyx":179
 * 
 *         self.end_elements = self.SP|self.EP|self.SM|self.EM
 *         if len(self.end_elements) == 0:             # <<<<<<<<<<<<<<
 *             self.no_ends = True
 *         else:
 */
    goto __pyx_L12;
  }

  /* "_element_graph.pyx":182
 *             self.no_ends = True
 *         else:
 *             self.no_ends = False             # <<<<<<<<<<<<<<
 * 
 *         if len(self.paths) > 0:
 */
  /*else*/ {
    __pyx_v_self->no_ends = 0;
  }
  __pyx_L12:;

  /* "_element_graph.pyx":184
 *             self.no_ends = False
 * 
 *         if len(self.paths) > 0:             # <<<<<<<<<<<<<<
 *             self.assign_weights()
 * 
 */
  __pyx_t_1 = __pyx_v_self->paths;
  __Pyx_INCREF(__pyx_t_1);
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(0, 184, __pyx_L1_error)
  }
  __pyx_t_5 = PyList_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 184, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = ((__pyx_t_5 > 0) != 0);
  if (__pyx_t_6) {

    /* "_element_graph.pyx":185
 * 
 *         if len(self.paths) > 0:
 *             self.assign_weights()             # <<<<<<<<<<<<<<
 * 
 *     cpdef void resolve_containment(self):
 */
    ((struct __pyx_vtabstruct_14_element_graph_ElementGraph *)__pyx_v_self->__pyx_vtab)->assign_weights(__pyx_v_self, 0);

    /* "_element_graph.pyx":184
 *             self.no_ends = False
 * 
 *         if len(self.paths) > 0:             # <<<<<<<<<<<<<<
 *             self.assign_weights()
 * 
 */
  }

  /* "_element_graph.pyx":148
 *                     self.bases -= original_bases-element.bases
 * 
 *     cpdef void check_for_full_paths(self):             # <<<<<<<<<<<<<<
 *         """Assign all reads to any existing complete paths"""
 *         cdef Element e, path, part
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(((PyObject *)__pyx_t_11));
  __Pyx_WriteUnraisable("_element_graph.ElementGraph.check_for_full_paths", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_e);
  __Pyx_XDECREF((PyObject *)__pyx_v_path);
  __Pyx_XDECREF((PyObject *)__pyx_v_part);
  __Pyx_XDECREF((PyObject *)__pyx_v_contained);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_5check_for_full_paths(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_14_element_graph_12ElementGraph_4check_for_full_paths[] = "Assign all reads to any existing complete paths";
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_5check_for_full_paths(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("check_for_full_paths (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_4check_for_full_paths(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self));

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

static PyObject *__pyx_pf_14_element_graph_12ElementGraph_4check_for_full_paths(struct __pyx_obj_14_element_graph_ElementGraph *__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("check_for_full_paths", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_14_element_graph_12ElementGraph_check_for_full_paths(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "_element_graph.pyx":187
 *             self.assign_weights()
 * 
 *     cpdef void resolve_containment(self):             # <<<<<<<<<<<<<<
 *         """Given a overlap matrix, 'bubble up' the weight of
 *         all reads that have one or more 'contained by' relationships
 */

static PyObject *__pyx_pw_14_element_graph_12ElementGraph_7resolve_containment(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static void __pyx_f_14_element_graph_12ElementGraph_resolve_containment(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, int __pyx_skip_dispatch) {
  PyArrayObject *__pyx_v_default_proportions = 0;
  PyArrayObject *__pyx_v_proportions = 0;
  PyObject *__pyx_v_contained = 0;
  PyObject *__pyx_v_resolve_order = 0;
  PyObject *__pyx_v_container_indices = 0;
  PyObject *__pyx_v_maxmember = 0;
  PyObject *__pyx_v_zeros = 0;
  PyObject *__pyx_v_containers = 0;
  PyObject *__pyx_v_incompatible = 0;
  float __pyx_v_total_container_weight;
  struct __pyx_obj_14_element_graph_Element *__pyx_v_element = 0;
  Py_ssize_t __pyx_v_resolve;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_c;
  struct __pyx_obj_14_element_graph_Element *__pyx_8genexpr3__pyx_v_element = NULL;
  Py_ssize_t __pyx_8genexpr4__pyx_v_i;
  __pyx_ctuple_int__and_int__and_int __pyx_8genexpr5__pyx_v_sorttuple;
  Py_ssize_t __pyx_8genexpr6__pyx_v_c;
  Py_ssize_t __pyx_8genexpr7__pyx_v_c;
  float __pyx_8genexpr8__pyx_v_m;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  __pyx_ctuple_int__and_int__and_int __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  float __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  npy_intp __pyx_t_20;
  npy_intp __pyx_t_21;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("resolve_containment", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_resolve_containment); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_14_element_graph_12ElementGraph_7resolve_containment)) {
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 187, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "_element_graph.pyx":202
 *             (int, int, int) sorttuple
 * 
 *         zeros = set([element.index for element in self.elements if element.cov == 0])             # <<<<<<<<<<<<<<
 *         contained = [i for i in range(self.number_of_elements) if len(self.elements[i].contained)>0] # Identify reads that are contained
 *         resolve_order = [sorttuple[2] for sorttuple in sorted([(-self.elements[c].IC, len(self.elements[c].contained), c) for c in contained])] # Rank them by decreasing number of members
 */
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 202, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (unlikely(__pyx_v_self->elements == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(0, 202, __pyx_L5_error)
    }
    __pyx_t_2 = __pyx_v_self->elements; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0;
    for (;;) {
      if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 202, __pyx_L5_error)
      #else
      __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 202, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_3);
      #endif
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_14_element_graph_Element))))) __PYX_ERR(0, 202, __pyx_L5_error)
      __Pyx_XDECREF_SET(__pyx_8genexpr3__pyx_v_element, ((struct __pyx_obj_14_element_graph_Element *)__pyx_t_3));
      __pyx_t_3 = 0;
      __pyx_t_6 = ((__pyx_8genexpr3__pyx_v_element->cov == 0.0) != 0);
      if (__pyx_t_6) {
        __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_8genexpr3__pyx_v_element->index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 202, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_3);
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 202, __pyx_L5_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF((PyObject *)__pyx_8genexpr3__pyx_v_element); __pyx_8genexpr3__pyx_v_element = 0;
    goto __pyx_L9_exit_scope;
    __pyx_L5_error:;
    __Pyx_XDECREF((PyObject *)__pyx_8genexpr3__pyx_v_element); __pyx_8genexpr3__pyx_v_element = 0;
    goto __pyx_L1_error;
    __pyx_L9_exit_scope:;
  } /* exit inner scope */
  __pyx_t_2 = PySet_New(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 202, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_zeros = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "_element_graph.pyx":203
 * 
 *         zeros = set([element.index for element in self.elements if element.cov == 0])
 *         contained = [i for i in range(self.number_of_elements) if len(self.elements[i].contained)>0] # Identify reads that are contained             # <<<<<<<<<<<<<<
 *         resolve_order = [sorttuple[2] for sorttuple in sorted([(-self.elements[c].IC, len(self.elements[c].contained), c) for c in contained])] # Rank them by decreasing number of members
 *         for resolve in resolve_order:
 */
  { /* enter inner scope */
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 203, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = __pyx_v_self->number_of_elements;
    __pyx_t_8 = __pyx_t_7;
    for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_8; __pyx_t_5+=1) {
      __pyx_8genexpr4__pyx_v_i = __pyx_t_5;
      if (unlikely(__pyx_v_self->elements == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(0, 203, __pyx_L1_error)
      }
      __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_self->elements, __pyx_8genexpr4__pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 203, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_contained); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 203, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_9 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 203, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = ((__pyx_t_9 > 0) != 0);
      if (__pyx_t_6) {
        __pyx_t_3 = PyInt_FromSsize_t(__pyx_8genexpr4__pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 203, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 203, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      }
    }
  } /* exit inner scope */
  __pyx_v_contained = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "_element_graph.pyx":204
 *         zeros = set([element.index for element in self.elements if element.cov == 0])
 *         contained = [i for i in range(self.number_of_elements) if len(self.elements[i].contained)>0] # Identify reads that are contained
 *         resolve_order = [sorttuple[2] for sorttuple in sorted([(-self.elements[c].IC, len(self.elements[c].contained), c) for c in contained])] # Rank them by decreasing number of members             # <<<<<<<<<<<<<<
 *         for resolve in resolve_order:
 *             element = self.elements[resolve]
 */
  { /* enter inner scope */
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 204, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    { /* enter inner scope */
      __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 204, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = __pyx_v_contained; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
      for (;;) {
        if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_10 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_10); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 204, __pyx_L1_error)
        #else
        __pyx_t_10 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 204, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        #endif
        __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_10); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 204, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_8genexpr6__pyx_v_c = __pyx_t_9;
        if (unlikely(__pyx_v_self->elements == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 204, __pyx_L1_error)
        }
        __pyx_t_10 = __Pyx_GetItemInt_List(__pyx_v_self->elements, __pyx_8genexpr6__pyx_v_c, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 204, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_IC); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 204, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_10 = PyNumber_Negative(__pyx_t_11); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 204, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        if (unlikely(__pyx_v_self->elements == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 204, __pyx_L1_error)
        }
        __pyx_t_11 = __Pyx_GetItemInt_List(__pyx_v_self->elements, __pyx_8genexpr6__pyx_v_c, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 204, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_contained); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 204, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_9 = PyObject_Length(__pyx_t_12); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 204, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = PyInt_FromSsize_t(__pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 204, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_11 = PyInt_FromSsize_t(__pyx_8genexpr6__pyx_v_c); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 204, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_13 = PyTuple_New(3); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 204, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_GIVEREF(__pyx_t_10);
        PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_10);
        __Pyx_GIVEREF(__pyx_t_12);
        PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_12);
        __Pyx_GIVEREF(__pyx_t_11);
        PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_11);
        __pyx_t_10 = 0;
        __pyx_t_12 = 0;
        __pyx_t_11 = 0;
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_13))) __PYX_ERR(0, 204, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } /* exit inner scope */
    __pyx_t_3 = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_14 = PyList_Sort(__pyx_t_3); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 204, __pyx_L1_error)
    if (unlikely(__pyx_t_3 == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(0, 204, __pyx_L1_error)
    }
    __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    for (;;) {
      if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 204, __pyx_L1_error)
      #else
      __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 204, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      #endif
      __pyx_t_15 = __pyx_convert__from_py___pyx_ctuple_int__and_int__and_int(__pyx_t_3); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 204, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_8genexpr5__pyx_v_sorttuple = __pyx_t_15;
      __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_8genexpr5__pyx_v_sorttuple.f2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 204, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 204, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } /* exit inner scope */
  __pyx_v_resolve_order = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "_element_graph.pyx":205
 *         contained = [i for i in range(self.number_of_elements) if len(self.elements[i].contained)>0] # Identify reads that are contained
 *         resolve_order = [sorttuple[2] for sorttuple in sorted([(-self.elements[c].IC, len(self.elements[c].contained), c) for c in contained])] # Rank them by decreasing number of members
 *         for resolve in resolve_order:             # <<<<<<<<<<<<<<
 *             element = self.elements[resolve]
 *             if element.cov == 0:continue
 */
  __pyx_t_2 = __pyx_v_resolve_order; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0;
  for (;;) {
    if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 205, __pyx_L1_error)
    #else
    __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 205, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    #endif
    __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 205, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_resolve = __pyx_t_9;

    /* "_element_graph.pyx":206
 *         resolve_order = [sorttuple[2] for sorttuple in sorted([(-self.elements[c].IC, len(self.elements[c].contained), c) for c in contained])] # Rank them by decreasing number of members
 *         for resolve in resolve_order:
 *             element = self.elements[resolve]             # <<<<<<<<<<<<<<
 *             if element.cov == 0:continue
 *             containers = element.contained.difference(zeros)
 */
    if (unlikely(__pyx_v_self->elements == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 206, __pyx_L1_error)
    }
    __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_self->elements, __pyx_v_resolve, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 206, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_14_element_graph_Element))))) __PYX_ERR(0, 206, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_element, ((struct __pyx_obj_14_element_graph_Element *)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "_element_graph.pyx":207
 *         for resolve in resolve_order:
 *             element = self.elements[resolve]
 *             if element.cov == 0:continue             # <<<<<<<<<<<<<<
 *             containers = element.contained.difference(zeros)
 *             # Get the set of reads incompatible with all containers but that do not exclude i
 */
    __pyx_t_6 = ((__pyx_v_element->cov == 0.0) != 0);
    if (__pyx_t_6) {
      goto __pyx_L17_continue;
    }

    /* "_element_graph.pyx":208
 *             element = self.elements[resolve]
 *             if element.cov == 0:continue
 *             containers = element.contained.difference(zeros)             # <<<<<<<<<<<<<<
 *             # Get the set of reads incompatible with all containers but that do not exclude i
 *             incompatible =  set(range(self.number_of_elements))
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_element->contained, __pyx_n_s_difference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 208, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_zeros) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_zeros);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 208, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (!(likely(PySet_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 208, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_containers, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "_element_graph.pyx":210
 *             containers = element.contained.difference(zeros)
 *             # Get the set of reads incompatible with all containers but that do not exclude i
 *             incompatible =  set(range(self.number_of_elements))             # <<<<<<<<<<<<<<
 *             for c in containers:
 *                 incompatible.intersection_update(self.elements[c].excludes)
 */
    __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->number_of_elements); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 210, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 210, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PySet_New(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 210, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF_SET(__pyx_v_incompatible, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "_element_graph.pyx":211
 *             # Get the set of reads incompatible with all containers but that do not exclude i
 *             incompatible =  set(range(self.number_of_elements))
 *             for c in containers:             # <<<<<<<<<<<<<<
 *                 incompatible.intersection_update(self.elements[c].excludes)
 * 
 */
    __pyx_t_9 = 0;
    __pyx_t_3 = __Pyx_set_iterator(__pyx_v_containers, 1, (&__pyx_t_16), (&__pyx_t_7)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 211, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
    while (1) {
      __pyx_t_8 = __Pyx_set_iter_next(__pyx_t_1, __pyx_t_16, &__pyx_t_9, &__pyx_t_3, __pyx_t_7);
      if (unlikely(__pyx_t_8 == 0)) break;
      if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 211, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_17 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_17 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 211, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_c = __pyx_t_17;

      /* "_element_graph.pyx":212
 *             incompatible =  set(range(self.number_of_elements))
 *             for c in containers:
 *                 incompatible.intersection_update(self.elements[c].excludes)             # <<<<<<<<<<<<<<
 * 
 *             incompatible.difference_update(element.excludes|zeros)
 */
      if (unlikely(__pyx_v_self->elements == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(0, 212, __pyx_L1_error)
      }
      __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_self->elements, __pyx_v_c, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 212, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_excludes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 212, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PySet_Type_intersection_update, __pyx_v_incompatible, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 212, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "_element_graph.pyx":214
 *                 incompatible.intersection_update(self.elements[c].excludes)
 * 
 *             incompatible.difference_update(element.excludes|zeros)             # <<<<<<<<<<<<<<
 *             if len(incompatible) == 0: # Special case, all weight goes to containers
 *                 if len(containers) == 1:
 */
    __pyx_t_1 = PyNumber_Or(__pyx_v_element->excludes, __pyx_v_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 214, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PySet_Type_difference_update, __pyx_v_incompatible, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 214, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "_element_graph.pyx":215
 * 
 *             incompatible.difference_update(element.excludes|zeros)
 *             if len(incompatible) == 0: # Special case, all weight goes to containers             # <<<<<<<<<<<<<<
 *                 if len(containers) == 1:
 *                     self.elements[containers.pop()].merge(element, element.all)
 */
    __pyx_t_16 = PySet_GET_SIZE(__pyx_v_incompatible); if (unlikely(__pyx_t_16 == ((Py_ssize_t)-1))) __PYX_ERR(0, 215, __pyx_L1_error)
    __pyx_t_6 = ((__pyx_t_16 == 0) != 0);
    if (__pyx_t_6) {

      /* "_element_graph.pyx":216
 *             incompatible.difference_update(element.excludes|zeros)
 *             if len(incompatible) == 0: # Special case, all weight goes to containers
 *                 if len(containers) == 1:             # <<<<<<<<<<<<<<
 *                     self.elements[containers.pop()].merge(element, element.all)
 *                 else: # Evaluate how much weight goes to each container
 */
      if (unlikely(__pyx_v_containers == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
        __PYX_ERR(0, 216, __pyx_L1_error)
      }
      __pyx_t_16 = PySet_GET_SIZE(__pyx_v_containers); if (unlikely(__pyx_t_16 == ((Py_ssize_t)-1))) __PYX_ERR(0, 216, __pyx_L1_error)
      __pyx_t_6 = ((__pyx_t_16 == 1) != 0);
      if (__pyx_t_6) {

        /* "_element_graph.pyx":217
 *             if len(incompatible) == 0: # Special case, all weight goes to containers
 *                 if len(containers) == 1:
 *                     self.elements[containers.pop()].merge(element, element.all)             # <<<<<<<<<<<<<<
 *                 else: # Evaluate how much weight goes to each container
 *                     container_indices = sorted(containers)
 */
        if (unlikely(__pyx_v_self->elements == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 217, __pyx_L1_error)
        }
        if (unlikely(__pyx_v_containers == Py_None)) {
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "pop");
          __PYX_ERR(0, 217, __pyx_L1_error)
        }
        __pyx_t_1 = PySet_Pop(__pyx_v_containers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_self->elements, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 217, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_merge); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = NULL;
        __pyx_t_7 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_1, function);
            __pyx_t_7 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_1)) {
          PyObject *__pyx_temp[3] = {__pyx_t_4, ((PyObject *)__pyx_v_element), ((PyObject *)__pyx_v_element->all)};
          __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 217, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_3);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
          PyObject *__pyx_temp[3] = {__pyx_t_4, ((PyObject *)__pyx_v_element), ((PyObject *)__pyx_v_element->all)};
          __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 217, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_3);
        } else
        #endif
        {
          __pyx_t_13 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 217, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_13);
          if (__pyx_t_4) {
            __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_4); __pyx_t_4 = NULL;
          }
          __Pyx_INCREF(((PyObject *)__pyx_v_element));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_element));
          PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_7, ((PyObject *)__pyx_v_element));
          __Pyx_INCREF(((PyObject *)__pyx_v_element->all));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_element->all));
          PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_7, ((PyObject *)__pyx_v_element->all));
          __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_13, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 217, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        }
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

        /* "_element_graph.pyx":216
 *             incompatible.difference_update(element.excludes|zeros)
 *             if len(incompatible) == 0: # Special case, all weight goes to containers
 *                 if len(containers) == 1:             # <<<<<<<<<<<<<<
 *                     self.elements[containers.pop()].merge(element, element.all)
 *                 else: # Evaluate how much weight goes to each container
 */
        goto __pyx_L23;
      }

      /* "_element_graph.pyx":219
 *                     self.elements[containers.pop()].merge(element, element.all)
 *                 else: # Evaluate how much weight goes to each container
 *                     container_indices = sorted(containers)             # <<<<<<<<<<<<<<
 *                     maxmember = [self.elements[c].cov for c in container_indices]
 *                     total_container_weight = sum(maxmember)
 */
      /*else*/ {
        __pyx_t_1 = PySequence_List(__pyx_v_containers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 219, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_3 = ((PyObject*)__pyx_t_1);
        __pyx_t_1 = 0;
        __pyx_t_14 = PyList_Sort(__pyx_t_3); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 219, __pyx_L1_error)
        __Pyx_XDECREF_SET(__pyx_v_container_indices, ((PyObject*)__pyx_t_3));
        __pyx_t_3 = 0;

        /* "_element_graph.pyx":220
 *                 else: # Evaluate how much weight goes to each container
 *                     container_indices = sorted(containers)
 *                     maxmember = [self.elements[c].cov for c in container_indices]             # <<<<<<<<<<<<<<
 *                     total_container_weight = sum(maxmember)
 *                     default_proportions = np.array([m/total_container_weight for m in maxmember], dtype=np.float32)
 */
        { /* enter inner scope */
          __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 220, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          if (unlikely(__pyx_v_container_indices == Py_None)) {
            PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
            __PYX_ERR(0, 220, __pyx_L1_error)
          }
          __pyx_t_1 = __pyx_v_container_indices; __Pyx_INCREF(__pyx_t_1); __pyx_t_16 = 0;
          for (;;) {
            if (__pyx_t_16 >= PyList_GET_SIZE(__pyx_t_1)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_13 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_16); __Pyx_INCREF(__pyx_t_13); __pyx_t_16++; if (unlikely(0 < 0)) __PYX_ERR(0, 220, __pyx_L1_error)
            #else
            __pyx_t_13 = PySequence_ITEM(__pyx_t_1, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 220, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_13);
            #endif
            __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_13); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 220, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            __pyx_8genexpr7__pyx_v_c = __pyx_t_9;
            if (unlikely(__pyx_v_self->elements == Py_None)) {
              PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
              __PYX_ERR(0, 220, __pyx_L1_error)
            }
            __pyx_t_13 = __Pyx_GetItemInt_List(__pyx_v_self->elements, __pyx_8genexpr7__pyx_v_c, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 220, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_13);
            __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_cov); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 220, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 220, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          }
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        } /* exit inner scope */
        __Pyx_XDECREF_SET(__pyx_v_maxmember, ((PyObject*)__pyx_t_3));
        __pyx_t_3 = 0;

        /* "_element_graph.pyx":221
 *                     container_indices = sorted(containers)
 *                     maxmember = [self.elements[c].cov for c in container_indices]
 *                     total_container_weight = sum(maxmember)             # <<<<<<<<<<<<<<
 *                     default_proportions = np.array([m/total_container_weight for m in maxmember], dtype=np.float32)
 *                     proportions = np.zeros(shape=(len(containers), element.all.shape[0]), dtype=np.float32)
 */
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_v_maxmember); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 221, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_18 = __pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_18 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 221, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_v_total_container_weight = __pyx_t_18;

        /* "_element_graph.pyx":222
 *                     maxmember = [self.elements[c].cov for c in container_indices]
 *                     total_container_weight = sum(maxmember)
 *                     default_proportions = np.array([m/total_container_weight for m in maxmember], dtype=np.float32)             # <<<<<<<<<<<<<<
 *                     proportions = np.zeros(shape=(len(containers), element.all.shape[0]), dtype=np.float32)
 *                     for i in range(len(container_indices)):
 */
        __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 222, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 222, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        { /* enter inner scope */
          __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 222, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_4 = __pyx_v_maxmember; __Pyx_INCREF(__pyx_t_4); __pyx_t_16 = 0;
          for (;;) {
            if (__pyx_t_16 >= PyList_GET_SIZE(__pyx_t_4)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_13 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_16); __Pyx_INCREF(__pyx_t_13); __pyx_t_16++; if (unlikely(0 < 0)) __PYX_ERR(0, 222, __pyx_L1_error)
            #else
            __pyx_t_13 = PySequence_ITEM(__pyx_t_4, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 222, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_13);
            #endif
            __pyx_t_18 = __pyx_PyFloat_AsFloat(__pyx_t_13); if (unlikely((__pyx_t_18 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 222, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            __pyx_8genexpr8__pyx_v_m = __pyx_t_18;
            if (unlikely(__pyx_v_total_container_weight == 0)) {
              PyErr_SetString(PyExc_ZeroDivisionError, "float division");
              __PYX_ERR(0, 222, __pyx_L1_error)
            }
            __pyx_t_13 = PyFloat_FromDouble((__pyx_8genexpr8__pyx_v_m / __pyx_v_total_container_weight)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 222, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_13);
            if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_13))) __PYX_ERR(0, 222, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          }
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } /* exit inner scope */
        __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 222, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 222, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_np); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 222, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_float32); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 222, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_11) < 0) __PYX_ERR(0, 222, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 222, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (!(likely(((__pyx_t_11) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_11, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 222, __pyx_L1_error)
        __Pyx_XDECREF_SET(__pyx_v_default_proportions, ((PyArrayObject *)__pyx_t_11));
        __pyx_t_11 = 0;

        /* "_element_graph.pyx":223
 *                     total_container_weight = sum(maxmember)
 *                     default_proportions = np.array([m/total_container_weight for m in maxmember], dtype=np.float32)
 *                     proportions = np.zeros(shape=(len(containers), element.all.shape[0]), dtype=np.float32)             # <<<<<<<<<<<<<<
 *                     for i in range(len(container_indices)):
 *                         c = container_indices[i]
 */
        __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 223, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 223, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 223, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (unlikely(__pyx_v_containers == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
          __PYX_ERR(0, 223, __pyx_L1_error)
        }
        __pyx_t_16 = PySet_GET_SIZE(__pyx_v_containers); if (unlikely(__pyx_t_16 == ((Py_ssize_t)-1))) __PYX_ERR(0, 223, __pyx_L1_error)
        __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_16); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 223, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_element->all->dimensions[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 223, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 223, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_1);
        PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_1);
        __pyx_t_4 = 0;
        __pyx_t_1 = 0;
        if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_shape, __pyx_t_13) < 0) __PYX_ERR(0, 223, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_np); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 223, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_float32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 223, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 223, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 223, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 223, __pyx_L1_error)
        __Pyx_XDECREF_SET(__pyx_v_proportions, ((PyArrayObject *)__pyx_t_1));
        __pyx_t_1 = 0;

        /* "_element_graph.pyx":224
 *                     default_proportions = np.array([m/total_container_weight for m in maxmember], dtype=np.float32)
 *                     proportions = np.zeros(shape=(len(containers), element.all.shape[0]), dtype=np.float32)
 *                     for i in range(len(container_indices)):             # <<<<<<<<<<<<<<
 *                         c = container_indices[i]
 *                         proportions[i,:] = self.normalize(self.elements[c].source_weights)*default_proportions[i]
 */
        if (unlikely(__pyx_v_container_indices == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
          __PYX_ERR(0, 224, __pyx_L1_error)
        }
        __pyx_t_16 = PyList_GET_SIZE(__pyx_v_container_indices); if (unlikely(__pyx_t_16 == ((Py_ssize_t)-1))) __PYX_ERR(0, 224, __pyx_L1_error)
        __pyx_t_9 = __pyx_t_16;
        for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_9; __pyx_t_17+=1) {
          __pyx_v_i = __pyx_t_17;

          /* "_element_graph.pyx":225
 *                     proportions = np.zeros(shape=(len(containers), element.all.shape[0]), dtype=np.float32)
 *                     for i in range(len(container_indices)):
 *                         c = container_indices[i]             # <<<<<<<<<<<<<<
 *                         proportions[i,:] = self.normalize(self.elements[c].source_weights)*default_proportions[i]
 * 
 */
          if (unlikely(__pyx_v_container_indices == Py_None)) {
            PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
            __PYX_ERR(0, 225, __pyx_L1_error)
          }
          __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_container_indices, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 225, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_19 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_19 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 225, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_v_c = __pyx_t_19;

          /* "_element_graph.pyx":226
 *                     for i in range(len(container_indices)):
 *                         c = container_indices[i]
 *                         proportions[i,:] = self.normalize(self.elements[c].source_weights)*default_proportions[i]             # <<<<<<<<<<<<<<
 * 
 *                     for i in range(element.all.shape[0]):
 */
          if (unlikely(__pyx_v_self->elements == Py_None)) {
            PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
            __PYX_ERR(0, 226, __pyx_L1_error)
          }
          __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_self->elements, __pyx_v_c, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 226, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_source_weights); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 226, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          if (!(likely(((__pyx_t_11) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_11, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 226, __pyx_L1_error)
          __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_14_element_graph_ElementGraph *)__pyx_v_self->__pyx_vtab)->normalize(__pyx_v_self, ((PyArrayObject *)__pyx_t_11), 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 226, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __pyx_t_11 = __Pyx_GetItemInt(((PyObject *)__pyx_v_default_proportions), __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 226, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_11);
          __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 226, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __pyx_t_11 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 226, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_11);
          __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 226, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_GIVEREF(__pyx_t_11);
          PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_11);
          __Pyx_INCREF(__pyx_slice_);
          __Pyx_GIVEREF(__pyx_slice_);
          PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_slice_);
          __pyx_t_11 = 0;
          if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_proportions), __pyx_t_1, __pyx_t_3) < 0)) __PYX_ERR(0, 226, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        }

        /* "_element_graph.pyx":228
 *                         proportions[i,:] = self.normalize(self.elements[c].source_weights)*default_proportions[i]
 * 
 *                     for i in range(element.all.shape[0]):             # <<<<<<<<<<<<<<
 *                         if np.sum(proportions[:,i]) == 0:
 *                             proportions[:,i] = default_proportions
 */
        __pyx_t_20 = (__pyx_v_element->all->dimensions[0]);
        __pyx_t_21 = __pyx_t_20;
        for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_21; __pyx_t_16+=1) {
          __pyx_v_i = __pyx_t_16;

          /* "_element_graph.pyx":229
 * 
 *                     for i in range(element.all.shape[0]):
 *                         if np.sum(proportions[:,i]) == 0:             # <<<<<<<<<<<<<<
 *                             proportions[:,i] = default_proportions
 *                         else:
 */
          __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sum); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 229, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 229, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_INCREF(__pyx_slice_);
          __Pyx_GIVEREF(__pyx_slice_);
          PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_slice_);
          __Pyx_GIVEREF(__pyx_t_1);
          PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_1);
          __pyx_t_1 = 0;
          __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_proportions), __pyx_t_13); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __pyx_t_13 = NULL;
          if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
            __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_11);
            if (likely(__pyx_t_13)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
              __Pyx_INCREF(__pyx_t_13);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_11, function);
            }
          }
          __pyx_t_3 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_13, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_1);
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 229, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __pyx_t_11 = __Pyx_PyInt_EqObjC(__pyx_t_3, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 229, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 229, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          if (__pyx_t_6) {

            /* "_element_graph.pyx":230
 *                     for i in range(element.all.shape[0]):
 *                         if np.sum(proportions[:,i]) == 0:
 *                             proportions[:,i] = default_proportions             # <<<<<<<<<<<<<<
 *                         else:
 *                             proportions[:,i] = self.normalize(proportions[:,i])
 */
            __pyx_t_11 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 230, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_11);
            __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 230, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_INCREF(__pyx_slice_);
            __Pyx_GIVEREF(__pyx_slice_);
            PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_slice_);
            __Pyx_GIVEREF(__pyx_t_11);
            PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_11);
            __pyx_t_11 = 0;
            if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_proportions), __pyx_t_3, ((PyObject *)__pyx_v_default_proportions)) < 0)) __PYX_ERR(0, 230, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

            /* "_element_graph.pyx":229
 * 
 *                     for i in range(element.all.shape[0]):
 *                         if np.sum(proportions[:,i]) == 0:             # <<<<<<<<<<<<<<
 *                             proportions[:,i] = default_proportions
 *                         else:
 */
            goto __pyx_L32;
          }

          /* "_element_graph.pyx":232
 *                             proportions[:,i] = default_proportions
 *                         else:
 *                             proportions[:,i] = self.normalize(proportions[:,i])             # <<<<<<<<<<<<<<
 * 
 *                     for i in range(len(container_indices)):
 */
          /*else*/ {
            __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 232, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 232, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_11);
            __Pyx_INCREF(__pyx_slice_);
            __Pyx_GIVEREF(__pyx_slice_);
            PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_slice_);
            __Pyx_GIVEREF(__pyx_t_3);
            PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_3);
            __pyx_t_3 = 0;
            __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_proportions), __pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 232, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 232, __pyx_L1_error)
            __pyx_t_11 = ((PyObject *)((struct __pyx_vtabstruct_14_element_graph_ElementGraph *)__pyx_v_self->__pyx_vtab)->normalize(__pyx_v_self, ((PyArrayObject *)__pyx_t_3), 0)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 232, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_11);
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 232, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_INCREF(__pyx_slice_);
            __Pyx_GIVEREF(__pyx_slice_);
            PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_slice_);
            __Pyx_GIVEREF(__pyx_t_3);
            PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
            __pyx_t_3 = 0;
            if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_proportions), __pyx_t_1, __pyx_t_11) < 0)) __PYX_ERR(0, 232, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          }
          __pyx_L32:;
        }

        /* "_element_graph.pyx":234
 *                             proportions[:,i] = self.normalize(proportions[:,i])
 * 
 *                     for i in range(len(container_indices)):             # <<<<<<<<<<<<<<
 *                         self.elements[container_indices[i]].merge(element, proportions[i,:])
 * 
 */
        if (unlikely(__pyx_v_container_indices == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
          __PYX_ERR(0, 234, __pyx_L1_error)
        }
        __pyx_t_16 = PyList_GET_SIZE(__pyx_v_container_indices); if (unlikely(__pyx_t_16 == ((Py_ssize_t)-1))) __PYX_ERR(0, 234, __pyx_L1_error)
        __pyx_t_9 = __pyx_t_16;
        for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_9; __pyx_t_17+=1) {
          __pyx_v_i = __pyx_t_17;

          /* "_element_graph.pyx":235
 * 
 *                     for i in range(len(container_indices)):
 *                         self.elements[container_indices[i]].merge(element, proportions[i,:])             # <<<<<<<<<<<<<<
 * 
 *                 self.zero_element(resolve)
 */
          if (unlikely(__pyx_v_self->elements == Py_None)) {
            PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
            __PYX_ERR(0, 235, __pyx_L1_error)
          }
          if (unlikely(__pyx_v_container_indices == Py_None)) {
            PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
            __PYX_ERR(0, 235, __pyx_L1_error)
          }
          __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_container_indices, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_self->elements, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 235, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_merge); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 235, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 235, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_3);
          __Pyx_INCREF(__pyx_slice_);
          __Pyx_GIVEREF(__pyx_slice_);
          PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_slice_);
          __pyx_t_3 = 0;
          __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_proportions), __pyx_t_13); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 235, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __pyx_t_13 = NULL;
          __pyx_t_7 = 0;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
            __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_1);
            if (likely(__pyx_t_13)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
              __Pyx_INCREF(__pyx_t_13);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_1, function);
              __pyx_t_7 = 1;
            }
          }
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_1)) {
            PyObject *__pyx_temp[3] = {__pyx_t_13, ((PyObject *)__pyx_v_element), __pyx_t_3};
            __pyx_t_11 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 235, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
            __Pyx_GOTREF(__pyx_t_11);
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
            PyObject *__pyx_temp[3] = {__pyx_t_13, ((PyObject *)__pyx_v_element), __pyx_t_3};
            __pyx_t_11 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 235, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
            __Pyx_GOTREF(__pyx_t_11);
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          } else
          #endif
          {
            __pyx_t_4 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 235, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            if (__pyx_t_13) {
              __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_13); __pyx_t_13 = NULL;
            }
            __Pyx_INCREF(((PyObject *)__pyx_v_element));
            __Pyx_GIVEREF(((PyObject *)__pyx_v_element));
            PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_7, ((PyObject *)__pyx_v_element));
            __Pyx_GIVEREF(__pyx_t_3);
            PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_7, __pyx_t_3);
            __pyx_t_3 = 0;
            __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 235, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_11);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          }
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        }
      }
      __pyx_L23:;

      /* "_element_graph.pyx":237
 *                         self.elements[container_indices[i]].merge(element, proportions[i,:])
 * 
 *                 self.zero_element(resolve)             # <<<<<<<<<<<<<<
 *                 zeros.add(resolve)
 * 
 */
      ((struct __pyx_vtabstruct_14_element_graph_ElementGraph *)__pyx_v_self->__pyx_vtab)->zero_element(__pyx_v_self, __pyx_v_resolve, 0);

      /* "_element_graph.pyx":238
 * 
 *                 self.zero_element(resolve)
 *                 zeros.add(resolve)             # <<<<<<<<<<<<<<
 * 
 *     cpdef void zero_element(self, int index):
 */
      __pyx_t_11 = PyInt_FromSsize_t(__pyx_v_resolve); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 238, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_14 = PySet_Add(__pyx_v_zeros, __pyx_t_11); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 238, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

      /* "_element_graph.pyx":215
 * 
 *             incompatible.difference_update(element.excludes|zeros)
 *             if len(incompatible) == 0: # Special case, all weight goes to containers             # <<<<<<<<<<<<<<
 *                 if len(containers) == 1:
 *                     self.elements[containers.pop()].merge(element, element.all)
 */
    }

    /* "_element_graph.pyx":205
 *         contained = [i for i in range(self.number_of_elements) if len(self.elements[i].contained)>0] # Identify reads that are contained
 *         resolve_order = [sorttuple[2] for sorttuple in sorted([(-self.elements[c].IC, len(self.elements[c].contained), c) for c in contained])] # Rank them by decreasing number of members
 *         for resolve in resolve_order:             # <<<<<<<<<<<<<<
 *             element = self.elements[resolve]
 *             if element.cov == 0:continue
 */
    __pyx_L17_continue:;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "_element_graph.pyx":187
 *             self.assign_weights()
 * 
 *     cpdef void resolve_containment(self):             # <<<<<<<<<<<<<<
 *         """Given a overlap matrix, 'bubble up' the weight of
 *         all reads that have one or more 'contained by' relationships
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_WriteUnraisable("_element_graph.ElementGraph.resolve_containment", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_default_proportions);
  __Pyx_XDECREF((PyObject *)__pyx_v_proportions);
  __Pyx_XDECREF(__pyx_v_contained);
  __Pyx_XDECREF(__pyx_v_resolve_order);
  __Pyx_XDECREF(__pyx_v_container_indices);
  __Pyx_XDECREF(__pyx_v_maxmember);
  __Pyx_XDECREF(__pyx_v_zeros);
  __Pyx_XDECREF(__pyx_v_containers);
  __Pyx_XDECREF(__pyx_v_incompatible);
  __Pyx_XDECREF((PyObject *)__pyx_v_element);
  __Pyx_XDECREF((PyObject *)__pyx_8genexpr3__pyx_v_element);
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_7resolve_containment(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_14_element_graph_12ElementGraph_6resolve_containment[] = "Given a overlap matrix, 'bubble up' the weight of\n        all reads that have one or more 'contained by' relationships\n        to other reads. Pass from highest complexity reads down, assigning\n        weight proportional to the existing weight.\n        The resulting matrix should contain only overlaps, exclusions, and unknowns.";
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_7resolve_containment(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("resolve_containment (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_6resolve_containment(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self));

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

static PyObject *__pyx_pf_14_element_graph_12ElementGraph_6resolve_containment(struct __pyx_obj_14_element_graph_ElementGraph *__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("resolve_containment", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_14_element_graph_12ElementGraph_resolve_containment(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "_element_graph.pyx":240
 *                 zeros.add(resolve)
 * 
 *     cpdef void zero_element(self, int index):             # <<<<<<<<<<<<<<
 *         """Given an element's index, remove all references to it without
 *         deleting it from the list of elements."""
 */

static PyObject *__pyx_pw_14_element_graph_12ElementGraph_9zero_element(PyObject *__pyx_v_self, PyObject *__pyx_arg_index); /*proto*/
static void __pyx_f_14_element_graph_12ElementGraph_zero_element(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, int __pyx_v_index, int __pyx_skip_dispatch) {
  struct __pyx_obj_14_element_graph_Element *__pyx_v_element = 0;
  PyObject *__pyx_v_e = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zero_element", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_zero_element); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_14_element_graph_12ElementGraph_9zero_element)) {
        __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 240, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
          }
        }
        __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
        __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, 240, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "_element_graph.pyx":244
 *         deleting it from the list of elements."""
 *         cdef Element element
 *         self.assignments[index] = -1             # <<<<<<<<<<<<<<
 *         element = self.elements[index]
 *         element.cov = 0
 */
  if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_self->assignments), __pyx_v_index, __pyx_int_neg_1, int, 1, __Pyx_PyInt_From_int, 0, 1, 1) < 0)) __PYX_ERR(0, 244, __pyx_L1_error)

  /* "_element_graph.pyx":245
 *         cdef Element element
 *         self.assignments[index] = -1
 *         element = self.elements[index]             # <<<<<<<<<<<<<<
 *         element.cov = 0
 *         element.bases = 0
 */
  if (unlikely(__pyx_v_self->elements == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(0, 245, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_self->elements, __pyx_v_index, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 245, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_14_element_graph_Element))))) __PYX_ERR(0, 245, __pyx_L1_error)
  __pyx_v_element = ((struct __pyx_obj_14_element_graph_Element *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "_element_graph.pyx":246
 *         self.assignments[index] = -1
 *         element = self.elements[index]
 *         element.cov = 0             # <<<<<<<<<<<<<<
 *         element.bases = 0
 *         element.source_weights -= element.source_weights
 */
  __pyx_v_element->cov = 0.0;

  /* "_element_graph.pyx":247
 *         element = self.elements[index]
 *         element.cov = 0
 *         element.bases = 0             # <<<<<<<<<<<<<<
 *         element.source_weights -= element.source_weights
 *         element.member_weights -= element.member_weights
 */
  __pyx_v_element->bases = 0.0;

  /* "_element_graph.pyx":248
 *         element.cov = 0
 *         element.bases = 0
 *         element.source_weights -= element.source_weights             # <<<<<<<<<<<<<<
 *         element.member_weights -= element.member_weights
 *         for e in self.elements:
 */
  __pyx_t_1 = PyNumber_InPlaceSubtract(((PyObject *)__pyx_v_element->source_weights), ((PyObject *)__pyx_v_element->source_weights)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 248, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 248, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_element->source_weights);
  __Pyx_DECREF(((PyObject *)__pyx_v_element->source_weights));
  __pyx_v_element->source_weights = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "_element_graph.pyx":249
 *         element.bases = 0
 *         element.source_weights -= element.source_weights
 *         element.member_weights -= element.member_weights             # <<<<<<<<<<<<<<
 *         for e in self.elements:
 *             e.ingroup.discard(index)
 */
  __pyx_t_1 = PyNumber_InPlaceSubtract(((PyObject *)__pyx_v_element->member_weights), ((PyObject *)__pyx_v_element->member_weights)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 249, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 249, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_element->member_weights);
  __Pyx_DECREF(((PyObject *)__pyx_v_element->member_weights));
  __pyx_v_element->member_weights = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "_element_graph.pyx":250
 *         element.source_weights -= element.source_weights
 *         element.member_weights -= element.member_weights
 *         for e in self.elements:             # <<<<<<<<<<<<<<
 *             e.ingroup.discard(index)
 *             e.outgroup.discard(index)
 */
  if (unlikely(__pyx_v_self->elements == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(0, 250, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_v_self->elements; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0;
  for (;;) {
    if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 250, __pyx_L1_error)
    #else
    __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 250, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_e, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "_element_graph.pyx":251
 *         element.member_weights -= element.member_weights
 *         for e in self.elements:
 *             e.ingroup.discard(index)             # <<<<<<<<<<<<<<
 *             e.outgroup.discard(index)
 *             e.contains.discard(index)
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_e, __pyx_n_s_ingroup); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 251, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_discard); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 251, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 251, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
    __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, 251, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "_element_graph.pyx":252
 *         for e in self.elements:
 *             e.ingroup.discard(index)
 *             e.outgroup.discard(index)             # <<<<<<<<<<<<<<
 *             e.contains.discard(index)
 *             e.contained.discard(index)
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_e, __pyx_n_s_outgroup); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 252, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_discard); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 252, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 252, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
    __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, 252, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "_element_graph.pyx":253
 *             e.ingroup.discard(index)
 *             e.outgroup.discard(index)
 *             e.contains.discard(index)             # <<<<<<<<<<<<<<
 *             e.contained.discard(index)
 *             e.includes.discard(index)
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_e, __pyx_n_s_contains); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 253, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_discard); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 253, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 253, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
    __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, 253, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "_element_graph.pyx":254
 *             e.outgroup.discard(index)
 *             e.contains.discard(index)
 *             e.contained.discard(index)             # <<<<<<<<<<<<<<
 *             e.includes.discard(index)
 *             e.excludes.discard(index)
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_e, __pyx_n_s_contained); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 254, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_discard); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 254, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 254, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
    __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, 254, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "_element_graph.pyx":255
 *             e.contains.discard(index)
 *             e.contained.discard(index)
 *             e.includes.discard(index)             # <<<<<<<<<<<<<<
 *             e.excludes.discard(index)
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_e, __pyx_n_s_includes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 255, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_discard); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 255, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 255, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
    __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, 255, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "_element_graph.pyx":256
 *             e.contained.discard(index)
 *             e.includes.discard(index)
 *             e.excludes.discard(index)             # <<<<<<<<<<<<<<
 * 
 *     cpdef void assign_weights(self):
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_e, __pyx_n_s_excludes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 256, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_discard); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 256, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 256, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
    __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, 256, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "_element_graph.pyx":250
 *         element.source_weights -= element.source_weights
 *         element.member_weights -= element.member_weights
 *         for e in self.elements:             # <<<<<<<<<<<<<<
 *             e.ingroup.discard(index)
 *             e.outgroup.discard(index)
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_element_graph.pyx":240
 *                 zeros.add(resolve)
 * 
 *     cpdef void zero_element(self, int index):             # <<<<<<<<<<<<<<
 *         """Given an element's index, remove all references to it without
 *         deleting it from the list of elements."""
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_WriteUnraisable("_element_graph.ElementGraph.zero_element", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_element);
  __Pyx_XDECREF(__pyx_v_e);
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_9zero_element(PyObject *__pyx_v_self, PyObject *__pyx_arg_index); /*proto*/
static char __pyx_doc_14_element_graph_12ElementGraph_8zero_element[] = "Given an element's index, remove all references to it without\n        deleting it from the list of elements.";
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_9zero_element(PyObject *__pyx_v_self, PyObject *__pyx_arg_index) {
  int __pyx_v_index;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("zero_element (wrapper)", 0);
  assert(__pyx_arg_index); {
    __pyx_v_index = __Pyx_PyInt_As_int(__pyx_arg_index); if (unlikely((__pyx_v_index == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 240, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("_element_graph.ElementGraph.zero_element", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_8zero_element(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self), ((int)__pyx_v_index));

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

static PyObject *__pyx_pf_14_element_graph_12ElementGraph_8zero_element(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, int __pyx_v_index) {
  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("zero_element", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_14_element_graph_12ElementGraph_zero_element(__pyx_v_self, __pyx_v_index, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "_element_graph.pyx":258
 *             e.excludes.discard(index)
 * 
 *     cpdef void assign_weights(self):             # <<<<<<<<<<<<<<
 *         """One round of Expectation Maximization:
 *         Given existing weights of Paths and all Element assignments,
 */

static PyObject *__pyx_pw_14_element_graph_12ElementGraph_11assign_weights(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static void __pyx_f_14_element_graph_12ElementGraph_assign_weights(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, int __pyx_skip_dispatch) {
  int __pyx_v_number_of_sources;
  PyObject *__pyx_v_assigned_to = 0;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  PyArrayObject *__pyx_v_priors = 0;
  PyArrayObject *__pyx_v_path_covs = 0;
  PyArrayObject *__pyx_v_sample_totals = 0;
  PyArrayObject *__pyx_v_proportions = 0;
  PyArrayObject *__pyx_v_cov_proportions = 0;
  PyArrayObject *__pyx_v_assignment_proportions = 0;
  struct __pyx_obj_14_element_graph_Element *__pyx_v_path = 0;
  struct __pyx_obj_14_element_graph_Element *__pyx_v_element = 0;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  PyObject *(*__pyx_t_11)(PyObject *);
  int __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  Py_ssize_t __pyx_t_14;
  float __pyx_t_15;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("assign_weights", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_assign_weights); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 258, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_14_element_graph_12ElementGraph_11assign_weights)) {
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 258, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "_element_graph.pyx":269
 *         cdef np.ndarray priors, path_covs, sample_totals, proportions, cov_proportions, assignment_proportions
 *         cdef Element path, element
 *         if len(self.paths) == 0:return             # <<<<<<<<<<<<<<
 *         number_of_sources = self.elements[0].source_weights.shape[0]
 *         priors = np.zeros(shape=(len(self.paths), number_of_sources))
 */
  __pyx_t_1 = __pyx_v_self->paths;
  __Pyx_INCREF(__pyx_t_1);
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(0, 269, __pyx_L1_error)
  }
  __pyx_t_5 = PyList_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 269, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = ((__pyx_t_5 == 0) != 0);
  if (__pyx_t_6) {
    goto __pyx_L0;
  }

  /* "_element_graph.pyx":270
 *         cdef Element path, element
 *         if len(self.paths) == 0:return
 *         number_of_sources = self.elements[0].source_weights.shape[0]             # <<<<<<<<<<<<<<
 *         priors = np.zeros(shape=(len(self.paths), number_of_sources))
 *         for i in range(len(self.paths)):
 */
  if (unlikely(__pyx_v_self->elements == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(0, 270, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_self->elements, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 270, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_source_weights); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 270, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 270, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 270, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 270, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_number_of_sources = __pyx_t_7;

  /* "_element_graph.pyx":271
 *         if len(self.paths) == 0:return
 *         number_of_sources = self.elements[0].source_weights.shape[0]
 *         priors = np.zeros(shape=(len(self.paths), number_of_sources))             # <<<<<<<<<<<<<<
 *         for i in range(len(self.paths)):
 *             priors[i,:] = self.paths[i].source_weights
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 271, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 271, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 271, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __pyx_v_self->paths;
  __Pyx_INCREF(__pyx_t_3);
  if (unlikely(__pyx_t_3 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(0, 271, __pyx_L1_error)
  }
  __pyx_t_5 = PyList_GET_SIZE(__pyx_t_3); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 271, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 271, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_number_of_sources); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 271, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 271, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_4);
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_shape, __pyx_t_8) < 0) __PYX_ERR(0, 271, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 271, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 271, __pyx_L1_error)
  __pyx_v_priors = ((PyArrayObject *)__pyx_t_8);
  __pyx_t_8 = 0;

  /* "_element_graph.pyx":272
 *         number_of_sources = self.elements[0].source_weights.shape[0]
 *         priors = np.zeros(shape=(len(self.paths), number_of_sources))
 *         for i in range(len(self.paths)):             # <<<<<<<<<<<<<<
 *             priors[i,:] = self.paths[i].source_weights
 *             self.paths[i].source_weights = np.zeros(shape=(number_of_sources), dtype=np.float32)
 */
  __pyx_t_8 = __pyx_v_self->paths;
  __Pyx_INCREF(__pyx_t_8);
  if (unlikely(__pyx_t_8 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(0, 272, __pyx_L1_error)
  }
  __pyx_t_5 = PyList_GET_SIZE(__pyx_t_8); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 272, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_9 = __pyx_t_5;
  for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
    __pyx_v_i = __pyx_t_10;

    /* "_element_graph.pyx":273
 *         priors = np.zeros(shape=(len(self.paths), number_of_sources))
 *         for i in range(len(self.paths)):
 *             priors[i,:] = self.paths[i].source_weights             # <<<<<<<<<<<<<<
 *             self.paths[i].source_weights = np.zeros(shape=(number_of_sources), dtype=np.float32)
 * 
 */
    if (unlikely(__pyx_v_self->paths == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 273, __pyx_L1_error)
    }
    __pyx_t_8 = __Pyx_GetItemInt_List(__pyx_v_self->paths, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 273, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_source_weights); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 273, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 273, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 273, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_8);
    __Pyx_INCREF(__pyx_slice_);
    __Pyx_GIVEREF(__pyx_slice_);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_slice_);
    __pyx_t_8 = 0;
    if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_priors), __pyx_t_1, __pyx_t_2) < 0)) __PYX_ERR(0, 273, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "_element_graph.pyx":274
 *         for i in range(len(self.paths)):
 *             priors[i,:] = self.paths[i].source_weights
 *             self.paths[i].source_weights = np.zeros(shape=(number_of_sources), dtype=np.float32)             # <<<<<<<<<<<<<<
 * 
 *         path_covs = np.sum(priors, axis=1, keepdims=True)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 274, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 274, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 274, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_number_of_sources); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 274, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_shape, __pyx_t_8) < 0) __PYX_ERR(0, 274, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 274, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float32); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 274, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 274, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 274, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(__pyx_v_self->paths == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 274, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_self->paths, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 274, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_PyObject_SetAttrStr(__pyx_t_2, __pyx_n_s_source_weights, __pyx_t_4) < 0) __PYX_ERR(0, 274, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }

  /* "_element_graph.pyx":276
 *             self.paths[i].source_weights = np.zeros(shape=(number_of_sources), dtype=np.float32)
 * 
 *         path_covs = np.sum(priors, axis=1, keepdims=True)             # <<<<<<<<<<<<<<
 *         cov_proportions = path_covs/np.sum(path_covs)
 *         sample_totals = np.sum(priors, axis=0)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 276, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_sum); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 276, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 276, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_v_priors));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_priors));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_priors));
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 276, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_axis, __pyx_int_1) < 0) __PYX_ERR(0, 276, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_keepdims, Py_True) < 0) __PYX_ERR(0, 276, __pyx_L1_error)
  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 276, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 276, __pyx_L1_error)
  __pyx_v_path_covs = ((PyArrayObject *)__pyx_t_8);
  __pyx_t_8 = 0;

  /* "_element_graph.pyx":277
 * 
 *         path_covs = np.sum(priors, axis=1, keepdims=True)
 *         cov_proportions = path_covs/np.sum(path_covs)             # <<<<<<<<<<<<<<
 *         sample_totals = np.sum(priors, axis=0)
 *         proportions = np.full(shape=(len(self.paths), number_of_sources), fill_value=cov_proportions)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 277, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sum); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 277, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_8 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_1, ((PyObject *)__pyx_v_path_covs)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_path_covs));
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 277, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyNumber_Divide(((PyObject *)__pyx_v_path_covs), __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 277, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 277, __pyx_L1_error)
  __pyx_v_cov_proportions = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "_element_graph.pyx":278
 *         path_covs = np.sum(priors, axis=1, keepdims=True)
 *         cov_proportions = path_covs/np.sum(path_covs)
 *         sample_totals = np.sum(priors, axis=0)             # <<<<<<<<<<<<<<
 *         proportions = np.full(shape=(len(self.paths), number_of_sources), fill_value=cov_proportions)
 *         for i in np.where(sample_totals > 0)[0]:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 278, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_sum); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 278, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 278, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_v_priors));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_priors));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_priors));
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 278, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_axis, __pyx_int_0) < 0) __PYX_ERR(0, 278, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 278, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 278, __pyx_L1_error)
  __pyx_v_sample_totals = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "_element_graph.pyx":279
 *         cov_proportions = path_covs/np.sum(path_covs)
 *         sample_totals = np.sum(priors, axis=0)
 *         proportions = np.full(shape=(len(self.paths), number_of_sources), fill_value=cov_proportions)             # <<<<<<<<<<<<<<
 *         for i in np.where(sample_totals > 0)[0]:
 *             proportions[:,i] = priors[:,i]/sample_totals[i]
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 279, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_full); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 279, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 279, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __pyx_v_self->paths;
  __Pyx_INCREF(__pyx_t_2);
  if (unlikely(__pyx_t_2 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(0, 279, __pyx_L1_error)
  }
  __pyx_t_5 = PyList_GET_SIZE(__pyx_t_2); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 279, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 279, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_number_of_sources); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 279, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 279, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_8);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_8);
  __pyx_t_2 = 0;
  __pyx_t_8 = 0;
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_shape, __pyx_t_3) < 0) __PYX_ERR(0, 279, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_fill_value, ((PyObject *)__pyx_v_cov_proportions)) < 0) __PYX_ERR(0, 279, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 279, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 279, __pyx_L1_error)
  __pyx_v_proportions = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "_element_graph.pyx":280
 *         sample_totals = np.sum(priors, axis=0)
 *         proportions = np.full(shape=(len(self.paths), number_of_sources), fill_value=cov_proportions)
 *         for i in np.where(sample_totals > 0)[0]:             # <<<<<<<<<<<<<<
 *             proportions[:,i] = priors[:,i]/sample_totals[i]
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_where); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_RichCompare(((PyObject *)__pyx_v_sample_totals), __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 280, __pyx_L1_error)
  __pyx_t_8 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_3 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_8, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4);
  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0;
    __pyx_t_11 = NULL;
  } else {
    __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 280, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_11 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 280, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_11)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 280, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 280, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 280, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 280, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_11(__pyx_t_3);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 280, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 280, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_i = __pyx_t_9;

    /* "_element_graph.pyx":281
 *         proportions = np.full(shape=(len(self.paths), number_of_sources), fill_value=cov_proportions)
 *         for i in np.where(sample_totals > 0)[0]:
 *             proportions[:,i] = priors[:,i]/sample_totals[i]             # <<<<<<<<<<<<<<
 * 
 *         for i in np.argsort(self.assignments): # Assign FULL weight of each assigned element
 */
    __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 281, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 281, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_slice_);
    __Pyx_GIVEREF(__pyx_slice_);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_slice_);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_priors), __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 281, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_GetItemInt(((PyObject *)__pyx_v_sample_totals), __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 281, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_8 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 281, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 281, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 281, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_slice_);
    __Pyx_GIVEREF(__pyx_slice_);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_slice_);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
    __pyx_t_4 = 0;
    if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_proportions), __pyx_t_1, __pyx_t_8) < 0)) __PYX_ERR(0, 281, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "_element_graph.pyx":280
 *         sample_totals = np.sum(priors, axis=0)
 *         proportions = np.full(shape=(len(self.paths), number_of_sources), fill_value=cov_proportions)
 *         for i in np.where(sample_totals > 0)[0]:             # <<<<<<<<<<<<<<
 *             proportions[:,i] = priors[:,i]/sample_totals[i]
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "_element_graph.pyx":283
 *             proportions[:,i] = priors[:,i]/sample_totals[i]
 * 
 *         for i in np.argsort(self.assignments): # Assign FULL weight of each assigned element             # <<<<<<<<<<<<<<
 *             if self.assignments[i] <= 0: continue
 *             element = self.elements[i]
 */
  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 283, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_argsort); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 283, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_3 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_8, ((PyObject *)__pyx_v_self->assignments)) : __Pyx_PyObject_CallOneArg(__pyx_t_1, ((PyObject *)__pyx_v_self->assignments));
  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 283, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
    __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 0;
    __pyx_t_11 = NULL;
  } else {
    __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 283, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_11 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 283, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  for (;;) {
    if (likely(!__pyx_t_11)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 283, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 283, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      } else {
        if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 283, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 283, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      }
    } else {
      __pyx_t_3 = __pyx_t_11(__pyx_t_1);
      if (unlikely(!__pyx_t_3)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 283, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 283, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_i = __pyx_t_9;

    /* "_element_graph.pyx":284
 * 
 *         for i in np.argsort(self.assignments): # Assign FULL weight of each assigned element
 *             if self.assignments[i] <= 0: continue             # <<<<<<<<<<<<<<
 *             element = self.elements[i]
 *             if self.assignments[i] == 1: # No proportions needed, assign all weight to 1 path
 */
    __pyx_t_3 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->assignments), __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 284, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = PyObject_RichCompare(__pyx_t_3, __pyx_int_0, Py_LE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 284, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 284, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (__pyx_t_6) {
      goto __pyx_L8_continue;
    }

    /* "_element_graph.pyx":285
 *         for i in np.argsort(self.assignments): # Assign FULL weight of each assigned element
 *             if self.assignments[i] <= 0: continue
 *             element = self.elements[i]             # <<<<<<<<<<<<<<
 *             if self.assignments[i] == 1: # No proportions needed, assign all weight to 1 path
 *                 self.paths[list(element.assigned_to)[0]].source_weights += element.source_weights * element.length
 */
    if (unlikely(__pyx_v_self->elements == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 285, __pyx_L1_error)
    }
    __pyx_t_8 = __Pyx_GetItemInt_List(__pyx_v_self->elements, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 285, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_14_element_graph_Element))))) __PYX_ERR(0, 285, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_element, ((struct __pyx_obj_14_element_graph_Element *)__pyx_t_8));
    __pyx_t_8 = 0;

    /* "_element_graph.pyx":286
 *             if self.assignments[i] <= 0: continue
 *             element = self.elements[i]
 *             if self.assignments[i] == 1: # No proportions needed, assign all weight to 1 path             # <<<<<<<<<<<<<<
 *                 self.paths[list(element.assigned_to)[0]].source_weights += element.source_weights * element.length
 *             else: # Assigned paths must compete for element's source_weights
 */
    __pyx_t_8 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->assignments), __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 286, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_3 = __Pyx_PyInt_EqObjC(__pyx_t_8, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 286, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 286, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_6) {

      /* "_element_graph.pyx":287
 *             element = self.elements[i]
 *             if self.assignments[i] == 1: # No proportions needed, assign all weight to 1 path
 *                 self.paths[list(element.assigned_to)[0]].source_weights += element.source_weights * element.length             # <<<<<<<<<<<<<<
 *             else: # Assigned paths must compete for element's source_weights
 *                 assigned_to = sorted(element.assigned_to)
 */
      if (unlikely(__pyx_v_self->paths == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(0, 287, __pyx_L1_error)
      }
      __pyx_t_3 = PySequence_List(__pyx_v_element->assigned_to); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 287, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_8 = __Pyx_GetItemInt_List(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 287, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_self->paths, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 287, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_source_weights); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 287, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_element->length); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 287, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_2 = PyNumber_Multiply(((PyObject *)__pyx_v_element->source_weights), __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 287, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_8, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 287, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (__Pyx_PyObject_SetAttrStr(__pyx_t_3, __pyx_n_s_source_weights, __pyx_t_4) < 0) __PYX_ERR(0, 287, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "_element_graph.pyx":286
 *             if self.assignments[i] <= 0: continue
 *             element = self.elements[i]
 *             if self.assignments[i] == 1: # No proportions needed, assign all weight to 1 path             # <<<<<<<<<<<<<<
 *                 self.paths[list(element.assigned_to)[0]].source_weights += element.source_weights * element.length
 *             else: # Assigned paths must compete for element's source_weights
 */
      goto __pyx_L11;
    }

    /* "_element_graph.pyx":289
 *                 self.paths[list(element.assigned_to)[0]].source_weights += element.source_weights * element.length
 *             else: # Assigned paths must compete for element's source_weights
 *                 assigned_to = sorted(element.assigned_to)             # <<<<<<<<<<<<<<
 *                 assignment_proportions = proportions[assigned_to,:]
 *                 assignment_proportions = np.apply_along_axis(self.normalize, 0, assignment_proportions)
 */
    /*else*/ {
      __pyx_t_4 = __pyx_v_element->assigned_to;
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_2 = PySequence_List(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 289, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_3 = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_12 = PyList_Sort(__pyx_t_3); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 289, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_assigned_to, ((PyObject*)__pyx_t_3));
      __pyx_t_3 = 0;

      /* "_element_graph.pyx":290
 *             else: # Assigned paths must compete for element's source_weights
 *                 assigned_to = sorted(element.assigned_to)
 *                 assignment_proportions = proportions[assigned_to,:]             # <<<<<<<<<<<<<<
 *                 assignment_proportions = np.apply_along_axis(self.normalize, 0, assignment_proportions)
 *                 for j in range(len(assigned_to)):
 */
      __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 290, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_v_assigned_to);
      __Pyx_GIVEREF(__pyx_v_assigned_to);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_assigned_to);
      __Pyx_INCREF(__pyx_slice_);
      __Pyx_GIVEREF(__pyx_slice_);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_slice_);
      __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_proportions), __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 290, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 290, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_assignment_proportions, ((PyArrayObject *)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "_element_graph.pyx":291
 *                 assigned_to = sorted(element.assigned_to)
 *                 assignment_proportions = proportions[assigned_to,:]
 *                 assignment_proportions = np.apply_along_axis(self.normalize, 0, assignment_proportions)             # <<<<<<<<<<<<<<
 *                 for j in range(len(assigned_to)):
 *                     path = self.paths[assigned_to[j]]
 */
      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 291, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_apply_along_axis); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 291, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_normalize); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 291, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_8 = NULL;
      __pyx_t_7 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_7 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[4] = {__pyx_t_8, __pyx_t_3, __pyx_int_0, ((PyObject *)__pyx_v_assignment_proportions)};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 291, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[4] = {__pyx_t_8, __pyx_t_3, __pyx_int_0, ((PyObject *)__pyx_v_assignment_proportions)};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 291, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else
      #endif
      {
        __pyx_t_13 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 291, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        if (__pyx_t_8) {
          __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_8); __pyx_t_8 = NULL;
        }
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_7, __pyx_t_3);
        __Pyx_INCREF(__pyx_int_0);
        __Pyx_GIVEREF(__pyx_int_0);
        PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_7, __pyx_int_0);
        __Pyx_INCREF(((PyObject *)__pyx_v_assignment_proportions));
        __Pyx_GIVEREF(((PyObject *)__pyx_v_assignment_proportions));
        PyTuple_SET_ITEM(__pyx_t_13, 2+__pyx_t_7, ((PyObject *)__pyx_v_assignment_proportions));
        __pyx_t_3 = 0;
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_13, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 291, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 291, __pyx_L1_error)
      __Pyx_DECREF_SET(__pyx_v_assignment_proportions, ((PyArrayObject *)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "_element_graph.pyx":292
 *                 assignment_proportions = proportions[assigned_to,:]
 *                 assignment_proportions = np.apply_along_axis(self.normalize, 0, assignment_proportions)
 *                 for j in range(len(assigned_to)):             # <<<<<<<<<<<<<<
 *                     path = self.paths[assigned_to[j]]
 *                     path.source_weights += element.source_weights * element.length * assignment_proportions[j,:]
 */
      if (unlikely(__pyx_v_assigned_to == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
        __PYX_ERR(0, 292, __pyx_L1_error)
      }
      __pyx_t_9 = PyList_GET_SIZE(__pyx_v_assigned_to); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 292, __pyx_L1_error)
      __pyx_t_10 = __pyx_t_9;
      for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_10; __pyx_t_14+=1) {
        __pyx_v_j = __pyx_t_14;

        /* "_element_graph.pyx":293
 *                 assignment_proportions = np.apply_along_axis(self.normalize, 0, assignment_proportions)
 *                 for j in range(len(assigned_to)):
 *                     path = self.paths[assigned_to[j]]             # <<<<<<<<<<<<<<
 *                     path.source_weights += element.source_weights * element.length * assignment_proportions[j,:]
 * 
 */
        if (unlikely(__pyx_v_self->paths == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 293, __pyx_L1_error)
        }
        if (unlikely(__pyx_v_assigned_to == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 293, __pyx_L1_error)
        }
        __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_assigned_to, __pyx_v_j, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 293, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_self->paths, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 293, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_14_element_graph_Element))))) __PYX_ERR(0, 293, __pyx_L1_error)
        __Pyx_XDECREF_SET(__pyx_v_path, ((struct __pyx_obj_14_element_graph_Element *)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "_element_graph.pyx":294
 *                 for j in range(len(assigned_to)):
 *                     path = self.paths[assigned_to[j]]
 *                     path.source_weights += element.source_weights * element.length * assignment_proportions[j,:]             # <<<<<<<<<<<<<<
 * 
 *         for path in self.paths: # Update path source_weights
 */
        __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_element->length); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 294, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_2 = PyNumber_Multiply(((PyObject *)__pyx_v_element->source_weights), __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 294, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_j); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 294, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 294, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_4);
        __Pyx_INCREF(__pyx_slice_);
        __Pyx_GIVEREF(__pyx_slice_);
        PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_slice_);
        __pyx_t_4 = 0;
        __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_assignment_proportions), __pyx_t_13); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 294, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_t_13 = PyNumber_Multiply(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 294, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = PyNumber_InPlaceAdd(((PyObject *)__pyx_v_path->source_weights), __pyx_t_13); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 294, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 294, __pyx_L1_error)
        __Pyx_GIVEREF(__pyx_t_4);
        __Pyx_GOTREF(__pyx_v_path->source_weights);
        __Pyx_DECREF(((PyObject *)__pyx_v_path->source_weights));
        __pyx_v_path->source_weights = ((PyArrayObject *)__pyx_t_4);
        __pyx_t_4 = 0;
      }
    }
    __pyx_L11:;

    /* "_element_graph.pyx":283
 *             proportions[:,i] = priors[:,i]/sample_totals[i]
 * 
 *         for i in np.argsort(self.assignments): # Assign FULL weight of each assigned element             # <<<<<<<<<<<<<<
 *             if self.assignments[i] <= 0: continue
 *             element = self.elements[i]
 */
    __pyx_L8_continue:;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_element_graph.pyx":296
 *                     path.source_weights += element.source_weights * element.length * assignment_proportions[j,:]
 * 
 *         for path in self.paths: # Update path source_weights             # <<<<<<<<<<<<<<
 *             path.source_weights /= path.length
 *             path.bases = sum(path.source_weights)*path.length
 */
  if (unlikely(__pyx_v_self->paths == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(0, 296, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_v_self->paths; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 0;
  for (;;) {
    if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_1)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 296, __pyx_L1_error)
    #else
    __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 296, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    #endif
    if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_14_element_graph_Element))))) __PYX_ERR(0, 296, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_path, ((struct __pyx_obj_14_element_graph_Element *)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "_element_graph.pyx":297
 * 
 *         for path in self.paths: # Update path source_weights
 *             path.source_weights /= path.length             # <<<<<<<<<<<<<<
 *             path.bases = sum(path.source_weights)*path.length
 * 
 */
    __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_path->length); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 297, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_13 = __Pyx_PyNumber_InPlaceDivide(((PyObject *)__pyx_v_path->source_weights), __pyx_t_4); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 297, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 297, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_13);
    __Pyx_GOTREF(__pyx_v_path->source_weights);
    __Pyx_DECREF(((PyObject *)__pyx_v_path->source_weights));
    __pyx_v_path->source_weights = ((PyArrayObject *)__pyx_t_13);
    __pyx_t_13 = 0;

    /* "_element_graph.pyx":298
 *         for path in self.paths: # Update path source_weights
 *             path.source_weights /= path.length
 *             path.bases = sum(path.source_weights)*path.length             # <<<<<<<<<<<<<<
 * 
 *     cpdef void assemble(self, float minimum_proportion, simplify=True):
 */
    __pyx_t_13 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, ((PyObject *)__pyx_v_path->source_weights)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 298, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_path->length); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 298, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = PyNumber_Multiply(__pyx_t_13, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 298, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_15 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_15 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 298, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_path->bases = __pyx_t_15;

    /* "_element_graph.pyx":296
 *                     path.source_weights += element.source_weights * element.length * assignment_proportions[j,:]
 * 
 *         for path in self.paths: # Update path source_weights             # <<<<<<<<<<<<<<
 *             path.source_weights /= path.length
 *             path.bases = sum(path.source_weights)*path.length
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_element_graph.pyx":258
 *             e.excludes.discard(index)
 * 
 *     cpdef void assign_weights(self):             # <<<<<<<<<<<<<<
 *         """One round of Expectation Maximization:
 *         Given existing weights of Paths and all Element assignments,
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_WriteUnraisable("_element_graph.ElementGraph.assign_weights", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_assigned_to);
  __Pyx_XDECREF((PyObject *)__pyx_v_priors);
  __Pyx_XDECREF((PyObject *)__pyx_v_path_covs);
  __Pyx_XDECREF((PyObject *)__pyx_v_sample_totals);
  __Pyx_XDECREF((PyObject *)__pyx_v_proportions);
  __Pyx_XDECREF((PyObject *)__pyx_v_cov_proportions);
  __Pyx_XDECREF((PyObject *)__pyx_v_assignment_proportions);
  __Pyx_XDECREF((PyObject *)__pyx_v_path);
  __Pyx_XDECREF((PyObject *)__pyx_v_element);
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_11assign_weights(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_14_element_graph_12ElementGraph_10assign_weights[] = "One round of Expectation Maximization: \n        Given existing weights of Paths and all Element assignments,\n        Set Path weights as sum of assigned Elements * proportion of\n        all weights of Paths that Element is assigned to.\n        Runs once at initialization and once after each round of find_optimal_path().";
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_11assign_weights(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("assign_weights (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_10assign_weights(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self));

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

static PyObject *__pyx_pf_14_element_graph_12ElementGraph_10assign_weights(struct __pyx_obj_14_element_graph_ElementGraph *__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("assign_weights", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_14_element_graph_12ElementGraph_assign_weights(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "_element_graph.pyx":300
 *             path.bases = sum(path.source_weights)*path.length
 * 
 *     cpdef void assemble(self, float minimum_proportion, simplify=True):             # <<<<<<<<<<<<<<
 *         """Iteratively perform find_optimal_path() on the graph
 *         until the number of novel reads fails to exceed minimum_proportion
 */

static PyObject *__pyx_pw_14_element_graph_12ElementGraph_13assemble(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_14_element_graph_12ElementGraph_assemble(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, float __pyx_v_minimum_proportion, int __pyx_skip_dispatch, struct __pyx_opt_args_14_element_graph_12ElementGraph_assemble *__pyx_optional_args) {
  PyObject *__pyx_v_simplify = ((PyObject *)Py_True);
  float __pyx_v_threshold;
  float __pyx_v_total_bases_assigned;
  float __pyx_v_novel_bases;
  struct __pyx_obj_14_element_graph_Element *__pyx_v_path = 0;
  PyObject *__pyx_8genexpr9__pyx_v_i = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  float __pyx_t_10;
  int __pyx_t_11;
  int __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("assemble", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_simplify = __pyx_optional_args->simplify;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_assemble); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 300, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_14_element_graph_12ElementGraph_13assemble)) {
        __pyx_t_3 = PyFloat_FromDouble(__pyx_v_minimum_proportion); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 300, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
        __pyx_t_6 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
            __pyx_t_6 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_3, __pyx_v_simplify};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 300, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_3, __pyx_v_simplify};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 300, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        {
          __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 300, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          if (__pyx_t_5) {
            __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_3);
          __Pyx_INCREF(__pyx_v_simplify);
          __Pyx_GIVEREF(__pyx_v_simplify);
          PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_simplify);
          __pyx_t_3 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 300, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        }
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "_element_graph.pyx":308
 *         cdef Element path
 * 
 *         total_bases_assigned = sum([self.elements[i].bases for i in np.where(self.assignments>0)[0]])             # <<<<<<<<<<<<<<
 *         threshold = self.bases*(1-minimum_proportion)
 *         while total_bases_assigned < threshold:
 */
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 308, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 308, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_where); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 308, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_RichCompare(((PyObject *)__pyx_v_self->assignments), __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 308, __pyx_L5_error)
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_4);
    __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, 308, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 308, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (likely(PyList_CheckExact(__pyx_t_7)) || PyTuple_CheckExact(__pyx_t_7)) {
      __pyx_t_2 = __pyx_t_7; __Pyx_INCREF(__pyx_t_2); __pyx_t_8 = 0;
      __pyx_t_9 = NULL;
    } else {
      __pyx_t_8 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 308, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_9 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 308, __pyx_L5_error)
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    for (;;) {
      if (likely(!__pyx_t_9)) {
        if (likely(PyList_CheckExact(__pyx_t_2))) {
          if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_7 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_7); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 308, __pyx_L5_error)
          #else
          __pyx_t_7 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 308, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_7);
          #endif
        } else {
          if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_7); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 308, __pyx_L5_error)
          #else
          __pyx_t_7 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 308, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_7);
          #endif
        }
      } else {
        __pyx_t_7 = __pyx_t_9(__pyx_t_2);
        if (unlikely(!__pyx_t_7)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 308, __pyx_L5_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_7);
      }
      __Pyx_XDECREF_SET(__pyx_8genexpr9__pyx_v_i, __pyx_t_7);
      __pyx_t_7 = 0;
      if (unlikely(__pyx_v_self->elements == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(0, 308, __pyx_L5_error)
      }
      __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_self->elements, __pyx_8genexpr9__pyx_v_i); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 308, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_bases); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 308, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 308, __pyx_L5_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_i); __pyx_8genexpr9__pyx_v_i = 0;
    goto __pyx_L8_exit_scope;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_i); __pyx_8genexpr9__pyx_v_i = 0;
    goto __pyx_L1_error;
    __pyx_L8_exit_scope:;
  } /* exit inner scope */
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 308, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_10 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_10 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 308, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_total_bases_assigned = __pyx_t_10;

  /* "_element_graph.pyx":309
 * 
 *         total_bases_assigned = sum([self.elements[i].bases for i in np.where(self.assignments>0)[0]])
 *         threshold = self.bases*(1-minimum_proportion)             # <<<<<<<<<<<<<<
 *         while total_bases_assigned < threshold:
 *             path = self.find_optimal_path(minimum_proportion)
 */
  __pyx_v_threshold = (__pyx_v_self->bases * (1.0 - __pyx_v_minimum_proportion));

  /* "_element_graph.pyx":310
 *         total_bases_assigned = sum([self.elements[i].bases for i in np.where(self.assignments>0)[0]])
 *         threshold = self.bases*(1-minimum_proportion)
 *         while total_bases_assigned < threshold:             # <<<<<<<<<<<<<<
 *             path = self.find_optimal_path(minimum_proportion)
 *             if path is self.emptyPath:
 */
  while (1) {
    __pyx_t_11 = ((__pyx_v_total_bases_assigned < __pyx_v_threshold) != 0);
    if (!__pyx_t_11) break;

    /* "_element_graph.pyx":311
 *         threshold = self.bases*(1-minimum_proportion)
 *         while total_bases_assigned < threshold:
 *             path = self.find_optimal_path(minimum_proportion)             # <<<<<<<<<<<<<<
 *             if path is self.emptyPath:
 *                 total_bases_assigned = threshold
 */
    __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_14_element_graph_ElementGraph *)__pyx_v_self->__pyx_vtab)->find_optimal_path(__pyx_v_self, __pyx_v_minimum_proportion, 0, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 311, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF_SET(__pyx_v_path, ((struct __pyx_obj_14_element_graph_Element *)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "_element_graph.pyx":312
 *         while total_bases_assigned < threshold:
 *             path = self.find_optimal_path(minimum_proportion)
 *             if path is self.emptyPath:             # <<<<<<<<<<<<<<
 *                 total_bases_assigned = threshold
 *             else:
 */
    __pyx_t_11 = (__pyx_v_path == __pyx_v_self->emptyPath);
    __pyx_t_12 = (__pyx_t_11 != 0);
    if (__pyx_t_12) {

      /* "_element_graph.pyx":313
 *             path = self.find_optimal_path(minimum_proportion)
 *             if path is self.emptyPath:
 *                 total_bases_assigned = threshold             # <<<<<<<<<<<<<<
 *             else:
 *                 novel_bases = self.add_path(path)
 */
      __pyx_v_total_bases_assigned = __pyx_v_threshold;

      /* "_element_graph.pyx":312
 *         while total_bases_assigned < threshold:
 *             path = self.find_optimal_path(minimum_proportion)
 *             if path is self.emptyPath:             # <<<<<<<<<<<<<<
 *                 total_bases_assigned = threshold
 *             else:
 */
      goto __pyx_L11;
    }

    /* "_element_graph.pyx":315
 *                 total_bases_assigned = threshold
 *             else:
 *                 novel_bases = self.add_path(path)             # <<<<<<<<<<<<<<
 *                 if novel_bases == 0 or np.max(self.assignments) >= self.max_isos:
 *                     total_bases_assigned = threshold
 */
    /*else*/ {
      __pyx_v_novel_bases = ((struct __pyx_vtabstruct_14_element_graph_ElementGraph *)__pyx_v_self->__pyx_vtab)->add_path(__pyx_v_self, __pyx_v_path, 0);

      /* "_element_graph.pyx":316
 *             else:
 *                 novel_bases = self.add_path(path)
 *                 if novel_bases == 0 or np.max(self.assignments) >= self.max_isos:             # <<<<<<<<<<<<<<
 *                     total_bases_assigned = threshold
 *                 else:
 */
      __pyx_t_11 = ((__pyx_v_novel_bases == 0.0) != 0);
      if (!__pyx_t_11) {
      } else {
        __pyx_t_12 = __pyx_t_11;
        goto __pyx_L13_bool_binop_done;
      }
      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 316, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_max); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 316, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_1, ((PyObject *)__pyx_v_self->assignments)) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_v_self->assignments));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 316, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->max_isos); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 316, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 316, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 316, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_12 = __pyx_t_11;
      __pyx_L13_bool_binop_done:;
      if (__pyx_t_12) {

        /* "_element_graph.pyx":317
 *                 novel_bases = self.add_path(path)
 *                 if novel_bases == 0 or np.max(self.assignments) >= self.max_isos:
 *                     total_bases_assigned = threshold             # <<<<<<<<<<<<<<
 *                 else:
 *                     total_bases_assigned += novel_bases
 */
        __pyx_v_total_bases_assigned = __pyx_v_threshold;

        /* "_element_graph.pyx":316
 *             else:
 *                 novel_bases = self.add_path(path)
 *                 if novel_bases == 0 or np.max(self.assignments) >= self.max_isos:             # <<<<<<<<<<<<<<
 *                     total_bases_assigned = threshold
 *                 else:
 */
        goto __pyx_L12;
      }

      /* "_element_graph.pyx":319
 *                     total_bases_assigned = threshold
 *                 else:
 *                     total_bases_assigned += novel_bases             # <<<<<<<<<<<<<<
 * 
 *         if simplify:
 */
      /*else*/ {
        __pyx_v_total_bases_assigned = (__pyx_v_total_bases_assigned + __pyx_v_novel_bases);
      }
      __pyx_L12:;
    }
    __pyx_L11:;
  }

  /* "_element_graph.pyx":321
 *                     total_bases_assigned += novel_bases
 * 
 *         if simplify:             # <<<<<<<<<<<<<<
 *             self.remove_bad_assemblies(minimum_proportion)
 * 
 */
  __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_simplify); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 321, __pyx_L1_error)
  if (__pyx_t_12) {

    /* "_element_graph.pyx":322
 * 
 *         if simplify:
 *             self.remove_bad_assemblies(minimum_proportion)             # <<<<<<<<<<<<<<
 * 
 *     cpdef void remove_bad_assemblies(self, minimum_proportion, verbose=False):
 */
    __pyx_t_1 = PyFloat_FromDouble(__pyx_v_minimum_proportion); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 322, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    ((struct __pyx_vtabstruct_14_element_graph_ElementGraph *)__pyx_v_self->__pyx_vtab)->remove_bad_assemblies(__pyx_v_self, __pyx_t_1, 0, NULL);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "_element_graph.pyx":321
 *                     total_bases_assigned += novel_bases
 * 
 *         if simplify:             # <<<<<<<<<<<<<<
 *             self.remove_bad_assemblies(minimum_proportion)
 * 
 */
  }

  /* "_element_graph.pyx":300
 *             path.bases = sum(path.source_weights)*path.length
 * 
 *     cpdef void assemble(self, float minimum_proportion, simplify=True):             # <<<<<<<<<<<<<<
 *         """Iteratively perform find_optimal_path() on the graph
 *         until the number of novel reads fails to exceed minimum_proportion
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_WriteUnraisable("_element_graph.ElementGraph.assemble", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_path);
  __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_i);
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_13assemble(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_14_element_graph_12ElementGraph_12assemble[] = "Iteratively perform find_optimal_path() on the graph\n        until the number of novel reads fails to exceed minimum_proportion\n        of the reads at the locus. If minimum_proportion == 0, assemble()\n        only terminates when every read is in a path.";
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_13assemble(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  float __pyx_v_minimum_proportion;
  PyObject *__pyx_v_simplify = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("assemble (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_minimum_proportion,&__pyx_n_s_simplify,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_True);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_minimum_proportion)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_simplify);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "assemble") < 0)) __PYX_ERR(0, 300, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_minimum_proportion = __pyx_PyFloat_AsFloat(values[0]); if (unlikely((__pyx_v_minimum_proportion == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 300, __pyx_L3_error)
    __pyx_v_simplify = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("assemble", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 300, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("_element_graph.ElementGraph.assemble", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_12assemble(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self), __pyx_v_minimum_proportion, __pyx_v_simplify);

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

static PyObject *__pyx_pf_14_element_graph_12ElementGraph_12assemble(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, float __pyx_v_minimum_proportion, PyObject *__pyx_v_simplify) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct __pyx_opt_args_14_element_graph_12ElementGraph_assemble __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("assemble", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1.__pyx_n = 1;
  __pyx_t_1.simplify = __pyx_v_simplify;
  __pyx_vtabptr_14_element_graph_ElementGraph->assemble(__pyx_v_self, __pyx_v_minimum_proportion, 1, &__pyx_t_1); 
  __pyx_t_2 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 300, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

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

/* "_element_graph.pyx":324
 *             self.remove_bad_assemblies(minimum_proportion)
 * 
 *     cpdef void remove_bad_assemblies(self, minimum_proportion, verbose=False):             # <<<<<<<<<<<<<<
 *         cdef np.ndarray bad_paths
 *         cdef int number_of_paths, i
 */

static PyObject *__pyx_pw_14_element_graph_12ElementGraph_15remove_bad_assemblies(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_14_element_graph_12ElementGraph_remove_bad_assemblies(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, PyObject *__pyx_v_minimum_proportion, int __pyx_skip_dispatch, struct __pyx_opt_args_14_element_graph_12ElementGraph_remove_bad_assemblies *__pyx_optional_args) {
  PyObject *__pyx_v_verbose = ((PyObject *)Py_False);
  PyArrayObject *__pyx_v_bad_paths = 0;
  int __pyx_v_number_of_paths;
  int __pyx_v_i;
  float __pyx_v_container_cov;
  float __pyx_v_path_cov;
  float __pyx_v_p_cov;
  PyObject *__pyx_v_m = 0;
  PyObject *__pyx_v_path_introns = 0;
  PyObject *__pyx_v_other_introns = 0;
  PyObject *__pyx_v_contained_ranges = 0;
  __pyx_ctuple_int__and_int __pyx_v_c1;
  __pyx_ctuple_int__and_int __pyx_v_c2;
  struct __pyx_obj_14_element_graph_Element *__pyx_v_path = 0;
  struct __pyx_obj_14_element_graph_Element *__pyx_v_p = 0;
  int __pyx_v_j;
  PyObject *__pyx_v_pm = NULL;
  PyObject *__pyx_v_overlapping_cov = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  PyObject *(*__pyx_t_12)(PyObject *);
  int __pyx_t_13;
  int __pyx_t_14;
  int __pyx_t_15;
  int __pyx_t_16;
  __pyx_ctuple_int__and_int __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("remove_bad_assemblies", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_verbose = __pyx_optional_args->verbose;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_remove_bad_assemblies); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 324, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_14_element_graph_12ElementGraph_15remove_bad_assemblies)) {
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        __pyx_t_5 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
            __pyx_t_5 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_minimum_proportion, __pyx_v_verbose};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 324, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_minimum_proportion, __pyx_v_verbose};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 324, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 324, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          if (__pyx_t_4) {
            __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
          }
          __Pyx_INCREF(__pyx_v_minimum_proportion);
          __Pyx_GIVEREF(__pyx_v_minimum_proportion);
          PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_minimum_proportion);
          __Pyx_INCREF(__pyx_v_verbose);
          __Pyx_GIVEREF(__pyx_v_verbose);
          PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_verbose);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 324, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        }
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "_element_graph.pyx":333
 *         cdef Element path, p
 *         # REMOVAL ROUND 1: INCOMPLETE ASSEMBLIES
 *         number_of_paths = len(self.paths)             # <<<<<<<<<<<<<<
 *         bad_paths = np.zeros(number_of_paths, dtype=bool)
 *         if self.ignore_ends or self.allow_incomplete: # Incomplete paths are those that have gaps
 */
  __pyx_t_1 = __pyx_v_self->paths;
  __Pyx_INCREF(__pyx_t_1);
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(0, 333, __pyx_L1_error)
  }
  __pyx_t_7 = PyList_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 333, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_number_of_paths = __pyx_t_7;

  /* "_element_graph.pyx":334
 *         # REMOVAL ROUND 1: INCOMPLETE ASSEMBLIES
 *         number_of_paths = len(self.paths)
 *         bad_paths = np.zeros(number_of_paths, dtype=bool)             # <<<<<<<<<<<<<<
 *         if self.ignore_ends or self.allow_incomplete: # Incomplete paths are those that have gaps
 *             for i in range(number_of_paths):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 334, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 334, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_number_of_paths); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 334, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 334, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 334, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, ((PyObject*)&PyBool_Type)) < 0) __PYX_ERR(0, 334, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 334, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 334, __pyx_L1_error)
  __pyx_v_bad_paths = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "_element_graph.pyx":335
 *         number_of_paths = len(self.paths)
 *         bad_paths = np.zeros(number_of_paths, dtype=bool)
 *         if self.ignore_ends or self.allow_incomplete: # Incomplete paths are those that have gaps             # <<<<<<<<<<<<<<
 *             for i in range(number_of_paths):
 *                 bad_paths[i] = self.paths[i].has_gaps
 */
  __pyx_t_9 = (__pyx_v_self->ignore_ends != 0);
  if (!__pyx_t_9) {
  } else {
    __pyx_t_8 = __pyx_t_9;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_9 = (__pyx_v_self->allow_incomplete != 0);
  __pyx_t_8 = __pyx_t_9;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_8) {

    /* "_element_graph.pyx":336
 *         bad_paths = np.zeros(number_of_paths, dtype=bool)
 *         if self.ignore_ends or self.allow_incomplete: # Incomplete paths are those that have gaps
 *             for i in range(number_of_paths):             # <<<<<<<<<<<<<<
 *                 bad_paths[i] = self.paths[i].has_gaps
 *         else: # To be considered complete, path must have no gaps AND a start and end site
 */
    __pyx_t_5 = __pyx_v_number_of_paths;
    __pyx_t_10 = __pyx_t_5;
    for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
      __pyx_v_i = __pyx_t_11;

      /* "_element_graph.pyx":337
 *         if self.ignore_ends or self.allow_incomplete: # Incomplete paths are those that have gaps
 *             for i in range(number_of_paths):
 *                 bad_paths[i] = self.paths[i].has_gaps             # <<<<<<<<<<<<<<
 *         else: # To be considered complete, path must have no gaps AND a start and end site
 *             for i in range(number_of_paths):
 */
      if (unlikely(__pyx_v_self->paths == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(0, 337, __pyx_L1_error)
      }
      __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_self->paths, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 337, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_has_gaps); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_bad_paths), __pyx_v_i, __pyx_t_1, int, 1, __Pyx_PyInt_From_int, 0, 1, 1) < 0)) __PYX_ERR(0, 337, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }

    /* "_element_graph.pyx":335
 *         number_of_paths = len(self.paths)
 *         bad_paths = np.zeros(number_of_paths, dtype=bool)
 *         if self.ignore_ends or self.allow_incomplete: # Incomplete paths are those that have gaps             # <<<<<<<<<<<<<<
 *             for i in range(number_of_paths):
 *                 bad_paths[i] = self.paths[i].has_gaps
 */
    goto __pyx_L3;
  }

  /* "_element_graph.pyx":339
 *                 bad_paths[i] = self.paths[i].has_gaps
 *         else: # To be considered complete, path must have no gaps AND a start and end site
 *             for i in range(number_of_paths):             # <<<<<<<<<<<<<<
 *                 bad_paths[i] = not self.paths[i].complete
 * 
 */
  /*else*/ {
    __pyx_t_5 = __pyx_v_number_of_paths;
    __pyx_t_10 = __pyx_t_5;
    for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
      __pyx_v_i = __pyx_t_11;

      /* "_element_graph.pyx":340
 *         else: # To be considered complete, path must have no gaps AND a start and end site
 *             for i in range(number_of_paths):
 *                 bad_paths[i] = not self.paths[i].complete             # <<<<<<<<<<<<<<
 * 
 *         if verbose:
 */
      if (unlikely(__pyx_v_self->paths == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(0, 340, __pyx_L1_error)
      }
      __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_self->paths, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 340, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_complete); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 340, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 340, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyBool_FromLong((!__pyx_t_8)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 340, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_bad_paths), __pyx_v_i, __pyx_t_6, int, 1, __Pyx_PyInt_From_int, 0, 1, 1) < 0)) __PYX_ERR(0, 340, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
  }
  __pyx_L3:;

  /* "_element_graph.pyx":342
 *                 bad_paths[i] = not self.paths[i].complete
 * 
 *         if verbose:             # <<<<<<<<<<<<<<
 *             for i in np.where(bad_paths)[0]:
 *                 print('Removing {}, incomplete.'.format(self.paths[i]))
 */
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_verbose); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 342, __pyx_L1_error)
  if (__pyx_t_8) {

    /* "_element_graph.pyx":343
 * 
 *         if verbose:
 *             for i in np.where(bad_paths)[0]:             # <<<<<<<<<<<<<<
 *                 print('Removing {}, incomplete.'.format(self.paths[i]))
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 343, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_where); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 343, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_6 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, ((PyObject *)__pyx_v_bad_paths)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_bad_paths));
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 343, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_6, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 343, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
      __pyx_t_6 = __pyx_t_3; __Pyx_INCREF(__pyx_t_6); __pyx_t_7 = 0;
      __pyx_t_12 = NULL;
    } else {
      __pyx_t_7 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 343, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_12 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 343, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    for (;;) {
      if (likely(!__pyx_t_12)) {
        if (likely(PyList_CheckExact(__pyx_t_6))) {
          if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_6)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 343, __pyx_L1_error)
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 343, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        } else {
          if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 343, __pyx_L1_error)
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 343, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        }
      } else {
        __pyx_t_3 = __pyx_t_12(__pyx_t_6);
        if (unlikely(!__pyx_t_3)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 343, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_3);
      }
      __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 343, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_i = __pyx_t_5;

      /* "_element_graph.pyx":344
 *         if verbose:
 *             for i in np.where(bad_paths)[0]:
 *                 print('Removing {}, incomplete.'.format(self.paths[i]))             # <<<<<<<<<<<<<<
 * 
 *         self.remove_paths(list(np.where(bad_paths)[0]))
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Removing_incomplete, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 344, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (unlikely(__pyx_v_self->paths == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(0, 344, __pyx_L1_error)
      }
      __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_self->paths, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 344, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 344, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 344, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "_element_graph.pyx":343
 * 
 *         if verbose:
 *             for i in np.where(bad_paths)[0]:             # <<<<<<<<<<<<<<
 *                 print('Removing {}, incomplete.'.format(self.paths[i]))
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "_element_graph.pyx":342
 *                 bad_paths[i] = not self.paths[i].complete
 * 
 *         if verbose:             # <<<<<<<<<<<<<<
 *             for i in np.where(bad_paths)[0]:
 *                 print('Removing {}, incomplete.'.format(self.paths[i]))
 */
  }

  /* "_element_graph.pyx":346
 *                 print('Removing {}, incomplete.'.format(self.paths[i]))
 * 
 *         self.remove_paths(list(np.where(bad_paths)[0]))             # <<<<<<<<<<<<<<
 *         # REMOVAL ROUND 2: FUSIONS
 *         # >=2 contained nonoverlapping paths with higher coverage
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 346, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_where); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 346, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_6 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, ((PyObject *)__pyx_v_bad_paths)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_bad_paths));
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 346, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_6, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 346, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PySequence_List(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 346, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  ((struct __pyx_vtabstruct_14_element_graph_ElementGraph *)__pyx_v_self->__pyx_vtab)->remove_paths(__pyx_v_self, ((PyObject*)__pyx_t_6), 0);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "_element_graph.pyx":349
 *         # REMOVAL ROUND 2: FUSIONS
 *         # >=2 contained nonoverlapping paths with higher coverage
 *         number_of_paths = len(self.paths)             # <<<<<<<<<<<<<<
 *         bad_paths = np.zeros(number_of_paths, dtype=bool)
 *         for i in range(number_of_paths):
 */
  __pyx_t_6 = __pyx_v_self->paths;
  __Pyx_INCREF(__pyx_t_6);
  if (unlikely(__pyx_t_6 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(0, 349, __pyx_L1_error)
  }
  __pyx_t_7 = PyList_GET_SIZE(__pyx_t_6); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 349, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_number_of_paths = __pyx_t_7;

  /* "_element_graph.pyx":350
 *         # >=2 contained nonoverlapping paths with higher coverage
 *         number_of_paths = len(self.paths)
 *         bad_paths = np.zeros(number_of_paths, dtype=bool)             # <<<<<<<<<<<<<<
 *         for i in range(number_of_paths):
 *             contained_ranges = []
 */
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 350, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 350, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_number_of_paths); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 350, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 350, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6);
  __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 350, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, ((PyObject*)&PyBool_Type)) < 0) __PYX_ERR(0, 350, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 350, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 350, __pyx_L1_error)
  __Pyx_DECREF_SET(__pyx_v_bad_paths, ((PyArrayObject *)__pyx_t_2));
  __pyx_t_2 = 0;

  /* "_element_graph.pyx":351
 *         number_of_paths = len(self.paths)
 *         bad_paths = np.zeros(number_of_paths, dtype=bool)
 *         for i in range(number_of_paths):             # <<<<<<<<<<<<<<
 *             contained_ranges = []
 *             path = self.paths[i]
 */
  __pyx_t_5 = __pyx_v_number_of_paths;
  __pyx_t_10 = __pyx_t_5;
  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
    __pyx_v_i = __pyx_t_11;

    /* "_element_graph.pyx":352
 *         bad_paths = np.zeros(number_of_paths, dtype=bool)
 *         for i in range(number_of_paths):
 *             contained_ranges = []             # <<<<<<<<<<<<<<
 *             path = self.paths[i]
 *             path_cov = path.bases / path.length
 */
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 352, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF_SET(__pyx_v_contained_ranges, ((PyObject*)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "_element_graph.pyx":353
 *         for i in range(number_of_paths):
 *             contained_ranges = []
 *             path = self.paths[i]             # <<<<<<<<<<<<<<
 *             path_cov = path.bases / path.length
 *             m = path.members
 */
    if (unlikely(__pyx_v_self->paths == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 353, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_self->paths, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 353, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_14_element_graph_Element))))) __PYX_ERR(0, 353, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_path, ((struct __pyx_obj_14_element_graph_Element *)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "_element_graph.pyx":354
 *             contained_ranges = []
 *             path = self.paths[i]
 *             path_cov = path.bases / path.length             # <<<<<<<<<<<<<<
 *             m = path.members
 *             container_cov = 0
 */
    if (unlikely(__pyx_v_path->length == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "float division");
      __PYX_ERR(0, 354, __pyx_L1_error)
    }
    __pyx_v_path_cov = (__pyx_v_path->bases / ((float)__pyx_v_path->length));

    /* "_element_graph.pyx":355
 *             path = self.paths[i]
 *             path_cov = path.bases / path.length
 *             m = path.members             # <<<<<<<<<<<<<<
 *             container_cov = 0
 *             for j in range(number_of_paths):
 */
    __pyx_t_2 = __pyx_v_path->members;
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_XDECREF_SET(__pyx_v_m, ((PyObject*)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "_element_graph.pyx":356
 *             path_cov = path.bases / path.length
 *             m = path.members
 *             container_cov = 0             # <<<<<<<<<<<<<<
 *             for j in range(number_of_paths):
 *                 if j != i:
 */
    __pyx_v_container_cov = 0.0;

    /* "_element_graph.pyx":357
 *             m = path.members
 *             container_cov = 0
 *             for j in range(number_of_paths):             # <<<<<<<<<<<<<<
 *                 if j != i:
 *                     p = self.paths[j]
 */
    __pyx_t_13 = __pyx_v_number_of_paths;
    __pyx_t_14 = __pyx_t_13;
    for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
      __pyx_v_j = __pyx_t_15;

      /* "_element_graph.pyx":358
 *             container_cov = 0
 *             for j in range(number_of_paths):
 *                 if j != i:             # <<<<<<<<<<<<<<
 *                     p = self.paths[j]
 *                     pm = p.members.difference(p.end_indices)
 */
      __pyx_t_8 = ((__pyx_v_j != __pyx_v_i) != 0);
      if (__pyx_t_8) {

        /* "_element_graph.pyx":359
 *             for j in range(number_of_paths):
 *                 if j != i:
 *                     p = self.paths[j]             # <<<<<<<<<<<<<<
 *                     pm = p.members.difference(p.end_indices)
 *                     if p.RM < path.RM or p.LM > path.LM and p.strand == path.strand:
 */
        if (unlikely(__pyx_v_self->paths == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 359, __pyx_L1_error)
        }
        __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_self->paths, __pyx_v_j, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 359, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_14_element_graph_Element))))) __PYX_ERR(0, 359, __pyx_L1_error)
        __Pyx_XDECREF_SET(__pyx_v_p, ((struct __pyx_obj_14_element_graph_Element *)__pyx_t_2));
        __pyx_t_2 = 0;

        /* "_element_graph.pyx":360
 *                 if j != i:
 *                     p = self.paths[j]
 *                     pm = p.members.difference(p.end_indices)             # <<<<<<<<<<<<<<
 *                     if p.RM < path.RM or p.LM > path.LM and p.strand == path.strand:
 *                         if pm.issubset(path.members):
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_p->members, __pyx_n_s_difference); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 360, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_1 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_1)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_1);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_1, __pyx_v_p->end_indices) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_p->end_indices);
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 360, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XDECREF_SET(__pyx_v_pm, __pyx_t_2);
        __pyx_t_2 = 0;

        /* "_element_graph.pyx":361
 *                     p = self.paths[j]
 *                     pm = p.members.difference(p.end_indices)
 *                     if p.RM < path.RM or p.LM > path.LM and p.strand == path.strand:             # <<<<<<<<<<<<<<
 *                         if pm.issubset(path.members):
 *                             p_cov = p.bases / p.length
 */
        __pyx_t_9 = ((__pyx_v_p->RM < __pyx_v_path->RM) != 0);
        if (!__pyx_t_9) {
        } else {
          __pyx_t_8 = __pyx_t_9;
          goto __pyx_L19_bool_binop_done;
        }
        __pyx_t_9 = ((__pyx_v_p->LM > __pyx_v_path->LM) != 0);
        if (__pyx_t_9) {
        } else {
          __pyx_t_8 = __pyx_t_9;
          goto __pyx_L19_bool_binop_done;
        }
        __pyx_t_9 = ((__pyx_v_p->strand == __pyx_v_path->strand) != 0);
        __pyx_t_8 = __pyx_t_9;
        __pyx_L19_bool_binop_done:;
        if (__pyx_t_8) {

          /* "_element_graph.pyx":362
 *                     pm = p.members.difference(p.end_indices)
 *                     if p.RM < path.RM or p.LM > path.LM and p.strand == path.strand:
 *                         if pm.issubset(path.members):             # <<<<<<<<<<<<<<
 *                             p_cov = p.bases / p.length
 *                             if p_cov >= path_cov:
 */
          __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_pm, __pyx_n_s_issubset); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 362, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_1 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
            __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_6);
            if (likely(__pyx_t_1)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
              __Pyx_INCREF(__pyx_t_1);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_6, function);
            }
          }
          __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_1, __pyx_v_path->members) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_path->members);
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 362, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 362, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (__pyx_t_8) {

            /* "_element_graph.pyx":363
 *                     if p.RM < path.RM or p.LM > path.LM and p.strand == path.strand:
 *                         if pm.issubset(path.members):
 *                             p_cov = p.bases / p.length             # <<<<<<<<<<<<<<
 *                             if p_cov >= path_cov:
 *                                 contained_ranges.append((p.LM, p.RM))
 */
            if (unlikely(__pyx_v_p->length == 0)) {
              PyErr_SetString(PyExc_ZeroDivisionError, "float division");
              __PYX_ERR(0, 363, __pyx_L1_error)
            }
            __pyx_v_p_cov = (__pyx_v_p->bases / ((float)__pyx_v_p->length));

            /* "_element_graph.pyx":364
 *                         if pm.issubset(path.members):
 *                             p_cov = p.bases / p.length
 *                             if p_cov >= path_cov:             # <<<<<<<<<<<<<<
 *                                 contained_ranges.append((p.LM, p.RM))
 * 
 */
            __pyx_t_8 = ((__pyx_v_p_cov >= __pyx_v_path_cov) != 0);
            if (__pyx_t_8) {

              /* "_element_graph.pyx":365
 *                             p_cov = p.bases / p.length
 *                             if p_cov >= path_cov:
 *                                 contained_ranges.append((p.LM, p.RM))             # <<<<<<<<<<<<<<
 * 
 *             if len(contained_ranges) > 1:
 */
              __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_p->LM); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 365, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_2);
              __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_p->RM); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 365, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_6);
              __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 365, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_1);
              __Pyx_GIVEREF(__pyx_t_2);
              PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
              __Pyx_GIVEREF(__pyx_t_6);
              PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_6);
              __pyx_t_2 = 0;
              __pyx_t_6 = 0;
              __pyx_t_16 = __Pyx_PyList_Append(__pyx_v_contained_ranges, __pyx_t_1); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(0, 365, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

              /* "_element_graph.pyx":364
 *                         if pm.issubset(path.members):
 *                             p_cov = p.bases / p.length
 *                             if p_cov >= path_cov:             # <<<<<<<<<<<<<<
 *                                 contained_ranges.append((p.LM, p.RM))
 * 
 */
            }

            /* "_element_graph.pyx":362
 *                     pm = p.members.difference(p.end_indices)
 *                     if p.RM < path.RM or p.LM > path.LM and p.strand == path.strand:
 *                         if pm.issubset(path.members):             # <<<<<<<<<<<<<<
 *                             p_cov = p.bases / p.length
 *                             if p_cov >= path_cov:
 */
          }

          /* "_element_graph.pyx":361
 *                     p = self.paths[j]
 *                     pm = p.members.difference(p.end_indices)
 *                     if p.RM < path.RM or p.LM > path.LM and p.strand == path.strand:             # <<<<<<<<<<<<<<
 *                         if pm.issubset(path.members):
 *                             p_cov = p.bases / p.length
 */
        }

        /* "_element_graph.pyx":358
 *             container_cov = 0
 *             for j in range(number_of_paths):
 *                 if j != i:             # <<<<<<<<<<<<<<
 *                     p = self.paths[j]
 *                     pm = p.members.difference(p.end_indices)
 */
      }
    }

    /* "_element_graph.pyx":367
 *                                 contained_ranges.append((p.LM, p.RM))
 * 
 *             if len(contained_ranges) > 1:             # <<<<<<<<<<<<<<
 *                 for c1 in contained_ranges:
 *                     for c2 in contained_ranges:
 */
    __pyx_t_7 = PyList_GET_SIZE(__pyx_v_contained_ranges); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 367, __pyx_L1_error)
    __pyx_t_8 = ((__pyx_t_7 > 1) != 0);
    if (__pyx_t_8) {

      /* "_element_graph.pyx":368
 * 
 *             if len(contained_ranges) > 1:
 *                 for c1 in contained_ranges:             # <<<<<<<<<<<<<<
 *                     for c2 in contained_ranges:
 *                         if c1[0] > c2[1] or c2[0] > c1[1]:
 */
      __pyx_t_1 = __pyx_v_contained_ranges; __Pyx_INCREF(__pyx_t_1); __pyx_t_7 = 0;
      for (;;) {
        if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_6); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 368, __pyx_L1_error)
        #else
        __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 368, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        #endif
        __pyx_t_17 = __pyx_convert__from_py___pyx_ctuple_int__and_int(__pyx_t_6); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 368, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_v_c1 = __pyx_t_17;

        /* "_element_graph.pyx":369
 *             if len(contained_ranges) > 1:
 *                 for c1 in contained_ranges:
 *                     for c2 in contained_ranges:             # <<<<<<<<<<<<<<
 *                         if c1[0] > c2[1] or c2[0] > c1[1]:
 *                             bad_paths[i] = True
 */
        __pyx_t_6 = __pyx_v_contained_ranges; __Pyx_INCREF(__pyx_t_6); __pyx_t_18 = 0;
        for (;;) {
          if (__pyx_t_18 >= PyList_GET_SIZE(__pyx_t_6)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_18); __Pyx_INCREF(__pyx_t_2); __pyx_t_18++; if (unlikely(0 < 0)) __PYX_ERR(0, 369, __pyx_L1_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_6, __pyx_t_18); __pyx_t_18++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 369, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
          __pyx_t_17 = __pyx_convert__from_py___pyx_ctuple_int__and_int(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 369, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_v_c2 = __pyx_t_17;

          /* "_element_graph.pyx":370
 *                 for c1 in contained_ranges:
 *                     for c2 in contained_ranges:
 *                         if c1[0] > c2[1] or c2[0] > c1[1]:             # <<<<<<<<<<<<<<
 *                             bad_paths[i] = True
 * 
 */
          __pyx_t_9 = ((__pyx_v_c1.f0 > __pyx_v_c2.f1) != 0);
          if (!__pyx_t_9) {
          } else {
            __pyx_t_8 = __pyx_t_9;
            goto __pyx_L30_bool_binop_done;
          }
          __pyx_t_9 = ((__pyx_v_c2.f0 > __pyx_v_c1.f1) != 0);
          __pyx_t_8 = __pyx_t_9;
          __pyx_L30_bool_binop_done:;
          if (__pyx_t_8) {

            /* "_element_graph.pyx":371
 *                     for c2 in contained_ranges:
 *                         if c1[0] > c2[1] or c2[0] > c1[1]:
 *                             bad_paths[i] = True             # <<<<<<<<<<<<<<
 * 
 *         if verbose:
 */
            if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_bad_paths), __pyx_v_i, Py_True, int, 1, __Pyx_PyInt_From_int, 0, 1, 1) < 0)) __PYX_ERR(0, 371, __pyx_L1_error)

            /* "_element_graph.pyx":370
 *                 for c1 in contained_ranges:
 *                     for c2 in contained_ranges:
 *                         if c1[0] > c2[1] or c2[0] > c1[1]:             # <<<<<<<<<<<<<<
 *                             bad_paths[i] = True
 * 
 */
          }

          /* "_element_graph.pyx":369
 *             if len(contained_ranges) > 1:
 *                 for c1 in contained_ranges:
 *                     for c2 in contained_ranges:             # <<<<<<<<<<<<<<
 *                         if c1[0] > c2[1] or c2[0] > c1[1]:
 *                             bad_paths[i] = True
 */
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

        /* "_element_graph.pyx":368
 * 
 *             if len(contained_ranges) > 1:
 *                 for c1 in contained_ranges:             # <<<<<<<<<<<<<<
 *                     for c2 in contained_ranges:
 *                         if c1[0] > c2[1] or c2[0] > c1[1]:
 */
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "_element_graph.pyx":367
 *                                 contained_ranges.append((p.LM, p.RM))
 * 
 *             if len(contained_ranges) > 1:             # <<<<<<<<<<<<<<
 *                 for c1 in contained_ranges:
 *                     for c2 in contained_ranges:
 */
    }
  }

  /* "_element_graph.pyx":373
 *                             bad_paths[i] = True
 * 
 *         if verbose:             # <<<<<<<<<<<<<<
 *             for i in np.where(bad_paths)[0]:
 *                 print('Removing {}, fusion.'.format(self.paths[i]))
 */
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_verbose); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 373, __pyx_L1_error)
  if (__pyx_t_8) {

    /* "_element_graph.pyx":374
 * 
 *         if verbose:
 *             for i in np.where(bad_paths)[0]:             # <<<<<<<<<<<<<<
 *                 print('Removing {}, fusion.'.format(self.paths[i]))
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 374, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_where); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 374, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_6, ((PyObject *)__pyx_v_bad_paths)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_bad_paths));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 374, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 374, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
      __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_7 = 0;
      __pyx_t_12 = NULL;
    } else {
      __pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 374, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_12 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 374, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    for (;;) {
      if (likely(!__pyx_t_12)) {
        if (likely(PyList_CheckExact(__pyx_t_1))) {
          if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 374, __pyx_L1_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 374, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        } else {
          if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 374, __pyx_L1_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 374, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        }
      } else {
        __pyx_t_2 = __pyx_t_12(__pyx_t_1);
        if (unlikely(!__pyx_t_2)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 374, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_2);
      }
      __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 374, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_i = __pyx_t_5;

      /* "_element_graph.pyx":375
 *         if verbose:
 *             for i in np.where(bad_paths)[0]:
 *                 print('Removing {}, fusion.'.format(self.paths[i]))             # <<<<<<<<<<<<<<
 * 
 *         self.remove_paths(list(np.where(bad_paths)[0]))
 */
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Removing_fusion, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 375, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (unlikely(__pyx_v_self->paths == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(0, 375, __pyx_L1_error)
      }
      __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_self->paths, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 375, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 375, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 375, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "_element_graph.pyx":374
 * 
 *         if verbose:
 *             for i in np.where(bad_paths)[0]:             # <<<<<<<<<<<<<<
 *                 print('Removing {}, fusion.'.format(self.paths[i]))
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "_element_graph.pyx":373
 *                             bad_paths[i] = True
 * 
 *         if verbose:             # <<<<<<<<<<<<<<
 *             for i in np.where(bad_paths)[0]:
 *                 print('Removing {}, fusion.'.format(self.paths[i]))
 */
  }

  /* "_element_graph.pyx":377
 *                 print('Removing {}, fusion.'.format(self.paths[i]))
 * 
 *         self.remove_paths(list(np.where(bad_paths)[0]))             # <<<<<<<<<<<<<<
 *         # REMOVAL ROUND 3: TRUNCATIONS
 *         number_of_paths = len(self.paths)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 377, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_where); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 377, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_6, ((PyObject *)__pyx_v_bad_paths)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_bad_paths));
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 377, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 377, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PySequence_List(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 377, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  ((struct __pyx_vtabstruct_14_element_graph_ElementGraph *)__pyx_v_self->__pyx_vtab)->remove_paths(__pyx_v_self, ((PyObject*)__pyx_t_1), 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_element_graph.pyx":379
 *         self.remove_paths(list(np.where(bad_paths)[0]))
 *         # REMOVAL ROUND 3: TRUNCATIONS
 *         number_of_paths = len(self.paths)             # <<<<<<<<<<<<<<
 *         bad_paths = np.zeros(number_of_paths, dtype=bool)
 *         # containment_order = [c for a,b,c in sorted([(-(p.RM-p.LM), len(p.members), i) for i,p in enumerate(self.paths)])]
 */
  __pyx_t_1 = __pyx_v_self->paths;
  __Pyx_INCREF(__pyx_t_1);
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(0, 379, __pyx_L1_error)
  }
  __pyx_t_7 = PyList_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 379, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_number_of_paths = __pyx_t_7;

  /* "_element_graph.pyx":380
 *         # REMOVAL ROUND 3: TRUNCATIONS
 *         number_of_paths = len(self.paths)
 *         bad_paths = np.zeros(number_of_paths, dtype=bool)             # <<<<<<<<<<<<<<
 *         # containment_order = [c for a,b,c in sorted([(-(p.RM-p.LM), len(p.members), i) for i,p in enumerate(self.paths)])]
 *         for i in range(number_of_paths):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 380, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 380, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_number_of_paths); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 380, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 380, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 380, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, ((PyObject*)&PyBool_Type)) < 0) __PYX_ERR(0, 380, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 380, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 380, __pyx_L1_error)
  __Pyx_DECREF_SET(__pyx_v_bad_paths, ((PyArrayObject *)__pyx_t_3));
  __pyx_t_3 = 0;

  /* "_element_graph.pyx":382
 *         bad_paths = np.zeros(number_of_paths, dtype=bool)
 *         # containment_order = [c for a,b,c in sorted([(-(p.RM-p.LM), len(p.members), i) for i,p in enumerate(self.paths)])]
 *         for i in range(number_of_paths):             # <<<<<<<<<<<<<<
 *             path = self.paths[i]
 *             m = path.members.difference(path.end_indices)
 */
  __pyx_t_5 = __pyx_v_number_of_paths;
  __pyx_t_10 = __pyx_t_5;
  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
    __pyx_v_i = __pyx_t_11;

    /* "_element_graph.pyx":383
 *         # containment_order = [c for a,b,c in sorted([(-(p.RM-p.LM), len(p.members), i) for i,p in enumerate(self.paths)])]
 *         for i in range(number_of_paths):
 *             path = self.paths[i]             # <<<<<<<<<<<<<<
 *             m = path.members.difference(path.end_indices)
 *             container_cov = 0
 */
    if (unlikely(__pyx_v_self->paths == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 383, __pyx_L1_error)
    }
    __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_self->paths, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 383, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_14_element_graph_Element))))) __PYX_ERR(0, 383, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_path, ((struct __pyx_obj_14_element_graph_Element *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "_element_graph.pyx":384
 *         for i in range(number_of_paths):
 *             path = self.paths[i]
 *             m = path.members.difference(path.end_indices)             # <<<<<<<<<<<<<<
 *             container_cov = 0
 *             for j in range(number_of_paths):
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_path->members, __pyx_n_s_difference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 384, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_6, __pyx_v_path->end_indices) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_path->end_indices);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 384, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (!(likely(PySet_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(0, 384, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_m, ((PyObject*)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "_element_graph.pyx":385
 *             path = self.paths[i]
 *             m = path.members.difference(path.end_indices)
 *             container_cov = 0             # <<<<<<<<<<<<<<
 *             for j in range(number_of_paths):
 *                 p = self.paths[j]
 */
    __pyx_v_container_cov = 0.0;

    /* "_element_graph.pyx":386
 *             m = path.members.difference(path.end_indices)
 *             container_cov = 0
 *             for j in range(number_of_paths):             # <<<<<<<<<<<<<<
 *                 p = self.paths[j]
 *                 if path.RM < p.RM or path.LM > p.LM:
 */
    __pyx_t_13 = __pyx_v_number_of_paths;
    __pyx_t_14 = __pyx_t_13;
    for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
      __pyx_v_j = __pyx_t_15;

      /* "_element_graph.pyx":387
 *             container_cov = 0
 *             for j in range(number_of_paths):
 *                 p = self.paths[j]             # <<<<<<<<<<<<<<
 *                 if path.RM < p.RM or path.LM > p.LM:
 *                     if m.issubset(p.members):
 */
      if (unlikely(__pyx_v_self->paths == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(0, 387, __pyx_L1_error)
      }
      __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_self->paths, __pyx_v_j, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 387, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_14_element_graph_Element))))) __PYX_ERR(0, 387, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_p, ((struct __pyx_obj_14_element_graph_Element *)__pyx_t_3));
      __pyx_t_3 = 0;

      /* "_element_graph.pyx":388
 *             for j in range(number_of_paths):
 *                 p = self.paths[j]
 *                 if path.RM < p.RM or path.LM > p.LM:             # <<<<<<<<<<<<<<
 *                     if m.issubset(p.members):
 *                         container_cov += p.bases / p.length
 */
      __pyx_t_9 = ((__pyx_v_path->RM < __pyx_v_p->RM) != 0);
      if (!__pyx_t_9) {
      } else {
        __pyx_t_8 = __pyx_t_9;
        goto __pyx_L40_bool_binop_done;
      }
      __pyx_t_9 = ((__pyx_v_path->LM > __pyx_v_p->LM) != 0);
      __pyx_t_8 = __pyx_t_9;
      __pyx_L40_bool_binop_done:;
      if (__pyx_t_8) {

        /* "_element_graph.pyx":389
 *                 p = self.paths[j]
 *                 if path.RM < p.RM or path.LM > p.LM:
 *                     if m.issubset(p.members):             # <<<<<<<<<<<<<<
 *                         container_cov += p.bases / p.length
 * 
 */
        __pyx_t_3 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PySet_Type_issubset, __pyx_v_m, __pyx_v_p->members); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 389, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 389, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (__pyx_t_8) {

          /* "_element_graph.pyx":390
 *                 if path.RM < p.RM or path.LM > p.LM:
 *                     if m.issubset(p.members):
 *                         container_cov += p.bases / p.length             # <<<<<<<<<<<<<<
 * 
 *             if container_cov > 0:
 */
          if (unlikely(__pyx_v_p->length == 0)) {
            PyErr_SetString(PyExc_ZeroDivisionError, "float division");
            __PYX_ERR(0, 390, __pyx_L1_error)
          }
          __pyx_v_container_cov = (__pyx_v_container_cov + (__pyx_v_p->bases / ((float)__pyx_v_p->length)));

          /* "_element_graph.pyx":389
 *                 p = self.paths[j]
 *                 if path.RM < p.RM or path.LM > p.LM:
 *                     if m.issubset(p.members):             # <<<<<<<<<<<<<<
 *                         container_cov += p.bases / p.length
 * 
 */
        }

        /* "_element_graph.pyx":388
 *             for j in range(number_of_paths):
 *                 p = self.paths[j]
 *                 if path.RM < p.RM or path.LM > p.LM:             # <<<<<<<<<<<<<<
 *                     if m.issubset(p.members):
 *                         container_cov += p.bases / p.length
 */
      }
    }

    /* "_element_graph.pyx":392
 *                         container_cov += p.bases / p.length
 * 
 *             if container_cov > 0:             # <<<<<<<<<<<<<<
 *                 path_cov = path.bases / path.length
 *                 if path_cov < (path_cov + container_cov) * self.truncation_filter:
 */
    __pyx_t_8 = ((__pyx_v_container_cov > 0.0) != 0);
    if (__pyx_t_8) {

      /* "_element_graph.pyx":393
 * 
 *             if container_cov > 0:
 *                 path_cov = path.bases / path.length             # <<<<<<<<<<<<<<
 *                 if path_cov < (path_cov + container_cov) * self.truncation_filter:
 *                     bad_paths[i] = True
 */
      if (unlikely(__pyx_v_path->length == 0)) {
        PyErr_SetString(PyExc_ZeroDivisionError, "float division");
        __PYX_ERR(0, 393, __pyx_L1_error)
      }
      __pyx_v_path_cov = (__pyx_v_path->bases / ((float)__pyx_v_path->length));

      /* "_element_graph.pyx":394
 *             if container_cov > 0:
 *                 path_cov = path.bases / path.length
 *                 if path_cov < (path_cov + container_cov) * self.truncation_filter:             # <<<<<<<<<<<<<<
 *                     bad_paths[i] = True
 * 
 */
      __pyx_t_8 = ((__pyx_v_path_cov < ((__pyx_v_path_cov + __pyx_v_container_cov) * __pyx_v_self->truncation_filter)) != 0);
      if (__pyx_t_8) {

        /* "_element_graph.pyx":395
 *                 path_cov = path.bases / path.length
 *                 if path_cov < (path_cov + container_cov) * self.truncation_filter:
 *                     bad_paths[i] = True             # <<<<<<<<<<<<<<
 * 
 *         if verbose:
 */
        if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_bad_paths), __pyx_v_i, Py_True, int, 1, __Pyx_PyInt_From_int, 0, 1, 1) < 0)) __PYX_ERR(0, 395, __pyx_L1_error)

        /* "_element_graph.pyx":394
 *             if container_cov > 0:
 *                 path_cov = path.bases / path.length
 *                 if path_cov < (path_cov + container_cov) * self.truncation_filter:             # <<<<<<<<<<<<<<
 *                     bad_paths[i] = True
 * 
 */
      }

      /* "_element_graph.pyx":392
 *                         container_cov += p.bases / p.length
 * 
 *             if container_cov > 0:             # <<<<<<<<<<<<<<
 *                 path_cov = path.bases / path.length
 *                 if path_cov < (path_cov + container_cov) * self.truncation_filter:
 */
    }
  }

  /* "_element_graph.pyx":397
 *                     bad_paths[i] = True
 * 
 *         if verbose:             # <<<<<<<<<<<<<<
 *             for i in np.where(bad_paths)[0]:
 *                 print('Removing {}, truncation.'.format(self.paths[i]))
 */
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_verbose); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 397, __pyx_L1_error)
  if (__pyx_t_8) {

    /* "_element_graph.pyx":398
 * 
 *         if verbose:
 *             for i in np.where(bad_paths)[0]:             # <<<<<<<<<<<<<<
 *                 print('Removing {}, truncation.'.format(self.paths[i]))
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 398, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_where); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 398, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_1, ((PyObject *)__pyx_v_bad_paths)) : __Pyx_PyObject_CallOneArg(__pyx_t_6, ((PyObject *)__pyx_v_bad_paths));
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 398, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 398, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) {
      __pyx_t_3 = __pyx_t_6; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
      __pyx_t_12 = NULL;
    } else {
      __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 398, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_12 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 398, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    for (;;) {
      if (likely(!__pyx_t_12)) {
        if (likely(PyList_CheckExact(__pyx_t_3))) {
          if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_6); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 398, __pyx_L1_error)
          #else
          __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 398, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          #endif
        } else {
          if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_6); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 398, __pyx_L1_error)
          #else
          __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 398, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          #endif
        }
      } else {
        __pyx_t_6 = __pyx_t_12(__pyx_t_3);
        if (unlikely(!__pyx_t_6)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 398, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_6);
      }
      __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 398, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_v_i = __pyx_t_5;

      /* "_element_graph.pyx":399
 *         if verbose:
 *             for i in np.where(bad_paths)[0]:
 *                 print('Removing {}, truncation.'.format(self.paths[i]))             # <<<<<<<<<<<<<<
 * 
 *         self.remove_paths(list(np.where(bad_paths)[0]))
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Removing_truncation, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 399, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (unlikely(__pyx_v_self->paths == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(0, 399, __pyx_L1_error)
      }
      __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_self->paths, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 399, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      __pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 399, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 399, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "_element_graph.pyx":398
 * 
 *         if verbose:
 *             for i in np.where(bad_paths)[0]:             # <<<<<<<<<<<<<<
 *                 print('Removing {}, truncation.'.format(self.paths[i]))
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "_element_graph.pyx":397
 *                     bad_paths[i] = True
 * 
 *         if verbose:             # <<<<<<<<<<<<<<
 *             for i in np.where(bad_paths)[0]:
 *                 print('Removing {}, truncation.'.format(self.paths[i]))
 */
  }

  /* "_element_graph.pyx":401
 *                 print('Removing {}, truncation.'.format(self.paths[i]))
 * 
 *         self.remove_paths(list(np.where(bad_paths)[0]))             # <<<<<<<<<<<<<<
 *         # REMOVAL ROUND 4: INTRON RETENTION
 *         number_of_paths = len(self.paths)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 401, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_where); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 401, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_1, ((PyObject *)__pyx_v_bad_paths)) : __Pyx_PyObject_CallOneArg(__pyx_t_6, ((PyObject *)__pyx_v_bad_paths));
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 401, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 401, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PySequence_List(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 401, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  ((struct __pyx_vtabstruct_14_element_graph_ElementGraph *)__pyx_v_self->__pyx_vtab)->remove_paths(__pyx_v_self, ((PyObject*)__pyx_t_3), 0);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "_element_graph.pyx":403
 *         self.remove_paths(list(np.where(bad_paths)[0]))
 *         # REMOVAL ROUND 4: INTRON RETENTION
 *         number_of_paths = len(self.paths)             # <<<<<<<<<<<<<<
 *         bad_paths = np.zeros(number_of_paths, dtype=bool)
 *         for i in range(number_of_paths):
 */
  __pyx_t_3 = __pyx_v_self->paths;
  __Pyx_INCREF(__pyx_t_3);
  if (unlikely(__pyx_t_3 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(0, 403, __pyx_L1_error)
  }
  __pyx_t_7 = PyList_GET_SIZE(__pyx_t_3); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 403, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_number_of_paths = __pyx_t_7;

  /* "_element_graph.pyx":404
 *         # REMOVAL ROUND 4: INTRON RETENTION
 *         number_of_paths = len(self.paths)
 *         bad_paths = np.zeros(number_of_paths, dtype=bool)             # <<<<<<<<<<<<<<
 *         for i in range(number_of_paths):
 *             path = self.paths[i]
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 404, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 404, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_number_of_paths); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 404, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 404, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 404, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, ((PyObject*)&PyBool_Type)) < 0) __PYX_ERR(0, 404, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 404, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 404, __pyx_L1_error)
  __Pyx_DECREF_SET(__pyx_v_bad_paths, ((PyArrayObject *)__pyx_t_2));
  __pyx_t_2 = 0;

  /* "_element_graph.pyx":405
 *         number_of_paths = len(self.paths)
 *         bad_paths = np.zeros(number_of_paths, dtype=bool)
 *         for i in range(number_of_paths):             # <<<<<<<<<<<<<<
 *             path = self.paths[i]
 *             path_introns = set(path.get_introns())
 */
  __pyx_t_5 = __pyx_v_number_of_paths;
  __pyx_t_10 = __pyx_t_5;
  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
    __pyx_v_i = __pyx_t_11;

    /* "_element_graph.pyx":406
 *         bad_paths = np.zeros(number_of_paths, dtype=bool)
 *         for i in range(number_of_paths):
 *             path = self.paths[i]             # <<<<<<<<<<<<<<
 *             path_introns = set(path.get_introns())
 *             container_cov = 0
 */
    if (unlikely(__pyx_v_self->paths == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 406, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_self->paths, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 406, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_14_element_graph_Element))))) __PYX_ERR(0, 406, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_path, ((struct __pyx_obj_14_element_graph_Element *)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "_element_graph.pyx":407
 *         for i in range(number_of_paths):
 *             path = self.paths[i]
 *             path_introns = set(path.get_introns())             # <<<<<<<<<<<<<<
 *             container_cov = 0
 *             for j in range(number_of_paths):
 */
    __pyx_t_2 = ((struct __pyx_vtabstruct_14_element_graph_Element *)__pyx_v_path->__pyx_vtab)->get_introns(__pyx_v_path, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 407, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PySet_New(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 407, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF_SET(__pyx_v_path_introns, ((PyObject*)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "_element_graph.pyx":408
 *             path = self.paths[i]
 *             path_introns = set(path.get_introns())
 *             container_cov = 0             # <<<<<<<<<<<<<<
 *             for j in range(number_of_paths):
 *                 p = self.paths[j]
 */
    __pyx_v_container_cov = 0.0;

    /* "_element_graph.pyx":409
 *             path_introns = set(path.get_introns())
 *             container_cov = 0
 *             for j in range(number_of_paths):             # <<<<<<<<<<<<<<
 *                 p = self.paths[j]
 *                 if path.RM == p.RM and path.LM == p.LM: # Same start and same end
 */
    __pyx_t_13 = __pyx_v_number_of_paths;
    __pyx_t_14 = __pyx_t_13;
    for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
      __pyx_v_j = __pyx_t_15;

      /* "_element_graph.pyx":410
 *             container_cov = 0
 *             for j in range(number_of_paths):
 *                 p = self.paths[j]             # <<<<<<<<<<<<<<
 *                 if path.RM == p.RM and path.LM == p.LM: # Same start and same end
 *                     other_introns = set(p.get_introns())
 */
      if (unlikely(__pyx_v_self->paths == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(0, 410, __pyx_L1_error)
      }
      __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_self->paths, __pyx_v_j, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 410, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_14_element_graph_Element))))) __PYX_ERR(0, 410, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_p, ((struct __pyx_obj_14_element_graph_Element *)__pyx_t_3));
      __pyx_t_3 = 0;

      /* "_element_graph.pyx":411
 *             for j in range(number_of_paths):
 *                 p = self.paths[j]
 *                 if path.RM == p.RM and path.LM == p.LM: # Same start and same end             # <<<<<<<<<<<<<<
 *                     other_introns = set(p.get_introns())
 *                     if path_introns.issubset(other_introns):
 */
      __pyx_t_9 = ((__pyx_v_path->RM == __pyx_v_p->RM) != 0);
      if (__pyx_t_9) {
      } else {
        __pyx_t_8 = __pyx_t_9;
        goto __pyx_L53_bool_binop_done;
      }
      __pyx_t_9 = ((__pyx_v_path->LM == __pyx_v_p->LM) != 0);
      __pyx_t_8 = __pyx_t_9;
      __pyx_L53_bool_binop_done:;
      if (__pyx_t_8) {

        /* "_element_graph.pyx":412
 *                 p = self.paths[j]
 *                 if path.RM == p.RM and path.LM == p.LM: # Same start and same end
 *                     other_introns = set(p.get_introns())             # <<<<<<<<<<<<<<
 *                     if path_introns.issubset(other_introns):
 *                         container_cov += p.bases / p.length
 */
        __pyx_t_3 = ((struct __pyx_vtabstruct_14_element_graph_Element *)__pyx_v_p->__pyx_vtab)->get_introns(__pyx_v_p, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 412, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_2 = PySet_New(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 412, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF_SET(__pyx_v_other_introns, ((PyObject*)__pyx_t_2));
        __pyx_t_2 = 0;

        /* "_element_graph.pyx":413
 *                 if path.RM == p.RM and path.LM == p.LM: # Same start and same end
 *                     other_introns = set(p.get_introns())
 *                     if path_introns.issubset(other_introns):             # <<<<<<<<<<<<<<
 *                         container_cov += p.bases / p.length
 * 
 */
        __pyx_t_2 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PySet_Type_issubset, __pyx_v_path_introns, __pyx_v_other_introns); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 413, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 413, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (__pyx_t_8) {

          /* "_element_graph.pyx":414
 *                     other_introns = set(p.get_introns())
 *                     if path_introns.issubset(other_introns):
 *                         container_cov += p.bases / p.length             # <<<<<<<<<<<<<<
 * 
 *             if container_cov > 0:
 */
          if (unlikely(__pyx_v_p->length == 0)) {
            PyErr_SetString(PyExc_ZeroDivisionError, "float division");
            __PYX_ERR(0, 414, __pyx_L1_error)
          }
          __pyx_v_container_cov = (__pyx_v_container_cov + (__pyx_v_p->bases / ((float)__pyx_v_p->length)));

          /* "_element_graph.pyx":413
 *                 if path.RM == p.RM and path.LM == p.LM: # Same start and same end
 *                     other_introns = set(p.get_introns())
 *                     if path_introns.issubset(other_introns):             # <<<<<<<<<<<<<<
 *                         container_cov += p.bases / p.length
 * 
 */
        }

        /* "_element_graph.pyx":411
 *             for j in range(number_of_paths):
 *                 p = self.paths[j]
 *                 if path.RM == p.RM and path.LM == p.LM: # Same start and same end             # <<<<<<<<<<<<<<
 *                     other_introns = set(p.get_introns())
 *                     if path_introns.issubset(other_introns):
 */
      }
    }

    /* "_element_graph.pyx":416
 *                         container_cov += p.bases / p.length
 * 
 *             if container_cov > 0:             # <<<<<<<<<<<<<<
 *                 path_cov = path.bases/path.length
 *                 container_cov += path_cov
 */
    __pyx_t_8 = ((__pyx_v_container_cov > 0.0) != 0);
    if (__pyx_t_8) {

      /* "_element_graph.pyx":417
 * 
 *             if container_cov > 0:
 *                 path_cov = path.bases/path.length             # <<<<<<<<<<<<<<
 *                 container_cov += path_cov
 *                 if path_cov < container_cov * self.intron_filter:
 */
      if (unlikely(__pyx_v_path->length == 0)) {
        PyErr_SetString(PyExc_ZeroDivisionError, "float division");
        __PYX_ERR(0, 417, __pyx_L1_error)
      }
      __pyx_v_path_cov = (__pyx_v_path->bases / ((float)__pyx_v_path->length));

      /* "_element_graph.pyx":418
 *             if container_cov > 0:
 *                 path_cov = path.bases/path.length
 *                 container_cov += path_cov             # <<<<<<<<<<<<<<
 *                 if path_cov < container_cov * self.intron_filter:
 *                     bad_paths[i] = True
 */
      __pyx_v_container_cov = (__pyx_v_container_cov + __pyx_v_path_cov);

      /* "_element_graph.pyx":419
 *                 path_cov = path.bases/path.length
 *                 container_cov += path_cov
 *                 if path_cov < container_cov * self.intron_filter:             # <<<<<<<<<<<<<<
 *                     bad_paths[i] = True
 * 
 */
      __pyx_t_8 = ((__pyx_v_path_cov < (__pyx_v_container_cov * __pyx_v_self->intron_filter)) != 0);
      if (__pyx_t_8) {

        /* "_element_graph.pyx":420
 *                 container_cov += path_cov
 *                 if path_cov < container_cov * self.intron_filter:
 *                     bad_paths[i] = True             # <<<<<<<<<<<<<<
 * 
 *         if verbose:
 */
        if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_bad_paths), __pyx_v_i, Py_True, int, 1, __Pyx_PyInt_From_int, 0, 1, 1) < 0)) __PYX_ERR(0, 420, __pyx_L1_error)

        /* "_element_graph.pyx":419
 *                 path_cov = path.bases/path.length
 *                 container_cov += path_cov
 *                 if path_cov < container_cov * self.intron_filter:             # <<<<<<<<<<<<<<
 *                     bad_paths[i] = True
 * 
 */
      }

      /* "_element_graph.pyx":416
 *                         container_cov += p.bases / p.length
 * 
 *             if container_cov > 0:             # <<<<<<<<<<<<<<
 *                 path_cov = path.bases/path.length
 *                 container_cov += path_cov
 */
    }
  }

  /* "_element_graph.pyx":422
 *                     bad_paths[i] = True
 * 
 *         if verbose:             # <<<<<<<<<<<<<<
 *             for i in np.where(bad_paths)[0]:
 *                 print('Removing {}, intron retention.'.format(self.paths[i]))
 */
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_verbose); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 422, __pyx_L1_error)
  if (__pyx_t_8) {

    /* "_element_graph.pyx":423
 * 
 *         if verbose:
 *             for i in np.where(bad_paths)[0]:             # <<<<<<<<<<<<<<
 *                 print('Removing {}, intron retention.'.format(self.paths[i]))
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 423, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_where); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 423, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, ((PyObject *)__pyx_v_bad_paths)) : __Pyx_PyObject_CallOneArg(__pyx_t_1, ((PyObject *)__pyx_v_bad_paths));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 423, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 423, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
      __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0;
      __pyx_t_12 = NULL;
    } else {
      __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 423, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_12 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 423, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    for (;;) {
      if (likely(!__pyx_t_12)) {
        if (likely(PyList_CheckExact(__pyx_t_2))) {
          if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 423, __pyx_L1_error)
          #else
          __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 423, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          #endif
        } else {
          if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 423, __pyx_L1_error)
          #else
          __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 423, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          #endif
        }
      } else {
        __pyx_t_1 = __pyx_t_12(__pyx_t_2);
        if (unlikely(!__pyx_t_1)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 423, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_1);
      }
      __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 423, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_i = __pyx_t_5;

      /* "_element_graph.pyx":424
 *         if verbose:
 *             for i in np.where(bad_paths)[0]:
 *                 print('Removing {}, intron retention.'.format(self.paths[i]))             # <<<<<<<<<<<<<<
 * 
 *         self.remove_paths(list(np.where(bad_paths)[0]))
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Removing_intron_retention, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 424, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (unlikely(__pyx_v_self->paths == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(0, 424, __pyx_L1_error)
      }
      __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_self->paths, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 424, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __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_1)) __PYX_ERR(0, 424, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 424, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "_element_graph.pyx":423
 * 
 *         if verbose:
 *             for i in np.where(bad_paths)[0]:             # <<<<<<<<<<<<<<
 *                 print('Removing {}, intron retention.'.format(self.paths[i]))
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "_element_graph.pyx":422
 *                     bad_paths[i] = True
 * 
 *         if verbose:             # <<<<<<<<<<<<<<
 *             for i in np.where(bad_paths)[0]:
 *                 print('Removing {}, intron retention.'.format(self.paths[i]))
 */
  }

  /* "_element_graph.pyx":426
 *                 print('Removing {}, intron retention.'.format(self.paths[i]))
 * 
 *         self.remove_paths(list(np.where(bad_paths)[0]))             # <<<<<<<<<<<<<<
 *         # REMOVAL ROUND 5: LOW ABUNDANCE
 *         number_of_paths = len(self.paths)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 426, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_where); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 426, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, ((PyObject *)__pyx_v_bad_paths)) : __Pyx_PyObject_CallOneArg(__pyx_t_1, ((PyObject *)__pyx_v_bad_paths));
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 426, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 426, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PySequence_List(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 426, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  ((struct __pyx_vtabstruct_14_element_graph_ElementGraph *)__pyx_v_self->__pyx_vtab)->remove_paths(__pyx_v_self, ((PyObject*)__pyx_t_2), 0);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "_element_graph.pyx":428
 *         self.remove_paths(list(np.where(bad_paths)[0]))
 *         # REMOVAL ROUND 5: LOW ABUNDANCE
 *         number_of_paths = len(self.paths)             # <<<<<<<<<<<<<<
 *         bad_paths = np.zeros(number_of_paths, dtype=bool)
 *         for i in range(number_of_paths):
 */
  __pyx_t_2 = __pyx_v_self->paths;
  __Pyx_INCREF(__pyx_t_2);
  if (unlikely(__pyx_t_2 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(0, 428, __pyx_L1_error)
  }
  __pyx_t_7 = PyList_GET_SIZE(__pyx_t_2); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 428, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_number_of_paths = __pyx_t_7;

  /* "_element_graph.pyx":429
 *         # REMOVAL ROUND 5: LOW ABUNDANCE
 *         number_of_paths = len(self.paths)
 *         bad_paths = np.zeros(number_of_paths, dtype=bool)             # <<<<<<<<<<<<<<
 *         for i in range(number_of_paths):
 *             path = self.paths[i]
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_number_of_paths); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_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_n_s_dtype, ((PyObject*)&PyBool_Type)) < 0) __PYX_ERR(0, 429, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 429, __pyx_L1_error)
  __Pyx_DECREF_SET(__pyx_v_bad_paths, ((PyArrayObject *)__pyx_t_6));
  __pyx_t_6 = 0;

  /* "_element_graph.pyx":430
 *         number_of_paths = len(self.paths)
 *         bad_paths = np.zeros(number_of_paths, dtype=bool)
 *         for i in range(number_of_paths):             # <<<<<<<<<<<<<<
 *             path = self.paths[i]
 *             path_introns = set(path.get_introns())
 */
  __pyx_t_5 = __pyx_v_number_of_paths;
  __pyx_t_10 = __pyx_t_5;
  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
    __pyx_v_i = __pyx_t_11;

    /* "_element_graph.pyx":431
 *         bad_paths = np.zeros(number_of_paths, dtype=bool)
 *         for i in range(number_of_paths):
 *             path = self.paths[i]             # <<<<<<<<<<<<<<
 *             path_introns = set(path.get_introns())
 *             overlapping_cov = 0
 */
    if (unlikely(__pyx_v_self->paths == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 431, __pyx_L1_error)
    }
    __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_self->paths, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 431, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_14_element_graph_Element))))) __PYX_ERR(0, 431, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_path, ((struct __pyx_obj_14_element_graph_Element *)__pyx_t_6));
    __pyx_t_6 = 0;

    /* "_element_graph.pyx":432
 *         for i in range(number_of_paths):
 *             path = self.paths[i]
 *             path_introns = set(path.get_introns())             # <<<<<<<<<<<<<<
 *             overlapping_cov = 0
 *             for j in range(number_of_paths):
 */
    __pyx_t_6 = ((struct __pyx_vtabstruct_14_element_graph_Element *)__pyx_v_path->__pyx_vtab)->get_introns(__pyx_v_path, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 432, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = PySet_New(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 432, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF_SET(__pyx_v_path_introns, ((PyObject*)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "_element_graph.pyx":433
 *             path = self.paths[i]
 *             path_introns = set(path.get_introns())
 *             overlapping_cov = 0             # <<<<<<<<<<<<<<
 *             for j in range(number_of_paths):
 *                 p = self.paths[j]
 */
    __Pyx_INCREF(__pyx_int_0);
    __Pyx_XDECREF_SET(__pyx_v_overlapping_cov, __pyx_int_0);

    /* "_element_graph.pyx":434
 *             path_introns = set(path.get_introns())
 *             overlapping_cov = 0
 *             for j in range(number_of_paths):             # <<<<<<<<<<<<<<
 *                 p = self.paths[j]
 *                 if len(path.members.intersection(p.members)) >= .5*min([len(path.members),len(p.members)]): # Same start and same end
 */
    __pyx_t_13 = __pyx_v_number_of_paths;
    __pyx_t_14 = __pyx_t_13;
    for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
      __pyx_v_j = __pyx_t_15;

      /* "_element_graph.pyx":435
 *             overlapping_cov = 0
 *             for j in range(number_of_paths):
 *                 p = self.paths[j]             # <<<<<<<<<<<<<<
 *                 if len(path.members.intersection(p.members)) >= .5*min([len(path.members),len(p.members)]): # Same start and same end
 *                     overlapping_cov += p.bases / p.length
 */
      if (unlikely(__pyx_v_self->paths == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(0, 435, __pyx_L1_error)
      }
      __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_self->paths, __pyx_v_j, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 435, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_14_element_graph_Element))))) __PYX_ERR(0, 435, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_p, ((struct __pyx_obj_14_element_graph_Element *)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "_element_graph.pyx":436
 *             for j in range(number_of_paths):
 *                 p = self.paths[j]
 *                 if len(path.members.intersection(p.members)) >= .5*min([len(path.members),len(p.members)]): # Same start and same end             # <<<<<<<<<<<<<<
 *                     overlapping_cov += p.bases / p.length
 * 
 */
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_path->members, __pyx_n_s_intersection); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 436, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_3 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_3, __pyx_v_p->members) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_p->members);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 436, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_7 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 436, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __pyx_v_p->members;
      __Pyx_INCREF(__pyx_t_2);
      if (unlikely(__pyx_t_2 == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
        __PYX_ERR(0, 436, __pyx_L1_error)
      }
      __pyx_t_18 = PySet_GET_SIZE(__pyx_t_2); if (unlikely(__pyx_t_18 == ((Py_ssize_t)-1))) __PYX_ERR(0, 436, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __pyx_v_path->members;
      __Pyx_INCREF(__pyx_t_2);
      if (unlikely(__pyx_t_2 == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
        __PYX_ERR(0, 436, __pyx_L1_error)
      }
      __pyx_t_19 = PySet_GET_SIZE(__pyx_t_2); if (unlikely(__pyx_t_19 == ((Py_ssize_t)-1))) __PYX_ERR(0, 436, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (((__pyx_t_18 < __pyx_t_19) != 0)) {
        __pyx_t_20 = __pyx_t_18;
      } else {
        __pyx_t_20 = __pyx_t_19;
      }
      __pyx_t_8 = ((__pyx_t_7 >= (.5 * __pyx_t_20)) != 0);
      if (__pyx_t_8) {

        /* "_element_graph.pyx":437
 *                 p = self.paths[j]
 *                 if len(path.members.intersection(p.members)) >= .5*min([len(path.members),len(p.members)]): # Same start and same end
 *                     overlapping_cov += p.bases / p.length             # <<<<<<<<<<<<<<
 * 
 *             if overlapping_cov > 0:
 */
        if (unlikely(__pyx_v_p->length == 0)) {
          PyErr_SetString(PyExc_ZeroDivisionError, "float division");
          __PYX_ERR(0, 437, __pyx_L1_error)
        }
        __pyx_t_2 = PyFloat_FromDouble((__pyx_v_p->bases / ((float)__pyx_v_p->length))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 437, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_overlapping_cov, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 437, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF_SET(__pyx_v_overlapping_cov, __pyx_t_6);
        __pyx_t_6 = 0;

        /* "_element_graph.pyx":436
 *             for j in range(number_of_paths):
 *                 p = self.paths[j]
 *                 if len(path.members.intersection(p.members)) >= .5*min([len(path.members),len(p.members)]): # Same start and same end             # <<<<<<<<<<<<<<
 *                     overlapping_cov += p.bases / p.length
 * 
 */
      }
    }

    /* "_element_graph.pyx":439
 *                     overlapping_cov += p.bases / p.length
 * 
 *             if overlapping_cov > 0:             # <<<<<<<<<<<<<<
 *                 path_cov = path.bases/path.length
 *                 overlapping_cov += path_cov
 */
    __pyx_t_6 = PyObject_RichCompare(__pyx_v_overlapping_cov, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 439, __pyx_L1_error)
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 439, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (__pyx_t_8) {

      /* "_element_graph.pyx":440
 * 
 *             if overlapping_cov > 0:
 *                 path_cov = path.bases/path.length             # <<<<<<<<<<<<<<
 *                 overlapping_cov += path_cov
 *                 if path_cov < overlapping_cov * minimum_proportion:
 */
      if (unlikely(__pyx_v_path->length == 0)) {
        PyErr_SetString(PyExc_ZeroDivisionError, "float division");
        __PYX_ERR(0, 440, __pyx_L1_error)
      }
      __pyx_v_path_cov = (__pyx_v_path->bases / ((float)__pyx_v_path->length));

      /* "_element_graph.pyx":441
 *             if overlapping_cov > 0:
 *                 path_cov = path.bases/path.length
 *                 overlapping_cov += path_cov             # <<<<<<<<<<<<<<
 *                 if path_cov < overlapping_cov * minimum_proportion:
 *                     bad_paths[i] = True
 */
      __pyx_t_6 = PyFloat_FromDouble(__pyx_v_path_cov); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 441, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_overlapping_cov, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 441, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF_SET(__pyx_v_overlapping_cov, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "_element_graph.pyx":442
 *                 path_cov = path.bases/path.length
 *                 overlapping_cov += path_cov
 *                 if path_cov < overlapping_cov * minimum_proportion:             # <<<<<<<<<<<<<<
 *                     bad_paths[i] = True
 * 
 */
      __pyx_t_2 = PyFloat_FromDouble(__pyx_v_path_cov); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 442, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_6 = PyNumber_Multiply(__pyx_v_overlapping_cov, __pyx_v_minimum_proportion); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 442, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_6, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 442, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 442, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_8) {

        /* "_element_graph.pyx":443
 *                 overlapping_cov += path_cov
 *                 if path_cov < overlapping_cov * minimum_proportion:
 *                     bad_paths[i] = True             # <<<<<<<<<<<<<<
 * 
 *         if verbose:
 */
        if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_bad_paths), __pyx_v_i, Py_True, int, 1, __Pyx_PyInt_From_int, 0, 1, 1) < 0)) __PYX_ERR(0, 443, __pyx_L1_error)

        /* "_element_graph.pyx":442
 *                 path_cov = path.bases/path.length
 *                 overlapping_cov += path_cov
 *                 if path_cov < overlapping_cov * minimum_proportion:             # <<<<<<<<<<<<<<
 *                     bad_paths[i] = True
 * 
 */
      }

      /* "_element_graph.pyx":439
 *                     overlapping_cov += p.bases / p.length
 * 
 *             if overlapping_cov > 0:             # <<<<<<<<<<<<<<
 *                 path_cov = path.bases/path.length
 *                 overlapping_cov += path_cov
 */
    }
  }

  /* "_element_graph.pyx":445
 *                     bad_paths[i] = True
 * 
 *         if verbose:             # <<<<<<<<<<<<<<
 *             for i in np.where(bad_paths)[0]:
 *                 print('Removing {}, low abundance.'.format(self.paths[i]))
 */
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_verbose); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 445, __pyx_L1_error)
  if (__pyx_t_8) {

    /* "_element_graph.pyx":446
 * 
 *         if verbose:
 *             for i in np.where(bad_paths)[0]:             # <<<<<<<<<<<<<<
 *                 print('Removing {}, low abundance.'.format(self.paths[i]))
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 446, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_where); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 446, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_6, ((PyObject *)__pyx_v_bad_paths)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_bad_paths));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 446, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 446, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
      __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_20 = 0;
      __pyx_t_12 = NULL;
    } else {
      __pyx_t_20 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 446, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_12 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 446, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    for (;;) {
      if (likely(!__pyx_t_12)) {
        if (likely(PyList_CheckExact(__pyx_t_3))) {
          if (__pyx_t_20 >= PyList_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_20); __Pyx_INCREF(__pyx_t_2); __pyx_t_20++; if (unlikely(0 < 0)) __PYX_ERR(0, 446, __pyx_L1_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_20); __pyx_t_20++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 446, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        } else {
          if (__pyx_t_20 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_20); __Pyx_INCREF(__pyx_t_2); __pyx_t_20++; if (unlikely(0 < 0)) __PYX_ERR(0, 446, __pyx_L1_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_20); __pyx_t_20++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 446, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        }
      } else {
        __pyx_t_2 = __pyx_t_12(__pyx_t_3);
        if (unlikely(!__pyx_t_2)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 446, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_2);
      }
      __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 446, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_i = __pyx_t_5;

      /* "_element_graph.pyx":447
 *         if verbose:
 *             for i in np.where(bad_paths)[0]:
 *                 print('Removing {}, low abundance.'.format(self.paths[i]))             # <<<<<<<<<<<<<<
 * 
 *         self.remove_paths(list(np.where(bad_paths)[0]))
 */
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Removing_low_abundance, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 447, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (unlikely(__pyx_v_self->paths == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(0, 447, __pyx_L1_error)
      }
      __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_self->paths, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 447, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_4, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_1);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 447, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 447, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "_element_graph.pyx":446
 * 
 *         if verbose:
 *             for i in np.where(bad_paths)[0]:             # <<<<<<<<<<<<<<
 *                 print('Removing {}, low abundance.'.format(self.paths[i]))
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "_element_graph.pyx":445
 *                     bad_paths[i] = True
 * 
 *         if verbose:             # <<<<<<<<<<<<<<
 *             for i in np.where(bad_paths)[0]:
 *                 print('Removing {}, low abundance.'.format(self.paths[i]))
 */
  }

  /* "_element_graph.pyx":449
 *                 print('Removing {}, low abundance.'.format(self.paths[i]))
 * 
 *         self.remove_paths(list(np.where(bad_paths)[0]))             # <<<<<<<<<<<<<<
 * 
 *     cpdef np.ndarray available_proportion(self, np.ndarray weights, Element element):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 449, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_where); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 449, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_6, ((PyObject *)__pyx_v_bad_paths)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_bad_paths));
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 449, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 449, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PySequence_List(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 449, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  ((struct __pyx_vtabstruct_14_element_graph_ElementGraph *)__pyx_v_self->__pyx_vtab)->remove_paths(__pyx_v_self, ((PyObject*)__pyx_t_3), 0);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "_element_graph.pyx":324
 *             self.remove_bad_assemblies(minimum_proportion)
 * 
 *     cpdef void remove_bad_assemblies(self, minimum_proportion, verbose=False):             # <<<<<<<<<<<<<<
 *         cdef np.ndarray bad_paths
 *         cdef int number_of_paths, i
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_WriteUnraisable("_element_graph.ElementGraph.remove_bad_assemblies", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_bad_paths);
  __Pyx_XDECREF(__pyx_v_m);
  __Pyx_XDECREF(__pyx_v_path_introns);
  __Pyx_XDECREF(__pyx_v_other_introns);
  __Pyx_XDECREF(__pyx_v_contained_ranges);
  __Pyx_XDECREF((PyObject *)__pyx_v_path);
  __Pyx_XDECREF((PyObject *)__pyx_v_p);
  __Pyx_XDECREF(__pyx_v_pm);
  __Pyx_XDECREF(__pyx_v_overlapping_cov);
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_15remove_bad_assemblies(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_15remove_bad_assemblies(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_minimum_proportion = 0;
  PyObject *__pyx_v_verbose = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("remove_bad_assemblies (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_minimum_proportion,&__pyx_n_s_verbose,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_False);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_minimum_proportion)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_verbose);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "remove_bad_assemblies") < 0)) __PYX_ERR(0, 324, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_minimum_proportion = values[0];
    __pyx_v_verbose = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("remove_bad_assemblies", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 324, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("_element_graph.ElementGraph.remove_bad_assemblies", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_14remove_bad_assemblies(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self), __pyx_v_minimum_proportion, __pyx_v_verbose);

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

static PyObject *__pyx_pf_14_element_graph_12ElementGraph_14remove_bad_assemblies(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, PyObject *__pyx_v_minimum_proportion, PyObject *__pyx_v_verbose) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct __pyx_opt_args_14_element_graph_12ElementGraph_remove_bad_assemblies __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("remove_bad_assemblies", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1.__pyx_n = 1;
  __pyx_t_1.verbose = __pyx_v_verbose;
  __pyx_vtabptr_14_element_graph_ElementGraph->remove_bad_assemblies(__pyx_v_self, __pyx_v_minimum_proportion, 1, &__pyx_t_1); 
  __pyx_t_2 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 324, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

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

/* "_element_graph.pyx":451
 *         self.remove_paths(list(np.where(bad_paths)[0]))
 * 
 *     cpdef np.ndarray available_proportion(self, np.ndarray weights, Element element):             # <<<<<<<<<<<<<<
 *         """Given a path that wants to merge with the indexed element,
 *         calculate how much coverage is actually available to the path."""
 */

static PyObject *__pyx_pw_14_element_graph_12ElementGraph_17available_proportion(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyArrayObject *__pyx_f_14_element_graph_12ElementGraph_available_proportion(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, PyArrayObject *__pyx_v_weights, struct __pyx_obj_14_element_graph_Element *__pyx_v_element, int __pyx_skip_dispatch) {
  PyArrayObject *__pyx_v_assigned_weights = 0;
  PyArrayObject *__pyx_v_proportion = 0;
  int __pyx_v_i;
  struct __pyx_obj_14_element_graph_Element *__pyx_v_path = 0;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  int __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  int __pyx_t_10;
  PyObject *(*__pyx_t_11)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("available_proportion", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_available_proportion); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 451, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_14_element_graph_12ElementGraph_17available_proportion)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        __pyx_t_5 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
            __pyx_t_5 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[3] = {__pyx_t_4, ((PyObject *)__pyx_v_weights), ((PyObject *)__pyx_v_element)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 451, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[3] = {__pyx_t_4, ((PyObject *)__pyx_v_weights), ((PyObject *)__pyx_v_element)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 451, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 451, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          if (__pyx_t_4) {
            __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
          }
          __Pyx_INCREF(((PyObject *)__pyx_v_weights));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_weights));
          PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, ((PyObject *)__pyx_v_weights));
          __Pyx_INCREF(((PyObject *)__pyx_v_element));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_element));
          PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, ((PyObject *)__pyx_v_element));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 451, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        }
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 451, __pyx_L1_error)
        __pyx_r = ((PyArrayObject *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "_element_graph.pyx":461
 *             Element path
 *             # set outside_element
 *         if len(element.assigned_to) == 0: # No competition, all reads are available             # <<<<<<<<<<<<<<
 *             return element.all
 * 
 */
  __pyx_t_1 = __pyx_v_element->assigned_to;
  __Pyx_INCREF(__pyx_t_1);
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(0, 461, __pyx_L1_error)
  }
  __pyx_t_7 = PySet_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 461, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_8 = ((__pyx_t_7 == 0) != 0);
  if (__pyx_t_8) {

    /* "_element_graph.pyx":462
 *             # set outside_element
 *         if len(element.assigned_to) == 0: # No competition, all reads are available
 *             return element.all             # <<<<<<<<<<<<<<
 * 
 *         assigned_weights = np.copy(weights)
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_element->all));
    __pyx_r = __pyx_v_element->all;
    goto __pyx_L0;

    /* "_element_graph.pyx":461
 *             Element path
 *             # set outside_element
 *         if len(element.assigned_to) == 0: # No competition, all reads are available             # <<<<<<<<<<<<<<
 *             return element.all
 * 
 */
  }

  /* "_element_graph.pyx":464
 *             return element.all
 * 
 *         assigned_weights = np.copy(weights)             # <<<<<<<<<<<<<<
 *         for i in element.assigned_to:
 *             path = self.paths[i]
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 464, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 464, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, ((PyObject *)__pyx_v_weights)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_weights));
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 464, __pyx_L1_error)
  __pyx_v_assigned_weights = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "_element_graph.pyx":465
 * 
 *         assigned_weights = np.copy(weights)
 *         for i in element.assigned_to:             # <<<<<<<<<<<<<<
 *             path = self.paths[i]
 *             assigned_weights += path.source_weights
 */
  __pyx_t_7 = 0;
  __pyx_t_3 = __Pyx_set_iterator(__pyx_v_element->assigned_to, 1, (&__pyx_t_9), (&__pyx_t_5)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 465, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_1);
  __pyx_t_1 = __pyx_t_3;
  __pyx_t_3 = 0;
  while (1) {
    __pyx_t_10 = __Pyx_set_iter_next(__pyx_t_1, __pyx_t_9, &__pyx_t_7, &__pyx_t_3, __pyx_t_5);
    if (unlikely(__pyx_t_10 == 0)) break;
    if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 465, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 465, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_i = __pyx_t_10;

    /* "_element_graph.pyx":466
 *         assigned_weights = np.copy(weights)
 *         for i in element.assigned_to:
 *             path = self.paths[i]             # <<<<<<<<<<<<<<
 *             assigned_weights += path.source_weights
 *             # if len(element.members.intersection(path.bottleneck)) > 0: # Element is in path's bottleneck
 */
    if (unlikely(__pyx_v_self->paths == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 466, __pyx_L1_error)
    }
    __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_self->paths, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 466, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_14_element_graph_Element))))) __PYX_ERR(0, 466, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_path, ((struct __pyx_obj_14_element_graph_Element *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "_element_graph.pyx":467
 *         for i in element.assigned_to:
 *             path = self.paths[i]
 *             assigned_weights += path.source_weights             # <<<<<<<<<<<<<<
 *             # if len(element.members.intersection(path.bottleneck)) > 0: # Element is in path's bottleneck
 *             #     return np.zeros(element.all.shape[0], dtype=np.float32)
 */
    __pyx_t_3 = PyNumber_InPlaceAdd(((PyObject *)__pyx_v_assigned_weights), ((PyObject *)__pyx_v_path->source_weights)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 467, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 467, __pyx_L1_error)
    __Pyx_DECREF_SET(__pyx_v_assigned_weights, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_element_graph.pyx":471
 *             #     return np.zeros(element.all.shape[0], dtype=np.float32)
 * 
 *         proportion = np.ones(weights.shape[0], dtype=np.float32)             # <<<<<<<<<<<<<<
 *         for i in np.where(assigned_weights > weights)[0]:
 *             proportion[i] = weights[i]/assigned_weights[i]
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 471, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ones); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 471, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_weights->dimensions[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 471, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 471, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 471, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 471, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_float32); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 471, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 471, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 471, __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_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 471, __pyx_L1_error)
  __pyx_v_proportion = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "_element_graph.pyx":472
 * 
 *         proportion = np.ones(weights.shape[0], dtype=np.float32)
 *         for i in np.where(assigned_weights > weights)[0]:             # <<<<<<<<<<<<<<
 *             proportion[i] = weights[i]/assigned_weights[i]
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_where); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 472, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_RichCompare(((PyObject *)__pyx_v_assigned_weights), ((PyObject *)__pyx_v_weights), Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L1_error)
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_4 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 472, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 472, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_4 = __pyx_t_2; __Pyx_INCREF(__pyx_t_4); __pyx_t_9 = 0;
    __pyx_t_11 = NULL;
  } else {
    __pyx_t_9 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 472, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_11 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 472, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_11)) {
      if (likely(PyList_CheckExact(__pyx_t_4))) {
        if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_9); __Pyx_INCREF(__pyx_t_2); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 472, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 472, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_9); __Pyx_INCREF(__pyx_t_2); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 472, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 472, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_11(__pyx_t_4);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 472, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 472, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_i = __pyx_t_5;

    /* "_element_graph.pyx":473
 *         proportion = np.ones(weights.shape[0], dtype=np.float32)
 *         for i in np.where(assigned_weights > weights)[0]:
 *             proportion[i] = weights[i]/assigned_weights[i]             # <<<<<<<<<<<<<<
 * 
 *         return proportion
 */
    __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_weights), __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 473, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_assigned_weights), __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 473, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 473, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_proportion), __pyx_v_i, __pyx_t_3, int, 1, __Pyx_PyInt_From_int, 0, 1, 1) < 0)) __PYX_ERR(0, 473, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "_element_graph.pyx":472
 * 
 *         proportion = np.ones(weights.shape[0], dtype=np.float32)
 *         for i in np.where(assigned_weights > weights)[0]:             # <<<<<<<<<<<<<<
 *             proportion[i] = weights[i]/assigned_weights[i]
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "_element_graph.pyx":475
 *             proportion[i] = weights[i]/assigned_weights[i]
 * 
 *         return proportion             # <<<<<<<<<<<<<<
 * 
 *     cpdef float available_bases(self, np.ndarray weights, Element element):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_proportion));
  __pyx_r = __pyx_v_proportion;
  goto __pyx_L0;

  /* "_element_graph.pyx":451
 *         self.remove_paths(list(np.where(bad_paths)[0]))
 * 
 *     cpdef np.ndarray available_proportion(self, np.ndarray weights, Element element):             # <<<<<<<<<<<<<<
 *         """Given a path that wants to merge with the indexed element,
 *         calculate how much coverage is actually available to the path."""
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("_element_graph.ElementGraph.available_proportion", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_assigned_weights);
  __Pyx_XDECREF((PyObject *)__pyx_v_proportion);
  __Pyx_XDECREF((PyObject *)__pyx_v_path);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_17available_proportion(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_14_element_graph_12ElementGraph_16available_proportion[] = "Given a path that wants to merge with the indexed element,\n        calculate how much coverage is actually available to the path.";
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_17available_proportion(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_weights = 0;
  struct __pyx_obj_14_element_graph_Element *__pyx_v_element = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("available_proportion (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_weights,&__pyx_n_s_element,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_weights)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_element)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("available_proportion", 1, 2, 2, 1); __PYX_ERR(0, 451, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "available_proportion") < 0)) __PYX_ERR(0, 451, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_weights = ((PyArrayObject *)values[0]);
    __pyx_v_element = ((struct __pyx_obj_14_element_graph_Element *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("available_proportion", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 451, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("_element_graph.ElementGraph.available_proportion", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_weights), __pyx_ptype_5numpy_ndarray, 1, "weights", 0))) __PYX_ERR(0, 451, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_element), __pyx_ptype_14_element_graph_Element, 1, "element", 0))) __PYX_ERR(0, 451, __pyx_L1_error)
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_16available_proportion(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self), __pyx_v_weights, __pyx_v_element);

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

static PyObject *__pyx_pf_14_element_graph_12ElementGraph_16available_proportion(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, PyArrayObject *__pyx_v_weights, struct __pyx_obj_14_element_graph_Element *__pyx_v_element) {
  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("available_proportion", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_14_element_graph_12ElementGraph_available_proportion(__pyx_v_self, __pyx_v_weights, __pyx_v_element, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 451, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "_element_graph.pyx":477
 *         return proportion
 * 
 *     cpdef float available_bases(self, np.ndarray weights, Element element):             # <<<<<<<<<<<<<<
 *         """Given a path to merge, calculate the number of bases available for merging"""
 *         cdef np.ndarray proportion
 */

static PyObject *__pyx_pw_14_element_graph_12ElementGraph_19available_bases(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static float __pyx_f_14_element_graph_12ElementGraph_available_bases(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, PyArrayObject *__pyx_v_weights, struct __pyx_obj_14_element_graph_Element *__pyx_v_element, int __pyx_skip_dispatch) {
  PyArrayObject *__pyx_v_proportion = 0;
  float __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  float __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("available_bases", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_available_bases); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 477, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_14_element_graph_12ElementGraph_19available_bases)) {
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        __pyx_t_5 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
            __pyx_t_5 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[3] = {__pyx_t_4, ((PyObject *)__pyx_v_weights), ((PyObject *)__pyx_v_element)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 477, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[3] = {__pyx_t_4, ((PyObject *)__pyx_v_weights), ((PyObject *)__pyx_v_element)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 477, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 477, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          if (__pyx_t_4) {
            __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
          }
          __Pyx_INCREF(((PyObject *)__pyx_v_weights));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_weights));
          PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, ((PyObject *)__pyx_v_weights));
          __Pyx_INCREF(((PyObject *)__pyx_v_element));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_element));
          PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, ((PyObject *)__pyx_v_element));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 477, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        }
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_7 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_7 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 477, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_7;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "_element_graph.pyx":480
 *         """Given a path to merge, calculate the number of bases available for merging"""
 *         cdef np.ndarray proportion
 *         proportion = self.available_proportion(weights, element)             # <<<<<<<<<<<<<<
 *         return np.sum(element.source_weights*proportion)*element.length
 * 
 */
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_14_element_graph_ElementGraph *)__pyx_v_self->__pyx_vtab)->available_proportion(__pyx_v_self, __pyx_v_weights, __pyx_v_element, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 480, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_proportion = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "_element_graph.pyx":481
 *         cdef np.ndarray proportion
 *         proportion = self.available_proportion(weights, element)
 *         return np.sum(element.source_weights*proportion)*element.length             # <<<<<<<<<<<<<<
 * 
 *     cpdef void extend_path(self, Element path, tuple extension):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 481, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_sum); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 481, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Multiply(((PyObject *)__pyx_v_element->source_weights), ((PyObject *)__pyx_v_proportion)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 481, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_6, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 481, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_element->length); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 481, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyNumber_Multiply(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 481, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_7 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_7 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 481, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_7;
  goto __pyx_L0;

  /* "_element_graph.pyx":477
 *         return proportion
 * 
 *     cpdef float available_bases(self, np.ndarray weights, Element element):             # <<<<<<<<<<<<<<
 *         """Given a path to merge, calculate the number of bases available for merging"""
 *         cdef np.ndarray proportion
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_WriteUnraisable("_element_graph.ElementGraph.available_bases", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_proportion);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_19available_bases(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_14_element_graph_12ElementGraph_18available_bases[] = "Given a path to merge, calculate the number of bases available for merging";
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_19available_bases(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_weights = 0;
  struct __pyx_obj_14_element_graph_Element *__pyx_v_element = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("available_bases (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_weights,&__pyx_n_s_element,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_weights)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_element)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("available_bases", 1, 2, 2, 1); __PYX_ERR(0, 477, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "available_bases") < 0)) __PYX_ERR(0, 477, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_weights = ((PyArrayObject *)values[0]);
    __pyx_v_element = ((struct __pyx_obj_14_element_graph_Element *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("available_bases", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 477, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("_element_graph.ElementGraph.available_bases", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_weights), __pyx_ptype_5numpy_ndarray, 1, "weights", 0))) __PYX_ERR(0, 477, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_element), __pyx_ptype_14_element_graph_Element, 1, "element", 0))) __PYX_ERR(0, 477, __pyx_L1_error)
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_18available_bases(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self), __pyx_v_weights, __pyx_v_element);

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

static PyObject *__pyx_pf_14_element_graph_12ElementGraph_18available_bases(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, PyArrayObject *__pyx_v_weights, struct __pyx_obj_14_element_graph_Element *__pyx_v_element) {
  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("available_bases", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_f_14_element_graph_12ElementGraph_available_bases(__pyx_v_self, __pyx_v_weights, __pyx_v_element, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 477, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "_element_graph.pyx":483
 *         return np.sum(element.source_weights*proportion)*element.length
 * 
 *     cpdef void extend_path(self, Element path, tuple extension):             # <<<<<<<<<<<<<<
 *         """Merges the proper
 *         """
 */

static PyObject *__pyx_pw_14_element_graph_12ElementGraph_21extend_path(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_14_element_graph_12ElementGraph_extend_path(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, struct __pyx_obj_14_element_graph_Element *__pyx_v_path, PyObject *__pyx_v_extension, int __pyx_skip_dispatch) {
  struct __pyx_obj_14_element_graph_Element *__pyx_v_extpath = 0;
  int __pyx_v_i;
  PyArrayObject *__pyx_v_prior_weights = 0;
  PyArrayObject *__pyx_v_proportion = 0;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("extend_path", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_extend_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 483, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_14_element_graph_12ElementGraph_21extend_path)) {
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        __pyx_t_5 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
            __pyx_t_5 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[3] = {__pyx_t_4, ((PyObject *)__pyx_v_path), __pyx_v_extension};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 483, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[3] = {__pyx_t_4, ((PyObject *)__pyx_v_path), __pyx_v_extension};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 483, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 483, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          if (__pyx_t_4) {
            __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
          }
          __Pyx_INCREF(((PyObject *)__pyx_v_path));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_path));
          PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, ((PyObject *)__pyx_v_path));
          __Pyx_INCREF(__pyx_v_extension);
          __Pyx_GIVEREF(__pyx_v_extension);
          PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_extension);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 483, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        }
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "_element_graph.pyx":489
 *         cdef int i
 *         cdef np.ndarray prior_weights, proportion
 *         prior_weights = np.copy(path.source_weights)             # <<<<<<<<<<<<<<
 *         for i in range(len(extension)):
 *             if extension[i] not in path.includes:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 489, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 489, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, ((PyObject *)__pyx_v_path->source_weights)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_path->source_weights));
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 489, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 489, __pyx_L1_error)
  __pyx_v_prior_weights = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "_element_graph.pyx":490
 *         cdef np.ndarray prior_weights, proportion
 *         prior_weights = np.copy(path.source_weights)
 *         for i in range(len(extension)):             # <<<<<<<<<<<<<<
 *             if extension[i] not in path.includes:
 *                 extpath = self.elements[extension[i]]
 */
  if (unlikely(__pyx_v_extension == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(0, 490, __pyx_L1_error)
  }
  __pyx_t_7 = PyTuple_GET_SIZE(__pyx_v_extension); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 490, __pyx_L1_error)
  __pyx_t_8 = __pyx_t_7;
  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_8; __pyx_t_5+=1) {
    __pyx_v_i = __pyx_t_5;

    /* "_element_graph.pyx":491
 *         prior_weights = np.copy(path.source_weights)
 *         for i in range(len(extension)):
 *             if extension[i] not in path.includes:             # <<<<<<<<<<<<<<
 *                 extpath = self.elements[extension[i]]
 *                 proportion = self.available_proportion(prior_weights, extpath)
 */
    if (unlikely(__pyx_v_extension == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 491, __pyx_L1_error)
    }
    __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v_extension, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 491, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (unlikely(__pyx_v_path->includes == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(0, 491, __pyx_L1_error)
    }
    __pyx_t_9 = (__Pyx_PySet_ContainsTF(__pyx_t_1, __pyx_v_path->includes, Py_NE)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 491, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_10 = (__pyx_t_9 != 0);
    if (__pyx_t_10) {

      /* "_element_graph.pyx":492
 *         for i in range(len(extension)):
 *             if extension[i] not in path.includes:
 *                 extpath = self.elements[extension[i]]             # <<<<<<<<<<<<<<
 *                 proportion = self.available_proportion(prior_weights, extpath)
 *                 path.merge(extpath, proportion)
 */
      if (unlikely(__pyx_v_self->elements == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(0, 492, __pyx_L1_error)
      }
      if (unlikely(__pyx_v_extension == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(0, 492, __pyx_L1_error)
      }
      __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v_extension, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 492, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_self->elements, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 492, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_14_element_graph_Element))))) __PYX_ERR(0, 492, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_extpath, ((struct __pyx_obj_14_element_graph_Element *)__pyx_t_3));
      __pyx_t_3 = 0;

      /* "_element_graph.pyx":493
 *             if extension[i] not in path.includes:
 *                 extpath = self.elements[extension[i]]
 *                 proportion = self.available_proportion(prior_weights, extpath)             # <<<<<<<<<<<<<<
 *                 path.merge(extpath, proportion)
 * 
 */
      __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_14_element_graph_ElementGraph *)__pyx_v_self->__pyx_vtab)->available_proportion(__pyx_v_self, __pyx_v_prior_weights, __pyx_v_extpath, 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 493, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_XDECREF_SET(__pyx_v_proportion, ((PyArrayObject *)__pyx_t_3));
      __pyx_t_3 = 0;

      /* "_element_graph.pyx":494
 *                 extpath = self.elements[extension[i]]
 *                 proportion = self.available_proportion(prior_weights, extpath)
 *                 path.merge(extpath, proportion)             # <<<<<<<<<<<<<<
 * 
 *     cpdef Element get_heaviest_element(self):
 */
      ((struct __pyx_vtabstruct_14_element_graph_Element *)__pyx_v_path->__pyx_vtab)->merge(__pyx_v_path, __pyx_v_extpath, __pyx_v_proportion, 0);

      /* "_element_graph.pyx":491
 *         prior_weights = np.copy(path.source_weights)
 *         for i in range(len(extension)):
 *             if extension[i] not in path.includes:             # <<<<<<<<<<<<<<
 *                 extpath = self.elements[extension[i]]
 *                 proportion = self.available_proportion(prior_weights, extpath)
 */
    }
  }

  /* "_element_graph.pyx":483
 *         return np.sum(element.source_weights*proportion)*element.length
 * 
 *     cpdef void extend_path(self, Element path, tuple extension):             # <<<<<<<<<<<<<<
 *         """Merges the proper
 *         """
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_WriteUnraisable("_element_graph.ElementGraph.extend_path", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_extpath);
  __Pyx_XDECREF((PyObject *)__pyx_v_prior_weights);
  __Pyx_XDECREF((PyObject *)__pyx_v_proportion);
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_21extend_path(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_14_element_graph_12ElementGraph_20extend_path[] = "Merges the proper \n        ";
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_21extend_path(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_14_element_graph_Element *__pyx_v_path = 0;
  PyObject *__pyx_v_extension = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("extend_path (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,&__pyx_n_s_extension,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_path)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_extension)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("extend_path", 1, 2, 2, 1); __PYX_ERR(0, 483, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "extend_path") < 0)) __PYX_ERR(0, 483, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_path = ((struct __pyx_obj_14_element_graph_Element *)values[0]);
    __pyx_v_extension = ((PyObject*)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("extend_path", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 483, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("_element_graph.ElementGraph.extend_path", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_path), __pyx_ptype_14_element_graph_Element, 1, "path", 0))) __PYX_ERR(0, 483, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_extension), (&PyTuple_Type), 1, "extension", 1))) __PYX_ERR(0, 483, __pyx_L1_error)
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_20extend_path(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self), __pyx_v_path, __pyx_v_extension);

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

static PyObject *__pyx_pf_14_element_graph_12ElementGraph_20extend_path(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, struct __pyx_obj_14_element_graph_Element *__pyx_v_path, PyObject *__pyx_v_extension) {
  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("extend_path", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_14_element_graph_12ElementGraph_extend_path(__pyx_v_self, __pyx_v_path, __pyx_v_extension, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 483, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "_element_graph.pyx":496
 *                 path.merge(extpath, proportion)
 * 
 *     cpdef Element get_heaviest_element(self):             # <<<<<<<<<<<<<<
 *         cdef Element best_element, new_element
 *         cdef float most_bases
 */

static PyObject *__pyx_pw_14_element_graph_12ElementGraph_23get_heaviest_element(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static struct __pyx_obj_14_element_graph_Element *__pyx_f_14_element_graph_12ElementGraph_get_heaviest_element(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, int __pyx_skip_dispatch) {
  struct __pyx_obj_14_element_graph_Element *__pyx_v_best_element = 0;
  struct __pyx_obj_14_element_graph_Element *__pyx_v_new_element = 0;
  int __pyx_v_c;
  PyArrayObject *__pyx_v_available_elements = 0;
  PyObject *__pyx_v_most_cov = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_new_cov = NULL;
  struct __pyx_obj_14_element_graph_Element *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  int __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  PyObject *(*__pyx_t_11)(PyObject *);
  Py_ssize_t __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_heaviest_element", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_heaviest_element); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 496, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_14_element_graph_12ElementGraph_23get_heaviest_element)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 496, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_14_element_graph_Element))))) __PYX_ERR(0, 496, __pyx_L1_error)
        __pyx_r = ((struct __pyx_obj_14_element_graph_Element *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "_element_graph.pyx":500
 *         cdef float most_bases
 *         cdef int c
 *         cdef np.ndarray available_elements = np.where(self.assignments==0)[0]             # <<<<<<<<<<<<<<
 *         if len(available_elements) == 0:
 *             return self.emptyPath
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 500, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_where); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 500, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_RichCompare(((PyObject *)__pyx_v_self->assignments), __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 500, __pyx_L1_error)
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 500, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 500, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 500, __pyx_L1_error)
  __pyx_v_available_elements = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "_element_graph.pyx":501
 *         cdef int c
 *         cdef np.ndarray available_elements = np.where(self.assignments==0)[0]
 *         if len(available_elements) == 0:             # <<<<<<<<<<<<<<
 *             return self.emptyPath
 * 
 */
  __pyx_t_5 = PyObject_Length(((PyObject *)__pyx_v_available_elements)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 501, __pyx_L1_error)
  __pyx_t_6 = ((__pyx_t_5 == 0) != 0);
  if (__pyx_t_6) {

    /* "_element_graph.pyx":502
 *         cdef np.ndarray available_elements = np.where(self.assignments==0)[0]
 *         if len(available_elements) == 0:
 *             return self.emptyPath             # <<<<<<<<<<<<<<
 * 
 *         best_element = self.elements[available_elements[0]]
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_self->emptyPath));
    __pyx_r = __pyx_v_self->emptyPath;
    goto __pyx_L0;

    /* "_element_graph.pyx":501
 *         cdef int c
 *         cdef np.ndarray available_elements = np.where(self.assignments==0)[0]
 *         if len(available_elements) == 0:             # <<<<<<<<<<<<<<
 *             return self.emptyPath
 * 
 */
  }

  /* "_element_graph.pyx":504
 *             return self.emptyPath
 * 
 *         best_element = self.elements[available_elements[0]]             # <<<<<<<<<<<<<<
 *         most_cov = best_element.bases
 *         for c in best_element.contains:
 */
  if (unlikely(__pyx_v_self->elements == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(0, 504, __pyx_L1_error)
  }
  __pyx_t_3 = __Pyx_GetItemInt(((PyObject *)__pyx_v_available_elements), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 504, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_self->elements, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 504, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_14_element_graph_Element))))) __PYX_ERR(0, 504, __pyx_L1_error)
  __pyx_v_best_element = ((struct __pyx_obj_14_element_graph_Element *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "_element_graph.pyx":505
 * 
 *         best_element = self.elements[available_elements[0]]
 *         most_cov = best_element.bases             # <<<<<<<<<<<<<<
 *         for c in best_element.contains:
 *             if c != best_element.index and self.assignments[c]==0:
 */
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_best_element->bases); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 505, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_most_cov = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "_element_graph.pyx":506
 *         best_element = self.elements[available_elements[0]]
 *         most_cov = best_element.bases
 *         for c in best_element.contains:             # <<<<<<<<<<<<<<
 *             if c != best_element.index and self.assignments[c]==0:
 *                 most_cov += self.elements[c].bases
 */
  __pyx_t_5 = 0;
  __pyx_t_3 = __Pyx_set_iterator(__pyx_v_best_element->contains, 1, (&__pyx_t_7), (&__pyx_t_8)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 506, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_1);
  __pyx_t_1 = __pyx_t_3;
  __pyx_t_3 = 0;
  while (1) {
    __pyx_t_9 = __Pyx_set_iter_next(__pyx_t_1, __pyx_t_7, &__pyx_t_5, &__pyx_t_3, __pyx_t_8);
    if (unlikely(__pyx_t_9 == 0)) break;
    if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 506, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 506, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_c = __pyx_t_9;

    /* "_element_graph.pyx":507
 *         most_cov = best_element.bases
 *         for c in best_element.contains:
 *             if c != best_element.index and self.assignments[c]==0:             # <<<<<<<<<<<<<<
 *                 most_cov += self.elements[c].bases
 * 
 */
    __pyx_t_10 = ((__pyx_v_c != __pyx_v_best_element->index) != 0);
    if (__pyx_t_10) {
    } else {
      __pyx_t_6 = __pyx_t_10;
      goto __pyx_L7_bool_binop_done;
    }
    __pyx_t_3 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->assignments), __pyx_v_c, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 507, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_t_3, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 507, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 507, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_6 = __pyx_t_10;
    __pyx_L7_bool_binop_done:;
    if (__pyx_t_6) {

      /* "_element_graph.pyx":508
 *         for c in best_element.contains:
 *             if c != best_element.index and self.assignments[c]==0:
 *                 most_cov += self.elements[c].bases             # <<<<<<<<<<<<<<
 * 
 *         most_cov /= best_element.length
 */
      if (unlikely(__pyx_v_self->elements == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(0, 508, __pyx_L1_error)
      }
      __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_self->elements, __pyx_v_c, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 508, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_bases); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 508, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_most_cov, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 508, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF_SET(__pyx_v_most_cov, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "_element_graph.pyx":507
 *         most_cov = best_element.bases
 *         for c in best_element.contains:
 *             if c != best_element.index and self.assignments[c]==0:             # <<<<<<<<<<<<<<
 *                 most_cov += self.elements[c].bases
 * 
 */
    }
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_element_graph.pyx":510
 *                 most_cov += self.elements[c].bases
 * 
 *         most_cov /= best_element.length             # <<<<<<<<<<<<<<
 *         for i in available_elements:
 *             new_element = self.elements[i]
 */
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_best_element->length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 510, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyNumber_InPlaceDivide(__pyx_v_most_cov, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 510, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF_SET(__pyx_v_most_cov, __pyx_t_2);
  __pyx_t_2 = 0;

  /* "_element_graph.pyx":511
 * 
 *         most_cov /= best_element.length
 *         for i in available_elements:             # <<<<<<<<<<<<<<
 *             new_element = self.elements[i]
 *             new_cov = new_element.bases
 */
  if (likely(PyList_CheckExact(((PyObject *)__pyx_v_available_elements))) || PyTuple_CheckExact(((PyObject *)__pyx_v_available_elements))) {
    __pyx_t_2 = ((PyObject *)__pyx_v_available_elements); __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0;
    __pyx_t_11 = NULL;
  } else {
    __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(((PyObject *)__pyx_v_available_elements)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 511, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_11 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 511, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_11)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 511, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 511, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 511, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 511, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_11(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 511, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "_element_graph.pyx":512
 *         most_cov /= best_element.length
 *         for i in available_elements:
 *             new_element = self.elements[i]             # <<<<<<<<<<<<<<
 *             new_cov = new_element.bases
 *             for c in new_element.contains:
 */
    if (unlikely(__pyx_v_self->elements == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 512, __pyx_L1_error)
    }
    __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_self->elements, __pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 512, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_14_element_graph_Element))))) __PYX_ERR(0, 512, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_new_element, ((struct __pyx_obj_14_element_graph_Element *)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "_element_graph.pyx":513
 *         for i in available_elements:
 *             new_element = self.elements[i]
 *             new_cov = new_element.bases             # <<<<<<<<<<<<<<
 *             for c in new_element.contains:
 *                 if c != new_element.index and self.assignments[c]==0:
 */
    __pyx_t_1 = PyFloat_FromDouble(__pyx_v_new_element->bases); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 513, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_new_cov, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "_element_graph.pyx":514
 *             new_element = self.elements[i]
 *             new_cov = new_element.bases
 *             for c in new_element.contains:             # <<<<<<<<<<<<<<
 *                 if c != new_element.index and self.assignments[c]==0:
 *                     new_cov += self.elements[c].bases
 */
    __pyx_t_5 = 0;
    __pyx_t_3 = __Pyx_set_iterator(__pyx_v_new_element->contains, 1, (&__pyx_t_12), (&__pyx_t_8)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 514, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
    while (1) {
      __pyx_t_9 = __Pyx_set_iter_next(__pyx_t_1, __pyx_t_12, &__pyx_t_5, &__pyx_t_3, __pyx_t_8);
      if (unlikely(__pyx_t_9 == 0)) break;
      if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 514, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 514, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_c = __pyx_t_9;

      /* "_element_graph.pyx":515
 *             new_cov = new_element.bases
 *             for c in new_element.contains:
 *                 if c != new_element.index and self.assignments[c]==0:             # <<<<<<<<<<<<<<
 *                     new_cov += self.elements[c].bases
 * 
 */
      __pyx_t_10 = ((__pyx_v_c != __pyx_v_new_element->index) != 0);
      if (__pyx_t_10) {
      } else {
        __pyx_t_6 = __pyx_t_10;
        goto __pyx_L14_bool_binop_done;
      }
      __pyx_t_3 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->assignments), __pyx_v_c, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 515, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyInt_EqObjC(__pyx_t_3, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 515, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 515, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __pyx_t_10;
      __pyx_L14_bool_binop_done:;
      if (__pyx_t_6) {

        /* "_element_graph.pyx":516
 *             for c in new_element.contains:
 *                 if c != new_element.index and self.assignments[c]==0:
 *                     new_cov += self.elements[c].bases             # <<<<<<<<<<<<<<
 * 
 *             new_cov /= new_element.length
 */
        if (unlikely(__pyx_v_self->elements == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 516, __pyx_L1_error)
        }
        __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_self->elements, __pyx_v_c, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 516, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_bases); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 516, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_new_cov, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 516, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF_SET(__pyx_v_new_cov, __pyx_t_4);
        __pyx_t_4 = 0;

        /* "_element_graph.pyx":515
 *             new_cov = new_element.bases
 *             for c in new_element.contains:
 *                 if c != new_element.index and self.assignments[c]==0:             # <<<<<<<<<<<<<<
 *                     new_cov += self.elements[c].bases
 * 
 */
      }
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "_element_graph.pyx":518
 *                     new_cov += self.elements[c].bases
 * 
 *             new_cov /= new_element.length             # <<<<<<<<<<<<<<
 *             # print(i, new_element, new_cov)
 *             if new_cov > most_cov:
 */
    __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_new_element->length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyNumber_InPlaceDivide(__pyx_v_new_cov, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 518, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_new_cov, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "_element_graph.pyx":520
 *             new_cov /= new_element.length
 *             # print(i, new_element, new_cov)
 *             if new_cov > most_cov:             # <<<<<<<<<<<<<<
 *                 best_element = new_element
 *                 most_cov = new_cov
 */
    __pyx_t_4 = PyObject_RichCompare(__pyx_v_new_cov, __pyx_v_most_cov, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error)
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 520, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_6) {

      /* "_element_graph.pyx":521
 *             # print(i, new_element, new_cov)
 *             if new_cov > most_cov:
 *                 best_element = new_element             # <<<<<<<<<<<<<<
 *                 most_cov = new_cov
 *             elif new_cov == most_cov: # Break ties by complexity
 */
      __Pyx_INCREF(((PyObject *)__pyx_v_new_element));
      __Pyx_DECREF_SET(__pyx_v_best_element, __pyx_v_new_element);

      /* "_element_graph.pyx":522
 *             if new_cov > most_cov:
 *                 best_element = new_element
 *                 most_cov = new_cov             # <<<<<<<<<<<<<<
 *             elif new_cov == most_cov: # Break ties by complexity
 *                 if new_element.IC > best_element.IC:
 */
      __Pyx_INCREF(__pyx_v_new_cov);
      __Pyx_DECREF_SET(__pyx_v_most_cov, __pyx_v_new_cov);

      /* "_element_graph.pyx":520
 *             new_cov /= new_element.length
 *             # print(i, new_element, new_cov)
 *             if new_cov > most_cov:             # <<<<<<<<<<<<<<
 *                 best_element = new_element
 *                 most_cov = new_cov
 */
      goto __pyx_L16;
    }

    /* "_element_graph.pyx":523
 *                 best_element = new_element
 *                 most_cov = new_cov
 *             elif new_cov == most_cov: # Break ties by complexity             # <<<<<<<<<<<<<<
 *                 if new_element.IC > best_element.IC:
 *                     best_element = new_element
 */
    __pyx_t_4 = PyObject_RichCompare(__pyx_v_new_cov, __pyx_v_most_cov, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 523, __pyx_L1_error)
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 523, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_6) {

      /* "_element_graph.pyx":524
 *                 most_cov = new_cov
 *             elif new_cov == most_cov: # Break ties by complexity
 *                 if new_element.IC > best_element.IC:             # <<<<<<<<<<<<<<
 *                     best_element = new_element
 *                     most_cov = new_cov
 */
      __pyx_t_6 = ((__pyx_v_new_element->IC > __pyx_v_best_element->IC) != 0);
      if (__pyx_t_6) {

        /* "_element_graph.pyx":525
 *             elif new_cov == most_cov: # Break ties by complexity
 *                 if new_element.IC > best_element.IC:
 *                     best_element = new_element             # <<<<<<<<<<<<<<
 *                     most_cov = new_cov
 * 
 */
        __Pyx_INCREF(((PyObject *)__pyx_v_new_element));
        __Pyx_DECREF_SET(__pyx_v_best_element, __pyx_v_new_element);

        /* "_element_graph.pyx":526
 *                 if new_element.IC > best_element.IC:
 *                     best_element = new_element
 *                     most_cov = new_cov             # <<<<<<<<<<<<<<
 * 
 *         return copy.deepcopy(best_element)
 */
        __Pyx_INCREF(__pyx_v_new_cov);
        __Pyx_DECREF_SET(__pyx_v_most_cov, __pyx_v_new_cov);

        /* "_element_graph.pyx":524
 *                 most_cov = new_cov
 *             elif new_cov == most_cov: # Break ties by complexity
 *                 if new_element.IC > best_element.IC:             # <<<<<<<<<<<<<<
 *                     best_element = new_element
 *                     most_cov = new_cov
 */
      }

      /* "_element_graph.pyx":523
 *                 best_element = new_element
 *                 most_cov = new_cov
 *             elif new_cov == most_cov: # Break ties by complexity             # <<<<<<<<<<<<<<
 *                 if new_element.IC > best_element.IC:
 *                     best_element = new_element
 */
    }
    __pyx_L16:;

    /* "_element_graph.pyx":511
 * 
 *         most_cov /= best_element.length
 *         for i in available_elements:             # <<<<<<<<<<<<<<
 *             new_element = self.elements[i]
 *             new_cov = new_element.bases
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "_element_graph.pyx":528
 *                     most_cov = new_cov
 * 
 *         return copy.deepcopy(best_element)             # <<<<<<<<<<<<<<
 * 
 *     cpdef float dead_end(self, Element path, tuple extension):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_copy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 528, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_deepcopy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 528, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_4, ((PyObject *)__pyx_v_best_element)) : __Pyx_PyObject_CallOneArg(__pyx_t_1, ((PyObject *)__pyx_v_best_element));
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 528, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_14_element_graph_Element))))) __PYX_ERR(0, 528, __pyx_L1_error)
  __pyx_r = ((struct __pyx_obj_14_element_graph_Element *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "_element_graph.pyx":496
 *                 path.merge(extpath, proportion)
 * 
 *     cpdef Element get_heaviest_element(self):             # <<<<<<<<<<<<<<
 *         cdef Element best_element, new_element
 *         cdef float most_bases
 */

  /* 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("_element_graph.ElementGraph.get_heaviest_element", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_best_element);
  __Pyx_XDECREF((PyObject *)__pyx_v_new_element);
  __Pyx_XDECREF((PyObject *)__pyx_v_available_elements);
  __Pyx_XDECREF(__pyx_v_most_cov);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_new_cov);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_23get_heaviest_element(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_23get_heaviest_element(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_heaviest_element (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_22get_heaviest_element(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self));

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

static PyObject *__pyx_pf_14_element_graph_12ElementGraph_22get_heaviest_element(struct __pyx_obj_14_element_graph_ElementGraph *__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_heaviest_element", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_14_element_graph_12ElementGraph_get_heaviest_element(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 496, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "_element_graph.pyx":530
 *         return copy.deepcopy(best_element)
 * 
 *     cpdef float dead_end(self, Element path, tuple extension):             # <<<<<<<<<<<<<<
 *         """Returns a multiplier that indicates how many termini can be
 *         reached by extending the path through extension:
 */

static PyObject *__pyx_pw_14_element_graph_12ElementGraph_25dead_end(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static float __pyx_f_14_element_graph_12ElementGraph_dead_end(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, struct __pyx_obj_14_element_graph_Element *__pyx_v_path, PyObject *__pyx_v_extension, int __pyx_skip_dispatch) {
  struct __pyx_obj_14_element_graph_Element *__pyx_v_element = 0;
  int __pyx_v_i;
  int __pyx_v_strand;
  int __pyx_v_s_tag;
  int __pyx_v_e_tag;
  float __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  float __pyx_t_7;
  int __pyx_t_8;
  char __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  int __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dead_end", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dead_end); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 530, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_14_element_graph_12ElementGraph_25dead_end)) {
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        __pyx_t_5 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
            __pyx_t_5 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[3] = {__pyx_t_4, ((PyObject *)__pyx_v_path), __pyx_v_extension};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 530, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[3] = {__pyx_t_4, ((PyObject *)__pyx_v_path), __pyx_v_extension};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 530, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 530, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          if (__pyx_t_4) {
            __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
          }
          __Pyx_INCREF(((PyObject *)__pyx_v_path));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_path));
          PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, ((PyObject *)__pyx_v_path));
          __Pyx_INCREF(__pyx_v_extension);
          __Pyx_GIVEREF(__pyx_v_extension);
          PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_extension);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 530, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        }
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_7 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_7 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 530, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_7;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "_element_graph.pyx":540
 *         cdef bint s_tag, e_tag
 *         cdef set includes, excludes, starts, ends
 *         if self.no_ends:             # <<<<<<<<<<<<<<
 *             return 1
 * 
 */
  __pyx_t_8 = (__pyx_v_self->no_ends != 0);
  if (__pyx_t_8) {

    /* "_element_graph.pyx":541
 *         cdef set includes, excludes, starts, ends
 *         if self.no_ends:
 *             return 1             # <<<<<<<<<<<<<<
 * 
 *         s_tag = path.s_tag
 */
    __pyx_r = 1.0;
    goto __pyx_L0;

    /* "_element_graph.pyx":540
 *         cdef bint s_tag, e_tag
 *         cdef set includes, excludes, starts, ends
 *         if self.no_ends:             # <<<<<<<<<<<<<<
 *             return 1
 * 
 */
  }

  /* "_element_graph.pyx":543
 *             return 1
 * 
 *         s_tag = path.s_tag             # <<<<<<<<<<<<<<
 *         e_tag = path.e_tag
 *         strand = path.strand
 */
  __pyx_t_8 = __pyx_v_path->s_tag;
  __pyx_v_s_tag = __pyx_t_8;

  /* "_element_graph.pyx":544
 * 
 *         s_tag = path.s_tag
 *         e_tag = path.e_tag             # <<<<<<<<<<<<<<
 *         strand = path.strand
 *         for i in extension:
 */
  __pyx_t_8 = __pyx_v_path->e_tag;
  __pyx_v_e_tag = __pyx_t_8;

  /* "_element_graph.pyx":545
 *         s_tag = path.s_tag
 *         e_tag = path.e_tag
 *         strand = path.strand             # <<<<<<<<<<<<<<
 *         for i in extension:
 *             element = self.elements[i]
 */
  __pyx_t_9 = __pyx_v_path->strand;
  __pyx_v_strand = __pyx_t_9;

  /* "_element_graph.pyx":546
 *         e_tag = path.e_tag
 *         strand = path.strand
 *         for i in extension:             # <<<<<<<<<<<<<<
 *             element = self.elements[i]
 *             s_tag = s_tag or element.s_tag
 */
  if (unlikely(__pyx_v_extension == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(0, 546, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_v_extension; __Pyx_INCREF(__pyx_t_1); __pyx_t_10 = 0;
  for (;;) {
    if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_10); __Pyx_INCREF(__pyx_t_2); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 546, __pyx_L1_error)
    #else
    __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 546, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
    __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 546, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_i = __pyx_t_5;

    /* "_element_graph.pyx":547
 *         strand = path.strand
 *         for i in extension:
 *             element = self.elements[i]             # <<<<<<<<<<<<<<
 *             s_tag = s_tag or element.s_tag
 *             e_tag = e_tag or element.e_tag
 */
    if (unlikely(__pyx_v_self->elements == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 547, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_self->elements, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 547, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_14_element_graph_Element))))) __PYX_ERR(0, 547, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_element, ((struct __pyx_obj_14_element_graph_Element *)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "_element_graph.pyx":548
 *         for i in extension:
 *             element = self.elements[i]
 *             s_tag = s_tag or element.s_tag             # <<<<<<<<<<<<<<
 *             e_tag = e_tag or element.e_tag
 *             if strand == 0:
 */
    __pyx_t_11 = (__pyx_v_s_tag != 0);
    if (!__pyx_t_11) {
    } else {
      __pyx_t_8 = __pyx_t_11;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_11 = (__pyx_v_element->s_tag != 0);
    __pyx_t_8 = __pyx_t_11;
    __pyx_L6_bool_binop_done:;
    __pyx_v_s_tag = __pyx_t_8;

    /* "_element_graph.pyx":549
 *             element = self.elements[i]
 *             s_tag = s_tag or element.s_tag
 *             e_tag = e_tag or element.e_tag             # <<<<<<<<<<<<<<
 *             if strand == 0:
 *                 strand = element.strand
 */
    __pyx_t_11 = (__pyx_v_e_tag != 0);
    if (!__pyx_t_11) {
    } else {
      __pyx_t_8 = __pyx_t_11;
      goto __pyx_L8_bool_binop_done;
    }
    __pyx_t_11 = (__pyx_v_element->e_tag != 0);
    __pyx_t_8 = __pyx_t_11;
    __pyx_L8_bool_binop_done:;
    __pyx_v_e_tag = __pyx_t_8;

    /* "_element_graph.pyx":550
 *             s_tag = s_tag or element.s_tag
 *             e_tag = e_tag or element.e_tag
 *             if strand == 0:             # <<<<<<<<<<<<<<
 *                 strand = element.strand
 * 
 */
    __pyx_t_8 = ((__pyx_v_strand == 0) != 0);
    if (__pyx_t_8) {

      /* "_element_graph.pyx":551
 *             e_tag = e_tag or element.e_tag
 *             if strand == 0:
 *                 strand = element.strand             # <<<<<<<<<<<<<<
 * 
 *         if s_tag and e_tag: # Both ends are already found
 */
      __pyx_t_9 = __pyx_v_element->strand;
      __pyx_v_strand = __pyx_t_9;

      /* "_element_graph.pyx":550
 *             s_tag = s_tag or element.s_tag
 *             e_tag = e_tag or element.e_tag
 *             if strand == 0:             # <<<<<<<<<<<<<<
 *                 strand = element.strand
 * 
 */
    }

    /* "_element_graph.pyx":546
 *         e_tag = path.e_tag
 *         strand = path.strand
 *         for i in extension:             # <<<<<<<<<<<<<<
 *             element = self.elements[i]
 *             s_tag = s_tag or element.s_tag
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_element_graph.pyx":553
 *                 strand = element.strand
 * 
 *         if s_tag and e_tag: # Both ends are already found             # <<<<<<<<<<<<<<
 *             return 1
 * 
 */
  __pyx_t_11 = (__pyx_v_s_tag != 0);
  if (__pyx_t_11) {
  } else {
    __pyx_t_8 = __pyx_t_11;
    goto __pyx_L12_bool_binop_done;
  }
  __pyx_t_11 = (__pyx_v_e_tag != 0);
  __pyx_t_8 = __pyx_t_11;
  __pyx_L12_bool_binop_done:;
  if (__pyx_t_8) {

    /* "_element_graph.pyx":554
 * 
 *         if s_tag and e_tag: # Both ends are already found
 *             return 1             # <<<<<<<<<<<<<<
 * 
 *         if not s_tag: # Check that BFS from the + and/or - Start reached all extension indices
 */
    __pyx_r = 1.0;
    goto __pyx_L0;

    /* "_element_graph.pyx":553
 *                 strand = element.strand
 * 
 *         if s_tag and e_tag: # Both ends are already found             # <<<<<<<<<<<<<<
 *             return 1
 * 
 */
  }

  /* "_element_graph.pyx":556
 *             return 1
 * 
 *         if not s_tag: # Check that BFS from the + and/or - Start reached all extension indices             # <<<<<<<<<<<<<<
 *             if strand >= 0:
 *                 s_tag = np.all(self.end_reachability[0,extension])
 */
  __pyx_t_8 = ((!(__pyx_v_s_tag != 0)) != 0);
  if (__pyx_t_8) {

    /* "_element_graph.pyx":557
 * 
 *         if not s_tag: # Check that BFS from the + and/or - Start reached all extension indices
 *             if strand >= 0:             # <<<<<<<<<<<<<<
 *                 s_tag = np.all(self.end_reachability[0,extension])
 * 
 */
    __pyx_t_8 = ((__pyx_v_strand >= 0) != 0);
    if (__pyx_t_8) {

      /* "_element_graph.pyx":558
 *         if not s_tag: # Check that BFS from the + and/or - Start reached all extension indices
 *             if strand >= 0:
 *                 s_tag = np.all(self.end_reachability[0,extension])             # <<<<<<<<<<<<<<
 * 
 *             if strand <= 0 and not s_tag:
 */
      __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 558, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_all); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 558, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 558, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_int_0);
      __Pyx_GIVEREF(__pyx_int_0);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_int_0);
      __Pyx_INCREF(__pyx_v_extension);
      __Pyx_GIVEREF(__pyx_v_extension);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_extension);
      __pyx_t_6 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->end_reachability), __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 558, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 558, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 558, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_s_tag = __pyx_t_8;

      /* "_element_graph.pyx":557
 * 
 *         if not s_tag: # Check that BFS from the + and/or - Start reached all extension indices
 *             if strand >= 0:             # <<<<<<<<<<<<<<
 *                 s_tag = np.all(self.end_reachability[0,extension])
 * 
 */
    }

    /* "_element_graph.pyx":560
 *                 s_tag = np.all(self.end_reachability[0,extension])
 * 
 *             if strand <= 0 and not s_tag:             # <<<<<<<<<<<<<<
 *                 s_tag = np.all(self.end_reachability[2,extension])
 * 
 */
    __pyx_t_11 = ((__pyx_v_strand <= 0) != 0);
    if (__pyx_t_11) {
    } else {
      __pyx_t_8 = __pyx_t_11;
      goto __pyx_L17_bool_binop_done;
    }
    __pyx_t_11 = ((!(__pyx_v_s_tag != 0)) != 0);
    __pyx_t_8 = __pyx_t_11;
    __pyx_L17_bool_binop_done:;
    if (__pyx_t_8) {

      /* "_element_graph.pyx":561
 * 
 *             if strand <= 0 and not s_tag:
 *                 s_tag = np.all(self.end_reachability[2,extension])             # <<<<<<<<<<<<<<
 * 
 *         if not e_tag:
 */
      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 561, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_all); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 561, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 561, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_int_2);
      __Pyx_GIVEREF(__pyx_int_2);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_int_2);
      __Pyx_INCREF(__pyx_v_extension);
      __Pyx_GIVEREF(__pyx_v_extension);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_extension);
      __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->end_reachability), __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 561, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 561, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 561, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_s_tag = __pyx_t_8;

      /* "_element_graph.pyx":560
 *                 s_tag = np.all(self.end_reachability[0,extension])
 * 
 *             if strand <= 0 and not s_tag:             # <<<<<<<<<<<<<<
 *                 s_tag = np.all(self.end_reachability[2,extension])
 * 
 */
    }

    /* "_element_graph.pyx":556
 *             return 1
 * 
 *         if not s_tag: # Check that BFS from the + and/or - Start reached all extension indices             # <<<<<<<<<<<<<<
 *             if strand >= 0:
 *                 s_tag = np.all(self.end_reachability[0,extension])
 */
  }

  /* "_element_graph.pyx":563
 *                 s_tag = np.all(self.end_reachability[2,extension])
 * 
 *         if not e_tag:             # <<<<<<<<<<<<<<
 *             if strand >= 0:
 *                 e_tag = np.all(self.end_reachability[1,extension])
 */
  __pyx_t_8 = ((!(__pyx_v_e_tag != 0)) != 0);
  if (__pyx_t_8) {

    /* "_element_graph.pyx":564
 * 
 *         if not e_tag:
 *             if strand >= 0:             # <<<<<<<<<<<<<<
 *                 e_tag = np.all(self.end_reachability[1,extension])
 * 
 */
    __pyx_t_8 = ((__pyx_v_strand >= 0) != 0);
    if (__pyx_t_8) {

      /* "_element_graph.pyx":565
 *         if not e_tag:
 *             if strand >= 0:
 *                 e_tag = np.all(self.end_reachability[1,extension])             # <<<<<<<<<<<<<<
 * 
 *             if strand <= 0 and not e_tag:
 */
      __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 565, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_all); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 565, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 565, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_int_1);
      __Pyx_GIVEREF(__pyx_int_1);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_int_1);
      __Pyx_INCREF(__pyx_v_extension);
      __Pyx_GIVEREF(__pyx_v_extension);
      PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_extension);
      __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->end_reachability), __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 565, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_6, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 565, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 565, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_e_tag = __pyx_t_8;

      /* "_element_graph.pyx":564
 * 
 *         if not e_tag:
 *             if strand >= 0:             # <<<<<<<<<<<<<<
 *                 e_tag = np.all(self.end_reachability[1,extension])
 * 
 */
    }

    /* "_element_graph.pyx":567
 *                 e_tag = np.all(self.end_reachability[1,extension])
 * 
 *             if strand <= 0 and not e_tag:             # <<<<<<<<<<<<<<
 *                 e_tag = np.all(self.end_reachability[3,extension])
 * 
 */
    __pyx_t_11 = ((__pyx_v_strand <= 0) != 0);
    if (__pyx_t_11) {
    } else {
      __pyx_t_8 = __pyx_t_11;
      goto __pyx_L22_bool_binop_done;
    }
    __pyx_t_11 = ((!(__pyx_v_e_tag != 0)) != 0);
    __pyx_t_8 = __pyx_t_11;
    __pyx_L22_bool_binop_done:;
    if (__pyx_t_8) {

      /* "_element_graph.pyx":568
 * 
 *             if strand <= 0 and not e_tag:
 *                 e_tag = np.all(self.end_reachability[3,extension])             # <<<<<<<<<<<<<<
 * 
 *         return [self.dead_end_penalty,1.][s_tag] * [self.dead_end_penalty,1.][e_tag]
 */
      __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 568, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_all); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 568, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 568, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_int_3);
      __Pyx_GIVEREF(__pyx_int_3);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_int_3);
      __Pyx_INCREF(__pyx_v_extension);
      __Pyx_GIVEREF(__pyx_v_extension);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_extension);
      __pyx_t_6 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->end_reachability), __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 568, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 568, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 568, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_e_tag = __pyx_t_8;

      /* "_element_graph.pyx":567
 *                 e_tag = np.all(self.end_reachability[1,extension])
 * 
 *             if strand <= 0 and not e_tag:             # <<<<<<<<<<<<<<
 *                 e_tag = np.all(self.end_reachability[3,extension])
 * 
 */
    }

    /* "_element_graph.pyx":563
 *                 s_tag = np.all(self.end_reachability[2,extension])
 * 
 *         if not e_tag:             # <<<<<<<<<<<<<<
 *             if strand >= 0:
 *                 e_tag = np.all(self.end_reachability[1,extension])
 */
  }

  /* "_element_graph.pyx":570
 *                 e_tag = np.all(self.end_reachability[3,extension])
 * 
 *         return [self.dead_end_penalty,1.][s_tag] * [self.dead_end_penalty,1.][e_tag]             # <<<<<<<<<<<<<<
 * 
 *     cpdef list generate_extensions(self, Element path):
 */
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->dead_end_penalty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 570, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 570, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_INCREF(__pyx_float_1_);
  __Pyx_GIVEREF(__pyx_float_1_);
  PyList_SET_ITEM(__pyx_t_3, 1, __pyx_float_1_);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_t_3, __pyx_v_s_tag, int, 1, __Pyx_PyBool_FromLong, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 570, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->dead_end_penalty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 570, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = PyList_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 570, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_3);
  PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_3);
  __Pyx_INCREF(__pyx_float_1_);
  __Pyx_GIVEREF(__pyx_float_1_);
  PyList_SET_ITEM(__pyx_t_6, 1, __pyx_float_1_);
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_t_6, __pyx_v_e_tag, int, 1, __Pyx_PyBool_FromLong, 1, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 570, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyNumber_Multiply(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 570, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_7 = __pyx_PyFloat_AsFloat(__pyx_t_6); if (unlikely((__pyx_t_7 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 570, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_r = __pyx_t_7;
  goto __pyx_L0;

  /* "_element_graph.pyx":530
 *         return copy.deepcopy(best_element)
 * 
 *     cpdef float dead_end(self, Element path, tuple extension):             # <<<<<<<<<<<<<<
 *         """Returns a multiplier that indicates how many termini can be
 *         reached by extending the path through extension:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_WriteUnraisable("_element_graph.ElementGraph.dead_end", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_element);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_25dead_end(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_14_element_graph_12ElementGraph_24dead_end[] = "Returns a multiplier that indicates how many termini can be\n        reached by extending the path through extension:\n        1 = neither end can be reached\n        10 = one end can be reached\n        100 = both ends can be reached.";
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_25dead_end(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_14_element_graph_Element *__pyx_v_path = 0;
  PyObject *__pyx_v_extension = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dead_end (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,&__pyx_n_s_extension,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_path)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_extension)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dead_end", 1, 2, 2, 1); __PYX_ERR(0, 530, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dead_end") < 0)) __PYX_ERR(0, 530, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_path = ((struct __pyx_obj_14_element_graph_Element *)values[0]);
    __pyx_v_extension = ((PyObject*)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dead_end", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 530, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("_element_graph.ElementGraph.dead_end", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_path), __pyx_ptype_14_element_graph_Element, 1, "path", 0))) __PYX_ERR(0, 530, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_extension), (&PyTuple_Type), 1, "extension", 1))) __PYX_ERR(0, 530, __pyx_L1_error)
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_24dead_end(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self), __pyx_v_path, __pyx_v_extension);

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

static PyObject *__pyx_pf_14_element_graph_12ElementGraph_24dead_end(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, struct __pyx_obj_14_element_graph_Element *__pyx_v_path, PyObject *__pyx_v_extension) {
  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("dead_end", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_f_14_element_graph_12ElementGraph_dead_end(__pyx_v_self, __pyx_v_path, __pyx_v_extension, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 530, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "_element_graph.pyx":572
 *         return [self.dead_end_penalty,1.][s_tag] * [self.dead_end_penalty,1.][e_tag]
 * 
 *     cpdef list generate_extensions(self, Element path):             # <<<<<<<<<<<<<<
 *         """Defines all combinations of mutally compatible elements in
 *         the path's ingroup/outgroup that should be evaluated. Requires
 */

static PyObject *__pyx_pw_14_element_graph_12ElementGraph_27generate_extensions(PyObject *__pyx_v_self, PyObject *__pyx_v_path); /*proto*/
static PyObject *__pyx_f_14_element_graph_12ElementGraph_generate_extensions(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, struct __pyx_obj_14_element_graph_Element *__pyx_v_path, int __pyx_skip_dispatch) {
  PyObject *__pyx_v_pairs = 0;
  PyObject *__pyx_v_ingroup = 0;
  PyObject *__pyx_v_outgroup = 0;
  PyObject *__pyx_v_ext_accounts = 0;
  PyObject *__pyx_v_ext_members = 0;
  PyObject *__pyx_v_ext_nonmembers = 0;
  PyObject *__pyx_v_exclude = 0;
  PyObject *__pyx_v_contained = 0;
  int __pyx_v_c;
  struct __pyx_obj_14_element_graph_Element *__pyx_v_e_in = 0;
  struct __pyx_obj_14_element_graph_Element *__pyx_v_e_out = 0;
  struct __pyx_obj_14_element_graph_Element *__pyx_v_e_con = 0;
  __pyx_ctuple_int__and_int __pyx_v_pair;
  PyObject *__pyx_v_freebies = 0;
  PyObject *__pyx_v_ext = 0;
  PyObject *__pyx_v_extdict = 0;
  PyObject *__pyx_v_exthash = 0;
  PyObject *__pyx_v_stranded = NULL;
  PyObject *__pyx_v_extensions = NULL;
  int __pyx_9genexpr10__pyx_v_o;
  int __pyx_9genexpr10__pyx_v_i;
  int __pyx_9genexpr11__pyx_v_i;
  int __pyx_9genexpr12__pyx_v_o;
  int __pyx_9genexpr13__pyx_v_i;
  int __pyx_9genexpr14__pyx_v_i;
  PyObject *__pyx_9genexpr15__pyx_v_ext = NULL;
  int __pyx_9genexpr16__pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  __pyx_ctuple_int__and_int __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  int __pyx_t_14;
  int __pyx_t_15;
  int __pyx_t_16;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("generate_extensions", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_generate_extensions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 572, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_14_element_graph_12ElementGraph_27generate_extensions)) {
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, ((PyObject *)__pyx_v_path)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_path));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 572, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 572, __pyx_L1_error)
        __pyx_r = ((PyObject*)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "_element_graph.pyx":585
 *             dict extdict
 *             str exthash
 *         extdict = {}             # <<<<<<<<<<<<<<
 *         ingroup = path.ingroup|path.contained
 *         outgroup = path.outgroup|path.contained
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 585, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_extdict = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "_element_graph.pyx":586
 *             str exthash
 *         extdict = {}
 *         ingroup = path.ingroup|path.contained             # <<<<<<<<<<<<<<
 *         outgroup = path.outgroup|path.contained
 *         freebies = tuple(path.contains.difference(path.includes))
 */
  __pyx_t_1 = PyNumber_Or(__pyx_v_path->ingroup, __pyx_v_path->contained); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 586, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_ingroup = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "_element_graph.pyx":587
 *         extdict = {}
 *         ingroup = path.ingroup|path.contained
 *         outgroup = path.outgroup|path.contained             # <<<<<<<<<<<<<<
 *         freebies = tuple(path.contains.difference(path.includes))
 *         if len(freebies) > 0:
 */
  __pyx_t_1 = PyNumber_Or(__pyx_v_path->outgroup, __pyx_v_path->contained); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 587, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_outgroup = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "_element_graph.pyx":588
 *         ingroup = path.ingroup|path.contained
 *         outgroup = path.outgroup|path.contained
 *         freebies = tuple(path.contains.difference(path.includes))             # <<<<<<<<<<<<<<
 *         if len(freebies) > 0:
 *             self.extend_path(path, freebies)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_path->contains, __pyx_n_s_difference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 588, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_path->includes) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_path->includes);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 588, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 588, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_freebies = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "_element_graph.pyx":589
 *         outgroup = path.outgroup|path.contained
 *         freebies = tuple(path.contains.difference(path.includes))
 *         if len(freebies) > 0:             # <<<<<<<<<<<<<<
 *             self.extend_path(path, freebies)
 *             ingroup = path.ingroup
 */
  __pyx_t_5 = PyTuple_GET_SIZE(__pyx_v_freebies); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 589, __pyx_L1_error)
  __pyx_t_6 = ((__pyx_t_5 > 0) != 0);
  if (__pyx_t_6) {

    /* "_element_graph.pyx":590
 *         freebies = tuple(path.contains.difference(path.includes))
 *         if len(freebies) > 0:
 *             self.extend_path(path, freebies)             # <<<<<<<<<<<<<<
 *             ingroup = path.ingroup
 *             outgroup = path.outgroup
 */
    ((struct __pyx_vtabstruct_14_element_graph_ElementGraph *)__pyx_v_self->__pyx_vtab)->extend_path(__pyx_v_self, __pyx_v_path, __pyx_v_freebies, 0);

    /* "_element_graph.pyx":591
 *         if len(freebies) > 0:
 *             self.extend_path(path, freebies)
 *             ingroup = path.ingroup             # <<<<<<<<<<<<<<
 *             outgroup = path.outgroup
 * 
 */
    __pyx_t_2 = __pyx_v_path->ingroup;
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v_ingroup, ((PyObject*)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "_element_graph.pyx":592
 *             self.extend_path(path, freebies)
 *             ingroup = path.ingroup
 *             outgroup = path.outgroup             # <<<<<<<<<<<<<<
 * 
 *         if len(ingroup.difference(path.contained)) > 0:
 */
    __pyx_t_2 = __pyx_v_path->outgroup;
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v_outgroup, ((PyObject*)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "_element_graph.pyx":589
 *         outgroup = path.outgroup|path.contained
 *         freebies = tuple(path.contains.difference(path.includes))
 *         if len(freebies) > 0:             # <<<<<<<<<<<<<<
 *             self.extend_path(path, freebies)
 *             ingroup = path.ingroup
 */
  }

  /* "_element_graph.pyx":594
 *             outgroup = path.outgroup
 * 
 *         if len(ingroup.difference(path.contained)) > 0:             # <<<<<<<<<<<<<<
 *             if len(outgroup.difference(path.contained)) > 0:
 *                 pairs = list(set([(i,o) for o in sorted(outgroup) for i in sorted(ingroup) if self.overlap[i,o] > -1]))
 */
  __pyx_t_2 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PySet_Type_difference, __pyx_v_ingroup, __pyx_v_path->contained); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 594, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 594, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_6 = ((__pyx_t_5 > 0) != 0);
  if (__pyx_t_6) {

    /* "_element_graph.pyx":595
 * 
 *         if len(ingroup.difference(path.contained)) > 0:
 *             if len(outgroup.difference(path.contained)) > 0:             # <<<<<<<<<<<<<<
 *                 pairs = list(set([(i,o) for o in sorted(outgroup) for i in sorted(ingroup) if self.overlap[i,o] > -1]))
 *             else: # No outgroups, use path.index as other end of pair
 */
    __pyx_t_2 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PySet_Type_difference, __pyx_v_outgroup, __pyx_v_path->contained); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 595, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 595, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_6 = ((__pyx_t_5 > 0) != 0);
    if (__pyx_t_6) {

      /* "_element_graph.pyx":596
 *         if len(ingroup.difference(path.contained)) > 0:
 *             if len(outgroup.difference(path.contained)) > 0:
 *                 pairs = list(set([(i,o) for o in sorted(outgroup) for i in sorted(ingroup) if self.overlap[i,o] > -1]))             # <<<<<<<<<<<<<<
 *             else: # No outgroups, use path.index as other end of pair
 *                 pairs = [(i,path.index) for i in sorted(ingroup)]
 */
      { /* enter inner scope */
        __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 596, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_3 = PySequence_List(__pyx_v_outgroup); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 596, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_1 = ((PyObject*)__pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_7 = PyList_Sort(__pyx_t_1); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 596, __pyx_L1_error)
        if (unlikely(__pyx_t_1 == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
          __PYX_ERR(0, 596, __pyx_L1_error)
        }
        __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        for (;;) {
          if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 596, __pyx_L1_error)
          #else
          __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 596, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          #endif
          __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 596, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_9genexpr10__pyx_v_o = __pyx_t_8;
          __pyx_t_4 = PySequence_List(__pyx_v_ingroup); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 596, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_1 = ((PyObject*)__pyx_t_4);
          __pyx_t_4 = 0;
          __pyx_t_7 = PyList_Sort(__pyx_t_1); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 596, __pyx_L1_error)
          if (unlikely(__pyx_t_1 == Py_None)) {
            PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
            __PYX_ERR(0, 596, __pyx_L1_error)
          }
          __pyx_t_4 = __pyx_t_1; __Pyx_INCREF(__pyx_t_4); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          for (;;) {
            if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_4)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_9); __Pyx_INCREF(__pyx_t_1); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 596, __pyx_L1_error)
            #else
            __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 596, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_1);
            #endif
            __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 596, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __pyx_9genexpr10__pyx_v_i = __pyx_t_8;
            __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_9genexpr10__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 596, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_9genexpr10__pyx_v_o); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 596, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_10);
            __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 596, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_11);
            __Pyx_GIVEREF(__pyx_t_1);
            PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_1);
            __Pyx_GIVEREF(__pyx_t_10);
            PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_10);
            __pyx_t_1 = 0;
            __pyx_t_10 = 0;
            __pyx_t_10 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->overlap), __pyx_t_11); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 596, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_10);
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            __pyx_t_11 = PyObject_RichCompare(__pyx_t_10, __pyx_int_neg_1, Py_GT); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 596, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 596, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            if (__pyx_t_6) {
              __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_9genexpr10__pyx_v_i); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 596, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_11);
              __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_9genexpr10__pyx_v_o); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 596, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_10);
              __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 596, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_1);
              __Pyx_GIVEREF(__pyx_t_11);
              PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_11);
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_10);
              __pyx_t_11 = 0;
              __pyx_t_10 = 0;
              if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 596, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        }
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } /* exit inner scope */
      __pyx_t_3 = PySet_New(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 596, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PySequence_List(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 596, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_pairs = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;

      /* "_element_graph.pyx":595
 * 
 *         if len(ingroup.difference(path.contained)) > 0:
 *             if len(outgroup.difference(path.contained)) > 0:             # <<<<<<<<<<<<<<
 *                 pairs = list(set([(i,o) for o in sorted(outgroup) for i in sorted(ingroup) if self.overlap[i,o] > -1]))
 *             else: # No outgroups, use path.index as other end of pair
 */
      goto __pyx_L5;
    }

    /* "_element_graph.pyx":598
 *                 pairs = list(set([(i,o) for o in sorted(outgroup) for i in sorted(ingroup) if self.overlap[i,o] > -1]))
 *             else: # No outgroups, use path.index as other end of pair
 *                 pairs = [(i,path.index) for i in sorted(ingroup)]             # <<<<<<<<<<<<<<
 *         else: # No ingroups, use path.index as other end of pair
 *             pairs = [(path.index,o) for o in sorted(outgroup)]
 */
    /*else*/ {
      { /* enter inner scope */
        __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 598, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_4 = PySequence_List(__pyx_v_ingroup); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 598, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_3 = ((PyObject*)__pyx_t_4);
        __pyx_t_4 = 0;
        __pyx_t_7 = PyList_Sort(__pyx_t_3); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 598, __pyx_L1_error)
        if (unlikely(__pyx_t_3 == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
          __PYX_ERR(0, 598, __pyx_L1_error)
        }
        __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        for (;;) {
          if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 598, __pyx_L1_error)
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 598, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
          __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 598, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_9genexpr11__pyx_v_i = __pyx_t_8;
          __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_9genexpr11__pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 598, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_path->index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 598, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 598, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3);
          __Pyx_GIVEREF(__pyx_t_1);
          PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_1);
          __pyx_t_3 = 0;
          __pyx_t_1 = 0;
          if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_10))) __PYX_ERR(0, 598, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } /* exit inner scope */
      __pyx_v_pairs = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
    }
    __pyx_L5:;

    /* "_element_graph.pyx":594
 *             outgroup = path.outgroup
 * 
 *         if len(ingroup.difference(path.contained)) > 0:             # <<<<<<<<<<<<<<
 *             if len(outgroup.difference(path.contained)) > 0:
 *                 pairs = list(set([(i,o) for o in sorted(outgroup) for i in sorted(ingroup) if self.overlap[i,o] > -1]))
 */
    goto __pyx_L4;
  }

  /* "_element_graph.pyx":600
 *                 pairs = [(i,path.index) for i in sorted(ingroup)]
 *         else: # No ingroups, use path.index as other end of pair
 *             pairs = [(path.index,o) for o in sorted(outgroup)]             # <<<<<<<<<<<<<<
 * 
 *         # Make an extension set out of each pair by adding all elements contained by path+pair
 */
  /*else*/ {
    { /* enter inner scope */
      __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 600, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_10 = PySequence_List(__pyx_v_outgroup); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 600, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_4 = ((PyObject*)__pyx_t_10);
      __pyx_t_10 = 0;
      __pyx_t_7 = PyList_Sort(__pyx_t_4); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 600, __pyx_L1_error)
      if (unlikely(__pyx_t_4 == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
        __PYX_ERR(0, 600, __pyx_L1_error)
      }
      __pyx_t_10 = __pyx_t_4; __Pyx_INCREF(__pyx_t_10); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      for (;;) {
        if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_10)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 600, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_10, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 600, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
        __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 600, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_9genexpr12__pyx_v_o = __pyx_t_8;
        __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_path->index); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 600, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_9genexpr12__pyx_v_o); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 600, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 600, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_1);
        PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
        __pyx_t_4 = 0;
        __pyx_t_1 = 0;
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 600, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      }
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    } /* exit inner scope */
    __pyx_v_pairs = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;
  }
  __pyx_L4:;

  /* "_element_graph.pyx":603
 * 
 *         # Make an extension set out of each pair by adding all elements contained by path+pair
 *         for pair in pairs:             # <<<<<<<<<<<<<<
 *             e_in = self.elements[pair[0]]
 *             e_out = self.elements[pair[1]]
 */
  __pyx_t_2 = __pyx_v_pairs; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0;
  for (;;) {
    if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_10 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_10); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 603, __pyx_L1_error)
    #else
    __pyx_t_10 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 603, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    #endif
    __pyx_t_12 = __pyx_convert__from_py___pyx_ctuple_int__and_int(__pyx_t_10); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 603, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_v_pair = __pyx_t_12;

    /* "_element_graph.pyx":604
 *         # Make an extension set out of each pair by adding all elements contained by path+pair
 *         for pair in pairs:
 *             e_in = self.elements[pair[0]]             # <<<<<<<<<<<<<<
 *             e_out = self.elements[pair[1]]
 *             contained = e_in.outgroup | e_out.ingroup | e_in.contains | e_out.contains # Potential set of elements contained in the extension
 */
    if (unlikely(__pyx_v_self->elements == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 604, __pyx_L1_error)
    }
    __pyx_t_8 = __pyx_v_pair.f0;
    __pyx_t_10 = __Pyx_GetItemInt_List(__pyx_v_self->elements, __pyx_t_8, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 604, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_14_element_graph_Element))))) __PYX_ERR(0, 604, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_e_in, ((struct __pyx_obj_14_element_graph_Element *)__pyx_t_10));
    __pyx_t_10 = 0;

    /* "_element_graph.pyx":605
 *         for pair in pairs:
 *             e_in = self.elements[pair[0]]
 *             e_out = self.elements[pair[1]]             # <<<<<<<<<<<<<<
 *             contained = e_in.outgroup | e_out.ingroup | e_in.contains | e_out.contains # Potential set of elements contained in the extension
 *             # Filter 1: All elements already included or excluded in the extension itself
 */
    if (unlikely(__pyx_v_self->elements == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 605, __pyx_L1_error)
    }
    __pyx_t_8 = __pyx_v_pair.f1;
    __pyx_t_10 = __Pyx_GetItemInt_List(__pyx_v_self->elements, __pyx_t_8, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 605, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_14_element_graph_Element))))) __PYX_ERR(0, 605, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_e_out, ((struct __pyx_obj_14_element_graph_Element *)__pyx_t_10));
    __pyx_t_10 = 0;

    /* "_element_graph.pyx":606
 *             e_in = self.elements[pair[0]]
 *             e_out = self.elements[pair[1]]
 *             contained = e_in.outgroup | e_out.ingroup | e_in.contains | e_out.contains # Potential set of elements contained in the extension             # <<<<<<<<<<<<<<
 *             # Filter 1: All elements already included or excluded in the extension itself
 *             ext_accounts = e_in.includes | path.includes | e_out.includes | e_in.excludes | path.excludes | e_out.excludes
 */
    __pyx_t_10 = PyNumber_Or(__pyx_v_e_in->outgroup, __pyx_v_e_out->ingroup); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 606, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_3 = PyNumber_Or(__pyx_t_10, __pyx_v_e_in->contains); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 606, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_10 = PyNumber_Or(__pyx_t_3, __pyx_v_e_out->contains); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 606, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF_SET(__pyx_v_contained, ((PyObject*)__pyx_t_10));
    __pyx_t_10 = 0;

    /* "_element_graph.pyx":608
 *             contained = e_in.outgroup | e_out.ingroup | e_in.contains | e_out.contains # Potential set of elements contained in the extension
 *             # Filter 1: All elements already included or excluded in the extension itself
 *             ext_accounts = e_in.includes | path.includes | e_out.includes | e_in.excludes | path.excludes | e_out.excludes             # <<<<<<<<<<<<<<
 *             contained.difference_update(ext_accounts)
 *             # Filter 2: All elements in the set that add information not contained in the extension
 */
    __pyx_t_10 = PyNumber_Or(__pyx_v_e_in->includes, __pyx_v_path->includes); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 608, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_3 = PyNumber_Or(__pyx_t_10, __pyx_v_e_out->includes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 608, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_10 = PyNumber_Or(__pyx_t_3, __pyx_v_e_in->excludes); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 608, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyNumber_Or(__pyx_t_10, __pyx_v_path->excludes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 608, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_10 = PyNumber_Or(__pyx_t_3, __pyx_v_e_out->excludes); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 608, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF_SET(__pyx_v_ext_accounts, ((PyObject*)__pyx_t_10));
    __pyx_t_10 = 0;

    /* "_element_graph.pyx":609
 *             # Filter 1: All elements already included or excluded in the extension itself
 *             ext_accounts = e_in.includes | path.includes | e_out.includes | e_in.excludes | path.excludes | e_out.excludes
 *             contained.difference_update(ext_accounts)             # <<<<<<<<<<<<<<
 *             # Filter 2: All elements in the set that add information not contained in the extension
 *             stranded = e_in.strand != 0 or e_out.strand !=0 or path.strand != 0
 */
    __pyx_t_10 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PySet_Type_difference_update, __pyx_v_contained, __pyx_v_ext_accounts); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 609, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

    /* "_element_graph.pyx":611
 *             contained.difference_update(ext_accounts)
 *             # Filter 2: All elements in the set that add information not contained in the extension
 *             stranded = e_in.strand != 0 or e_out.strand !=0 or path.strand != 0             # <<<<<<<<<<<<<<
 *             ext_members = e_in.members | path.members | e_out.members
 *             ext_nonmembers = e_in.nonmembers | path.nonmembers | e_out.nonmembers
 */
    __pyx_t_6 = (__pyx_v_e_in->strand != 0);
    if (!__pyx_t_6) {
    } else {
      __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 611, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_10 = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L17_bool_binop_done;
    }
    __pyx_t_6 = (__pyx_v_e_out->strand != 0);
    if (!__pyx_t_6) {
    } else {
      __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 611, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_10 = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L17_bool_binop_done;
    }
    __pyx_t_6 = (__pyx_v_path->strand != 0);
    __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 611, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_10 = __pyx_t_3;
    __pyx_t_3 = 0;
    __pyx_L17_bool_binop_done:;
    __Pyx_XDECREF_SET(__pyx_v_stranded, __pyx_t_10);
    __pyx_t_10 = 0;

    /* "_element_graph.pyx":612
 *             # Filter 2: All elements in the set that add information not contained in the extension
 *             stranded = e_in.strand != 0 or e_out.strand !=0 or path.strand != 0
 *             ext_members = e_in.members | path.members | e_out.members             # <<<<<<<<<<<<<<
 *             ext_nonmembers = e_in.nonmembers | path.nonmembers | e_out.nonmembers
 *             exclude = set([path.index])
 */
    __pyx_t_10 = PyNumber_Or(__pyx_v_e_in->members, __pyx_v_path->members); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 612, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_3 = PyNumber_Or(__pyx_t_10, __pyx_v_e_out->members); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 612, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF_SET(__pyx_v_ext_members, ((PyObject*)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "_element_graph.pyx":613
 *             stranded = e_in.strand != 0 or e_out.strand !=0 or path.strand != 0
 *             ext_members = e_in.members | path.members | e_out.members
 *             ext_nonmembers = e_in.nonmembers | path.nonmembers | e_out.nonmembers             # <<<<<<<<<<<<<<
 *             exclude = set([path.index])
 *             for c in contained:
 */
    __pyx_t_3 = PyNumber_Or(__pyx_v_e_in->nonmembers, __pyx_v_path->nonmembers); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 613, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_10 = PyNumber_Or(__pyx_t_3, __pyx_v_e_out->nonmembers); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 613, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF_SET(__pyx_v_ext_nonmembers, ((PyObject*)__pyx_t_10));
    __pyx_t_10 = 0;

    /* "_element_graph.pyx":614
 *             ext_members = e_in.members | path.members | e_out.members
 *             ext_nonmembers = e_in.nonmembers | path.nonmembers | e_out.nonmembers
 *             exclude = set([path.index])             # <<<<<<<<<<<<<<
 *             for c in contained:
 *                 e_con = self.elements[c]
 */
    __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_path->index); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 614, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_3 = PySet_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 614, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (PySet_Add(__pyx_t_3, __pyx_t_10) < 0) __PYX_ERR(0, 614, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF_SET(__pyx_v_exclude, ((PyObject*)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "_element_graph.pyx":615
 *             ext_nonmembers = e_in.nonmembers | path.nonmembers | e_out.nonmembers
 *             exclude = set([path.index])
 *             for c in contained:             # <<<<<<<<<<<<<<
 *                 e_con = self.elements[c]
 *                 if not stranded and e_con.strand != 0:
 */
    __pyx_t_9 = 0;
    __pyx_t_10 = __Pyx_set_iterator(__pyx_v_contained, 1, (&__pyx_t_13), (&__pyx_t_8)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 615, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_XDECREF(__pyx_t_3);
    __pyx_t_3 = __pyx_t_10;
    __pyx_t_10 = 0;
    while (1) {
      __pyx_t_14 = __Pyx_set_iter_next(__pyx_t_3, __pyx_t_13, &__pyx_t_9, &__pyx_t_10, __pyx_t_8);
      if (unlikely(__pyx_t_14 == 0)) break;
      if (unlikely(__pyx_t_14 == -1)) __PYX_ERR(0, 615, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_10); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 615, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_v_c = __pyx_t_14;

      /* "_element_graph.pyx":616
 *             exclude = set([path.index])
 *             for c in contained:
 *                 e_con = self.elements[c]             # <<<<<<<<<<<<<<
 *                 if not stranded and e_con.strand != 0:
 *                     exclude.add(c)
 */
      if (unlikely(__pyx_v_self->elements == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(0, 616, __pyx_L1_error)
      }
      __pyx_t_10 = __Pyx_GetItemInt_List(__pyx_v_self->elements, __pyx_v_c, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 616, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_14_element_graph_Element))))) __PYX_ERR(0, 616, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_e_con, ((struct __pyx_obj_14_element_graph_Element *)__pyx_t_10));
      __pyx_t_10 = 0;

      /* "_element_graph.pyx":617
 *             for c in contained:
 *                 e_con = self.elements[c]
 *                 if not stranded and e_con.strand != 0:             # <<<<<<<<<<<<<<
 *                     exclude.add(c)
 * 
 */
      __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_v_stranded); if (unlikely(__pyx_t_15 < 0)) __PYX_ERR(0, 617, __pyx_L1_error)
      __pyx_t_16 = ((!__pyx_t_15) != 0);
      if (__pyx_t_16) {
      } else {
        __pyx_t_6 = __pyx_t_16;
        goto __pyx_L23_bool_binop_done;
      }
      __pyx_t_16 = ((__pyx_v_e_con->strand != 0) != 0);
      __pyx_t_6 = __pyx_t_16;
      __pyx_L23_bool_binop_done:;
      if (__pyx_t_6) {

        /* "_element_graph.pyx":618
 *                 e_con = self.elements[c]
 *                 if not stranded and e_con.strand != 0:
 *                     exclude.add(c)             # <<<<<<<<<<<<<<
 * 
 *                 if not e_con.members.issubset(ext_members) or not e_con.nonmembers.issubset(ext_nonmembers):
 */
        __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_c); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 618, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_7 = PySet_Add(__pyx_v_exclude, __pyx_t_10); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 618, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

        /* "_element_graph.pyx":617
 *             for c in contained:
 *                 e_con = self.elements[c]
 *                 if not stranded and e_con.strand != 0:             # <<<<<<<<<<<<<<
 *                     exclude.add(c)
 * 
 */
      }

      /* "_element_graph.pyx":620
 *                     exclude.add(c)
 * 
 *                 if not e_con.members.issubset(ext_members) or not e_con.nonmembers.issubset(ext_nonmembers):             # <<<<<<<<<<<<<<
 *                     exclude.add(c)
 * 
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_e_con->members, __pyx_n_s_issubset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 620, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      __pyx_t_10 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_4, __pyx_v_ext_members) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_ext_members);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 620, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_16 < 0)) __PYX_ERR(0, 620, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_15 = ((!__pyx_t_16) != 0);
      if (!__pyx_t_15) {
      } else {
        __pyx_t_6 = __pyx_t_15;
        goto __pyx_L26_bool_binop_done;
      }
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_e_con->nonmembers, __pyx_n_s_issubset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 620, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      __pyx_t_10 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_4, __pyx_v_ext_nonmembers) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_ext_nonmembers);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 620, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_15 < 0)) __PYX_ERR(0, 620, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_16 = ((!__pyx_t_15) != 0);
      __pyx_t_6 = __pyx_t_16;
      __pyx_L26_bool_binop_done:;
      if (__pyx_t_6) {

        /* "_element_graph.pyx":621
 * 
 *                 if not e_con.members.issubset(ext_members) or not e_con.nonmembers.issubset(ext_nonmembers):
 *                     exclude.add(c)             # <<<<<<<<<<<<<<
 * 
 *             contained.update([pair[0], pair[1]])
 */
        __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_c); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 621, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_7 = PySet_Add(__pyx_v_exclude, __pyx_t_10); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 621, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

        /* "_element_graph.pyx":620
 *                     exclude.add(c)
 * 
 *                 if not e_con.members.issubset(ext_members) or not e_con.nonmembers.issubset(ext_nonmembers):             # <<<<<<<<<<<<<<
 *                     exclude.add(c)
 * 
 */
      }
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "_element_graph.pyx":623
 *                     exclude.add(c)
 * 
 *             contained.update([pair[0], pair[1]])             # <<<<<<<<<<<<<<
 *             contained.difference_update(exclude)
 *             ext = tuple(sorted(list(contained)))
 */
    __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_pair.f0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 623, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_pair.f1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 623, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 623, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_3);
    PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_10);
    PyList_SET_ITEM(__pyx_t_1, 1, __pyx_t_10);
    __pyx_t_3 = 0;
    __pyx_t_10 = 0;
    __pyx_t_10 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PySet_Type_update, __pyx_v_contained, __pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 623, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

    /* "_element_graph.pyx":624
 * 
 *             contained.update([pair[0], pair[1]])
 *             contained.difference_update(exclude)             # <<<<<<<<<<<<<<
 *             ext = tuple(sorted(list(contained)))
 *             if len(ext) == 0 or ext_members.issubset(path.members):continue
 */
    __pyx_t_10 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PySet_Type_difference_update, __pyx_v_contained, __pyx_v_exclude); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 624, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

    /* "_element_graph.pyx":625
 *             contained.update([pair[0], pair[1]])
 *             contained.difference_update(exclude)
 *             ext = tuple(sorted(list(contained)))             # <<<<<<<<<<<<<<
 *             if len(ext) == 0 or ext_members.issubset(path.members):continue
 *             if len(ext) > 1 or len(self.elements[ext[0]].uniqueMembers(path)) > 0:
 */
    __pyx_t_1 = PySequence_List(__pyx_v_contained); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 625, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PySequence_List(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 625, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_10 = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_7 = PyList_Sort(__pyx_t_10); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 625, __pyx_L1_error)
    if (unlikely(__pyx_t_10 == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(0, 625, __pyx_L1_error)
    }
    __pyx_t_3 = PyList_AsTuple(__pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 625, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF_SET(__pyx_v_ext, ((PyObject*)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "_element_graph.pyx":626
 *             contained.difference_update(exclude)
 *             ext = tuple(sorted(list(contained)))
 *             if len(ext) == 0 or ext_members.issubset(path.members):continue             # <<<<<<<<<<<<<<
 *             if len(ext) > 1 or len(self.elements[ext[0]].uniqueMembers(path)) > 0:
 *                 exthash = '_'.join([','.join([str(i) for i in sorted(ext_members)]), ','.join([str(i) for i in sorted(ext_nonmembers)])])
 */
    __pyx_t_13 = PyTuple_GET_SIZE(__pyx_v_ext); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 626, __pyx_L1_error)
    __pyx_t_16 = ((__pyx_t_13 == 0) != 0);
    if (!__pyx_t_16) {
    } else {
      __pyx_t_6 = __pyx_t_16;
      goto __pyx_L29_bool_binop_done;
    }
    __pyx_t_3 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PySet_Type_issubset, __pyx_v_ext_members, __pyx_v_path->members); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 626, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_16 < 0)) __PYX_ERR(0, 626, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_6 = __pyx_t_16;
    __pyx_L29_bool_binop_done:;
    if (__pyx_t_6) {
      goto __pyx_L15_continue;
    }

    /* "_element_graph.pyx":627
 *             ext = tuple(sorted(list(contained)))
 *             if len(ext) == 0 or ext_members.issubset(path.members):continue
 *             if len(ext) > 1 or len(self.elements[ext[0]].uniqueMembers(path)) > 0:             # <<<<<<<<<<<<<<
 *                 exthash = '_'.join([','.join([str(i) for i in sorted(ext_members)]), ','.join([str(i) for i in sorted(ext_nonmembers)])])
 *                 if len(ext) > len(extdict.get(exthash, ())):
 */
    __pyx_t_13 = PyTuple_GET_SIZE(__pyx_v_ext); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 627, __pyx_L1_error)
    __pyx_t_16 = ((__pyx_t_13 > 1) != 0);
    if (!__pyx_t_16) {
    } else {
      __pyx_t_6 = __pyx_t_16;
      goto __pyx_L32_bool_binop_done;
    }
    if (unlikely(__pyx_v_self->elements == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 627, __pyx_L1_error)
    }
    __pyx_t_10 = __Pyx_GetItemInt_Tuple(__pyx_v_ext, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 627, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_self->elements, __pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 627, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uniqueMembers); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 627, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_10);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_10, function);
      }
    }
    __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_1, ((PyObject *)__pyx_v_path)) : __Pyx_PyObject_CallOneArg(__pyx_t_10, ((PyObject *)__pyx_v_path));
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 627, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_13 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 627, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_16 = ((__pyx_t_13 > 0) != 0);
    __pyx_t_6 = __pyx_t_16;
    __pyx_L32_bool_binop_done:;
    if (__pyx_t_6) {

      /* "_element_graph.pyx":628
 *             if len(ext) == 0 or ext_members.issubset(path.members):continue
 *             if len(ext) > 1 or len(self.elements[ext[0]].uniqueMembers(path)) > 0:
 *                 exthash = '_'.join([','.join([str(i) for i in sorted(ext_members)]), ','.join([str(i) for i in sorted(ext_nonmembers)])])             # <<<<<<<<<<<<<<
 *                 if len(ext) > len(extdict.get(exthash, ())):
 *                     extdict[exthash] = ext
 */
      { /* enter inner scope */
        __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 628, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_1 = PySequence_List(__pyx_v_ext_members); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 628, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_10 = ((PyObject*)__pyx_t_1);
        __pyx_t_1 = 0;
        __pyx_t_7 = PyList_Sort(__pyx_t_10); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 628, __pyx_L1_error)
        if (unlikely(__pyx_t_10 == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
          __PYX_ERR(0, 628, __pyx_L1_error)
        }
        __pyx_t_1 = __pyx_t_10; __Pyx_INCREF(__pyx_t_1); __pyx_t_13 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        for (;;) {
          if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_10 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_13); __Pyx_INCREF(__pyx_t_10); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 628, __pyx_L1_error)
          #else
          __pyx_t_10 = PySequence_ITEM(__pyx_t_1, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 628, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          #endif
          __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_10); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 628, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_9genexpr13__pyx_v_i = __pyx_t_8;
          __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_9genexpr13__pyx_v_i); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 628, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 628, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 628, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        }
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      } /* exit inner scope */
      __pyx_t_1 = PyUnicode_Join(__pyx_kp_u__4, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 628, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      { /* enter inner scope */
        __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 628, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_10 = PySequence_List(__pyx_v_ext_nonmembers); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 628, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_4 = ((PyObject*)__pyx_t_10);
        __pyx_t_10 = 0;
        __pyx_t_7 = PyList_Sort(__pyx_t_4); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 628, __pyx_L1_error)
        if (unlikely(__pyx_t_4 == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
          __PYX_ERR(0, 628, __pyx_L1_error)
        }
        __pyx_t_10 = __pyx_t_4; __Pyx_INCREF(__pyx_t_10); __pyx_t_13 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        for (;;) {
          if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_10)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_4 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_13); __Pyx_INCREF(__pyx_t_4); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 628, __pyx_L1_error)
          #else
          __pyx_t_4 = PySequence_ITEM(__pyx_t_10, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 628, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          #endif
          __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 628, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_9genexpr14__pyx_v_i = __pyx_t_8;
          __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_9genexpr14__pyx_v_i); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 628, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_11 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 628, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_11))) __PYX_ERR(0, 628, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        }
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      } /* exit inner scope */
      __pyx_t_10 = PyUnicode_Join(__pyx_kp_u__4, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 628, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 628, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_10);
      PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_10);
      __pyx_t_1 = 0;
      __pyx_t_10 = 0;
      __pyx_t_10 = PyUnicode_Join(__pyx_n_u__3, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 628, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF_SET(__pyx_v_exthash, ((PyObject*)__pyx_t_10));
      __pyx_t_10 = 0;

      /* "_element_graph.pyx":629
 *             if len(ext) > 1 or len(self.elements[ext[0]].uniqueMembers(path)) > 0:
 *                 exthash = '_'.join([','.join([str(i) for i in sorted(ext_members)]), ','.join([str(i) for i in sorted(ext_nonmembers)])])
 *                 if len(ext) > len(extdict.get(exthash, ())):             # <<<<<<<<<<<<<<
 *                     extdict[exthash] = ext
 * 
 */
      __pyx_t_13 = PyTuple_GET_SIZE(__pyx_v_ext); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 629, __pyx_L1_error)
      __pyx_t_10 = __Pyx_PyDict_GetItemDefault(__pyx_v_extdict, __pyx_v_exthash, __pyx_empty_tuple); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 629, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_9 = PyObject_Length(__pyx_t_10); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 629, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_6 = ((__pyx_t_13 > __pyx_t_9) != 0);
      if (__pyx_t_6) {

        /* "_element_graph.pyx":630
 *                 exthash = '_'.join([','.join([str(i) for i in sorted(ext_members)]), ','.join([str(i) for i in sorted(ext_nonmembers)])])
 *                 if len(ext) > len(extdict.get(exthash, ())):
 *                     extdict[exthash] = ext             # <<<<<<<<<<<<<<
 * 
 *         # Final check: If >0 extensions go both ways, remove the extensions that don't
 */
        if (unlikely(PyDict_SetItem(__pyx_v_extdict, __pyx_v_exthash, __pyx_v_ext) < 0)) __PYX_ERR(0, 630, __pyx_L1_error)

        /* "_element_graph.pyx":629
 *             if len(ext) > 1 or len(self.elements[ext[0]].uniqueMembers(path)) > 0:
 *                 exthash = '_'.join([','.join([str(i) for i in sorted(ext_members)]), ','.join([str(i) for i in sorted(ext_nonmembers)])])
 *                 if len(ext) > len(extdict.get(exthash, ())):             # <<<<<<<<<<<<<<
 *                     extdict[exthash] = ext
 * 
 */
      }

      /* "_element_graph.pyx":627
 *             ext = tuple(sorted(list(contained)))
 *             if len(ext) == 0 or ext_members.issubset(path.members):continue
 *             if len(ext) > 1 or len(self.elements[ext[0]].uniqueMembers(path)) > 0:             # <<<<<<<<<<<<<<
 *                 exthash = '_'.join([','.join([str(i) for i in sorted(ext_members)]), ','.join([str(i) for i in sorted(ext_nonmembers)])])
 *                 if len(ext) > len(extdict.get(exthash, ())):
 */
    }

    /* "_element_graph.pyx":603
 * 
 *         # Make an extension set out of each pair by adding all elements contained by path+pair
 *         for pair in pairs:             # <<<<<<<<<<<<<<
 *             e_in = self.elements[pair[0]]
 *             e_out = self.elements[pair[1]]
 */
    __pyx_L15_continue:;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "_element_graph.pyx":633
 * 
 *         # Final check: If >0 extensions go both ways, remove the extensions that don't
 *         extensions = sorted([(sum([self.elements[i].cov for i in ext]),ext) for ext in list(extdict.values())],reverse=True)             # <<<<<<<<<<<<<<
 *         return extensions
 * 
 */
  { /* enter inner scope */
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 633, __pyx_L41_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_10 = __Pyx_PyDict_Values(__pyx_v_extdict); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 633, __pyx_L41_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_3 = PySequence_List(__pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 633, __pyx_L41_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_10 = __pyx_t_3; __Pyx_INCREF(__pyx_t_10); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    for (;;) {
      if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_10)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_3 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 633, __pyx_L41_error)
      #else
      __pyx_t_3 = PySequence_ITEM(__pyx_t_10, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 633, __pyx_L41_error)
      __Pyx_GOTREF(__pyx_t_3);
      #endif
      if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(0, 633, __pyx_L41_error)
      __Pyx_XDECREF_SET(__pyx_9genexpr15__pyx_v_ext, ((PyObject*)__pyx_t_3));
      __pyx_t_3 = 0;
      { /* enter inner scope */
        __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 633, __pyx_L41_error)
        __Pyx_GOTREF(__pyx_t_3);
        if (unlikely(__pyx_9genexpr15__pyx_v_ext == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
          __PYX_ERR(0, 633, __pyx_L41_error)
        }
        __pyx_t_1 = __pyx_9genexpr15__pyx_v_ext; __Pyx_INCREF(__pyx_t_1); __pyx_t_9 = 0;
        for (;;) {
          if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_11 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_9); __Pyx_INCREF(__pyx_t_11); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 633, __pyx_L41_error)
          #else
          __pyx_t_11 = PySequence_ITEM(__pyx_t_1, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 633, __pyx_L41_error)
          __Pyx_GOTREF(__pyx_t_11);
          #endif
          __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_11); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 633, __pyx_L41_error)
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __pyx_9genexpr16__pyx_v_i = __pyx_t_8;
          if (unlikely(__pyx_v_self->elements == Py_None)) {
            PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
            __PYX_ERR(0, 633, __pyx_L41_error)
          }
          __pyx_t_11 = __Pyx_GetItemInt_List(__pyx_v_self->elements, __pyx_9genexpr16__pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 633, __pyx_L41_error)
          __Pyx_GOTREF(__pyx_t_11);
          __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_cov); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 633, __pyx_L41_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 633, __pyx_L41_error)
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        }
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      } /* exit inner scope */
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 633, __pyx_L41_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 633, __pyx_L41_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __Pyx_INCREF(__pyx_9genexpr15__pyx_v_ext);
      __Pyx_GIVEREF(__pyx_9genexpr15__pyx_v_ext);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_9genexpr15__pyx_v_ext);
      __pyx_t_1 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 633, __pyx_L41_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_9genexpr15__pyx_v_ext); __pyx_9genexpr15__pyx_v_ext = 0;
    goto __pyx_L46_exit_scope;
    __pyx_L41_error:;
    __Pyx_XDECREF(__pyx_9genexpr15__pyx_v_ext); __pyx_9genexpr15__pyx_v_ext = 0;
    goto __pyx_L1_error;
    __pyx_L46_exit_scope:;
  } /* exit inner scope */
  __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 633, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 633, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_reverse, Py_True) < 0) __PYX_ERR(0, 633, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_sorted, __pyx_t_10, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 633, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_extensions = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "_element_graph.pyx":634
 *         # Final check: If >0 extensions go both ways, remove the extensions that don't
 *         extensions = sorted([(sum([self.elements[i].cov for i in ext]),ext) for ext in list(extdict.values())],reverse=True)
 *         return extensions             # <<<<<<<<<<<<<<
 * 
 *     cpdef tuple best_extension(self, Element path, list extensions, float minimum_proportion):
 */
  __Pyx_XDECREF(__pyx_r);
  if (!(likely(PyList_CheckExact(__pyx_v_extensions))||((__pyx_v_extensions) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_v_extensions)->tp_name), 0))) __PYX_ERR(0, 634, __pyx_L1_error)
  __Pyx_INCREF(__pyx_v_extensions);
  __pyx_r = ((PyObject*)__pyx_v_extensions);
  goto __pyx_L0;

  /* "_element_graph.pyx":572
 *         return [self.dead_end_penalty,1.][s_tag] * [self.dead_end_penalty,1.][e_tag]
 * 
 *     cpdef list generate_extensions(self, Element path):             # <<<<<<<<<<<<<<
 *         """Defines all combinations of mutally compatible elements in
 *         the path's ingroup/outgroup that should be evaluated. Requires
 */

  /* 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_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("_element_graph.ElementGraph.generate_extensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_pairs);
  __Pyx_XDECREF(__pyx_v_ingroup);
  __Pyx_XDECREF(__pyx_v_outgroup);
  __Pyx_XDECREF(__pyx_v_ext_accounts);
  __Pyx_XDECREF(__pyx_v_ext_members);
  __Pyx_XDECREF(__pyx_v_ext_nonmembers);
  __Pyx_XDECREF(__pyx_v_exclude);
  __Pyx_XDECREF(__pyx_v_contained);
  __Pyx_XDECREF((PyObject *)__pyx_v_e_in);
  __Pyx_XDECREF((PyObject *)__pyx_v_e_out);
  __Pyx_XDECREF((PyObject *)__pyx_v_e_con);
  __Pyx_XDECREF(__pyx_v_freebies);
  __Pyx_XDECREF(__pyx_v_ext);
  __Pyx_XDECREF(__pyx_v_extdict);
  __Pyx_XDECREF(__pyx_v_exthash);
  __Pyx_XDECREF(__pyx_v_stranded);
  __Pyx_XDECREF(__pyx_v_extensions);
  __Pyx_XDECREF(__pyx_9genexpr15__pyx_v_ext);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_27generate_extensions(PyObject *__pyx_v_self, PyObject *__pyx_v_path); /*proto*/
static char __pyx_doc_14_element_graph_12ElementGraph_26generate_extensions[] = "Defines all combinations of mutally compatible elements in\n        the path's ingroup/outgroup that should be evaluated. Requires\n        at least one each from ingroup and outgroup if they are nonempty.";
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_27generate_extensions(PyObject *__pyx_v_self, PyObject *__pyx_v_path) {
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("generate_extensions (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_path), __pyx_ptype_14_element_graph_Element, 1, "path", 0))) __PYX_ERR(0, 572, __pyx_L1_error)
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_26generate_extensions(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self), ((struct __pyx_obj_14_element_graph_Element *)__pyx_v_path));

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

static PyObject *__pyx_pf_14_element_graph_12ElementGraph_26generate_extensions(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, struct __pyx_obj_14_element_graph_Element *__pyx_v_path) {
  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("generate_extensions", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_14_element_graph_12ElementGraph_generate_extensions(__pyx_v_self, __pyx_v_path, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 572, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "_element_graph.pyx":636
 *         return extensions
 * 
 *     cpdef tuple best_extension(self, Element path, list extensions, float minimum_proportion):             # <<<<<<<<<<<<<<
 *         cdef tuple ext, best_ext
 *         cdef float score, best_score
 */

static PyObject *__pyx_pw_14_element_graph_12ElementGraph_29best_extension(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_14_element_graph_12ElementGraph_best_extension(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, struct __pyx_obj_14_element_graph_Element *__pyx_v_path, PyObject *__pyx_v_extensions, float __pyx_v_minimum_proportion, int __pyx_skip_dispatch) {
  PyObject *__pyx_v_ext = 0;
  PyObject *__pyx_v_best_ext = 0;
  float __pyx_v_score;
  float __pyx_v_best_score;
  int __pyx_v_has_an_end;
  PyObject *__pyx_v_cov = NULL;
  int __pyx_9genexpr17__pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  Py_ssize_t __pyx_t_10;
  int __pyx_t_11;
  int __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("best_extension", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_best_extension); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 636, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_14_element_graph_12ElementGraph_29best_extension)) {
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_3 = PyFloat_FromDouble(__pyx_v_minimum_proportion); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 636, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
        __pyx_t_6 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
            __pyx_t_6 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[4] = {__pyx_t_5, ((PyObject *)__pyx_v_path), __pyx_v_extensions, __pyx_t_3};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 636, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[4] = {__pyx_t_5, ((PyObject *)__pyx_v_path), __pyx_v_extensions, __pyx_t_3};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 636, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        {
          __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 636, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          if (__pyx_t_5) {
            __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
          }
          __Pyx_INCREF(((PyObject *)__pyx_v_path));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_path));
          PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, ((PyObject *)__pyx_v_path));
          __Pyx_INCREF(__pyx_v_extensions);
          __Pyx_GIVEREF(__pyx_v_extensions);
          PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_extensions);
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_t_3);
          __pyx_t_3 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 636, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        }
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 636, __pyx_L1_error)
        __pyx_r = ((PyObject*)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "_element_graph.pyx":641
 *         cdef bint has_an_end
 *         cdef int i
 *         best_ext = ()             # <<<<<<<<<<<<<<
 *         best_score = 0
 *         for cov,ext in extensions:
 */
  __Pyx_INCREF(__pyx_empty_tuple);
  __pyx_v_best_ext = __pyx_empty_tuple;

  /* "_element_graph.pyx":642
 *         cdef int i
 *         best_ext = ()
 *         best_score = 0             # <<<<<<<<<<<<<<
 *         for cov,ext in extensions:
 *             has_an_end = any([i in self.end_elements for i in ext])
 */
  __pyx_v_best_score = 0.0;

  /* "_element_graph.pyx":643
 *         best_ext = ()
 *         best_score = 0
 *         for cov,ext in extensions:             # <<<<<<<<<<<<<<
 *             has_an_end = any([i in self.end_elements for i in ext])
 *             if cov >= best_score or has_an_end:
 */
  if (unlikely(__pyx_v_extensions == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(0, 643, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_v_extensions; __Pyx_INCREF(__pyx_t_1); __pyx_t_8 = 0;
  for (;;) {
    if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_1)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 643, __pyx_L1_error)
    #else
    __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 643, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
    if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
      PyObject* sequence = __pyx_t_2;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 643, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_4 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_7 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_7);
      #else
      __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 643, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 643, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      #endif
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 643, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_9 = Py_TYPE(__pyx_t_3)->tp_iternext;
      index = 0; __pyx_t_4 = __pyx_t_9(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_4);
      index = 1; __pyx_t_7 = __pyx_t_9(__pyx_t_3); if (unlikely(!__pyx_t_7)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_7);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_3), 2) < 0) __PYX_ERR(0, 643, __pyx_L1_error)
      __pyx_t_9 = NULL;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      goto __pyx_L6_unpacking_done;
      __pyx_L5_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_9 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 643, __pyx_L1_error)
      __pyx_L6_unpacking_done:;
    }
    if (!(likely(PyTuple_CheckExact(__pyx_t_7))||((__pyx_t_7) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_7)->tp_name), 0))) __PYX_ERR(0, 643, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_cov, __pyx_t_4);
    __pyx_t_4 = 0;
    __Pyx_XDECREF_SET(__pyx_v_ext, ((PyObject*)__pyx_t_7));
    __pyx_t_7 = 0;

    /* "_element_graph.pyx":644
 *         best_score = 0
 *         for cov,ext in extensions:
 *             has_an_end = any([i in self.end_elements for i in ext])             # <<<<<<<<<<<<<<
 *             if cov >= best_score or has_an_end:
 *                 score = self.calculate_extension_score(path, ext, minimum_proportion)
 */
    { /* enter inner scope */
      __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 644, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (unlikely(__pyx_v_ext == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
        __PYX_ERR(0, 644, __pyx_L1_error)
      }
      __pyx_t_7 = __pyx_v_ext; __Pyx_INCREF(__pyx_t_7); __pyx_t_10 = 0;
      for (;;) {
        if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_10); __Pyx_INCREF(__pyx_t_4); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 644, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_7, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 644, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
        __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 644, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_9genexpr17__pyx_v_i = __pyx_t_6;
        __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_9genexpr17__pyx_v_i); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 644, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        if (unlikely(__pyx_v_self->end_elements == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
          __PYX_ERR(0, 644, __pyx_L1_error)
        }
        __pyx_t_11 = (__Pyx_PySet_ContainsTF(__pyx_t_4, __pyx_v_self->end_elements, Py_EQ)); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 644, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 644, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 644, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } /* exit inner scope */
    __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_any, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 644, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 644, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_v_has_an_end = __pyx_t_11;

    /* "_element_graph.pyx":645
 *         for cov,ext in extensions:
 *             has_an_end = any([i in self.end_elements for i in ext])
 *             if cov >= best_score or has_an_end:             # <<<<<<<<<<<<<<
 *                 score = self.calculate_extension_score(path, ext, minimum_proportion)
 *                 if score > best_score or (score == best_score and (has_an_end or len(ext) > len(best_ext))):
 */
    __pyx_t_7 = PyFloat_FromDouble(__pyx_v_best_score); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 645, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_cov, __pyx_t_7, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 645, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 645, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!__pyx_t_12) {
    } else {
      __pyx_t_11 = __pyx_t_12;
      goto __pyx_L10_bool_binop_done;
    }
    __pyx_t_12 = (__pyx_v_has_an_end != 0);
    __pyx_t_11 = __pyx_t_12;
    __pyx_L10_bool_binop_done:;
    if (__pyx_t_11) {

      /* "_element_graph.pyx":646
 *             has_an_end = any([i in self.end_elements for i in ext])
 *             if cov >= best_score or has_an_end:
 *                 score = self.calculate_extension_score(path, ext, minimum_proportion)             # <<<<<<<<<<<<<<
 *                 if score > best_score or (score == best_score and (has_an_end or len(ext) > len(best_ext))):
 *                     best_ext = ext
 */
      __pyx_v_score = ((struct __pyx_vtabstruct_14_element_graph_ElementGraph *)__pyx_v_self->__pyx_vtab)->calculate_extension_score(__pyx_v_self, __pyx_v_path, __pyx_v_ext, __pyx_v_minimum_proportion, 0);

      /* "_element_graph.pyx":647
 *             if cov >= best_score or has_an_end:
 *                 score = self.calculate_extension_score(path, ext, minimum_proportion)
 *                 if score > best_score or (score == best_score and (has_an_end or len(ext) > len(best_ext))):             # <<<<<<<<<<<<<<
 *                     best_ext = ext
 *                     best_score = score
 */
      __pyx_t_12 = ((__pyx_v_score > __pyx_v_best_score) != 0);
      if (!__pyx_t_12) {
      } else {
        __pyx_t_11 = __pyx_t_12;
        goto __pyx_L13_bool_binop_done;
      }
      __pyx_t_12 = ((__pyx_v_score == __pyx_v_best_score) != 0);
      if (__pyx_t_12) {
      } else {
        __pyx_t_11 = __pyx_t_12;
        goto __pyx_L13_bool_binop_done;
      }
      __pyx_t_12 = (__pyx_v_has_an_end != 0);
      if (!__pyx_t_12) {
      } else {
        __pyx_t_11 = __pyx_t_12;
        goto __pyx_L13_bool_binop_done;
      }
      if (unlikely(__pyx_v_ext == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
        __PYX_ERR(0, 647, __pyx_L1_error)
      }
      __pyx_t_10 = PyTuple_GET_SIZE(__pyx_v_ext); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(0, 647, __pyx_L1_error)
      if (unlikely(__pyx_v_best_ext == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
        __PYX_ERR(0, 647, __pyx_L1_error)
      }
      __pyx_t_13 = PyTuple_GET_SIZE(__pyx_v_best_ext); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 647, __pyx_L1_error)
      __pyx_t_12 = ((__pyx_t_10 > __pyx_t_13) != 0);
      __pyx_t_11 = __pyx_t_12;
      __pyx_L13_bool_binop_done:;
      if (__pyx_t_11) {

        /* "_element_graph.pyx":648
 *                 score = self.calculate_extension_score(path, ext, minimum_proportion)
 *                 if score > best_score or (score == best_score and (has_an_end or len(ext) > len(best_ext))):
 *                     best_ext = ext             # <<<<<<<<<<<<<<
 *                     best_score = score
 *             else:
 */
        __Pyx_INCREF(__pyx_v_ext);
        __Pyx_DECREF_SET(__pyx_v_best_ext, __pyx_v_ext);

        /* "_element_graph.pyx":649
 *                 if score > best_score or (score == best_score and (has_an_end or len(ext) > len(best_ext))):
 *                     best_ext = ext
 *                     best_score = score             # <<<<<<<<<<<<<<
 *             else:
 *                 break
 */
        __pyx_v_best_score = __pyx_v_score;

        /* "_element_graph.pyx":647
 *             if cov >= best_score or has_an_end:
 *                 score = self.calculate_extension_score(path, ext, minimum_proportion)
 *                 if score > best_score or (score == best_score and (has_an_end or len(ext) > len(best_ext))):             # <<<<<<<<<<<<<<
 *                     best_ext = ext
 *                     best_score = score
 */
      }

      /* "_element_graph.pyx":645
 *         for cov,ext in extensions:
 *             has_an_end = any([i in self.end_elements for i in ext])
 *             if cov >= best_score or has_an_end:             # <<<<<<<<<<<<<<
 *                 score = self.calculate_extension_score(path, ext, minimum_proportion)
 *                 if score > best_score or (score == best_score and (has_an_end or len(ext) > len(best_ext))):
 */
      goto __pyx_L9;
    }

    /* "_element_graph.pyx":651
 *                     best_score = score
 *             else:
 *                 break             # <<<<<<<<<<<<<<
 * 
 *         return best_ext
 */
    /*else*/ {
      goto __pyx_L4_break;
    }
    __pyx_L9:;

    /* "_element_graph.pyx":643
 *         best_ext = ()
 *         best_score = 0
 *         for cov,ext in extensions:             # <<<<<<<<<<<<<<
 *             has_an_end = any([i in self.end_elements for i in ext])
 *             if cov >= best_score or has_an_end:
 */
  }
  __pyx_L4_break:;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_element_graph.pyx":653
 *                 break
 * 
 *         return best_ext             # <<<<<<<<<<<<<<
 * 
 *     cpdef float calculate_extension_score(self, Element path, tuple extension, float minimum_proportion):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_best_ext);
  __pyx_r = __pyx_v_best_ext;
  goto __pyx_L0;

  /* "_element_graph.pyx":636
 *         return extensions
 * 
 *     cpdef tuple best_extension(self, Element path, list extensions, float minimum_proportion):             # <<<<<<<<<<<<<<
 *         cdef tuple ext, best_ext
 *         cdef float score, best_score
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("_element_graph.ElementGraph.best_extension", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ext);
  __Pyx_XDECREF(__pyx_v_best_ext);
  __Pyx_XDECREF(__pyx_v_cov);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_29best_extension(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_29best_extension(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_14_element_graph_Element *__pyx_v_path = 0;
  PyObject *__pyx_v_extensions = 0;
  float __pyx_v_minimum_proportion;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("best_extension (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,&__pyx_n_s_extensions,&__pyx_n_s_minimum_proportion,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_path)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_extensions)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("best_extension", 1, 3, 3, 1); __PYX_ERR(0, 636, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_minimum_proportion)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("best_extension", 1, 3, 3, 2); __PYX_ERR(0, 636, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "best_extension") < 0)) __PYX_ERR(0, 636, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_path = ((struct __pyx_obj_14_element_graph_Element *)values[0]);
    __pyx_v_extensions = ((PyObject*)values[1]);
    __pyx_v_minimum_proportion = __pyx_PyFloat_AsFloat(values[2]); if (unlikely((__pyx_v_minimum_proportion == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 636, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("best_extension", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 636, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("_element_graph.ElementGraph.best_extension", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_path), __pyx_ptype_14_element_graph_Element, 1, "path", 0))) __PYX_ERR(0, 636, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_extensions), (&PyList_Type), 1, "extensions", 1))) __PYX_ERR(0, 636, __pyx_L1_error)
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_28best_extension(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self), __pyx_v_path, __pyx_v_extensions, __pyx_v_minimum_proportion);

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

static PyObject *__pyx_pf_14_element_graph_12ElementGraph_28best_extension(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, struct __pyx_obj_14_element_graph_Element *__pyx_v_path, PyObject *__pyx_v_extensions, float __pyx_v_minimum_proportion) {
  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("best_extension", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_14_element_graph_12ElementGraph_best_extension(__pyx_v_self, __pyx_v_path, __pyx_v_extensions, __pyx_v_minimum_proportion, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 636, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "_element_graph.pyx":655
 *         return best_ext
 * 
 *     cpdef float calculate_extension_score(self, Element path, tuple extension, float minimum_proportion):             # <<<<<<<<<<<<<<
 *         """Given a path and a set of Elements to extend from it, calculate the
 *         new weights of the extended path and return a score
 */

static PyObject *__pyx_pw_14_element_graph_12ElementGraph_31calculate_extension_score(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static float __pyx_f_14_element_graph_12ElementGraph_calculate_extension_score(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, struct __pyx_obj_14_element_graph_Element *__pyx_v_path, PyObject *__pyx_v_extension, CYTHON_UNUSED float __pyx_v_minimum_proportion, int __pyx_skip_dispatch) {
  struct __pyx_obj_14_element_graph_Element *__pyx_v_element = 0;
  int __pyx_v_i;
  PyObject *__pyx_v_new_covered_indices = 0;
  float __pyx_v_div;
  float __pyx_v_available;
  float __pyx_v_score;
  float __pyx_v_source_similarity;
  float __pyx_v_ext_cov;
  float __pyx_v_dead_end_penalty;
  float __pyx_v_variance_penalty;
  PyArrayObject *__pyx_v_ext_proportions = 0;
  PyArrayObject *__pyx_v_e_prop = 0;
  PyArrayObject *__pyx_v_path_proportions = 0;
  PyArrayObject *__pyx_v_combined_member_coverage = 0;
  PyObject *__pyx_v_ext_member_weights = NULL;
  float __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  float __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("calculate_extension_score", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_calculate_extension_score); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 655, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_14_element_graph_12ElementGraph_31calculate_extension_score)) {
        __pyx_t_3 = PyFloat_FromDouble(__pyx_v_minimum_proportion); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 655, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
        __pyx_t_6 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
            __pyx_t_6 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[4] = {__pyx_t_5, ((PyObject *)__pyx_v_path), __pyx_v_extension, __pyx_t_3};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 655, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[4] = {__pyx_t_5, ((PyObject *)__pyx_v_path), __pyx_v_extension, __pyx_t_3};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 655, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        {
          __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 655, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          if (__pyx_t_5) {
            __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
          }
          __Pyx_INCREF(((PyObject *)__pyx_v_path));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_path));
          PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, ((PyObject *)__pyx_v_path));
          __Pyx_INCREF(__pyx_v_extension);
          __Pyx_GIVEREF(__pyx_v_extension);
          PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_extension);
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_t_3);
          __pyx_t_3 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 655, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        }
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_8 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_8 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 655, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_8;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "_element_graph.pyx":666
 *             np.ndarray ext_proportions, e_prop, path_proportions, combined_member_coverage
 *             list shared_members, excluded_cov
 *         if len(extension)==0:return 0             # <<<<<<<<<<<<<<
 *         ext_member_weights = np.zeros(path.member_weights.shape[0], dtype=np.float32)
 *         ext_proportions = np.zeros(path.source_weights.shape[0], dtype=np.float32)
 */
  if (unlikely(__pyx_v_extension == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(0, 666, __pyx_L1_error)
  }
  __pyx_t_9 = PyTuple_GET_SIZE(__pyx_v_extension); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 666, __pyx_L1_error)
  __pyx_t_10 = ((__pyx_t_9 == 0) != 0);
  if (__pyx_t_10) {
    __pyx_r = 0.0;
    goto __pyx_L0;
  }

  /* "_element_graph.pyx":667
 *             list shared_members, excluded_cov
 *         if len(extension)==0:return 0
 *         ext_member_weights = np.zeros(path.member_weights.shape[0], dtype=np.float32)             # <<<<<<<<<<<<<<
 *         ext_proportions = np.zeros(path.source_weights.shape[0], dtype=np.float32)
 *         new_covered_indices = set()
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 667, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 667, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_path->member_weights->dimensions[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 667, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 667, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 667, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 667, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_float32); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 667, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_3) < 0) __PYX_ERR(0, 667, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 667, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_ext_member_weights = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "_element_graph.pyx":668
 *         if len(extension)==0:return 0
 *         ext_member_weights = np.zeros(path.member_weights.shape[0], dtype=np.float32)
 *         ext_proportions = np.zeros(path.source_weights.shape[0], dtype=np.float32)             # <<<<<<<<<<<<<<
 *         new_covered_indices = set()
 *         # extension_excludes = set()
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 668, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 668, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_path->source_weights->dimensions[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 668, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 668, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 668, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 668, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float32); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 668, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_7) < 0) __PYX_ERR(0, 668, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 668, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 668, __pyx_L1_error)
  __pyx_v_ext_proportions = ((PyArrayObject *)__pyx_t_7);
  __pyx_t_7 = 0;

  /* "_element_graph.pyx":669
 *         ext_member_weights = np.zeros(path.member_weights.shape[0], dtype=np.float32)
 *         ext_proportions = np.zeros(path.source_weights.shape[0], dtype=np.float32)
 *         new_covered_indices = set()             # <<<<<<<<<<<<<<
 *         # extension_excludes = set()
 *         div = 1/len(extension)
 */
  __pyx_t_7 = PySet_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 669, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_v_new_covered_indices = ((PyObject*)__pyx_t_7);
  __pyx_t_7 = 0;

  /* "_element_graph.pyx":671
 *         new_covered_indices = set()
 *         # extension_excludes = set()
 *         div = 1/len(extension)             # <<<<<<<<<<<<<<
 *         for i in extension:
 *             element = self.elements[i]
 */
  if (unlikely(__pyx_v_extension == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(0, 671, __pyx_L1_error)
  }
  __pyx_t_9 = PyTuple_GET_SIZE(__pyx_v_extension); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 671, __pyx_L1_error)
  if (unlikely(__pyx_t_9 == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "float division");
    __PYX_ERR(0, 671, __pyx_L1_error)
  }
  __pyx_v_div = (1.0 / ((double)__pyx_t_9));

  /* "_element_graph.pyx":672
 *         # extension_excludes = set()
 *         div = 1/len(extension)
 *         for i in extension:             # <<<<<<<<<<<<<<
 *             element = self.elements[i]
 *             new_covered_indices.update(element.covered_indices)
 */
  if (unlikely(__pyx_v_extension == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(0, 672, __pyx_L1_error)
  }
  __pyx_t_7 = __pyx_v_extension; __Pyx_INCREF(__pyx_t_7); __pyx_t_9 = 0;
  for (;;) {
    if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 672, __pyx_L1_error)
    #else
    __pyx_t_3 = PySequence_ITEM(__pyx_t_7, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 672, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 672, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_i = __pyx_t_6;

    /* "_element_graph.pyx":673
 *         div = 1/len(extension)
 *         for i in extension:
 *             element = self.elements[i]             # <<<<<<<<<<<<<<
 *             new_covered_indices.update(element.covered_indices)
 *             # extension_excludes.update(element.excludes)
 */
    if (unlikely(__pyx_v_self->elements == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 673, __pyx_L1_error)
    }
    __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_self->elements, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 673, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_14_element_graph_Element))))) __PYX_ERR(0, 673, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_element, ((struct __pyx_obj_14_element_graph_Element *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "_element_graph.pyx":674
 *         for i in extension:
 *             element = self.elements[i]
 *             new_covered_indices.update(element.covered_indices)             # <<<<<<<<<<<<<<
 *             # extension_excludes.update(element.excludes)
 *             e_prop = self.available_proportion(path.source_weights, element)
 */
    __pyx_t_3 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PySet_Type_update, __pyx_v_new_covered_indices, __pyx_v_element->covered_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 674, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "_element_graph.pyx":676
 *             new_covered_indices.update(element.covered_indices)
 *             # extension_excludes.update(element.excludes)
 *             e_prop = self.available_proportion(path.source_weights, element)             # <<<<<<<<<<<<<<
 *             ext_proportions += self.normalize(e_prop*element.source_weights)*div
 *             available = np.sum(e_prop*element.source_weights)/np.sum(element.source_weights)
 */
    __pyx_t_3 = ((PyObject *)__pyx_v_path->source_weights);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = ((PyObject *)((struct __pyx_vtabstruct_14_element_graph_ElementGraph *)__pyx_v_self->__pyx_vtab)->available_proportion(__pyx_v_self, ((PyArrayObject *)__pyx_t_3), __pyx_v_element, 0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 676, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF_SET(__pyx_v_e_prop, ((PyArrayObject *)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "_element_graph.pyx":677
 *             # extension_excludes.update(element.excludes)
 *             e_prop = self.available_proportion(path.source_weights, element)
 *             ext_proportions += self.normalize(e_prop*element.source_weights)*div             # <<<<<<<<<<<<<<
 *             available = np.sum(e_prop*element.source_weights)/np.sum(element.source_weights)
 *             ext_member_weights += element.member_weights*available
 */
    __pyx_t_4 = PyNumber_Multiply(((PyObject *)__pyx_v_e_prop), ((PyObject *)__pyx_v_element->source_weights)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 677, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 677, __pyx_L1_error)
    __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_14_element_graph_ElementGraph *)__pyx_v_self->__pyx_vtab)->normalize(__pyx_v_self, ((PyArrayObject *)__pyx_t_4), 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 677, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyFloat_FromDouble(__pyx_v_div); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 677, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyNumber_Multiply(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 677, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_InPlaceAdd(((PyObject *)__pyx_v_ext_proportions), __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 677, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 677, __pyx_L1_error)
    __Pyx_DECREF_SET(__pyx_v_ext_proportions, ((PyArrayObject *)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "_element_graph.pyx":678
 *             e_prop = self.available_proportion(path.source_weights, element)
 *             ext_proportions += self.normalize(e_prop*element.source_weights)*div
 *             available = np.sum(e_prop*element.source_weights)/np.sum(element.source_weights)             # <<<<<<<<<<<<<<
 *             ext_member_weights += element.member_weights*available
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 678, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sum); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 678, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyNumber_Multiply(((PyObject *)__pyx_v_e_prop), ((PyObject *)__pyx_v_element->source_weights)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 678, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_4 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 678, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 678, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sum); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 678, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_1, ((PyObject *)__pyx_v_element->source_weights)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_element->source_weights));
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 678, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 678, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_8 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_8 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 678, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_available = __pyx_t_8;

    /* "_element_graph.pyx":679
 *             ext_proportions += self.normalize(e_prop*element.source_weights)*div
 *             available = np.sum(e_prop*element.source_weights)/np.sum(element.source_weights)
 *             ext_member_weights += element.member_weights*available             # <<<<<<<<<<<<<<
 * 
 *         ext_cov = np.max(ext_member_weights[sorted(new_covered_indices)])
 */
    __pyx_t_2 = PyFloat_FromDouble(__pyx_v_available); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 679, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyNumber_Multiply(((PyObject *)__pyx_v_element->member_weights), __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 679, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_ext_member_weights, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 679, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF_SET(__pyx_v_ext_member_weights, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "_element_graph.pyx":672
 *         # extension_excludes = set()
 *         div = 1/len(extension)
 *         for i in extension:             # <<<<<<<<<<<<<<
 *             element = self.elements[i]
 *             new_covered_indices.update(element.covered_indices)
 */
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "_element_graph.pyx":681
 *             ext_member_weights += element.member_weights*available
 * 
 *         ext_cov = np.max(ext_member_weights[sorted(new_covered_indices)])             # <<<<<<<<<<<<<<
 *         # extension_excludes.difference_update(path.excludes)
 *         # if len(extension_excludes) > 0 and not any([e in self.end_elements for e in extension]):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 681, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_max); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 681, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = PySequence_List(__pyx_v_new_covered_indices); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 681, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_11 = PyList_Sort(__pyx_t_2); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 681, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_ext_member_weights, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 681, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_7 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 681, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_8 = __pyx_PyFloat_AsFloat(__pyx_t_7); if (unlikely((__pyx_t_8 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 681, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_v_ext_cov = __pyx_t_8;

  /* "_element_graph.pyx":689
 *         #     exclusion_penalty = 1
 * 
 *         combined_member_coverage = np.add(path.member_weights,ext_member_weights)[sorted(path.covered_indices.union(new_covered_indices))]             # <<<<<<<<<<<<<<
 *         variance_penalty = np.mean(combined_member_coverage)/np.max(combined_member_coverage)
 *         path_proportions = self.normalize(path.source_weights)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 689, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_add); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 689, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_6 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_path->member_weights), __pyx_v_ext_member_weights};
    __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 689, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_7);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_path->member_weights), __pyx_v_ext_member_weights};
    __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 689, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_7);
  } else
  #endif
  {
    __pyx_t_2 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 689, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(((PyObject *)__pyx_v_path->member_weights));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_path->member_weights));
    PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_6, ((PyObject *)__pyx_v_path->member_weights));
    __Pyx_INCREF(__pyx_v_ext_member_weights);
    __Pyx_GIVEREF(__pyx_v_ext_member_weights);
    PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_6, __pyx_v_ext_member_weights);
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 689, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_path->covered_indices, __pyx_n_s_union); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 689, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, __pyx_v_new_covered_indices) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_new_covered_indices);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 689, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PySequence_List(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 689, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_11 = PyList_Sort(__pyx_t_4); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 689, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_7, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 689, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 689, __pyx_L1_error)
  __pyx_v_combined_member_coverage = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "_element_graph.pyx":690
 * 
 *         combined_member_coverage = np.add(path.member_weights,ext_member_weights)[sorted(path.covered_indices.union(new_covered_indices))]
 *         variance_penalty = np.mean(combined_member_coverage)/np.max(combined_member_coverage)             # <<<<<<<<<<<<<<
 *         path_proportions = self.normalize(path.source_weights)
 *         source_similarity = .5*(2 - np.sum(np.abs(path_proportions - ext_proportions)))
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 690, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_mean); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 690, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
    }
  }
  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_4, ((PyObject *)__pyx_v_combined_member_coverage)) : __Pyx_PyObject_CallOneArg(__pyx_t_7, ((PyObject *)__pyx_v_combined_member_coverage));
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 690, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 690, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_max); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 690, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_7 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, ((PyObject *)__pyx_v_combined_member_coverage)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_combined_member_coverage));
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 690, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 690, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_8 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_8 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 690, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_variance_penalty = __pyx_t_8;

  /* "_element_graph.pyx":691
 *         combined_member_coverage = np.add(path.member_weights,ext_member_weights)[sorted(path.covered_indices.union(new_covered_indices))]
 *         variance_penalty = np.mean(combined_member_coverage)/np.max(combined_member_coverage)
 *         path_proportions = self.normalize(path.source_weights)             # <<<<<<<<<<<<<<
 *         source_similarity = .5*(2 - np.sum(np.abs(path_proportions - ext_proportions)))
 *         dead_end_penalty = self.dead_end(path, extension)
 */
  __pyx_t_2 = ((PyObject *)__pyx_v_path->source_weights);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_7 = ((PyObject *)((struct __pyx_vtabstruct_14_element_graph_ElementGraph *)__pyx_v_self->__pyx_vtab)->normalize(__pyx_v_self, ((PyArrayObject *)__pyx_t_2), 0)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 691, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_path_proportions = ((PyArrayObject *)__pyx_t_7);
  __pyx_t_7 = 0;

  /* "_element_graph.pyx":692
 *         variance_penalty = np.mean(combined_member_coverage)/np.max(combined_member_coverage)
 *         path_proportions = self.normalize(path.source_weights)
 *         source_similarity = .5*(2 - np.sum(np.abs(path_proportions - ext_proportions)))             # <<<<<<<<<<<<<<
 *         dead_end_penalty = self.dead_end(path, extension)
 *         score = ext_cov * source_similarity * variance_penalty * dead_end_penalty # * exclusion_penalty
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 692, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_sum); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 692, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 692, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_abs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 692, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyNumber_Subtract(((PyObject *)__pyx_v_path_proportions), ((PyObject *)__pyx_v_ext_proportions)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 692, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4);
  __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, 692, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_7 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 692, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyInt_SubtractCObj(__pyx_int_2, __pyx_t_7, 2, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 692, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = PyNumber_Multiply(__pyx_float__5, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 692, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_8 = __pyx_PyFloat_AsFloat(__pyx_t_7); if (unlikely((__pyx_t_8 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 692, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_v_source_similarity = __pyx_t_8;

  /* "_element_graph.pyx":693
 *         path_proportions = self.normalize(path.source_weights)
 *         source_similarity = .5*(2 - np.sum(np.abs(path_proportions - ext_proportions)))
 *         dead_end_penalty = self.dead_end(path, extension)             # <<<<<<<<<<<<<<
 *         score = ext_cov * source_similarity * variance_penalty * dead_end_penalty # * exclusion_penalty
 *         return score
 */
  __pyx_v_dead_end_penalty = ((struct __pyx_vtabstruct_14_element_graph_ElementGraph *)__pyx_v_self->__pyx_vtab)->dead_end(__pyx_v_self, __pyx_v_path, __pyx_v_extension, 0);

  /* "_element_graph.pyx":694
 *         source_similarity = .5*(2 - np.sum(np.abs(path_proportions - ext_proportions)))
 *         dead_end_penalty = self.dead_end(path, extension)
 *         score = ext_cov * source_similarity * variance_penalty * dead_end_penalty # * exclusion_penalty             # <<<<<<<<<<<<<<
 *         return score
 * 
 */
  __pyx_v_score = (((__pyx_v_ext_cov * __pyx_v_source_similarity) * __pyx_v_variance_penalty) * __pyx_v_dead_end_penalty);

  /* "_element_graph.pyx":695
 *         dead_end_penalty = self.dead_end(path, extension)
 *         score = ext_cov * source_similarity * variance_penalty * dead_end_penalty # * exclusion_penalty
 *         return score             # <<<<<<<<<<<<<<
 * 
 *     cpdef Element find_optimal_path(self, float minimum_proportion, bint verbose=False):
 */
  __pyx_r = __pyx_v_score;
  goto __pyx_L0;

  /* "_element_graph.pyx":655
 *         return best_ext
 * 
 *     cpdef float calculate_extension_score(self, Element path, tuple extension, float minimum_proportion):             # <<<<<<<<<<<<<<
 *         """Given a path and a set of Elements to extend from it, calculate the
 *         new weights of the extended path and return a score
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_WriteUnraisable("_element_graph.ElementGraph.calculate_extension_score", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_element);
  __Pyx_XDECREF(__pyx_v_new_covered_indices);
  __Pyx_XDECREF((PyObject *)__pyx_v_ext_proportions);
  __Pyx_XDECREF((PyObject *)__pyx_v_e_prop);
  __Pyx_XDECREF((PyObject *)__pyx_v_path_proportions);
  __Pyx_XDECREF((PyObject *)__pyx_v_combined_member_coverage);
  __Pyx_XDECREF(__pyx_v_ext_member_weights);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_31calculate_extension_score(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_14_element_graph_12ElementGraph_30calculate_extension_score[] = "Given a path and a set of Elements to extend from it, calculate the\n        new weights of the extended path and return a score \n        ";
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_31calculate_extension_score(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_14_element_graph_Element *__pyx_v_path = 0;
  PyObject *__pyx_v_extension = 0;
  float __pyx_v_minimum_proportion;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("calculate_extension_score (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,&__pyx_n_s_extension,&__pyx_n_s_minimum_proportion,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_path)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_extension)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("calculate_extension_score", 1, 3, 3, 1); __PYX_ERR(0, 655, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_minimum_proportion)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("calculate_extension_score", 1, 3, 3, 2); __PYX_ERR(0, 655, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "calculate_extension_score") < 0)) __PYX_ERR(0, 655, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_path = ((struct __pyx_obj_14_element_graph_Element *)values[0]);
    __pyx_v_extension = ((PyObject*)values[1]);
    __pyx_v_minimum_proportion = __pyx_PyFloat_AsFloat(values[2]); if (unlikely((__pyx_v_minimum_proportion == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 655, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("calculate_extension_score", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 655, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("_element_graph.ElementGraph.calculate_extension_score", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_path), __pyx_ptype_14_element_graph_Element, 1, "path", 0))) __PYX_ERR(0, 655, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_extension), (&PyTuple_Type), 1, "extension", 1))) __PYX_ERR(0, 655, __pyx_L1_error)
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_30calculate_extension_score(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self), __pyx_v_path, __pyx_v_extension, __pyx_v_minimum_proportion);

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

static PyObject *__pyx_pf_14_element_graph_12ElementGraph_30calculate_extension_score(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, struct __pyx_obj_14_element_graph_Element *__pyx_v_path, PyObject *__pyx_v_extension, float __pyx_v_minimum_proportion) {
  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("calculate_extension_score", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_f_14_element_graph_12ElementGraph_calculate_extension_score(__pyx_v_self, __pyx_v_path, __pyx_v_extension, __pyx_v_minimum_proportion, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 655, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "_element_graph.pyx":697
 *         return score
 * 
 *     cpdef Element find_optimal_path(self, float minimum_proportion, bint verbose=False):             # <<<<<<<<<<<<<<
 *         """Traverses the path in a greedy fashion from the heaviest element."""
 *         cdef Element currentPath, e
 */

static PyObject *__pyx_pw_14_element_graph_12ElementGraph_33find_optimal_path(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_14_element_graph_Element *__pyx_f_14_element_graph_12ElementGraph_find_optimal_path(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, float __pyx_v_minimum_proportion, int __pyx_skip_dispatch, struct __pyx_opt_args_14_element_graph_12ElementGraph_find_optimal_path *__pyx_optional_args) {
  int __pyx_v_verbose = ((int)0);
  struct __pyx_obj_14_element_graph_Element *__pyx_v_currentPath = 0;
  PyObject *__pyx_v_ext = 0;
  PyObject *__pyx_v_extensions = 0;
  int __pyx_9genexpr18__pyx_v_i;
  struct __pyx_obj_14_element_graph_Element *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("find_optimal_path", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_verbose = __pyx_optional_args->verbose;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_find_optimal_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 697, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_14_element_graph_12ElementGraph_33find_optimal_path)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __pyx_t_3 = PyFloat_FromDouble(__pyx_v_minimum_proportion); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 697, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_verbose); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 697, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_5 = __pyx_t_1; __pyx_t_6 = NULL;
        __pyx_t_7 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
          if (likely(__pyx_t_6)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_5, function);
            __pyx_t_7 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_5)) {
          PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_3, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 697, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
          PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_3, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 697, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        {
          __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 697, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          if (__pyx_t_6) {
            __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_3);
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_4);
          __pyx_t_3 = 0;
          __pyx_t_4 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 697, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        }
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_14_element_graph_Element))))) __PYX_ERR(0, 697, __pyx_L1_error)
        __pyx_r = ((struct __pyx_obj_14_element_graph_Element *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "_element_graph.pyx":704
 *         cdef list extensions
 *         # Get the current working path (heaviest unassigned Element)
 *         currentPath = self.get_heaviest_element()             # <<<<<<<<<<<<<<
 *         self.extend_path(currentPath, tuple(sorted(currentPath.contains)))
 * 
 */
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_14_element_graph_ElementGraph *)__pyx_v_self->__pyx_vtab)->get_heaviest_element(__pyx_v_self, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 704, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_currentPath = ((struct __pyx_obj_14_element_graph_Element *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "_element_graph.pyx":705
 *         # Get the current working path (heaviest unassigned Element)
 *         currentPath = self.get_heaviest_element()
 *         self.extend_path(currentPath, tuple(sorted(currentPath.contains)))             # <<<<<<<<<<<<<<
 * 
 *         if currentPath is self.emptyPath:
 */
  __pyx_t_2 = __pyx_v_currentPath->contains;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_5 = PySequence_List(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 705, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_1 = ((PyObject*)__pyx_t_5);
  __pyx_t_5 = 0;
  __pyx_t_9 = PyList_Sort(__pyx_t_1); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 705, __pyx_L1_error)
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(0, 705, __pyx_L1_error)
  }
  __pyx_t_5 = PyList_AsTuple(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 705, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  ((struct __pyx_vtabstruct_14_element_graph_ElementGraph *)__pyx_v_self->__pyx_vtab)->extend_path(__pyx_v_self, __pyx_v_currentPath, ((PyObject*)__pyx_t_5), 0);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "_element_graph.pyx":707
 *         self.extend_path(currentPath, tuple(sorted(currentPath.contains)))
 * 
 *         if currentPath is self.emptyPath:             # <<<<<<<<<<<<<<
 *             return currentPath
 * 
 */
  __pyx_t_10 = (__pyx_v_currentPath == __pyx_v_self->emptyPath);
  __pyx_t_11 = (__pyx_t_10 != 0);
  if (__pyx_t_11) {

    /* "_element_graph.pyx":708
 * 
 *         if currentPath is self.emptyPath:
 *             return currentPath             # <<<<<<<<<<<<<<
 * 
 *         extensions = self.generate_extensions(currentPath)
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_currentPath));
    __pyx_r = __pyx_v_currentPath;
    goto __pyx_L0;

    /* "_element_graph.pyx":707
 *         self.extend_path(currentPath, tuple(sorted(currentPath.contains)))
 * 
 *         if currentPath is self.emptyPath:             # <<<<<<<<<<<<<<
 *             return currentPath
 * 
 */
  }

  /* "_element_graph.pyx":710
 *             return currentPath
 * 
 *         extensions = self.generate_extensions(currentPath)             # <<<<<<<<<<<<<<
 *         while len(extensions) > 0: # Extend as long as possible
 *             if len(extensions) == 1: # Only one option, do not evaluate
 */
  __pyx_t_5 = ((struct __pyx_vtabstruct_14_element_graph_ElementGraph *)__pyx_v_self->__pyx_vtab)->generate_extensions(__pyx_v_self, __pyx_v_currentPath, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 710, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_v_extensions = ((PyObject*)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "_element_graph.pyx":711
 * 
 *         extensions = self.generate_extensions(currentPath)
 *         while len(extensions) > 0: # Extend as long as possible             # <<<<<<<<<<<<<<
 *             if len(extensions) == 1: # Only one option, do not evaluate
 *                 ext = extensions[0][1]
 */
  while (1) {
    if (unlikely(__pyx_v_extensions == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
      __PYX_ERR(0, 711, __pyx_L1_error)
    }
    __pyx_t_12 = PyList_GET_SIZE(__pyx_v_extensions); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 711, __pyx_L1_error)
    __pyx_t_11 = ((__pyx_t_12 > 0) != 0);
    if (!__pyx_t_11) break;

    /* "_element_graph.pyx":712
 *         extensions = self.generate_extensions(currentPath)
 *         while len(extensions) > 0: # Extend as long as possible
 *             if len(extensions) == 1: # Only one option, do not evaluate             # <<<<<<<<<<<<<<
 *                 ext = extensions[0][1]
 *                 if not any([i in self.end_elements for i in ext]):  # Allow extension to an end even if the score is 0
 */
    if (unlikely(__pyx_v_extensions == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
      __PYX_ERR(0, 712, __pyx_L1_error)
    }
    __pyx_t_12 = PyList_GET_SIZE(__pyx_v_extensions); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 712, __pyx_L1_error)
    __pyx_t_11 = ((__pyx_t_12 == 1) != 0);
    if (__pyx_t_11) {

      /* "_element_graph.pyx":713
 *         while len(extensions) > 0: # Extend as long as possible
 *             if len(extensions) == 1: # Only one option, do not evaluate
 *                 ext = extensions[0][1]             # <<<<<<<<<<<<<<
 *                 if not any([i in self.end_elements for i in ext]):  # Allow extension to an end even if the score is 0
 *                     if self.calculate_extension_score(currentPath, ext, minimum_proportion) == 0:
 */
      if (unlikely(__pyx_v_extensions == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(0, 713, __pyx_L1_error)
      }
      __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_extensions, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 713, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_5, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 713, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 713, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_ext, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "_element_graph.pyx":714
 *             if len(extensions) == 1: # Only one option, do not evaluate
 *                 ext = extensions[0][1]
 *                 if not any([i in self.end_elements for i in ext]):  # Allow extension to an end even if the score is 0             # <<<<<<<<<<<<<<
 *                     if self.calculate_extension_score(currentPath, ext, minimum_proportion) == 0:
 *                         break
 */
      { /* enter inner scope */
        __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 714, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        if (unlikely(__pyx_v_ext == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
          __PYX_ERR(0, 714, __pyx_L1_error)
        }
        __pyx_t_5 = __pyx_v_ext; __Pyx_INCREF(__pyx_t_5); __pyx_t_12 = 0;
        for (;;) {
          if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_12); __Pyx_INCREF(__pyx_t_2); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 714, __pyx_L1_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_5, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 714, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
          __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 714, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_9genexpr18__pyx_v_i = __pyx_t_7;
          __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_9genexpr18__pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 714, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          if (unlikely(__pyx_v_self->end_elements == Py_None)) {
            PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
            __PYX_ERR(0, 714, __pyx_L1_error)
          }
          __pyx_t_11 = (__Pyx_PySet_ContainsTF(__pyx_t_2, __pyx_v_self->end_elements, Py_EQ)); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 714, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_11); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 714, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 714, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        }
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      } /* exit inner scope */
      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_any, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 714, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 714, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_10 = ((!__pyx_t_11) != 0);
      if (__pyx_t_10) {

        /* "_element_graph.pyx":715
 *                 ext = extensions[0][1]
 *                 if not any([i in self.end_elements for i in ext]):  # Allow extension to an end even if the score is 0
 *                     if self.calculate_extension_score(currentPath, ext, minimum_proportion) == 0:             # <<<<<<<<<<<<<<
 *                         break
 * 
 */
        __pyx_t_10 = ((((struct __pyx_vtabstruct_14_element_graph_ElementGraph *)__pyx_v_self->__pyx_vtab)->calculate_extension_score(__pyx_v_self, __pyx_v_currentPath, __pyx_v_ext, __pyx_v_minimum_proportion, 0) == 0.0) != 0);
        if (__pyx_t_10) {

          /* "_element_graph.pyx":716
 *                 if not any([i in self.end_elements for i in ext]):  # Allow extension to an end even if the score is 0
 *                     if self.calculate_extension_score(currentPath, ext, minimum_proportion) == 0:
 *                         break             # <<<<<<<<<<<<<<
 * 
 *                 self.extend_path(currentPath, extensions[0][1])
 */
          goto __pyx_L5_break;

          /* "_element_graph.pyx":715
 *                 ext = extensions[0][1]
 *                 if not any([i in self.end_elements for i in ext]):  # Allow extension to an end even if the score is 0
 *                     if self.calculate_extension_score(currentPath, ext, minimum_proportion) == 0:             # <<<<<<<<<<<<<<
 *                         break
 * 
 */
        }

        /* "_element_graph.pyx":714
 *             if len(extensions) == 1: # Only one option, do not evaluate
 *                 ext = extensions[0][1]
 *                 if not any([i in self.end_elements for i in ext]):  # Allow extension to an end even if the score is 0             # <<<<<<<<<<<<<<
 *                     if self.calculate_extension_score(currentPath, ext, minimum_proportion) == 0:
 *                         break
 */
      }

      /* "_element_graph.pyx":718
 *                         break
 * 
 *                 self.extend_path(currentPath, extensions[0][1])             # <<<<<<<<<<<<<<
 *             else:
 *                 ext = self.best_extension(currentPath, extensions, minimum_proportion)
 */
      if (unlikely(__pyx_v_extensions == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(0, 718, __pyx_L1_error)
      }
      __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_extensions, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 718, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_5, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 718, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 718, __pyx_L1_error)
      ((struct __pyx_vtabstruct_14_element_graph_ElementGraph *)__pyx_v_self->__pyx_vtab)->extend_path(__pyx_v_self, __pyx_v_currentPath, ((PyObject*)__pyx_t_1), 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "_element_graph.pyx":712
 *         extensions = self.generate_extensions(currentPath)
 *         while len(extensions) > 0: # Extend as long as possible
 *             if len(extensions) == 1: # Only one option, do not evaluate             # <<<<<<<<<<<<<<
 *                 ext = extensions[0][1]
 *                 if not any([i in self.end_elements for i in ext]):  # Allow extension to an end even if the score is 0
 */
      goto __pyx_L6;
    }

    /* "_element_graph.pyx":720
 *                 self.extend_path(currentPath, extensions[0][1])
 *             else:
 *                 ext = self.best_extension(currentPath, extensions, minimum_proportion)             # <<<<<<<<<<<<<<
 *                 if verbose:print("{} + {}".format(currentPath, ext))
 *                 if len(ext) == 0:break
 */
    /*else*/ {
      __pyx_t_1 = ((struct __pyx_vtabstruct_14_element_graph_ElementGraph *)__pyx_v_self->__pyx_vtab)->best_extension(__pyx_v_self, __pyx_v_currentPath, __pyx_v_extensions, __pyx_v_minimum_proportion, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 720, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_XDECREF_SET(__pyx_v_ext, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "_element_graph.pyx":721
 *             else:
 *                 ext = self.best_extension(currentPath, extensions, minimum_proportion)
 *                 if verbose:print("{} + {}".format(currentPath, ext))             # <<<<<<<<<<<<<<
 *                 if len(ext) == 0:break
 *                 self.extend_path(currentPath, ext)
 */
      __pyx_t_10 = (__pyx_v_verbose != 0);
      if (__pyx_t_10) {
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u__5, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 721, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_2 = NULL;
        __pyx_t_7 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
          __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
          if (likely(__pyx_t_2)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
            __Pyx_INCREF(__pyx_t_2);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_5, function);
            __pyx_t_7 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_5)) {
          PyObject *__pyx_temp[3] = {__pyx_t_2, ((PyObject *)__pyx_v_currentPath), __pyx_v_ext};
          __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 721, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_GOTREF(__pyx_t_1);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
          PyObject *__pyx_temp[3] = {__pyx_t_2, ((PyObject *)__pyx_v_currentPath), __pyx_v_ext};
          __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 721, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_GOTREF(__pyx_t_1);
        } else
        #endif
        {
          __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 721, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          if (__pyx_t_2) {
            __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2); __pyx_t_2 = NULL;
          }
          __Pyx_INCREF(((PyObject *)__pyx_v_currentPath));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_currentPath));
          PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, ((PyObject *)__pyx_v_currentPath));
          __Pyx_INCREF(__pyx_v_ext);
          __Pyx_GIVEREF(__pyx_v_ext);
          PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_ext);
          __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 721, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        }
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 721, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }

      /* "_element_graph.pyx":722
 *                 ext = self.best_extension(currentPath, extensions, minimum_proportion)
 *                 if verbose:print("{} + {}".format(currentPath, ext))
 *                 if len(ext) == 0:break             # <<<<<<<<<<<<<<
 *                 self.extend_path(currentPath, ext)
 * 
 */
      if (unlikely(__pyx_v_ext == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
        __PYX_ERR(0, 722, __pyx_L1_error)
      }
      __pyx_t_12 = PyTuple_GET_SIZE(__pyx_v_ext); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 722, __pyx_L1_error)
      __pyx_t_10 = ((__pyx_t_12 == 0) != 0);
      if (__pyx_t_10) {
        goto __pyx_L5_break;
      }

      /* "_element_graph.pyx":723
 *                 if verbose:print("{} + {}".format(currentPath, ext))
 *                 if len(ext) == 0:break
 *                 self.extend_path(currentPath, ext)             # <<<<<<<<<<<<<<
 * 
 *             extensions = self.generate_extensions(currentPath)
 */
      ((struct __pyx_vtabstruct_14_element_graph_ElementGraph *)__pyx_v_self->__pyx_vtab)->extend_path(__pyx_v_self, __pyx_v_currentPath, __pyx_v_ext, 0);
    }
    __pyx_L6:;

    /* "_element_graph.pyx":725
 *                 self.extend_path(currentPath, ext)
 * 
 *             extensions = self.generate_extensions(currentPath)             # <<<<<<<<<<<<<<
 * 
 *         if verbose:print(currentPath)
 */
    __pyx_t_5 = ((struct __pyx_vtabstruct_14_element_graph_ElementGraph *)__pyx_v_self->__pyx_vtab)->generate_extensions(__pyx_v_self, __pyx_v_currentPath, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 725, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF_SET(__pyx_v_extensions, ((PyObject*)__pyx_t_5));
    __pyx_t_5 = 0;
  }
  __pyx_L5_break:;

  /* "_element_graph.pyx":727
 *             extensions = self.generate_extensions(currentPath)
 * 
 *         if verbose:print(currentPath)             # <<<<<<<<<<<<<<
 *         self.rescue_ends(currentPath)
 *         return currentPath
 */
  __pyx_t_10 = (__pyx_v_verbose != 0);
  if (__pyx_t_10) {
    __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, ((PyObject *)__pyx_v_currentPath)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 727, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }

  /* "_element_graph.pyx":728
 * 
 *         if verbose:print(currentPath)
 *         self.rescue_ends(currentPath)             # <<<<<<<<<<<<<<
 *         return currentPath
 * 
 */
  ((struct __pyx_vtabstruct_14_element_graph_ElementGraph *)__pyx_v_self->__pyx_vtab)->rescue_ends(__pyx_v_self, __pyx_v_currentPath, 0);

  /* "_element_graph.pyx":729
 *         if verbose:print(currentPath)
 *         self.rescue_ends(currentPath)
 *         return currentPath             # <<<<<<<<<<<<<<
 * 
 *     cpdef void rescue_ends(self, Element path):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_currentPath));
  __pyx_r = __pyx_v_currentPath;
  goto __pyx_L0;

  /* "_element_graph.pyx":697
 *         return score
 * 
 *     cpdef Element find_optimal_path(self, float minimum_proportion, bint verbose=False):             # <<<<<<<<<<<<<<
 *         """Traverses the path in a greedy fashion from the heaviest element."""
 *         cdef Element currentPath, e
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("_element_graph.ElementGraph.find_optimal_path", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_currentPath);
  __Pyx_XDECREF(__pyx_v_ext);
  __Pyx_XDECREF(__pyx_v_extensions);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_33find_optimal_path(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_14_element_graph_12ElementGraph_32find_optimal_path[] = "Traverses the path in a greedy fashion from the heaviest element.";
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_33find_optimal_path(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  float __pyx_v_minimum_proportion;
  int __pyx_v_verbose;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("find_optimal_path (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_minimum_proportion,&__pyx_n_s_verbose,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_minimum_proportion)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_verbose);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "find_optimal_path") < 0)) __PYX_ERR(0, 697, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_minimum_proportion = __pyx_PyFloat_AsFloat(values[0]); if (unlikely((__pyx_v_minimum_proportion == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 697, __pyx_L3_error)
    if (values[1]) {
      __pyx_v_verbose = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_verbose == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 697, __pyx_L3_error)
    } else {
      __pyx_v_verbose = ((int)0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("find_optimal_path", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 697, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("_element_graph.ElementGraph.find_optimal_path", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_32find_optimal_path(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self), __pyx_v_minimum_proportion, __pyx_v_verbose);

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

static PyObject *__pyx_pf_14_element_graph_12ElementGraph_32find_optimal_path(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, float __pyx_v_minimum_proportion, int __pyx_v_verbose) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_14_element_graph_12ElementGraph_find_optimal_path __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("find_optimal_path", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.verbose = __pyx_v_verbose;
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_14_element_graph_ElementGraph->find_optimal_path(__pyx_v_self, __pyx_v_minimum_proportion, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 697, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "_element_graph.pyx":731
 *         return currentPath
 * 
 *     cpdef void rescue_ends(self, Element path):             # <<<<<<<<<<<<<<
 *         """If a path has malformed ends, check if it is possible to back up to a
 *         bypassed start/end site without crossing a splice junction."""
 */

static PyObject *__pyx_pw_14_element_graph_12ElementGraph_35rescue_ends(PyObject *__pyx_v_self, PyObject *__pyx_v_path); /*proto*/
static void __pyx_f_14_element_graph_12ElementGraph_rescue_ends(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, struct __pyx_obj_14_element_graph_Element *__pyx_v_path, int __pyx_skip_dispatch) {
  struct __pyx_obj_14_element_graph_Element *__pyx_v_element = 0;
  PyArrayObject *__pyx_v_members = 0;
  int __pyx_v_left_exon_border;
  int __pyx_v_right_exon_border;
  int __pyx_v_m;
  int __pyx_v_lastm;
  int __pyx_v_i;
  PyObject *__pyx_v_remove = 0;
  PyObject *__pyx_v_candidates = 0;
  int __pyx_9genexpr19__pyx_v_m;
  int __pyx_9genexpr20__pyx_v_m;
  int __pyx_9genexpr21__pyx_v_m;
  int __pyx_9genexpr22__pyx_v_m;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  PyObject *(*__pyx_t_10)(PyObject *);
  int __pyx_t_11;
  long __pyx_t_12;
  long __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  int __pyx_t_15;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("rescue_ends", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_rescue_ends); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 731, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_14_element_graph_12ElementGraph_35rescue_ends)) {
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, ((PyObject *)__pyx_v_path)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_path));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 731, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "_element_graph.pyx":739
 *         cdef set elements_to_trim, remove
 *         cdef list candidates, repair_elements
 *         if path.complete or path.strand==0:return             # <<<<<<<<<<<<<<
 * 
 *         left_exon_border = -1
 */
  __pyx_t_6 = (__pyx_v_path->complete != 0);
  if (!__pyx_t_6) {
  } else {
    __pyx_t_5 = __pyx_t_6;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_6 = ((__pyx_v_path->strand == 0) != 0);
  __pyx_t_5 = __pyx_t_6;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_5) {
    goto __pyx_L0;
  }

  /* "_element_graph.pyx":741
 *         if path.complete or path.strand==0:return
 * 
 *         left_exon_border = -1             # <<<<<<<<<<<<<<
 *         right_exon_border = -1
 *         lastm = -1
 */
  __pyx_v_left_exon_border = -1;

  /* "_element_graph.pyx":742
 * 
 *         left_exon_border = -1
 *         right_exon_border = -1             # <<<<<<<<<<<<<<
 *         lastm = -1
 *         members = np.array(sorted(path.members.difference(path.end_indices)), dtype=np.int32)
 */
  __pyx_v_right_exon_border = -1;

  /* "_element_graph.pyx":743
 *         left_exon_border = -1
 *         right_exon_border = -1
 *         lastm = -1             # <<<<<<<<<<<<<<
 *         members = np.array(sorted(path.members.difference(path.end_indices)), dtype=np.int32)
 *         for m in members:
 */
  __pyx_v_lastm = -1;

  /* "_element_graph.pyx":744
 *         right_exon_border = -1
 *         lastm = -1
 *         members = np.array(sorted(path.members.difference(path.end_indices)), dtype=np.int32)             # <<<<<<<<<<<<<<
 *         for m in members:
 *             if lastm == -1:lastm = m
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 744, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 744, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_path->members, __pyx_n_s_difference); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 744, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_7, __pyx_v_path->end_indices) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_path->end_indices);
  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 744, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PySequence_List(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 744, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_1 = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_8 = PyList_Sort(__pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 744, __pyx_L1_error)
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 744, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 744, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 744, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int32); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 744, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_7) < 0) __PYX_ERR(0, 744, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 744, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 744, __pyx_L1_error)
  __pyx_v_members = ((PyArrayObject *)__pyx_t_7);
  __pyx_t_7 = 0;

  /* "_element_graph.pyx":745
 *         lastm = -1
 *         members = np.array(sorted(path.members.difference(path.end_indices)), dtype=np.int32)
 *         for m in members:             # <<<<<<<<<<<<<<
 *             if lastm == -1:lastm = m
 *             if m > lastm+1:
 */
  if (likely(PyList_CheckExact(((PyObject *)__pyx_v_members))) || PyTuple_CheckExact(((PyObject *)__pyx_v_members))) {
    __pyx_t_7 = ((PyObject *)__pyx_v_members); __Pyx_INCREF(__pyx_t_7); __pyx_t_9 = 0;
    __pyx_t_10 = NULL;
  } else {
    __pyx_t_9 = -1; __pyx_t_7 = PyObject_GetIter(((PyObject *)__pyx_v_members)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 745, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_10 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 745, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_10)) {
      if (likely(PyList_CheckExact(__pyx_t_7))) {
        if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_7)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_9); __Pyx_INCREF(__pyx_t_1); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 745, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_7, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 745, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_9); __Pyx_INCREF(__pyx_t_1); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 745, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_7, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 745, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_10(__pyx_t_7);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 745, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 745, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_m = __pyx_t_11;

    /* "_element_graph.pyx":746
 *         members = np.array(sorted(path.members.difference(path.end_indices)), dtype=np.int32)
 *         for m in members:
 *             if lastm == -1:lastm = m             # <<<<<<<<<<<<<<
 *             if m > lastm+1:
 *                 if left_exon_border==-1:left_exon_border = lastm
 */
    __pyx_t_5 = ((__pyx_v_lastm == -1L) != 0);
    if (__pyx_t_5) {
      __pyx_v_lastm = __pyx_v_m;
    }

    /* "_element_graph.pyx":747
 *         for m in members:
 *             if lastm == -1:lastm = m
 *             if m > lastm+1:             # <<<<<<<<<<<<<<
 *                 if left_exon_border==-1:left_exon_border = lastm
 *                 right_exon_border = m
 */
    __pyx_t_5 = ((__pyx_v_m > (__pyx_v_lastm + 1)) != 0);
    if (__pyx_t_5) {

      /* "_element_graph.pyx":748
 *             if lastm == -1:lastm = m
 *             if m > lastm+1:
 *                 if left_exon_border==-1:left_exon_border = lastm             # <<<<<<<<<<<<<<
 *                 right_exon_border = m
 * 
 */
      __pyx_t_5 = ((__pyx_v_left_exon_border == -1L) != 0);
      if (__pyx_t_5) {
        __pyx_v_left_exon_border = __pyx_v_lastm;
      }

      /* "_element_graph.pyx":749
 *             if m > lastm+1:
 *                 if left_exon_border==-1:left_exon_border = lastm
 *                 right_exon_border = m             # <<<<<<<<<<<<<<
 * 
 *             lastm = m
 */
      __pyx_v_right_exon_border = __pyx_v_m;

      /* "_element_graph.pyx":747
 *         for m in members:
 *             if lastm == -1:lastm = m
 *             if m > lastm+1:             # <<<<<<<<<<<<<<
 *                 if left_exon_border==-1:left_exon_border = lastm
 *                 right_exon_border = m
 */
    }

    /* "_element_graph.pyx":751
 *                 right_exon_border = m
 * 
 *             lastm = m             # <<<<<<<<<<<<<<
 * 
 *         if left_exon_border == -1:left_exon_border=path.RM # single-exon path
 */
    __pyx_v_lastm = __pyx_v_m;

    /* "_element_graph.pyx":745
 *         lastm = -1
 *         members = np.array(sorted(path.members.difference(path.end_indices)), dtype=np.int32)
 *         for m in members:             # <<<<<<<<<<<<<<
 *             if lastm == -1:lastm = m
 *             if m > lastm+1:
 */
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "_element_graph.pyx":753
 *             lastm = m
 * 
 *         if left_exon_border == -1:left_exon_border=path.RM # single-exon path             # <<<<<<<<<<<<<<
 *         if right_exon_border == -1:right_exon_border=path.LM # single-exon path
 *         if path.strand == 1:
 */
  __pyx_t_5 = ((__pyx_v_left_exon_border == -1L) != 0);
  if (__pyx_t_5) {
    __pyx_t_11 = __pyx_v_path->RM;
    __pyx_v_left_exon_border = __pyx_t_11;
  }

  /* "_element_graph.pyx":754
 * 
 *         if left_exon_border == -1:left_exon_border=path.RM # single-exon path
 *         if right_exon_border == -1:right_exon_border=path.LM # single-exon path             # <<<<<<<<<<<<<<
 *         if path.strand == 1:
 *             if not path.e_tag: # An end exists, pick the most downstream
 */
  __pyx_t_5 = ((__pyx_v_right_exon_border == -1L) != 0);
  if (__pyx_t_5) {
    __pyx_t_11 = __pyx_v_path->LM;
    __pyx_v_right_exon_border = __pyx_t_11;
  }

  /* "_element_graph.pyx":755
 *         if left_exon_border == -1:left_exon_border=path.RM # single-exon path
 *         if right_exon_border == -1:right_exon_border=path.LM # single-exon path
 *         if path.strand == 1:             # <<<<<<<<<<<<<<
 *             if not path.e_tag: # An end exists, pick the most downstream
 *                 candidates = [m for m in range(right_exon_border, path.RM+1) if m in self.EPmembers]
 */
  switch (__pyx_v_path->strand) {
    case 1:

    /* "_element_graph.pyx":756
 *         if right_exon_border == -1:right_exon_border=path.LM # single-exon path
 *         if path.strand == 1:
 *             if not path.e_tag: # An end exists, pick the most downstream             # <<<<<<<<<<<<<<
 *                 candidates = [m for m in range(right_exon_border, path.RM+1) if m in self.EPmembers]
 *                 if len(candidates) > 0:
 */
    __pyx_t_5 = ((!(__pyx_v_path->e_tag != 0)) != 0);
    if (__pyx_t_5) {

      /* "_element_graph.pyx":757
 *         if path.strand == 1:
 *             if not path.e_tag: # An end exists, pick the most downstream
 *                 candidates = [m for m in range(right_exon_border, path.RM+1) if m in self.EPmembers]             # <<<<<<<<<<<<<<
 *                 if len(candidates) > 0:
 *                     m = max(candidates)
 */
      { /* enter inner scope */
        __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 757, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_12 = (__pyx_v_path->RM + 1);
        __pyx_t_13 = __pyx_t_12;
        for (__pyx_t_11 = __pyx_v_right_exon_border; __pyx_t_11 < __pyx_t_13; __pyx_t_11+=1) {
          __pyx_9genexpr19__pyx_v_m = __pyx_t_11;
          __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_9genexpr19__pyx_v_m); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 757, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          if (unlikely(__pyx_v_self->EPmembers == Py_None)) {
            PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
            __PYX_ERR(0, 757, __pyx_L1_error)
          }
          __pyx_t_5 = (__Pyx_PySet_ContainsTF(__pyx_t_1, __pyx_v_self->EPmembers, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 757, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_6 = (__pyx_t_5 != 0);
          if (__pyx_t_6) {
            __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_9genexpr19__pyx_v_m); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 757, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_1);
            if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 757, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          }
        }
      } /* exit inner scope */
      __pyx_v_candidates = ((PyObject*)__pyx_t_7);
      __pyx_t_7 = 0;

      /* "_element_graph.pyx":758
 *             if not path.e_tag: # An end exists, pick the most downstream
 *                 candidates = [m for m in range(right_exon_border, path.RM+1) if m in self.EPmembers]
 *                 if len(candidates) > 0:             # <<<<<<<<<<<<<<
 *                     m = max(candidates)
 *                     path.e_tag = True
 */
      __pyx_t_9 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 758, __pyx_L1_error)
      __pyx_t_6 = ((__pyx_t_9 > 0) != 0);
      if (__pyx_t_6) {

        /* "_element_graph.pyx":759
 *                 candidates = [m for m in range(right_exon_border, path.RM+1) if m in self.EPmembers]
 *                 if len(candidates) > 0:
 *                     m = max(candidates)             # <<<<<<<<<<<<<<
 *                     path.e_tag = True
 *                     path.members.add(path.number_of_members+1)
 */
        __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_max, __pyx_v_candidates); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 759, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 759, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_v_m = __pyx_t_11;

        /* "_element_graph.pyx":760
 *                 if len(candidates) > 0:
 *                     m = max(candidates)
 *                     path.e_tag = True             # <<<<<<<<<<<<<<
 *                     path.members.add(path.number_of_members+1)
 *                     path.members.difference_update(range(m+1,path.RM+1))
 */
        __pyx_v_path->e_tag = 1;

        /* "_element_graph.pyx":761
 *                     m = max(candidates)
 *                     path.e_tag = True
 *                     path.members.add(path.number_of_members+1)             # <<<<<<<<<<<<<<
 *                     path.members.difference_update(range(m+1,path.RM+1))
 *                     path.covered_indices.difference_update(range(m+1,path.RM+1))
 */
        if (unlikely(__pyx_v_path->members == Py_None)) {
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add");
          __PYX_ERR(0, 761, __pyx_L1_error)
        }
        __pyx_t_7 = __Pyx_PyInt_From_long((__pyx_v_path->number_of_members + 1)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 761, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = PySet_Add(__pyx_v_path->members, __pyx_t_7); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 761, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "_element_graph.pyx":762
 *                     path.e_tag = True
 *                     path.members.add(path.number_of_members+1)
 *                     path.members.difference_update(range(m+1,path.RM+1))             # <<<<<<<<<<<<<<
 *                     path.covered_indices.difference_update(range(m+1,path.RM+1))
 *                     path.nonmembers.update(range(m+1,path.number_of_members))
 */
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_path->members, __pyx_n_s_difference_update); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 762, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_4 = __Pyx_PyInt_From_long((__pyx_v_m + 1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 762, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_2 = __Pyx_PyInt_From_long((__pyx_v_path->RM + 1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 762, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 762, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_2);
        PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
        __pyx_t_4 = 0;
        __pyx_t_2 = 0;
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 762, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
          if (likely(__pyx_t_3)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
            __Pyx_INCREF(__pyx_t_3);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_1, function);
          }
        }
        __pyx_t_7 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2);
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 762, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "_element_graph.pyx":763
 *                     path.members.add(path.number_of_members+1)
 *                     path.members.difference_update(range(m+1,path.RM+1))
 *                     path.covered_indices.difference_update(range(m+1,path.RM+1))             # <<<<<<<<<<<<<<
 *                     path.nonmembers.update(range(m+1,path.number_of_members))
 *             elif not path.s_tag:
 */
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_path->covered_indices, __pyx_n_s_difference_update); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 763, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_2 = __Pyx_PyInt_From_long((__pyx_v_m + 1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 763, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_3 = __Pyx_PyInt_From_long((__pyx_v_path->RM + 1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 763, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 763, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_2);
        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
        __pyx_t_2 = 0;
        __pyx_t_3 = 0;
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 763, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_1, function);
          }
        }
        __pyx_t_7 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 763, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "_element_graph.pyx":764
 *                     path.members.difference_update(range(m+1,path.RM+1))
 *                     path.covered_indices.difference_update(range(m+1,path.RM+1))
 *                     path.nonmembers.update(range(m+1,path.number_of_members))             # <<<<<<<<<<<<<<
 *             elif not path.s_tag:
 *                 candidates = [m for m in range(path.LM, left_exon_border+1) if m in self.SPmembers]
 */
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_path->nonmembers, __pyx_n_s_update); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 764, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_3 = __Pyx_PyInt_From_long((__pyx_v_m + 1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 764, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_path->number_of_members); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 764, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 764, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
        __pyx_t_3 = 0;
        __pyx_t_4 = 0;
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 764, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
          __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
          if (likely(__pyx_t_2)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
            __Pyx_INCREF(__pyx_t_2);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_1, function);
          }
        }
        __pyx_t_7 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4);
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 764, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "_element_graph.pyx":758
 *             if not path.e_tag: # An end exists, pick the most downstream
 *                 candidates = [m for m in range(right_exon_border, path.RM+1) if m in self.EPmembers]
 *                 if len(candidates) > 0:             # <<<<<<<<<<<<<<
 *                     m = max(candidates)
 *                     path.e_tag = True
 */
      }

      /* "_element_graph.pyx":756
 *         if right_exon_border == -1:right_exon_border=path.LM # single-exon path
 *         if path.strand == 1:
 *             if not path.e_tag: # An end exists, pick the most downstream             # <<<<<<<<<<<<<<
 *                 candidates = [m for m in range(right_exon_border, path.RM+1) if m in self.EPmembers]
 *                 if len(candidates) > 0:
 */
      goto __pyx_L13;
    }

    /* "_element_graph.pyx":765
 *                     path.covered_indices.difference_update(range(m+1,path.RM+1))
 *                     path.nonmembers.update(range(m+1,path.number_of_members))
 *             elif not path.s_tag:             # <<<<<<<<<<<<<<
 *                 candidates = [m for m in range(path.LM, left_exon_border+1) if m in self.SPmembers]
 *                 if len(candidates) > 0: # A start exists, pick the most upstream
 */
    __pyx_t_6 = ((!(__pyx_v_path->s_tag != 0)) != 0);
    if (__pyx_t_6) {

      /* "_element_graph.pyx":766
 *                     path.nonmembers.update(range(m+1,path.number_of_members))
 *             elif not path.s_tag:
 *                 candidates = [m for m in range(path.LM, left_exon_border+1) if m in self.SPmembers]             # <<<<<<<<<<<<<<
 *                 if len(candidates) > 0: # A start exists, pick the most upstream
 *                     m = min(candidates)
 */
      { /* enter inner scope */
        __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 766, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_12 = (__pyx_v_left_exon_border + 1);
        __pyx_t_13 = __pyx_t_12;
        for (__pyx_t_11 = __pyx_v_path->LM; __pyx_t_11 < __pyx_t_13; __pyx_t_11+=1) {
          __pyx_9genexpr20__pyx_v_m = __pyx_t_11;
          __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_9genexpr20__pyx_v_m); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 766, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          if (unlikely(__pyx_v_self->SPmembers == Py_None)) {
            PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
            __PYX_ERR(0, 766, __pyx_L1_error)
          }
          __pyx_t_6 = (__Pyx_PySet_ContainsTF(__pyx_t_1, __pyx_v_self->SPmembers, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 766, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_5 = (__pyx_t_6 != 0);
          if (__pyx_t_5) {
            __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_9genexpr20__pyx_v_m); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 766, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_1);
            if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 766, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          }
        }
      } /* exit inner scope */
      __pyx_v_candidates = ((PyObject*)__pyx_t_7);
      __pyx_t_7 = 0;

      /* "_element_graph.pyx":767
 *             elif not path.s_tag:
 *                 candidates = [m for m in range(path.LM, left_exon_border+1) if m in self.SPmembers]
 *                 if len(candidates) > 0: # A start exists, pick the most upstream             # <<<<<<<<<<<<<<
 *                     m = min(candidates)
 *                     path.s_tag = True
 */
      __pyx_t_9 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 767, __pyx_L1_error)
      __pyx_t_5 = ((__pyx_t_9 > 0) != 0);
      if (__pyx_t_5) {

        /* "_element_graph.pyx":768
 *                 candidates = [m for m in range(path.LM, left_exon_border+1) if m in self.SPmembers]
 *                 if len(candidates) > 0: # A start exists, pick the most upstream
 *                     m = min(candidates)             # <<<<<<<<<<<<<<
 *                     path.s_tag = True
 *                     path.members.add(path.number_of_members)
 */
        __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_min, __pyx_v_candidates); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 768, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 768, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_v_m = __pyx_t_11;

        /* "_element_graph.pyx":769
 *                 if len(candidates) > 0: # A start exists, pick the most upstream
 *                     m = min(candidates)
 *                     path.s_tag = True             # <<<<<<<<<<<<<<
 *                     path.members.add(path.number_of_members)
 *                     path.members.difference_update(range(path.LM,m))
 */
        __pyx_v_path->s_tag = 1;

        /* "_element_graph.pyx":770
 *                     m = min(candidates)
 *                     path.s_tag = True
 *                     path.members.add(path.number_of_members)             # <<<<<<<<<<<<<<
 *                     path.members.difference_update(range(path.LM,m))
 *                     path.covered_indices.difference_update(range(path.LM,m))
 */
        if (unlikely(__pyx_v_path->members == Py_None)) {
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add");
          __PYX_ERR(0, 770, __pyx_L1_error)
        }
        __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_path->number_of_members); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 770, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = PySet_Add(__pyx_v_path->members, __pyx_t_7); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 770, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "_element_graph.pyx":771
 *                     path.s_tag = True
 *                     path.members.add(path.number_of_members)
 *                     path.members.difference_update(range(path.LM,m))             # <<<<<<<<<<<<<<
 *                     path.covered_indices.difference_update(range(path.LM,m))
 *                     path.nonmembers.update(range(m))
 */
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_path->members, __pyx_n_s_difference_update); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 771, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_path->LM); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 771, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_m); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 771, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 771, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_2);
        PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
        __pyx_t_4 = 0;
        __pyx_t_2 = 0;
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 771, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
          if (likely(__pyx_t_3)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
            __Pyx_INCREF(__pyx_t_3);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_1, function);
          }
        }
        __pyx_t_7 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2);
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 771, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "_element_graph.pyx":772
 *                     path.members.add(path.number_of_members)
 *                     path.members.difference_update(range(path.LM,m))
 *                     path.covered_indices.difference_update(range(path.LM,m))             # <<<<<<<<<<<<<<
 *                     path.nonmembers.update(range(m))
 *         elif path.strand == -1:
 */
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_path->covered_indices, __pyx_n_s_difference_update); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 772, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_path->LM); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 772, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_m); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 772, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 772, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_2);
        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
        __pyx_t_2 = 0;
        __pyx_t_3 = 0;
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 772, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_1, function);
          }
        }
        __pyx_t_7 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 772, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "_element_graph.pyx":773
 *                     path.members.difference_update(range(path.LM,m))
 *                     path.covered_indices.difference_update(range(path.LM,m))
 *                     path.nonmembers.update(range(m))             # <<<<<<<<<<<<<<
 *         elif path.strand == -1:
 *             if not path.e_tag: # An end exists, pick the most downstream
 */
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_path->nonmembers, __pyx_n_s_update); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 773, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_m); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 773, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 773, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
          if (likely(__pyx_t_3)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
            __Pyx_INCREF(__pyx_t_3);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_1, function);
          }
        }
        __pyx_t_7 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4);
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 773, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "_element_graph.pyx":767
 *             elif not path.s_tag:
 *                 candidates = [m for m in range(path.LM, left_exon_border+1) if m in self.SPmembers]
 *                 if len(candidates) > 0: # A start exists, pick the most upstream             # <<<<<<<<<<<<<<
 *                     m = min(candidates)
 *                     path.s_tag = True
 */
      }

      /* "_element_graph.pyx":765
 *                     path.covered_indices.difference_update(range(m+1,path.RM+1))
 *                     path.nonmembers.update(range(m+1,path.number_of_members))
 *             elif not path.s_tag:             # <<<<<<<<<<<<<<
 *                 candidates = [m for m in range(path.LM, left_exon_border+1) if m in self.SPmembers]
 *                 if len(candidates) > 0: # A start exists, pick the most upstream
 */
    }
    __pyx_L13:;

    /* "_element_graph.pyx":755
 *         if left_exon_border == -1:left_exon_border=path.RM # single-exon path
 *         if right_exon_border == -1:right_exon_border=path.LM # single-exon path
 *         if path.strand == 1:             # <<<<<<<<<<<<<<
 *             if not path.e_tag: # An end exists, pick the most downstream
 *                 candidates = [m for m in range(right_exon_border, path.RM+1) if m in self.EPmembers]
 */
    break;
    case -1L:

    /* "_element_graph.pyx":775
 *                     path.nonmembers.update(range(m))
 *         elif path.strand == -1:
 *             if not path.e_tag: # An end exists, pick the most downstream             # <<<<<<<<<<<<<<
 *                 candidates = [m for m in range(path.LM, left_exon_border+1) if m in self.EMmembers]
 *                 if len(candidates) > 0:
 */
    __pyx_t_5 = ((!(__pyx_v_path->e_tag != 0)) != 0);
    if (__pyx_t_5) {

      /* "_element_graph.pyx":776
 *         elif path.strand == -1:
 *             if not path.e_tag: # An end exists, pick the most downstream
 *                 candidates = [m for m in range(path.LM, left_exon_border+1) if m in self.EMmembers]             # <<<<<<<<<<<<<<
 *                 if len(candidates) > 0:
 *                     m = min(candidates)
 */
      { /* enter inner scope */
        __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 776, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_12 = (__pyx_v_left_exon_border + 1);
        __pyx_t_13 = __pyx_t_12;
        for (__pyx_t_11 = __pyx_v_path->LM; __pyx_t_11 < __pyx_t_13; __pyx_t_11+=1) {
          __pyx_9genexpr21__pyx_v_m = __pyx_t_11;
          __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_9genexpr21__pyx_v_m); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 776, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          if (unlikely(__pyx_v_self->EMmembers == Py_None)) {
            PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
            __PYX_ERR(0, 776, __pyx_L1_error)
          }
          __pyx_t_5 = (__Pyx_PySet_ContainsTF(__pyx_t_1, __pyx_v_self->EMmembers, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 776, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_6 = (__pyx_t_5 != 0);
          if (__pyx_t_6) {
            __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_9genexpr21__pyx_v_m); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 776, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_1);
            if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 776, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          }
        }
      } /* exit inner scope */
      __pyx_v_candidates = ((PyObject*)__pyx_t_7);
      __pyx_t_7 = 0;

      /* "_element_graph.pyx":777
 *             if not path.e_tag: # An end exists, pick the most downstream
 *                 candidates = [m for m in range(path.LM, left_exon_border+1) if m in self.EMmembers]
 *                 if len(candidates) > 0:             # <<<<<<<<<<<<<<
 *                     m = min(candidates)
 *                     path.e_tag = True
 */
      __pyx_t_9 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 777, __pyx_L1_error)
      __pyx_t_6 = ((__pyx_t_9 > 0) != 0);
      if (__pyx_t_6) {

        /* "_element_graph.pyx":778
 *                 candidates = [m for m in range(path.LM, left_exon_border+1) if m in self.EMmembers]
 *                 if len(candidates) > 0:
 *                     m = min(candidates)             # <<<<<<<<<<<<<<
 *                     path.e_tag = True
 *                     path.members.add(path.number_of_members+3)
 */
        __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_min, __pyx_v_candidates); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 778, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 778, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_v_m = __pyx_t_11;

        /* "_element_graph.pyx":779
 *                 if len(candidates) > 0:
 *                     m = min(candidates)
 *                     path.e_tag = True             # <<<<<<<<<<<<<<
 *                     path.members.add(path.number_of_members+3)
 *                     path.members.difference_update(range(path.LM,m))
 */
        __pyx_v_path->e_tag = 1;

        /* "_element_graph.pyx":780
 *                     m = min(candidates)
 *                     path.e_tag = True
 *                     path.members.add(path.number_of_members+3)             # <<<<<<<<<<<<<<
 *                     path.members.difference_update(range(path.LM,m))
 *                     path.covered_indices.difference_update(range(path.LM,m))
 */
        if (unlikely(__pyx_v_path->members == Py_None)) {
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add");
          __PYX_ERR(0, 780, __pyx_L1_error)
        }
        __pyx_t_7 = __Pyx_PyInt_From_long((__pyx_v_path->number_of_members + 3)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 780, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = PySet_Add(__pyx_v_path->members, __pyx_t_7); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 780, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "_element_graph.pyx":781
 *                     path.e_tag = True
 *                     path.members.add(path.number_of_members+3)
 *                     path.members.difference_update(range(path.LM,m))             # <<<<<<<<<<<<<<
 *                     path.covered_indices.difference_update(range(path.LM,m))
 *                     path.nonmembers.update(range(m))
 */
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_path->members, __pyx_n_s_difference_update); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 781, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_path->LM); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 781, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_m); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 781, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 781, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
        __pyx_t_4 = 0;
        __pyx_t_3 = 0;
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 781, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
          __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
          if (likely(__pyx_t_2)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
            __Pyx_INCREF(__pyx_t_2);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_1, function);
          }
        }
        __pyx_t_7 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3);
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 781, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "_element_graph.pyx":782
 *                     path.members.add(path.number_of_members+3)
 *                     path.members.difference_update(range(path.LM,m))
 *                     path.covered_indices.difference_update(range(path.LM,m))             # <<<<<<<<<<<<<<
 *                     path.nonmembers.update(range(m))
 *             elif not path.s_tag: # A start exists, pick the most upstream
 */
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_path->covered_indices, __pyx_n_s_difference_update); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 782, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_path->LM); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 782, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_m); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 782, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 782, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_2);
        PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
        __pyx_t_3 = 0;
        __pyx_t_2 = 0;
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 782, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_1, function);
          }
        }
        __pyx_t_7 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 782, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "_element_graph.pyx":783
 *                     path.members.difference_update(range(path.LM,m))
 *                     path.covered_indices.difference_update(range(path.LM,m))
 *                     path.nonmembers.update(range(m))             # <<<<<<<<<<<<<<
 *             elif not path.s_tag: # A start exists, pick the most upstream
 *                 candidates = [m for m in range(right_exon_border, path.RM+1) if m in self.SMmembers]
 */
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_path->nonmembers, __pyx_n_s_update); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 783, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_m); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 783, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 783, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
          __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
          if (likely(__pyx_t_2)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
            __Pyx_INCREF(__pyx_t_2);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_1, function);
          }
        }
        __pyx_t_7 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4);
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 783, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "_element_graph.pyx":777
 *             if not path.e_tag: # An end exists, pick the most downstream
 *                 candidates = [m for m in range(path.LM, left_exon_border+1) if m in self.EMmembers]
 *                 if len(candidates) > 0:             # <<<<<<<<<<<<<<
 *                     m = min(candidates)
 *                     path.e_tag = True
 */
      }

      /* "_element_graph.pyx":775
 *                     path.nonmembers.update(range(m))
 *         elif path.strand == -1:
 *             if not path.e_tag: # An end exists, pick the most downstream             # <<<<<<<<<<<<<<
 *                 candidates = [m for m in range(path.LM, left_exon_border+1) if m in self.EMmembers]
 *                 if len(candidates) > 0:
 */
      goto __pyx_L22;
    }

    /* "_element_graph.pyx":784
 *                     path.covered_indices.difference_update(range(path.LM,m))
 *                     path.nonmembers.update(range(m))
 *             elif not path.s_tag: # A start exists, pick the most upstream             # <<<<<<<<<<<<<<
 *                 candidates = [m for m in range(right_exon_border, path.RM+1) if m in self.SMmembers]
 *                 if len(candidates) > 0:
 */
    __pyx_t_6 = ((!(__pyx_v_path->s_tag != 0)) != 0);
    if (__pyx_t_6) {

      /* "_element_graph.pyx":785
 *                     path.nonmembers.update(range(m))
 *             elif not path.s_tag: # A start exists, pick the most upstream
 *                 candidates = [m for m in range(right_exon_border, path.RM+1) if m in self.SMmembers]             # <<<<<<<<<<<<<<
 *                 if len(candidates) > 0:
 *                     m = max(candidates)
 */
      { /* enter inner scope */
        __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 785, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_12 = (__pyx_v_path->RM + 1);
        __pyx_t_13 = __pyx_t_12;
        for (__pyx_t_11 = __pyx_v_right_exon_border; __pyx_t_11 < __pyx_t_13; __pyx_t_11+=1) {
          __pyx_9genexpr22__pyx_v_m = __pyx_t_11;
          __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_9genexpr22__pyx_v_m); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 785, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          if (unlikely(__pyx_v_self->SMmembers == Py_None)) {
            PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
            __PYX_ERR(0, 785, __pyx_L1_error)
          }
          __pyx_t_6 = (__Pyx_PySet_ContainsTF(__pyx_t_1, __pyx_v_self->SMmembers, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 785, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_5 = (__pyx_t_6 != 0);
          if (__pyx_t_5) {
            __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_9genexpr22__pyx_v_m); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 785, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_1);
            if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 785, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          }
        }
      } /* exit inner scope */
      __pyx_v_candidates = ((PyObject*)__pyx_t_7);
      __pyx_t_7 = 0;

      /* "_element_graph.pyx":786
 *             elif not path.s_tag: # A start exists, pick the most upstream
 *                 candidates = [m for m in range(right_exon_border, path.RM+1) if m in self.SMmembers]
 *                 if len(candidates) > 0:             # <<<<<<<<<<<<<<
 *                     m = max(candidates)
 *                     path.s_tag = True
 */
      __pyx_t_9 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 786, __pyx_L1_error)
      __pyx_t_5 = ((__pyx_t_9 > 0) != 0);
      if (__pyx_t_5) {

        /* "_element_graph.pyx":787
 *                 candidates = [m for m in range(right_exon_border, path.RM+1) if m in self.SMmembers]
 *                 if len(candidates) > 0:
 *                     m = max(candidates)             # <<<<<<<<<<<<<<
 *                     path.s_tag = True
 *                     path.members.add(path.number_of_members+2)
 */
        __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_max, __pyx_v_candidates); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 787, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 787, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_v_m = __pyx_t_11;

        /* "_element_graph.pyx":788
 *                 if len(candidates) > 0:
 *                     m = max(candidates)
 *                     path.s_tag = True             # <<<<<<<<<<<<<<
 *                     path.members.add(path.number_of_members+2)
 *                     path.members.difference_update(range(m+1,path.RM+1))
 */
        __pyx_v_path->s_tag = 1;

        /* "_element_graph.pyx":789
 *                     m = max(candidates)
 *                     path.s_tag = True
 *                     path.members.add(path.number_of_members+2)             # <<<<<<<<<<<<<<
 *                     path.members.difference_update(range(m+1,path.RM+1))
 *                     path.covered_indices.difference_update(range(m+1,path.RM+1))
 */
        if (unlikely(__pyx_v_path->members == Py_None)) {
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add");
          __PYX_ERR(0, 789, __pyx_L1_error)
        }
        __pyx_t_7 = __Pyx_PyInt_From_long((__pyx_v_path->number_of_members + 2)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 789, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = PySet_Add(__pyx_v_path->members, __pyx_t_7); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 789, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "_element_graph.pyx":790
 *                     path.s_tag = True
 *                     path.members.add(path.number_of_members+2)
 *                     path.members.difference_update(range(m+1,path.RM+1))             # <<<<<<<<<<<<<<
 *                     path.covered_indices.difference_update(range(m+1,path.RM+1))
 *                     path.nonmembers.update(range(m+1,path.number_of_members))
 */
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_path->members, __pyx_n_s_difference_update); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 790, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_4 = __Pyx_PyInt_From_long((__pyx_v_m + 1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 790, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_2 = __Pyx_PyInt_From_long((__pyx_v_path->RM + 1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 790, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 790, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_2);
        PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
        __pyx_t_4 = 0;
        __pyx_t_2 = 0;
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 790, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
          if (likely(__pyx_t_3)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
            __Pyx_INCREF(__pyx_t_3);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_1, function);
          }
        }
        __pyx_t_7 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2);
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 790, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "_element_graph.pyx":791
 *                     path.members.add(path.number_of_members+2)
 *                     path.members.difference_update(range(m+1,path.RM+1))
 *                     path.covered_indices.difference_update(range(m+1,path.RM+1))             # <<<<<<<<<<<<<<
 *                     path.nonmembers.update(range(m+1,path.number_of_members))
 * 
 */
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_path->covered_indices, __pyx_n_s_difference_update); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 791, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_2 = __Pyx_PyInt_From_long((__pyx_v_m + 1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 791, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_3 = __Pyx_PyInt_From_long((__pyx_v_path->RM + 1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 791, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 791, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_2);
        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
        __pyx_t_2 = 0;
        __pyx_t_3 = 0;
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 791, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_1, function);
          }
        }
        __pyx_t_7 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 791, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "_element_graph.pyx":792
 *                     path.members.difference_update(range(m+1,path.RM+1))
 *                     path.covered_indices.difference_update(range(m+1,path.RM+1))
 *                     path.nonmembers.update(range(m+1,path.number_of_members))             # <<<<<<<<<<<<<<
 * 
 *         # Get rid of assigned elements that are no longer compatible after the change
 */
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_path->nonmembers, __pyx_n_s_update); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 792, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_3 = __Pyx_PyInt_From_long((__pyx_v_m + 1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 792, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_path->number_of_members); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 792, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 792, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
        __pyx_t_3 = 0;
        __pyx_t_4 = 0;
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 792, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
          __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
          if (likely(__pyx_t_2)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
            __Pyx_INCREF(__pyx_t_2);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_1, function);
          }
        }
        __pyx_t_7 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4);
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 792, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "_element_graph.pyx":786
 *             elif not path.s_tag: # A start exists, pick the most upstream
 *                 candidates = [m for m in range(right_exon_border, path.RM+1) if m in self.SMmembers]
 *                 if len(candidates) > 0:             # <<<<<<<<<<<<<<
 *                     m = max(candidates)
 *                     path.s_tag = True
 */
      }

      /* "_element_graph.pyx":784
 *                     path.covered_indices.difference_update(range(path.LM,m))
 *                     path.nonmembers.update(range(m))
 *             elif not path.s_tag: # A start exists, pick the most upstream             # <<<<<<<<<<<<<<
 *                 candidates = [m for m in range(right_exon_border, path.RM+1) if m in self.SMmembers]
 *                 if len(candidates) > 0:
 */
    }
    __pyx_L22:;

    /* "_element_graph.pyx":774
 *                     path.covered_indices.difference_update(range(path.LM,m))
 *                     path.nonmembers.update(range(m))
 *         elif path.strand == -1:             # <<<<<<<<<<<<<<
 *             if not path.e_tag: # An end exists, pick the most downstream
 *                 candidates = [m for m in range(path.LM, left_exon_border+1) if m in self.EMmembers]
 */
    break;
    default: break;
  }

  /* "_element_graph.pyx":795
 * 
 *         # Get rid of assigned elements that are no longer compatible after the change
 *         remove = set()             # <<<<<<<<<<<<<<
 *         path.trimmed_bases = 0
 *         for i in path.includes|path.contains:
 */
  __pyx_t_7 = PySet_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 795, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_v_remove = ((PyObject*)__pyx_t_7);
  __pyx_t_7 = 0;

  /* "_element_graph.pyx":796
 *         # Get rid of assigned elements that are no longer compatible after the change
 *         remove = set()
 *         path.trimmed_bases = 0             # <<<<<<<<<<<<<<
 *         for i in path.includes|path.contains:
 *             element = self.elements[i]
 */
  __pyx_v_path->trimmed_bases = 0.0;

  /* "_element_graph.pyx":797
 *         remove = set()
 *         path.trimmed_bases = 0
 *         for i in path.includes|path.contains:             # <<<<<<<<<<<<<<
 *             element = self.elements[i]
 *             if not element.compatible(path):
 */
  __pyx_t_9 = 0;
  __pyx_t_1 = PyNumber_Or(__pyx_v_path->includes, __pyx_v_path->contains); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 797, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_set_iterator(__pyx_t_1, 1, (&__pyx_t_14), (&__pyx_t_11)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 797, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_XDECREF(__pyx_t_7);
  __pyx_t_7 = __pyx_t_4;
  __pyx_t_4 = 0;
  while (1) {
    __pyx_t_15 = __Pyx_set_iter_next(__pyx_t_7, __pyx_t_14, &__pyx_t_9, &__pyx_t_4, __pyx_t_11);
    if (unlikely(__pyx_t_15 == 0)) break;
    if (unlikely(__pyx_t_15 == -1)) __PYX_ERR(0, 797, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 797, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_i = __pyx_t_15;

    /* "_element_graph.pyx":798
 *         path.trimmed_bases = 0
 *         for i in path.includes|path.contains:
 *             element = self.elements[i]             # <<<<<<<<<<<<<<
 *             if not element.compatible(path):
 *                 remove.add(i)
 */
    if (unlikely(__pyx_v_self->elements == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 798, __pyx_L1_error)
    }
    __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_self->elements, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 798, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_14_element_graph_Element))))) __PYX_ERR(0, 798, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_element, ((struct __pyx_obj_14_element_graph_Element *)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "_element_graph.pyx":799
 *         for i in path.includes|path.contains:
 *             element = self.elements[i]
 *             if not element.compatible(path):             # <<<<<<<<<<<<<<
 *                 remove.add(i)
 *                 self.assignments[i] = -1
 */
    __pyx_t_5 = ((!(((struct __pyx_vtabstruct_14_element_graph_Element *)__pyx_v_element->__pyx_vtab)->compatible(__pyx_v_element, __pyx_v_path, 0) != 0)) != 0);
    if (__pyx_t_5) {

      /* "_element_graph.pyx":800
 *             element = self.elements[i]
 *             if not element.compatible(path):
 *                 remove.add(i)             # <<<<<<<<<<<<<<
 *                 self.assignments[i] = -1
 *                 path.trimmed_bases += element.bases
 */
      __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 800, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_8 = PySet_Add(__pyx_v_remove, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 800, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "_element_graph.pyx":801
 *             if not element.compatible(path):
 *                 remove.add(i)
 *                 self.assignments[i] = -1             # <<<<<<<<<<<<<<
 *                 path.trimmed_bases += element.bases
 *                 self.bases -= element.bases
 */
      if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_self->assignments), __pyx_v_i, __pyx_int_neg_1, int, 1, __Pyx_PyInt_From_int, 0, 1, 1) < 0)) __PYX_ERR(0, 801, __pyx_L1_error)

      /* "_element_graph.pyx":802
 *                 remove.add(i)
 *                 self.assignments[i] = -1
 *                 path.trimmed_bases += element.bases             # <<<<<<<<<<<<<<
 *                 self.bases -= element.bases
 * 
 */
      __pyx_v_path->trimmed_bases = (__pyx_v_path->trimmed_bases + __pyx_v_element->bases);

      /* "_element_graph.pyx":803
 *                 self.assignments[i] = -1
 *                 path.trimmed_bases += element.bases
 *                 self.bases -= element.bases             # <<<<<<<<<<<<<<
 * 
 *         path.includes.difference_update(remove)
 */
      __pyx_v_self->bases = (__pyx_v_self->bases - __pyx_v_element->bases);

      /* "_element_graph.pyx":799
 *         for i in path.includes|path.contains:
 *             element = self.elements[i]
 *             if not element.compatible(path):             # <<<<<<<<<<<<<<
 *                 remove.add(i)
 *                 self.assignments[i] = -1
 */
    }
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "_element_graph.pyx":805
 *                 self.bases -= element.bases
 * 
 *         path.includes.difference_update(remove)             # <<<<<<<<<<<<<<
 *         path.contains.difference_update(remove)
 *         path.excludes.update(remove)
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_path->includes, __pyx_n_s_difference_update); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 805, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_7 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_1, __pyx_v_remove) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_remove);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 805, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "_element_graph.pyx":806
 * 
 *         path.includes.difference_update(remove)
 *         path.contains.difference_update(remove)             # <<<<<<<<<<<<<<
 *         path.excludes.update(remove)
 *         path.length = np.sum(path.frag_len[sorted(path.members)])
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_path->contains, __pyx_n_s_difference_update); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 806, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_7 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_1, __pyx_v_remove) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_remove);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 806, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "_element_graph.pyx":807
 *         path.includes.difference_update(remove)
 *         path.contains.difference_update(remove)
 *         path.excludes.update(remove)             # <<<<<<<<<<<<<<
 *         path.length = np.sum(path.frag_len[sorted(path.members)])
 *         path.update()
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_path->excludes, __pyx_n_s_update); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 807, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_7 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_1, __pyx_v_remove) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_remove);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 807, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "_element_graph.pyx":808
 *         path.contains.difference_update(remove)
 *         path.excludes.update(remove)
 *         path.length = np.sum(path.frag_len[sorted(path.members)])             # <<<<<<<<<<<<<<
 *         path.update()
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 808, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_sum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 808, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_2 = __pyx_v_path->members;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = PySequence_List(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 808, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_8 = PyList_Sort(__pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 808, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_path->frag_len), __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 808, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_7 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 808, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 808, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_v_path->length = __pyx_t_11;

  /* "_element_graph.pyx":809
 *         path.excludes.update(remove)
 *         path.length = np.sum(path.frag_len[sorted(path.members)])
 *         path.update()             # <<<<<<<<<<<<<<
 * 
 *     cpdef float add_path(self, Element path):
 */
  ((struct __pyx_vtabstruct_14_element_graph_Element *)__pyx_v_path->__pyx_vtab)->update(__pyx_v_path, 0);

  /* "_element_graph.pyx":731
 *         return currentPath
 * 
 *     cpdef void rescue_ends(self, Element path):             # <<<<<<<<<<<<<<
 *         """If a path has malformed ends, check if it is possible to back up to a
 *         bypassed start/end site without crossing a splice junction."""
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_WriteUnraisable("_element_graph.ElementGraph.rescue_ends", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_element);
  __Pyx_XDECREF((PyObject *)__pyx_v_members);
  __Pyx_XDECREF(__pyx_v_remove);
  __Pyx_XDECREF(__pyx_v_candidates);
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_35rescue_ends(PyObject *__pyx_v_self, PyObject *__pyx_v_path); /*proto*/
static char __pyx_doc_14_element_graph_12ElementGraph_34rescue_ends[] = "If a path has malformed ends, check if it is possible to back up to a\n        bypassed start/end site without crossing a splice junction.";
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_35rescue_ends(PyObject *__pyx_v_self, PyObject *__pyx_v_path) {
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("rescue_ends (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_path), __pyx_ptype_14_element_graph_Element, 1, "path", 0))) __PYX_ERR(0, 731, __pyx_L1_error)
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_34rescue_ends(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self), ((struct __pyx_obj_14_element_graph_Element *)__pyx_v_path));

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

static PyObject *__pyx_pf_14_element_graph_12ElementGraph_34rescue_ends(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, struct __pyx_obj_14_element_graph_Element *__pyx_v_path) {
  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("rescue_ends", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_14_element_graph_12ElementGraph_rescue_ends(__pyx_v_self, __pyx_v_path, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 731, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "_element_graph.pyx":811
 *         path.update()
 * 
 *     cpdef float add_path(self, Element path):             # <<<<<<<<<<<<<<
 *         """Evaluate what proportion of the compatible reads should be """
 *         cdef int i
 */

static PyObject *__pyx_pw_14_element_graph_12ElementGraph_37add_path(PyObject *__pyx_v_self, PyObject *__pyx_v_path); /*proto*/
static float __pyx_f_14_element_graph_12ElementGraph_add_path(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, struct __pyx_obj_14_element_graph_Element *__pyx_v_path, int __pyx_skip_dispatch) {
  int __pyx_v_i;
  float __pyx_v_novel_bases;
  struct __pyx_obj_14_element_graph_Element *__pyx_v_existing_path = 0;
  struct __pyx_obj_14_element_graph_Element *__pyx_v_element = 0;
  float __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  float __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  int __pyx_t_12;
  PyArrayObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("add_path", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 811, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_14_element_graph_12ElementGraph_37add_path)) {
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, ((PyObject *)__pyx_v_path)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_path));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 811, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_5 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_5 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 811, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_5;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "_element_graph.pyx":814
 *         """Evaluate what proportion of the compatible reads should be """
 *         cdef int i
 *         cdef float novel_bases = 0             # <<<<<<<<<<<<<<
 *         cdef Element existing_path, element
 *         # Assign each included element to the path
 */
  __pyx_v_novel_bases = 0.0;

  /* "_element_graph.pyx":817
 *         cdef Element existing_path, element
 *         # Assign each included element to the path
 *         for existing_path in self.paths:             # <<<<<<<<<<<<<<
 *             if path.compatible(existing_path):
 *                 # The new assembly is a duplicate of an existing assembly
 */
  if (unlikely(__pyx_v_self->paths == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(0, 817, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_v_self->paths; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0;
  for (;;) {
    if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 817, __pyx_L1_error)
    #else
    __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 817, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_14_element_graph_Element))))) __PYX_ERR(0, 817, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_existing_path, ((struct __pyx_obj_14_element_graph_Element *)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "_element_graph.pyx":818
 *         # Assign each included element to the path
 *         for existing_path in self.paths:
 *             if path.compatible(existing_path):             # <<<<<<<<<<<<<<
 *                 # The new assembly is a duplicate of an existing assembly
 *                 return path.trimmed_bases
 */
    __pyx_t_7 = (((struct __pyx_vtabstruct_14_element_graph_Element *)__pyx_v_path->__pyx_vtab)->compatible(__pyx_v_path, __pyx_v_existing_path, 0) != 0);
    if (__pyx_t_7) {

      /* "_element_graph.pyx":820
 *             if path.compatible(existing_path):
 *                 # The new assembly is a duplicate of an existing assembly
 *                 return path.trimmed_bases             # <<<<<<<<<<<<<<
 * 
 *         for i in range(self.number_of_elements):
 */
      __pyx_r = __pyx_v_path->trimmed_bases;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;

      /* "_element_graph.pyx":818
 *         # Assign each included element to the path
 *         for existing_path in self.paths:
 *             if path.compatible(existing_path):             # <<<<<<<<<<<<<<
 *                 # The new assembly is a duplicate of an existing assembly
 *                 return path.trimmed_bases
 */
    }

    /* "_element_graph.pyx":817
 *         cdef Element existing_path, element
 *         # Assign each included element to the path
 *         for existing_path in self.paths:             # <<<<<<<<<<<<<<
 *             if path.compatible(existing_path):
 *                 # The new assembly is a duplicate of an existing assembly
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_element_graph.pyx":822
 *                 return path.trimmed_bases
 * 
 *         for i in range(self.number_of_elements):             # <<<<<<<<<<<<<<
 *             element = self.elements[i]
 *             if element.cov > 0:
 */
  __pyx_t_8 = __pyx_v_self->number_of_elements;
  __pyx_t_9 = __pyx_t_8;
  for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
    __pyx_v_i = __pyx_t_10;

    /* "_element_graph.pyx":823
 * 
 *         for i in range(self.number_of_elements):
 *             element = self.elements[i]             # <<<<<<<<<<<<<<
 *             if element.cov > 0:
 *                 if element.compatible(path) and element.LM >= path.LM and element.RM <= path.RM:
 */
    if (unlikely(__pyx_v_self->elements == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 823, __pyx_L1_error)
    }
    __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_self->elements, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 823, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_14_element_graph_Element))))) __PYX_ERR(0, 823, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_element, ((struct __pyx_obj_14_element_graph_Element *)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "_element_graph.pyx":824
 *         for i in range(self.number_of_elements):
 *             element = self.elements[i]
 *             if element.cov > 0:             # <<<<<<<<<<<<<<
 *                 if element.compatible(path) and element.LM >= path.LM and element.RM <= path.RM:
 *                     if self.assignments[i] == 0:
 */
    __pyx_t_7 = ((__pyx_v_element->cov > 0.0) != 0);
    if (__pyx_t_7) {

      /* "_element_graph.pyx":825
 *             element = self.elements[i]
 *             if element.cov > 0:
 *                 if element.compatible(path) and element.LM >= path.LM and element.RM <= path.RM:             # <<<<<<<<<<<<<<
 *                     if self.assignments[i] == 0:
 *                         novel_bases += self.elements[i].bases
 */
      __pyx_t_11 = (((struct __pyx_vtabstruct_14_element_graph_Element *)__pyx_v_element->__pyx_vtab)->compatible(__pyx_v_element, __pyx_v_path, 0) != 0);
      if (__pyx_t_11) {
      } else {
        __pyx_t_7 = __pyx_t_11;
        goto __pyx_L10_bool_binop_done;
      }
      __pyx_t_11 = ((__pyx_v_element->LM >= __pyx_v_path->LM) != 0);
      if (__pyx_t_11) {
      } else {
        __pyx_t_7 = __pyx_t_11;
        goto __pyx_L10_bool_binop_done;
      }
      __pyx_t_11 = ((__pyx_v_element->RM <= __pyx_v_path->RM) != 0);
      __pyx_t_7 = __pyx_t_11;
      __pyx_L10_bool_binop_done:;
      if (__pyx_t_7) {

        /* "_element_graph.pyx":826
 *             if element.cov > 0:
 *                 if element.compatible(path) and element.LM >= path.LM and element.RM <= path.RM:
 *                     if self.assignments[i] == 0:             # <<<<<<<<<<<<<<
 *                         novel_bases += self.elements[i].bases
 * 
 */
        __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->assignments), __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 826, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_t_1, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 826, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 826, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (__pyx_t_7) {

          /* "_element_graph.pyx":827
 *                 if element.compatible(path) and element.LM >= path.LM and element.RM <= path.RM:
 *                     if self.assignments[i] == 0:
 *                         novel_bases += self.elements[i].bases             # <<<<<<<<<<<<<<
 * 
 *                     path.includes.add(i)
 */
          __pyx_t_2 = PyFloat_FromDouble(__pyx_v_novel_bases); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 827, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          if (unlikely(__pyx_v_self->elements == Py_None)) {
            PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
            __PYX_ERR(0, 827, __pyx_L1_error)
          }
          __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_self->elements, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 827, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_bases); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 827, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 827, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_5 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_5 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 827, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_v_novel_bases = __pyx_t_5;

          /* "_element_graph.pyx":826
 *             if element.cov > 0:
 *                 if element.compatible(path) and element.LM >= path.LM and element.RM <= path.RM:
 *                     if self.assignments[i] == 0:             # <<<<<<<<<<<<<<
 *                         novel_bases += self.elements[i].bases
 * 
 */
        }

        /* "_element_graph.pyx":829
 *                         novel_bases += self.elements[i].bases
 * 
 *                     path.includes.add(i)             # <<<<<<<<<<<<<<
 *                     self.assignments[i] += 1
 *                     self.elements[i].assigned_to.add(len(self.paths))
 */
        if (unlikely(__pyx_v_path->includes == Py_None)) {
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add");
          __PYX_ERR(0, 829, __pyx_L1_error)
        }
        __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 829, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_12 = PySet_Add(__pyx_v_path->includes, __pyx_t_1); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 829, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "_element_graph.pyx":830
 * 
 *                     path.includes.add(i)
 *                     self.assignments[i] += 1             # <<<<<<<<<<<<<<
 *                     self.elements[i].assigned_to.add(len(self.paths))
 *                     self.elements[i].update()
 */
        __Pyx_INCREF(((PyObject *)__pyx_v_self->assignments));
        __pyx_t_13 = __pyx_v_self->assignments;
        __pyx_t_14 = __pyx_v_i;
        __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_t_13), __pyx_t_14, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 830, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 830, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_t_13), __pyx_t_14, __pyx_t_3, int, 1, __Pyx_PyInt_From_int, 0, 1, 1) < 0)) __PYX_ERR(0, 830, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0;

        /* "_element_graph.pyx":831
 *                     path.includes.add(i)
 *                     self.assignments[i] += 1
 *                     self.elements[i].assigned_to.add(len(self.paths))             # <<<<<<<<<<<<<<
 *                     self.elements[i].update()
 * 
 */
        if (unlikely(__pyx_v_self->elements == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 831, __pyx_L1_error)
        }
        __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_self->elements, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 831, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_assigned_to); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 831, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_add); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 831, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = __pyx_v_self->paths;
        __Pyx_INCREF(__pyx_t_2);
        if (unlikely(__pyx_t_2 == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
          __PYX_ERR(0, 831, __pyx_L1_error)
        }
        __pyx_t_6 = PyList_GET_SIZE(__pyx_t_2); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 831, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 831, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_1, function);
          }
        }
        __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 831, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

        /* "_element_graph.pyx":832
 *                     self.assignments[i] += 1
 *                     self.elements[i].assigned_to.add(len(self.paths))
 *                     self.elements[i].update()             # <<<<<<<<<<<<<<
 * 
 *         # Add the new path to the list of paths
 */
        if (unlikely(__pyx_v_self->elements == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 832, __pyx_L1_error)
        }
        __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_self->elements, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 832, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_update); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 832, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
          __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
          if (likely(__pyx_t_1)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
            __Pyx_INCREF(__pyx_t_1);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_2, function);
          }
        }
        __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 832, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

        /* "_element_graph.pyx":825
 *             element = self.elements[i]
 *             if element.cov > 0:
 *                 if element.compatible(path) and element.LM >= path.LM and element.RM <= path.RM:             # <<<<<<<<<<<<<<
 *                     if self.assignments[i] == 0:
 *                         novel_bases += self.elements[i].bases
 */
      }

      /* "_element_graph.pyx":824
 *         for i in range(self.number_of_elements):
 *             element = self.elements[i]
 *             if element.cov > 0:             # <<<<<<<<<<<<<<
 *                 if element.compatible(path) and element.LM >= path.LM and element.RM <= path.RM:
 *                     if self.assignments[i] == 0:
 */
    }
  }

  /* "_element_graph.pyx":835
 * 
 *         # Add the new path to the list of paths
 *         path.index = len(self.paths)             # <<<<<<<<<<<<<<
 *         self.paths.append(path)
 *         self.assign_weights()
 */
  __pyx_t_3 = __pyx_v_self->paths;
  __Pyx_INCREF(__pyx_t_3);
  if (unlikely(__pyx_t_3 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(0, 835, __pyx_L1_error)
  }
  __pyx_t_6 = PyList_GET_SIZE(__pyx_t_3); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 835, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_path->index = __pyx_t_6;

  /* "_element_graph.pyx":836
 *         # Add the new path to the list of paths
 *         path.index = len(self.paths)
 *         self.paths.append(path)             # <<<<<<<<<<<<<<
 *         self.assign_weights()
 *         return novel_bases + path.trimmed_bases
 */
  if (unlikely(__pyx_v_self->paths == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
    __PYX_ERR(0, 836, __pyx_L1_error)
  }
  __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_self->paths, ((PyObject *)__pyx_v_path)); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 836, __pyx_L1_error)

  /* "_element_graph.pyx":837
 *         path.index = len(self.paths)
 *         self.paths.append(path)
 *         self.assign_weights()             # <<<<<<<<<<<<<<
 *         return novel_bases + path.trimmed_bases
 * 
 */
  ((struct __pyx_vtabstruct_14_element_graph_ElementGraph *)__pyx_v_self->__pyx_vtab)->assign_weights(__pyx_v_self, 0);

  /* "_element_graph.pyx":838
 *         self.paths.append(path)
 *         self.assign_weights()
 *         return novel_bases + path.trimmed_bases             # <<<<<<<<<<<<<<
 * 
 *     cpdef void remove_paths(self, list indices):
 */
  __pyx_r = (__pyx_v_novel_bases + __pyx_v_path->trimmed_bases);
  goto __pyx_L0;

  /* "_element_graph.pyx":811
 *         path.update()
 * 
 *     cpdef float add_path(self, Element path):             # <<<<<<<<<<<<<<
 *         """Evaluate what proportion of the compatible reads should be """
 *         cdef int i
 */

  /* 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(((PyObject *)__pyx_t_13));
  __Pyx_WriteUnraisable("_element_graph.ElementGraph.add_path", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_existing_path);
  __Pyx_XDECREF((PyObject *)__pyx_v_element);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_37add_path(PyObject *__pyx_v_self, PyObject *__pyx_v_path); /*proto*/
static char __pyx_doc_14_element_graph_12ElementGraph_36add_path[] = "Evaluate what proportion of the compatible reads should be ";
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_37add_path(PyObject *__pyx_v_self, PyObject *__pyx_v_path) {
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add_path (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_path), __pyx_ptype_14_element_graph_Element, 1, "path", 0))) __PYX_ERR(0, 811, __pyx_L1_error)
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_36add_path(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self), ((struct __pyx_obj_14_element_graph_Element *)__pyx_v_path));

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

static PyObject *__pyx_pf_14_element_graph_12ElementGraph_36add_path(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, struct __pyx_obj_14_element_graph_Element *__pyx_v_path) {
  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("add_path", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_f_14_element_graph_12ElementGraph_add_path(__pyx_v_self, __pyx_v_path, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 811, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "_element_graph.pyx":840
 *         return novel_bases + path.trimmed_bases
 * 
 *     cpdef void remove_paths(self, list indices):             # <<<<<<<<<<<<<<
 *         """Removes all trace of a path from paths."""
 *         cdef Element path, element
 */

static PyObject *__pyx_pw_14_element_graph_12ElementGraph_39remove_paths(PyObject *__pyx_v_self, PyObject *__pyx_v_indices); /*proto*/
static void __pyx_f_14_element_graph_12ElementGraph_remove_paths(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, PyObject *__pyx_v_indices, int __pyx_skip_dispatch) {
  struct __pyx_obj_14_element_graph_Element *__pyx_v_path = 0;
  struct __pyx_obj_14_element_graph_Element *__pyx_v_element = 0;
  int __pyx_v_i;
  int __pyx_v_index;
  PyObject *__pyx_v_keep = 0;
  PyObject *__pyx_v_old_indices = 0;
  int __pyx_9genexpr23__pyx_v_i;
  int __pyx_9genexpr24__pyx_v_index;
  int __pyx_9genexpr25__pyx_v_i;
  PyObject *__pyx_9genexpr26__pyx_v_a = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  PyArrayObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  int __pyx_t_15;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("remove_paths", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_remove_paths); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 840, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_14_element_graph_12ElementGraph_39remove_paths)) {
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_indices) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_indices);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 840, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "_element_graph.pyx":845
 *         cdef int i, index
 *         cdef list keep
 *         cdef dict old_indices = {i:self.paths[i] for i in range(len(self.paths))}             # <<<<<<<<<<<<<<
 *         if len(indices) == 0:
 *             return
 */
  { /* enter inner scope */
    __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 845, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_v_self->paths;
    __Pyx_INCREF(__pyx_t_2);
    if (unlikely(__pyx_t_2 == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
      __PYX_ERR(0, 845, __pyx_L1_error)
    }
    __pyx_t_5 = PyList_GET_SIZE(__pyx_t_2); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 845, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_6 = __pyx_t_5;
    for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
      __pyx_9genexpr23__pyx_v_i = __pyx_t_7;
      __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_9genexpr23__pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 845, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (unlikely(__pyx_v_self->paths == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(0, 845, __pyx_L1_error)
      }
      __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_self->paths, __pyx_9genexpr23__pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 845, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_t_2, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 845, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
  } /* exit inner scope */
  __pyx_v_old_indices = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "_element_graph.pyx":846
 *         cdef list keep
 *         cdef dict old_indices = {i:self.paths[i] for i in range(len(self.paths))}
 *         if len(indices) == 0:             # <<<<<<<<<<<<<<
 *             return
 * 
 */
  if (unlikely(__pyx_v_indices == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(0, 846, __pyx_L1_error)
  }
  __pyx_t_5 = PyList_GET_SIZE(__pyx_v_indices); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 846, __pyx_L1_error)
  __pyx_t_8 = ((__pyx_t_5 == 0) != 0);
  if (__pyx_t_8) {

    /* "_element_graph.pyx":847
 *         cdef dict old_indices = {i:self.paths[i] for i in range(len(self.paths))}
 *         if len(indices) == 0:
 *             return             # <<<<<<<<<<<<<<
 * 
 *         for index in indices:
 */
    goto __pyx_L0;

    /* "_element_graph.pyx":846
 *         cdef list keep
 *         cdef dict old_indices = {i:self.paths[i] for i in range(len(self.paths))}
 *         if len(indices) == 0:             # <<<<<<<<<<<<<<
 *             return
 * 
 */
  }

  /* "_element_graph.pyx":849
 *             return
 * 
 *         for index in indices:             # <<<<<<<<<<<<<<
 *             path = self.paths[index]
 *             for i in path.includes:
 */
  if (unlikely(__pyx_v_indices == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(0, 849, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 0;
  for (;;) {
    if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_1)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 849, __pyx_L1_error)
    #else
    __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 849, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 849, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_index = __pyx_t_7;

    /* "_element_graph.pyx":850
 * 
 *         for index in indices:
 *             path = self.paths[index]             # <<<<<<<<<<<<<<
 *             for i in path.includes:
 *                 element = self.elements[i]
 */
    if (unlikely(__pyx_v_self->paths == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 850, __pyx_L1_error)
    }
    __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_self->paths, __pyx_v_index, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 850, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_14_element_graph_Element))))) __PYX_ERR(0, 850, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_path, ((struct __pyx_obj_14_element_graph_Element *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "_element_graph.pyx":851
 *         for index in indices:
 *             path = self.paths[index]
 *             for i in path.includes:             # <<<<<<<<<<<<<<
 *                 element = self.elements[i]
 *                 element.assigned_to.discard(index)
 */
    __pyx_t_6 = 0;
    __pyx_t_2 = __Pyx_set_iterator(__pyx_v_path->includes, 1, (&__pyx_t_9), (&__pyx_t_7)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 851, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __pyx_t_3 = __pyx_t_2;
    __pyx_t_2 = 0;
    while (1) {
      __pyx_t_10 = __Pyx_set_iter_next(__pyx_t_3, __pyx_t_9, &__pyx_t_6, &__pyx_t_2, __pyx_t_7);
      if (unlikely(__pyx_t_10 == 0)) break;
      if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 851, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 851, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_i = __pyx_t_10;

      /* "_element_graph.pyx":852
 *             path = self.paths[index]
 *             for i in path.includes:
 *                 element = self.elements[i]             # <<<<<<<<<<<<<<
 *                 element.assigned_to.discard(index)
 *                 self.assignments[i]-=1
 */
      if (unlikely(__pyx_v_self->elements == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(0, 852, __pyx_L1_error)
      }
      __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_self->elements, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 852, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_14_element_graph_Element))))) __PYX_ERR(0, 852, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_element, ((struct __pyx_obj_14_element_graph_Element *)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "_element_graph.pyx":853
 *             for i in path.includes:
 *                 element = self.elements[i]
 *                 element.assigned_to.discard(index)             # <<<<<<<<<<<<<<
 *                 self.assignments[i]-=1
 * 
 */
      if (unlikely(__pyx_v_element->assigned_to == Py_None)) {
        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "discard");
        __PYX_ERR(0, 853, __pyx_L1_error)
      }
      __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 853, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_11 = __Pyx_PySet_Discard(__pyx_v_element->assigned_to, __pyx_t_2); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 853, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "_element_graph.pyx":854
 *                 element = self.elements[i]
 *                 element.assigned_to.discard(index)
 *                 self.assignments[i]-=1             # <<<<<<<<<<<<<<
 * 
 *         keep = [index for index in range(len(self.paths)) if index not in indices]
 */
      __Pyx_INCREF(((PyObject *)__pyx_v_self->assignments));
      __pyx_t_12 = __pyx_v_self->assignments;
      __pyx_t_10 = __pyx_v_i;
      __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_t_12), __pyx_t_10, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 854, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_t_2, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 854, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_t_12), __pyx_t_10, __pyx_t_4, int, 1, __Pyx_PyInt_From_int, 0, 1, 1) < 0)) __PYX_ERR(0, 854, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "_element_graph.pyx":849
 *             return
 * 
 *         for index in indices:             # <<<<<<<<<<<<<<
 *             path = self.paths[index]
 *             for i in path.includes:
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_element_graph.pyx":856
 *                 self.assignments[i]-=1
 * 
 *         keep = [index for index in range(len(self.paths)) if index not in indices]             # <<<<<<<<<<<<<<
 *         self.paths = [self.paths[i] for i in keep]
 *         for i in range(len(self.paths)): # Update the index attribute of each path
 */
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 856, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __pyx_v_self->paths;
    __Pyx_INCREF(__pyx_t_3);
    if (unlikely(__pyx_t_3 == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
      __PYX_ERR(0, 856, __pyx_L1_error)
    }
    __pyx_t_5 = PyList_GET_SIZE(__pyx_t_3); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 856, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_9 = __pyx_t_5;
    for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_9; __pyx_t_7+=1) {
      __pyx_9genexpr24__pyx_v_index = __pyx_t_7;
      __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_9genexpr24__pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 856, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_8 = (__Pyx_PySequence_ContainsTF(__pyx_t_3, __pyx_v_indices, Py_NE)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 856, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_13 = (__pyx_t_8 != 0);
      if (__pyx_t_13) {
        __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_9genexpr24__pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 856, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 856, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      }
    }
  } /* exit inner scope */
  __pyx_v_keep = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "_element_graph.pyx":857
 * 
 *         keep = [index for index in range(len(self.paths)) if index not in indices]
 *         self.paths = [self.paths[i] for i in keep]             # <<<<<<<<<<<<<<
 *         for i in range(len(self.paths)): # Update the index attribute of each path
 *             self.paths[i].index = i
 */
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 857, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __pyx_v_keep; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0;
    for (;;) {
      if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_3)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 857, __pyx_L1_error)
      #else
      __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 857, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      #endif
      __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 857, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_9genexpr25__pyx_v_i = __pyx_t_7;
      if (unlikely(__pyx_v_self->paths == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(0, 857, __pyx_L1_error)
      }
      __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_self->paths, __pyx_9genexpr25__pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 857, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 857, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } /* exit inner scope */
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->paths);
  __Pyx_DECREF(__pyx_v_self->paths);
  __pyx_v_self->paths = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "_element_graph.pyx":858
 *         keep = [index for index in range(len(self.paths)) if index not in indices]
 *         self.paths = [self.paths[i] for i in keep]
 *         for i in range(len(self.paths)): # Update the index attribute of each path             # <<<<<<<<<<<<<<
 *             self.paths[i].index = i
 * 
 */
  __pyx_t_1 = __pyx_v_self->paths;
  __Pyx_INCREF(__pyx_t_1);
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(0, 858, __pyx_L1_error)
  }
  __pyx_t_5 = PyList_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 858, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_9 = __pyx_t_5;
  for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_9; __pyx_t_7+=1) {
    __pyx_v_i = __pyx_t_7;

    /* "_element_graph.pyx":859
 *         self.paths = [self.paths[i] for i in keep]
 *         for i in range(len(self.paths)): # Update the index attribute of each path
 *             self.paths[i].index = i             # <<<<<<<<<<<<<<
 * 
 *         for i in range(len(self.elements)): # Update each assigned_to to keep elements connected to paths
 */
    __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 859, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (unlikely(__pyx_v_self->paths == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 859, __pyx_L1_error)
    }
    __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_self->paths, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 859, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_PyObject_SetAttrStr(__pyx_t_3, __pyx_n_s_index, __pyx_t_1) < 0) __PYX_ERR(0, 859, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }

  /* "_element_graph.pyx":861
 *             self.paths[i].index = i
 * 
 *         for i in range(len(self.elements)): # Update each assigned_to to keep elements connected to paths             # <<<<<<<<<<<<<<
 *             element = self.elements[i]
 *             element.assigned_to = set([old_indices[a].index for a in element.assigned_to])
 */
  __pyx_t_3 = __pyx_v_self->elements;
  __Pyx_INCREF(__pyx_t_3);
  if (unlikely(__pyx_t_3 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(0, 861, __pyx_L1_error)
  }
  __pyx_t_5 = PyList_GET_SIZE(__pyx_t_3); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 861, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_9 = __pyx_t_5;
  for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_9; __pyx_t_7+=1) {
    __pyx_v_i = __pyx_t_7;

    /* "_element_graph.pyx":862
 * 
 *         for i in range(len(self.elements)): # Update each assigned_to to keep elements connected to paths
 *             element = self.elements[i]             # <<<<<<<<<<<<<<
 *             element.assigned_to = set([old_indices[a].index for a in element.assigned_to])
 * 
 */
    if (unlikely(__pyx_v_self->elements == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 862, __pyx_L1_error)
    }
    __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_self->elements, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 862, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_14_element_graph_Element))))) __PYX_ERR(0, 862, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_element, ((struct __pyx_obj_14_element_graph_Element *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "_element_graph.pyx":863
 *         for i in range(len(self.elements)): # Update each assigned_to to keep elements connected to paths
 *             element = self.elements[i]
 *             element.assigned_to = set([old_indices[a].index for a in element.assigned_to])             # <<<<<<<<<<<<<<
 * 
 *         self.assign_weights()
 */
    { /* enter inner scope */
      __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 863, __pyx_L21_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 = 0;
      __pyx_t_4 = __Pyx_set_iterator(__pyx_v_element->assigned_to, 1, (&__pyx_t_14), (&__pyx_t_10)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 863, __pyx_L21_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_1);
      __pyx_t_1 = __pyx_t_4;
      __pyx_t_4 = 0;
      while (1) {
        __pyx_t_15 = __Pyx_set_iter_next(__pyx_t_1, __pyx_t_14, &__pyx_t_6, &__pyx_t_4, __pyx_t_10);
        if (unlikely(__pyx_t_15 == 0)) break;
        if (unlikely(__pyx_t_15 == -1)) __PYX_ERR(0, 863, __pyx_L21_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_XDECREF_SET(__pyx_9genexpr26__pyx_v_a, __pyx_t_4);
        __pyx_t_4 = 0;
        __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_old_indices, __pyx_9genexpr26__pyx_v_a); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 863, __pyx_L21_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 863, __pyx_L21_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 863, __pyx_L21_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_9genexpr26__pyx_v_a); __pyx_9genexpr26__pyx_v_a = 0;
      goto __pyx_L24_exit_scope;
      __pyx_L21_error:;
      __Pyx_XDECREF(__pyx_9genexpr26__pyx_v_a); __pyx_9genexpr26__pyx_v_a = 0;
      goto __pyx_L1_error;
      __pyx_L24_exit_scope:;
    } /* exit inner scope */
    __pyx_t_1 = PySet_New(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 863, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GIVEREF(__pyx_t_1);
    __Pyx_GOTREF(__pyx_v_element->assigned_to);
    __Pyx_DECREF(__pyx_v_element->assigned_to);
    __pyx_v_element->assigned_to = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;
  }

  /* "_element_graph.pyx":865
 *             element.assigned_to = set([old_indices[a].index for a in element.assigned_to])
 * 
 *         self.assign_weights()             # <<<<<<<<<<<<<<
 * 
 *     cpdef np.ndarray normalize(self, np.ndarray arr):
 */
  ((struct __pyx_vtabstruct_14_element_graph_ElementGraph *)__pyx_v_self->__pyx_vtab)->assign_weights(__pyx_v_self, 0);

  /* "_element_graph.pyx":840
 *         return novel_bases + path.trimmed_bases
 * 
 *     cpdef void remove_paths(self, list indices):             # <<<<<<<<<<<<<<
 *         """Removes all trace of a path from paths."""
 *         cdef Element path, element
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(((PyObject *)__pyx_t_12));
  __Pyx_WriteUnraisable("_element_graph.ElementGraph.remove_paths", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_path);
  __Pyx_XDECREF((PyObject *)__pyx_v_element);
  __Pyx_XDECREF(__pyx_v_keep);
  __Pyx_XDECREF(__pyx_v_old_indices);
  __Pyx_XDECREF(__pyx_9genexpr26__pyx_v_a);
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_39remove_paths(PyObject *__pyx_v_self, PyObject *__pyx_v_indices); /*proto*/
static char __pyx_doc_14_element_graph_12ElementGraph_38remove_paths[] = "Removes all trace of a path from paths.";
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_39remove_paths(PyObject *__pyx_v_self, PyObject *__pyx_v_indices) {
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("remove_paths (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indices), (&PyList_Type), 1, "indices", 1))) __PYX_ERR(0, 840, __pyx_L1_error)
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_38remove_paths(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self), ((PyObject*)__pyx_v_indices));

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

static PyObject *__pyx_pf_14_element_graph_12ElementGraph_38remove_paths(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, PyObject *__pyx_v_indices) {
  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("remove_paths", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_14_element_graph_12ElementGraph_remove_paths(__pyx_v_self, __pyx_v_indices, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 840, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "_element_graph.pyx":867
 *         self.assign_weights()
 * 
 *     cpdef np.ndarray normalize(self, np.ndarray arr):             # <<<<<<<<<<<<<<
 *         cdef float arrsum
 *         arrsum = np.sum(arr)
 */

static PyObject *__pyx_pw_14_element_graph_12ElementGraph_41normalize(PyObject *__pyx_v_self, PyObject *__pyx_v_arr); /*proto*/
static PyArrayObject *__pyx_f_14_element_graph_12ElementGraph_normalize(CYTHON_UNUSED struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, PyArrayObject *__pyx_v_arr, int __pyx_skip_dispatch) {
  float __pyx_v_arrsum;
  PyArrayObject *__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;
  float __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("normalize", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_normalize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 867, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_14_element_graph_12ElementGraph_41normalize)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, ((PyObject *)__pyx_v_arr)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_arr));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 867, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 867, __pyx_L1_error)
        __pyx_r = ((PyArrayObject *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "_element_graph.pyx":869
 *     cpdef np.ndarray normalize(self, np.ndarray arr):
 *         cdef float arrsum
 *         arrsum = np.sum(arr)             # <<<<<<<<<<<<<<
 *         if arrsum > 0:
 *             return arr/arrsum
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 869, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_sum); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 869, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, ((PyObject *)__pyx_v_arr)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_arr));
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 869, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_5 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 869, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_arrsum = __pyx_t_5;

  /* "_element_graph.pyx":870
 *         cdef float arrsum
 *         arrsum = np.sum(arr)
 *         if arrsum > 0:             # <<<<<<<<<<<<<<
 *             return arr/arrsum
 *         else:
 */
  __pyx_t_6 = ((__pyx_v_arrsum > 0.0) != 0);
  if (__pyx_t_6) {

    /* "_element_graph.pyx":871
 *         arrsum = np.sum(arr)
 *         if arrsum > 0:
 *             return arr/arrsum             # <<<<<<<<<<<<<<
 *         else:
 *             return arr
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_1 = PyFloat_FromDouble(__pyx_v_arrsum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 871, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyNumber_Divide(((PyObject *)__pyx_v_arr), __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 871, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 871, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "_element_graph.pyx":870
 *         cdef float arrsum
 *         arrsum = np.sum(arr)
 *         if arrsum > 0:             # <<<<<<<<<<<<<<
 *             return arr/arrsum
 *         else:
 */
  }

  /* "_element_graph.pyx":873
 *             return arr/arrsum
 *         else:
 *             return arr             # <<<<<<<<<<<<<<
 * 
 * #################################################################################################################################
 */
  /*else*/ {
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_arr));
    __pyx_r = __pyx_v_arr;
    goto __pyx_L0;
  }

  /* "_element_graph.pyx":867
 *         self.assign_weights()
 * 
 *     cpdef np.ndarray normalize(self, np.ndarray arr):             # <<<<<<<<<<<<<<
 *         cdef float arrsum
 *         arrsum = np.sum(arr)
 */

  /* 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("_element_graph.ElementGraph.normalize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_41normalize(PyObject *__pyx_v_self, PyObject *__pyx_v_arr); /*proto*/
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_41normalize(PyObject *__pyx_v_self, PyObject *__pyx_v_arr) {
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("normalize (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 867, __pyx_L1_error)
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_40normalize(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self), ((PyArrayObject *)__pyx_v_arr));

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

static PyObject *__pyx_pf_14_element_graph_12ElementGraph_40normalize(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, PyArrayObject *__pyx_v_arr) {
  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("normalize", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_14_element_graph_12ElementGraph_normalize(__pyx_v_self, __pyx_v_arr, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 867, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "_element_graph.pyx":13
 * 
 * cdef class ElementGraph:
 *     cdef public list elements, paths             # <<<<<<<<<<<<<<
 *     cdef public np.ndarray assignments, overlap, end_reachability
 *     cdef readonly int number_of_elements, maxIC, max_isos
 */

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_8elements_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_8elements_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_8elements___get__(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self));

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

static PyObject *__pyx_pf_14_element_graph_12ElementGraph_8elements___get__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->elements);
  __pyx_r = __pyx_v_self->elements;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_12ElementGraph_8elements_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_14_element_graph_12ElementGraph_8elements_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_8elements_2__set__(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_14_element_graph_12ElementGraph_8elements_2__set__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyList_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(0, 13, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->elements);
  __Pyx_DECREF(__pyx_v_self->elements);
  __pyx_v_self->elements = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_12ElementGraph_8elements_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_14_element_graph_12ElementGraph_8elements_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_8elements_4__del__(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self));

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

static int __pyx_pf_14_element_graph_12ElementGraph_8elements_4__del__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->elements);
  __Pyx_DECREF(__pyx_v_self->elements);
  __pyx_v_self->elements = ((PyObject*)Py_None);

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

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_5paths_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_5paths_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_5paths___get__(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self));

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

static PyObject *__pyx_pf_14_element_graph_12ElementGraph_5paths___get__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->paths);
  __pyx_r = __pyx_v_self->paths;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_12ElementGraph_5paths_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_14_element_graph_12ElementGraph_5paths_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_5paths_2__set__(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_14_element_graph_12ElementGraph_5paths_2__set__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyList_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(0, 13, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->paths);
  __Pyx_DECREF(__pyx_v_self->paths);
  __pyx_v_self->paths = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_12ElementGraph_5paths_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_14_element_graph_12ElementGraph_5paths_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_5paths_4__del__(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self));

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

static int __pyx_pf_14_element_graph_12ElementGraph_5paths_4__del__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->paths);
  __Pyx_DECREF(__pyx_v_self->paths);
  __pyx_v_self->paths = ((PyObject*)Py_None);

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

/* "_element_graph.pyx":14
 * cdef class ElementGraph:
 *     cdef public list elements, paths
 *     cdef public np.ndarray assignments, overlap, end_reachability             # <<<<<<<<<<<<<<
 *     cdef readonly int number_of_elements, maxIC, max_isos
 *     cdef Element emptyPath
 */

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_11assignments_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_11assignments_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_11assignments___get__(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self));

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

static PyObject *__pyx_pf_14_element_graph_12ElementGraph_11assignments___get__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->assignments));
  __pyx_r = ((PyObject *)__pyx_v_self->assignments);
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_12ElementGraph_11assignments_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_14_element_graph_12ElementGraph_11assignments_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_11assignments_2__set__(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_14_element_graph_12ElementGraph_11assignments_2__set__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 14, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->assignments);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->assignments));
  __pyx_v_self->assignments = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_12ElementGraph_11assignments_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_14_element_graph_12ElementGraph_11assignments_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_11assignments_4__del__(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self));

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

static int __pyx_pf_14_element_graph_12ElementGraph_11assignments_4__del__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->assignments);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->assignments));
  __pyx_v_self->assignments = ((PyArrayObject *)Py_None);

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

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_7overlap_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_7overlap_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_7overlap___get__(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self));

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

static PyObject *__pyx_pf_14_element_graph_12ElementGraph_7overlap___get__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->overlap));
  __pyx_r = ((PyObject *)__pyx_v_self->overlap);
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_12ElementGraph_7overlap_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_14_element_graph_12ElementGraph_7overlap_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_7overlap_2__set__(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_14_element_graph_12ElementGraph_7overlap_2__set__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 14, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->overlap);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->overlap));
  __pyx_v_self->overlap = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_12ElementGraph_7overlap_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_14_element_graph_12ElementGraph_7overlap_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_7overlap_4__del__(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self));

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

static int __pyx_pf_14_element_graph_12ElementGraph_7overlap_4__del__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->overlap);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->overlap));
  __pyx_v_self->overlap = ((PyArrayObject *)Py_None);

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

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_16end_reachability_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_16end_reachability_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_16end_reachability___get__(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self));

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

static PyObject *__pyx_pf_14_element_graph_12ElementGraph_16end_reachability___get__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->end_reachability));
  __pyx_r = ((PyObject *)__pyx_v_self->end_reachability);
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_12ElementGraph_16end_reachability_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_14_element_graph_12ElementGraph_16end_reachability_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_16end_reachability_2__set__(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_14_element_graph_12ElementGraph_16end_reachability_2__set__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 14, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->end_reachability);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->end_reachability));
  __pyx_v_self->end_reachability = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_12ElementGraph_16end_reachability_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_14_element_graph_12ElementGraph_16end_reachability_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_16end_reachability_4__del__(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self));

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

static int __pyx_pf_14_element_graph_12ElementGraph_16end_reachability_4__del__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->end_reachability);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->end_reachability));
  __pyx_v_self->end_reachability = ((PyArrayObject *)Py_None);

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

/* "_element_graph.pyx":15
 *     cdef public list elements, paths
 *     cdef public np.ndarray assignments, overlap, end_reachability
 *     cdef readonly int number_of_elements, maxIC, max_isos             # <<<<<<<<<<<<<<
 *     cdef Element emptyPath
 *     cdef public float bases, input_bases, dead_end_penalty, intron_filter, truncation_filter
 */

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_18number_of_elements_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_18number_of_elements_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_18number_of_elements___get__(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self));

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

static PyObject *__pyx_pf_14_element_graph_12ElementGraph_18number_of_elements___get__(struct __pyx_obj_14_element_graph_ElementGraph *__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);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->number_of_elements); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_5maxIC_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_5maxIC_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_5maxIC___get__(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self));

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

static PyObject *__pyx_pf_14_element_graph_12ElementGraph_5maxIC___get__(struct __pyx_obj_14_element_graph_ElementGraph *__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);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->maxIC); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_8max_isos_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_8max_isos_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_8max_isos___get__(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self));

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

static PyObject *__pyx_pf_14_element_graph_12ElementGraph_8max_isos___get__(struct __pyx_obj_14_element_graph_ElementGraph *__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);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->max_isos); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "_element_graph.pyx":17
 *     cdef readonly int number_of_elements, maxIC, max_isos
 *     cdef Element emptyPath
 *     cdef public float bases, input_bases, dead_end_penalty, intron_filter, truncation_filter             # <<<<<<<<<<<<<<
 *     cdef public set SP, SM, EP, EM, end_elements, SPmembers, SMmembers, EPmembers, EMmembers
 *     cdef public bint no_ends, ignore_ends, naive, partial_coverage, allow_incomplete
 */

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_5bases_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_5bases_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_5bases___get__(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self));

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

static PyObject *__pyx_pf_14_element_graph_12ElementGraph_5bases___get__(struct __pyx_obj_14_element_graph_ElementGraph *__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);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->bases); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_12ElementGraph_5bases_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_14_element_graph_12ElementGraph_5bases_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_5bases_2__set__(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_14_element_graph_12ElementGraph_5bases_2__set__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  float __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __pyx_PyFloat_AsFloat(__pyx_v_value); if (unlikely((__pyx_t_1 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 17, __pyx_L1_error)
  __pyx_v_self->bases = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("_element_graph.ElementGraph.bases.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_11input_bases_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_11input_bases_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_11input_bases___get__(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self));

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

static PyObject *__pyx_pf_14_element_graph_12ElementGraph_11input_bases___get__(struct __pyx_obj_14_element_graph_ElementGraph *__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);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->input_bases); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_12ElementGraph_11input_bases_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_14_element_graph_12ElementGraph_11input_bases_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_11input_bases_2__set__(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_14_element_graph_12ElementGraph_11input_bases_2__set__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  float __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __pyx_PyFloat_AsFloat(__pyx_v_value); if (unlikely((__pyx_t_1 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 17, __pyx_L1_error)
  __pyx_v_self->input_bases = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("_element_graph.ElementGraph.input_bases.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_16dead_end_penalty_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_16dead_end_penalty_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_16dead_end_penalty___get__(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self));

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

static PyObject *__pyx_pf_14_element_graph_12ElementGraph_16dead_end_penalty___get__(struct __pyx_obj_14_element_graph_ElementGraph *__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);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->dead_end_penalty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_12ElementGraph_16dead_end_penalty_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_14_element_graph_12ElementGraph_16dead_end_penalty_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_16dead_end_penalty_2__set__(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_14_element_graph_12ElementGraph_16dead_end_penalty_2__set__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  float __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __pyx_PyFloat_AsFloat(__pyx_v_value); if (unlikely((__pyx_t_1 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 17, __pyx_L1_error)
  __pyx_v_self->dead_end_penalty = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("_element_graph.ElementGraph.dead_end_penalty.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_13intron_filter_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_13intron_filter_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_13intron_filter___get__(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self));

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

static PyObject *__pyx_pf_14_element_graph_12ElementGraph_13intron_filter___get__(struct __pyx_obj_14_element_graph_ElementGraph *__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);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->intron_filter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_12ElementGraph_13intron_filter_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_14_element_graph_12ElementGraph_13intron_filter_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_13intron_filter_2__set__(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_14_element_graph_12ElementGraph_13intron_filter_2__set__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  float __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __pyx_PyFloat_AsFloat(__pyx_v_value); if (unlikely((__pyx_t_1 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 17, __pyx_L1_error)
  __pyx_v_self->intron_filter = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("_element_graph.ElementGraph.intron_filter.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_17truncation_filter_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_17truncation_filter_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_17truncation_filter___get__(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self));

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

static PyObject *__pyx_pf_14_element_graph_12ElementGraph_17truncation_filter___get__(struct __pyx_obj_14_element_graph_ElementGraph *__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);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->truncation_filter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_12ElementGraph_17truncation_filter_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_14_element_graph_12ElementGraph_17truncation_filter_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_17truncation_filter_2__set__(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_14_element_graph_12ElementGraph_17truncation_filter_2__set__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  float __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __pyx_PyFloat_AsFloat(__pyx_v_value); if (unlikely((__pyx_t_1 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 17, __pyx_L1_error)
  __pyx_v_self->truncation_filter = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("_element_graph.ElementGraph.truncation_filter.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_element_graph.pyx":18
 *     cdef Element emptyPath
 *     cdef public float bases, input_bases, dead_end_penalty, intron_filter, truncation_filter
 *     cdef public set SP, SM, EP, EM, end_elements, SPmembers, SMmembers, EPmembers, EMmembers             # <<<<<<<<<<<<<<
 *     cdef public bint no_ends, ignore_ends, naive, partial_coverage, allow_incomplete
 *     def __init__(self, np.ndarray overlap_matrix, np.ndarray membership_matrix, source_weight_array, member_weight_array, strands, lengths, naive=False, dead_end_penalty=0.1, partial_coverage=True, ignore_ends=False, intron_filter=0.1, max_isos=10, allow_incomplete=False, truncation_filter=.5):
 */

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_2SP_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_2SP_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_2SP___get__(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self));

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

static PyObject *__pyx_pf_14_element_graph_12ElementGraph_2SP___get__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->SP);
  __pyx_r = __pyx_v_self->SP;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_12ElementGraph_2SP_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_14_element_graph_12ElementGraph_2SP_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_2SP_2__set__(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_14_element_graph_12ElementGraph_2SP_2__set__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PySet_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(0, 18, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->SP);
  __Pyx_DECREF(__pyx_v_self->SP);
  __pyx_v_self->SP = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_12ElementGraph_2SP_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_14_element_graph_12ElementGraph_2SP_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_2SP_4__del__(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self));

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

static int __pyx_pf_14_element_graph_12ElementGraph_2SP_4__del__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->SP);
  __Pyx_DECREF(__pyx_v_self->SP);
  __pyx_v_self->SP = ((PyObject*)Py_None);

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

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_2SM_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_2SM_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_2SM___get__(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self));

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

static PyObject *__pyx_pf_14_element_graph_12ElementGraph_2SM___get__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->SM);
  __pyx_r = __pyx_v_self->SM;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_12ElementGraph_2SM_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_14_element_graph_12ElementGraph_2SM_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_2SM_2__set__(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_14_element_graph_12ElementGraph_2SM_2__set__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PySet_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(0, 18, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->SM);
  __Pyx_DECREF(__pyx_v_self->SM);
  __pyx_v_self->SM = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_12ElementGraph_2SM_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_14_element_graph_12ElementGraph_2SM_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_2SM_4__del__(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self));

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

static int __pyx_pf_14_element_graph_12ElementGraph_2SM_4__del__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->SM);
  __Pyx_DECREF(__pyx_v_self->SM);
  __pyx_v_self->SM = ((PyObject*)Py_None);

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

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_2EP_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_2EP_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_2EP___get__(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self));

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

static PyObject *__pyx_pf_14_element_graph_12ElementGraph_2EP___get__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->EP);
  __pyx_r = __pyx_v_self->EP;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_12ElementGraph_2EP_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_14_element_graph_12ElementGraph_2EP_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_2EP_2__set__(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_14_element_graph_12ElementGraph_2EP_2__set__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PySet_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(0, 18, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->EP);
  __Pyx_DECREF(__pyx_v_self->EP);
  __pyx_v_self->EP = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_12ElementGraph_2EP_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_14_element_graph_12ElementGraph_2EP_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_2EP_4__del__(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self));

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

static int __pyx_pf_14_element_graph_12ElementGraph_2EP_4__del__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->EP);
  __Pyx_DECREF(__pyx_v_self->EP);
  __pyx_v_self->EP = ((PyObject*)Py_None);

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

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_2EM_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_2EM_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_2EM___get__(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self));

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

static PyObject *__pyx_pf_14_element_graph_12ElementGraph_2EM___get__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->EM);
  __pyx_r = __pyx_v_self->EM;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_12ElementGraph_2EM_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_14_element_graph_12ElementGraph_2EM_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_2EM_2__set__(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_14_element_graph_12ElementGraph_2EM_2__set__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PySet_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(0, 18, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->EM);
  __Pyx_DECREF(__pyx_v_self->EM);
  __pyx_v_self->EM = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_12ElementGraph_2EM_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_14_element_graph_12ElementGraph_2EM_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_2EM_4__del__(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self));

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

static int __pyx_pf_14_element_graph_12ElementGraph_2EM_4__del__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->EM);
  __Pyx_DECREF(__pyx_v_self->EM);
  __pyx_v_self->EM = ((PyObject*)Py_None);

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

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_12end_elements_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_12end_elements_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_12end_elements___get__(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self));

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

static PyObject *__pyx_pf_14_element_graph_12ElementGraph_12end_elements___get__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->end_elements);
  __pyx_r = __pyx_v_self->end_elements;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_12ElementGraph_12end_elements_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_14_element_graph_12ElementGraph_12end_elements_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_12end_elements_2__set__(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_14_element_graph_12ElementGraph_12end_elements_2__set__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PySet_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(0, 18, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->end_elements);
  __Pyx_DECREF(__pyx_v_self->end_elements);
  __pyx_v_self->end_elements = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_12ElementGraph_12end_elements_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_14_element_graph_12ElementGraph_12end_elements_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_12end_elements_4__del__(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self));

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

static int __pyx_pf_14_element_graph_12ElementGraph_12end_elements_4__del__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->end_elements);
  __Pyx_DECREF(__pyx_v_self->end_elements);
  __pyx_v_self->end_elements = ((PyObject*)Py_None);

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

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_9SPmembers_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_9SPmembers_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_9SPmembers___get__(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self));

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

static PyObject *__pyx_pf_14_element_graph_12ElementGraph_9SPmembers___get__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->SPmembers);
  __pyx_r = __pyx_v_self->SPmembers;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_12ElementGraph_9SPmembers_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_14_element_graph_12ElementGraph_9SPmembers_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_9SPmembers_2__set__(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_14_element_graph_12ElementGraph_9SPmembers_2__set__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PySet_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(0, 18, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->SPmembers);
  __Pyx_DECREF(__pyx_v_self->SPmembers);
  __pyx_v_self->SPmembers = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_12ElementGraph_9SPmembers_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_14_element_graph_12ElementGraph_9SPmembers_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_9SPmembers_4__del__(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self));

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

static int __pyx_pf_14_element_graph_12ElementGraph_9SPmembers_4__del__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->SPmembers);
  __Pyx_DECREF(__pyx_v_self->SPmembers);
  __pyx_v_self->SPmembers = ((PyObject*)Py_None);

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

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_9SMmembers_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_9SMmembers_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_9SMmembers___get__(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self));

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

static PyObject *__pyx_pf_14_element_graph_12ElementGraph_9SMmembers___get__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->SMmembers);
  __pyx_r = __pyx_v_self->SMmembers;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_12ElementGraph_9SMmembers_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_14_element_graph_12ElementGraph_9SMmembers_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_9SMmembers_2__set__(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_14_element_graph_12ElementGraph_9SMmembers_2__set__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PySet_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(0, 18, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->SMmembers);
  __Pyx_DECREF(__pyx_v_self->SMmembers);
  __pyx_v_self->SMmembers = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_12ElementGraph_9SMmembers_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_14_element_graph_12ElementGraph_9SMmembers_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_9SMmembers_4__del__(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self));

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

static int __pyx_pf_14_element_graph_12ElementGraph_9SMmembers_4__del__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->SMmembers);
  __Pyx_DECREF(__pyx_v_self->SMmembers);
  __pyx_v_self->SMmembers = ((PyObject*)Py_None);

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

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_9EPmembers_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_9EPmembers_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_9EPmembers___get__(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self));

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

static PyObject *__pyx_pf_14_element_graph_12ElementGraph_9EPmembers___get__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->EPmembers);
  __pyx_r = __pyx_v_self->EPmembers;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_12ElementGraph_9EPmembers_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_14_element_graph_12ElementGraph_9EPmembers_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_9EPmembers_2__set__(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_14_element_graph_12ElementGraph_9EPmembers_2__set__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PySet_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(0, 18, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->EPmembers);
  __Pyx_DECREF(__pyx_v_self->EPmembers);
  __pyx_v_self->EPmembers = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_12ElementGraph_9EPmembers_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_14_element_graph_12ElementGraph_9EPmembers_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_9EPmembers_4__del__(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self));

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

static int __pyx_pf_14_element_graph_12ElementGraph_9EPmembers_4__del__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->EPmembers);
  __Pyx_DECREF(__pyx_v_self->EPmembers);
  __pyx_v_self->EPmembers = ((PyObject*)Py_None);

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

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_9EMmembers_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_9EMmembers_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_9EMmembers___get__(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self));

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

static PyObject *__pyx_pf_14_element_graph_12ElementGraph_9EMmembers___get__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->EMmembers);
  __pyx_r = __pyx_v_self->EMmembers;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_12ElementGraph_9EMmembers_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_14_element_graph_12ElementGraph_9EMmembers_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_9EMmembers_2__set__(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_14_element_graph_12ElementGraph_9EMmembers_2__set__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PySet_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(0, 18, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->EMmembers);
  __Pyx_DECREF(__pyx_v_self->EMmembers);
  __pyx_v_self->EMmembers = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_12ElementGraph_9EMmembers_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_14_element_graph_12ElementGraph_9EMmembers_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_9EMmembers_4__del__(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self));

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

static int __pyx_pf_14_element_graph_12ElementGraph_9EMmembers_4__del__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->EMmembers);
  __Pyx_DECREF(__pyx_v_self->EMmembers);
  __pyx_v_self->EMmembers = ((PyObject*)Py_None);

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

/* "_element_graph.pyx":19
 *     cdef public float bases, input_bases, dead_end_penalty, intron_filter, truncation_filter
 *     cdef public set SP, SM, EP, EM, end_elements, SPmembers, SMmembers, EPmembers, EMmembers
 *     cdef public bint no_ends, ignore_ends, naive, partial_coverage, allow_incomplete             # <<<<<<<<<<<<<<
 *     def __init__(self, np.ndarray overlap_matrix, np.ndarray membership_matrix, source_weight_array, member_weight_array, strands, lengths, naive=False, dead_end_penalty=0.1, partial_coverage=True, ignore_ends=False, intron_filter=0.1, max_isos=10, allow_incomplete=False, truncation_filter=.5):
 *         """Constructs a forward and reverse directed graph from the
 */

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_7no_ends_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_7no_ends_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_7no_ends___get__(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self));

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

static PyObject *__pyx_pf_14_element_graph_12ElementGraph_7no_ends___get__(struct __pyx_obj_14_element_graph_ElementGraph *__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);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->no_ends); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_12ElementGraph_7no_ends_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_14_element_graph_12ElementGraph_7no_ends_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_7no_ends_2__set__(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_14_element_graph_12ElementGraph_7no_ends_2__set__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 19, __pyx_L1_error)
  __pyx_v_self->no_ends = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("_element_graph.ElementGraph.no_ends.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_11ignore_ends_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_11ignore_ends_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_11ignore_ends___get__(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self));

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

static PyObject *__pyx_pf_14_element_graph_12ElementGraph_11ignore_ends___get__(struct __pyx_obj_14_element_graph_ElementGraph *__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);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->ignore_ends); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_12ElementGraph_11ignore_ends_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_14_element_graph_12ElementGraph_11ignore_ends_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_11ignore_ends_2__set__(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_14_element_graph_12ElementGraph_11ignore_ends_2__set__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 19, __pyx_L1_error)
  __pyx_v_self->ignore_ends = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("_element_graph.ElementGraph.ignore_ends.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_5naive_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_5naive_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_5naive___get__(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self));

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

static PyObject *__pyx_pf_14_element_graph_12ElementGraph_5naive___get__(struct __pyx_obj_14_element_graph_ElementGraph *__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);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->naive); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_12ElementGraph_5naive_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_14_element_graph_12ElementGraph_5naive_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_5naive_2__set__(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_14_element_graph_12ElementGraph_5naive_2__set__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 19, __pyx_L1_error)
  __pyx_v_self->naive = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("_element_graph.ElementGraph.naive.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_16partial_coverage_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_16partial_coverage_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_16partial_coverage___get__(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self));

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

static PyObject *__pyx_pf_14_element_graph_12ElementGraph_16partial_coverage___get__(struct __pyx_obj_14_element_graph_ElementGraph *__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);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->partial_coverage); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_12ElementGraph_16partial_coverage_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_14_element_graph_12ElementGraph_16partial_coverage_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_16partial_coverage_2__set__(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_14_element_graph_12ElementGraph_16partial_coverage_2__set__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 19, __pyx_L1_error)
  __pyx_v_self->partial_coverage = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("_element_graph.ElementGraph.partial_coverage.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_16allow_incomplete_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_16allow_incomplete_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_16allow_incomplete___get__(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self));

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

static PyObject *__pyx_pf_14_element_graph_12ElementGraph_16allow_incomplete___get__(struct __pyx_obj_14_element_graph_ElementGraph *__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);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->allow_incomplete); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_12ElementGraph_16allow_incomplete_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_14_element_graph_12ElementGraph_16allow_incomplete_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_16allow_incomplete_2__set__(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_14_element_graph_12ElementGraph_16allow_incomplete_2__set__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 19, __pyx_L1_error)
  __pyx_v_self->allow_incomplete = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("_element_graph.ElementGraph.allow_incomplete.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_43__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_43__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_42__reduce_cython__(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self));

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

static PyObject *__pyx_pf_14_element_graph_12ElementGraph_42__reduce_cython__(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v_self) {
  PyObject *__pyx_v_state = 0;
  PyObject *__pyx_v__dict = 0;
  int __pyx_v_use_setstate;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  int __pyx_t_15;
  int __pyx_t_16;
  int __pyx_t_17;
  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
 *     state = (self.EM, self.EMmembers, self.EP, self.EPmembers, self.SM, self.SMmembers, self.SP, self.SPmembers, self.allow_incomplete, self.assignments, self.bases, self.dead_end_penalty, self.elements, self.emptyPath, self.end_elements, self.end_reachability, self.ignore_ends, self.input_bases, self.intron_filter, self.maxIC, self.max_isos, self.naive, self.no_ends, self.number_of_elements, self.overlap, self.partial_coverage, self.paths, self.truncation_filter)             # <<<<<<<<<<<<<<
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->allow_incomplete); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->bases); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->dead_end_penalty); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_self->ignore_ends); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyFloat_FromDouble(__pyx_v_self->input_bases); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyFloat_FromDouble(__pyx_v_self->intron_filter); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_self->maxIC); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_self->max_isos); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = __Pyx_PyBool_FromLong(__pyx_v_self->naive); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = __Pyx_PyBool_FromLong(__pyx_v_self->no_ends); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_self->number_of_elements); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_self->partial_coverage); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_13 = PyFloat_FromDouble(__pyx_v_self->truncation_filter); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_14 = PyTuple_New(28); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __Pyx_INCREF(__pyx_v_self->EM);
  __Pyx_GIVEREF(__pyx_v_self->EM);
  PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_v_self->EM);
  __Pyx_INCREF(__pyx_v_self->EMmembers);
  __Pyx_GIVEREF(__pyx_v_self->EMmembers);
  PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_v_self->EMmembers);
  __Pyx_INCREF(__pyx_v_self->EP);
  __Pyx_GIVEREF(__pyx_v_self->EP);
  PyTuple_SET_ITEM(__pyx_t_14, 2, __pyx_v_self->EP);
  __Pyx_INCREF(__pyx_v_self->EPmembers);
  __Pyx_GIVEREF(__pyx_v_self->EPmembers);
  PyTuple_SET_ITEM(__pyx_t_14, 3, __pyx_v_self->EPmembers);
  __Pyx_INCREF(__pyx_v_self->SM);
  __Pyx_GIVEREF(__pyx_v_self->SM);
  PyTuple_SET_ITEM(__pyx_t_14, 4, __pyx_v_self->SM);
  __Pyx_INCREF(__pyx_v_self->SMmembers);
  __Pyx_GIVEREF(__pyx_v_self->SMmembers);
  PyTuple_SET_ITEM(__pyx_t_14, 5, __pyx_v_self->SMmembers);
  __Pyx_INCREF(__pyx_v_self->SP);
  __Pyx_GIVEREF(__pyx_v_self->SP);
  PyTuple_SET_ITEM(__pyx_t_14, 6, __pyx_v_self->SP);
  __Pyx_INCREF(__pyx_v_self->SPmembers);
  __Pyx_GIVEREF(__pyx_v_self->SPmembers);
  PyTuple_SET_ITEM(__pyx_t_14, 7, __pyx_v_self->SPmembers);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_14, 8, __pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->assignments));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->assignments));
  PyTuple_SET_ITEM(__pyx_t_14, 9, ((PyObject *)__pyx_v_self->assignments));
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_14, 10, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_14, 11, __pyx_t_3);
  __Pyx_INCREF(__pyx_v_self->elements);
  __Pyx_GIVEREF(__pyx_v_self->elements);
  PyTuple_SET_ITEM(__pyx_t_14, 12, __pyx_v_self->elements);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->emptyPath));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->emptyPath));
  PyTuple_SET_ITEM(__pyx_t_14, 13, ((PyObject *)__pyx_v_self->emptyPath));
  __Pyx_INCREF(__pyx_v_self->end_elements);
  __Pyx_GIVEREF(__pyx_v_self->end_elements);
  PyTuple_SET_ITEM(__pyx_t_14, 14, __pyx_v_self->end_elements);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->end_reachability));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->end_reachability));
  PyTuple_SET_ITEM(__pyx_t_14, 15, ((PyObject *)__pyx_v_self->end_reachability));
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_14, 16, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_14, 17, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_14, 18, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_14, 19, __pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_8);
  PyTuple_SET_ITEM(__pyx_t_14, 20, __pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_9);
  PyTuple_SET_ITEM(__pyx_t_14, 21, __pyx_t_9);
  __Pyx_GIVEREF(__pyx_t_10);
  PyTuple_SET_ITEM(__pyx_t_14, 22, __pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_11);
  PyTuple_SET_ITEM(__pyx_t_14, 23, __pyx_t_11);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->overlap));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->overlap));
  PyTuple_SET_ITEM(__pyx_t_14, 24, ((PyObject *)__pyx_v_self->overlap));
  __Pyx_GIVEREF(__pyx_t_12);
  PyTuple_SET_ITEM(__pyx_t_14, 25, __pyx_t_12);
  __Pyx_INCREF(__pyx_v_self->paths);
  __Pyx_GIVEREF(__pyx_v_self->paths);
  PyTuple_SET_ITEM(__pyx_t_14, 26, __pyx_v_self->paths);
  __Pyx_GIVEREF(__pyx_t_13);
  PyTuple_SET_ITEM(__pyx_t_14, 27, __pyx_t_13);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_5 = 0;
  __pyx_t_6 = 0;
  __pyx_t_7 = 0;
  __pyx_t_8 = 0;
  __pyx_t_9 = 0;
  __pyx_t_10 = 0;
  __pyx_t_11 = 0;
  __pyx_t_12 = 0;
  __pyx_t_13 = 0;
  __pyx_v_state = ((PyObject*)__pyx_t_14);
  __pyx_t_14 = 0;

  /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     state = (self.EM, self.EMmembers, self.EP, self.EPmembers, self.SM, self.SMmembers, self.SP, self.SPmembers, self.allow_incomplete, self.assignments, self.bases, self.dead_end_penalty, self.elements, self.emptyPath, self.end_elements, self.end_reachability, self.ignore_ends, self.input_bases, self.intron_filter, self.maxIC, self.max_isos, self.naive, self.no_ends, self.number_of_elements, self.overlap, self.partial_coverage, self.paths, self.truncation_filter)
 *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None:
 *         state += (_dict,)
 */
  __pyx_t_14 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_v__dict = __pyx_t_14;
  __pyx_t_14 = 0;

  /* "(tree fragment)":7
 *     state = (self.EM, self.EMmembers, self.EP, self.EPmembers, self.SM, self.SMmembers, self.SP, self.SPmembers, self.allow_incomplete, self.assignments, self.bases, self.dead_end_penalty, self.elements, self.emptyPath, self.end_elements, self.end_reachability, self.ignore_ends, self.input_bases, self.intron_filter, self.maxIC, self.max_isos, self.naive, self.no_ends, self.number_of_elements, self.overlap, self.partial_coverage, self.paths, self.truncation_filter)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
  __pyx_t_15 = (__pyx_v__dict != Py_None);
  __pyx_t_16 = (__pyx_t_15 != 0);
  if (__pyx_t_16) {

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

    /* "(tree fragment)":9
 *     if _dict is not None:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = self.EM is not None or self.EMmembers is not None or self.EP is not None or self.EPmembers is not None or self.SM is not None or self.SMmembers is not None or self.SP is not None or self.SPmembers is not None or self.assignments is not None or self.elements is not None or self.emptyPath is not None or self.end_elements is not None or self.end_reachability is not None or self.overlap is not None or self.paths is not None
 */
    __pyx_v_use_setstate = 1;

    /* "(tree fragment)":7
 *     state = (self.EM, self.EMmembers, self.EP, self.EPmembers, self.SM, self.SMmembers, self.SP, self.SPmembers, self.allow_incomplete, self.assignments, self.bases, self.dead_end_penalty, self.elements, self.emptyPath, self.end_elements, self.end_reachability, self.ignore_ends, self.input_bases, self.intron_filter, self.maxIC, self.max_isos, self.naive, self.no_ends, self.number_of_elements, self.overlap, self.partial_coverage, self.paths, self.truncation_filter)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
    goto __pyx_L3;
  }

  /* "(tree fragment)":11
 *         use_setstate = True
 *     else:
 *         use_setstate = self.EM is not None or self.EMmembers is not None or self.EP is not None or self.EPmembers is not None or self.SM is not None or self.SMmembers is not None or self.SP is not None or self.SPmembers is not None or self.assignments is not None or self.elements is not None or self.emptyPath is not None or self.end_elements is not None or self.end_reachability is not None or self.overlap is not None or self.paths is not None             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle_ElementGraph, (type(self), 0xb5283f6, None), state
 */
  /*else*/ {
    __pyx_t_15 = (__pyx_v_self->EM != ((PyObject*)Py_None));
    __pyx_t_17 = (__pyx_t_15 != 0);
    if (!__pyx_t_17) {
    } else {
      __pyx_t_16 = __pyx_t_17;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_17 = (__pyx_v_self->EMmembers != ((PyObject*)Py_None));
    __pyx_t_15 = (__pyx_t_17 != 0);
    if (!__pyx_t_15) {
    } else {
      __pyx_t_16 = __pyx_t_15;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_15 = (__pyx_v_self->EP != ((PyObject*)Py_None));
    __pyx_t_17 = (__pyx_t_15 != 0);
    if (!__pyx_t_17) {
    } else {
      __pyx_t_16 = __pyx_t_17;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_17 = (__pyx_v_self->EPmembers != ((PyObject*)Py_None));
    __pyx_t_15 = (__pyx_t_17 != 0);
    if (!__pyx_t_15) {
    } else {
      __pyx_t_16 = __pyx_t_15;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_15 = (__pyx_v_self->SM != ((PyObject*)Py_None));
    __pyx_t_17 = (__pyx_t_15 != 0);
    if (!__pyx_t_17) {
    } else {
      __pyx_t_16 = __pyx_t_17;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_17 = (__pyx_v_self->SMmembers != ((PyObject*)Py_None));
    __pyx_t_15 = (__pyx_t_17 != 0);
    if (!__pyx_t_15) {
    } else {
      __pyx_t_16 = __pyx_t_15;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_15 = (__pyx_v_self->SP != ((PyObject*)Py_None));
    __pyx_t_17 = (__pyx_t_15 != 0);
    if (!__pyx_t_17) {
    } else {
      __pyx_t_16 = __pyx_t_17;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_17 = (__pyx_v_self->SPmembers != ((PyObject*)Py_None));
    __pyx_t_15 = (__pyx_t_17 != 0);
    if (!__pyx_t_15) {
    } else {
      __pyx_t_16 = __pyx_t_15;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_15 = (((PyObject *)__pyx_v_self->assignments) != Py_None);
    __pyx_t_17 = (__pyx_t_15 != 0);
    if (!__pyx_t_17) {
    } else {
      __pyx_t_16 = __pyx_t_17;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_17 = (__pyx_v_self->elements != ((PyObject*)Py_None));
    __pyx_t_15 = (__pyx_t_17 != 0);
    if (!__pyx_t_15) {
    } else {
      __pyx_t_16 = __pyx_t_15;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_15 = (((PyObject *)__pyx_v_self->emptyPath) != Py_None);
    __pyx_t_17 = (__pyx_t_15 != 0);
    if (!__pyx_t_17) {
    } else {
      __pyx_t_16 = __pyx_t_17;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_17 = (__pyx_v_self->end_elements != ((PyObject*)Py_None));
    __pyx_t_15 = (__pyx_t_17 != 0);
    if (!__pyx_t_15) {
    } else {
      __pyx_t_16 = __pyx_t_15;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_15 = (((PyObject *)__pyx_v_self->end_reachability) != Py_None);
    __pyx_t_17 = (__pyx_t_15 != 0);
    if (!__pyx_t_17) {
    } else {
      __pyx_t_16 = __pyx_t_17;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_17 = (((PyObject *)__pyx_v_self->overlap) != Py_None);
    __pyx_t_15 = (__pyx_t_17 != 0);
    if (!__pyx_t_15) {
    } else {
      __pyx_t_16 = __pyx_t_15;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_15 = (__pyx_v_self->paths != ((PyObject*)Py_None));
    __pyx_t_17 = (__pyx_t_15 != 0);
    __pyx_t_16 = __pyx_t_17;
    __pyx_L4_bool_binop_done:;
    __pyx_v_use_setstate = __pyx_t_16;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = self.EM is not None or self.EMmembers is not None or self.EP is not None or self.EPmembers is not None or self.SM is not None or self.SMmembers is not None or self.SP is not None or self.SPmembers is not None or self.assignments is not None or self.elements is not None or self.emptyPath is not None or self.end_elements is not None or self.end_reachability is not None or self.overlap is not None or self.paths is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_ElementGraph, (type(self), 0xb5283f6, None), state
 *     else:
 */
  __pyx_t_16 = (__pyx_v_use_setstate != 0);
  if (__pyx_t_16) {

    /* "(tree fragment)":13
 *         use_setstate = self.EM is not None or self.EMmembers is not None or self.EP is not None or self.EPmembers is not None or self.SM is not None or self.SMmembers is not None or self.SP is not None or self.SPmembers is not None or self.assignments is not None or self.elements is not None or self.emptyPath is not None or self.end_elements is not None or self.end_reachability is not None or self.overlap is not None or self.paths is not None
 *     if use_setstate:
 *         return __pyx_unpickle_ElementGraph, (type(self), 0xb5283f6, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_ElementGraph, (type(self), 0xb5283f6, state)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_pyx_unpickle_ElementGraph); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __pyx_t_14 = PyTuple_New(3); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    PyTuple_SET_ITEM(__pyx_t_14, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_INCREF(__pyx_int_189957110);
    __Pyx_GIVEREF(__pyx_int_189957110);
    PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_int_189957110);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    PyTuple_SET_ITEM(__pyx_t_14, 2, Py_None);
    __pyx_t_12 = PyTuple_New(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_GIVEREF(__pyx_t_13);
    PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_13);
    __Pyx_GIVEREF(__pyx_t_14);
    PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_14);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_v_state);
    __pyx_t_13 = 0;
    __pyx_t_14 = 0;
    __pyx_r = __pyx_t_12;
    __pyx_t_12 = 0;
    goto __pyx_L0;

    /* "(tree fragment)":12
 *     else:
 *         use_setstate = self.EM is not None or self.EMmembers is not None or self.EP is not None or self.EPmembers is not None or self.SM is not None or self.SMmembers is not None or self.SP is not None or self.SPmembers is not None or self.assignments is not None or self.elements is not None or self.emptyPath is not None or self.end_elements is not None or self.end_reachability is not None or self.overlap is not None or self.paths is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_ElementGraph, (type(self), 0xb5283f6, None), state
 *     else:
 */
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_ElementGraph, (type(self), 0xb5283f6, None), state
 *     else:
 *         return __pyx_unpickle_ElementGraph, (type(self), 0xb5283f6, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_ElementGraph__set_state(self, __pyx_state)
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_pyx_unpickle_ElementGraph); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_14 = PyTuple_New(3); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    PyTuple_SET_ITEM(__pyx_t_14, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_INCREF(__pyx_int_189957110);
    __Pyx_GIVEREF(__pyx_int_189957110);
    PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_int_189957110);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    PyTuple_SET_ITEM(__pyx_t_14, 2, __pyx_v_state);
    __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_GIVEREF(__pyx_t_12);
    PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_12);
    __Pyx_GIVEREF(__pyx_t_14);
    PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_14);
    __pyx_t_12 = 0;
    __pyx_t_14 = 0;
    __pyx_r = __pyx_t_13;
    __pyx_t_13 = 0;
    goto __pyx_L0;
  }

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_AddTraceback("_element_graph.ElementGraph.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v__dict);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_ElementGraph, (type(self), 0xb5283f6, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_ElementGraph__set_state(self, __pyx_state)
 */

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_45__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyObject *__pyx_pw_14_element_graph_12ElementGraph_45__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_12ElementGraph_44__setstate_cython__(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

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

  /* "(tree fragment)":17
 *         return __pyx_unpickle_ElementGraph, (type(self), 0xb5283f6, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_ElementGraph__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
 */
  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
  __pyx_t_1 = __pyx_f_14_element_graph___pyx_unpickle_ElementGraph__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_ElementGraph, (type(self), 0xb5283f6, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_ElementGraph__set_state(self, __pyx_state)
 */

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

/* "_element_graph.pyx":890
 *     cdef public np.ndarray frag_len, source_weights, member_weights, all
 *     cdef public bint complete, s_tag, e_tag, empty, is_spliced, has_gaps
 *     def __init__(self, int index, np.ndarray source_weights, np.ndarray member_weights, char strand, np.ndarray membership, np.ndarray overlap, np.ndarray frag_len, int maxIC):             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t i
 *         cdef char m, overOut, overIn
 */

/* Python wrapper */
static int __pyx_pw_14_element_graph_7Element_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_14_element_graph_7Element_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_index;
  PyArrayObject *__pyx_v_source_weights = 0;
  PyArrayObject *__pyx_v_member_weights = 0;
  char __pyx_v_strand;
  PyArrayObject *__pyx_v_membership = 0;
  PyArrayObject *__pyx_v_overlap = 0;
  PyArrayObject *__pyx_v_frag_len = 0;
  int __pyx_v_maxIC;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_source_weights,&__pyx_n_s_member_weights,&__pyx_n_s_strand,&__pyx_n_s_membership,&__pyx_n_s_overlap,&__pyx_n_s_frag_len,&__pyx_n_s_maxIC,0};
    PyObject* values[8] = {0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_source_weights)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 8, 8, 1); __PYX_ERR(0, 890, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_member_weights)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 8, 8, 2); __PYX_ERR(0, 890, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_strand)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 8, 8, 3); __PYX_ERR(0, 890, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_membership)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 8, 8, 4); __PYX_ERR(0, 890, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_overlap)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 8, 8, 5); __PYX_ERR(0, 890, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_frag_len)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 8, 8, 6); __PYX_ERR(0, 890, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_maxIC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 8, 8, 7); __PYX_ERR(0, 890, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 890, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 8) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
    }
    __pyx_v_index = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_index == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 890, __pyx_L3_error)
    __pyx_v_source_weights = ((PyArrayObject *)values[1]);
    __pyx_v_member_weights = ((PyArrayObject *)values[2]);
    __pyx_v_strand = __Pyx_PyInt_As_char(values[3]); if (unlikely((__pyx_v_strand == (char)-1) && PyErr_Occurred())) __PYX_ERR(0, 890, __pyx_L3_error)
    __pyx_v_membership = ((PyArrayObject *)values[4]);
    __pyx_v_overlap = ((PyArrayObject *)values[5]);
    __pyx_v_frag_len = ((PyArrayObject *)values[6]);
    __pyx_v_maxIC = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_maxIC == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 890, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 890, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("_element_graph.Element.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_source_weights), __pyx_ptype_5numpy_ndarray, 1, "source_weights", 0))) __PYX_ERR(0, 890, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_member_weights), __pyx_ptype_5numpy_ndarray, 1, "member_weights", 0))) __PYX_ERR(0, 890, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_membership), __pyx_ptype_5numpy_ndarray, 1, "membership", 0))) __PYX_ERR(0, 890, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_overlap), __pyx_ptype_5numpy_ndarray, 1, "overlap", 0))) __PYX_ERR(0, 890, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_frag_len), __pyx_ptype_5numpy_ndarray, 1, "frag_len", 0))) __PYX_ERR(0, 890, __pyx_L1_error)
  __pyx_r = __pyx_pf_14_element_graph_7Element___init__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self), __pyx_v_index, __pyx_v_source_weights, __pyx_v_member_weights, __pyx_v_strand, __pyx_v_membership, __pyx_v_overlap, __pyx_v_frag_len, __pyx_v_maxIC);

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

static int __pyx_pf_14_element_graph_7Element___init__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, int __pyx_v_index, PyArrayObject *__pyx_v_source_weights, PyArrayObject *__pyx_v_member_weights, char __pyx_v_strand, PyArrayObject *__pyx_v_membership, PyArrayObject *__pyx_v_overlap, PyArrayObject *__pyx_v_frag_len, int __pyx_v_maxIC) {
  Py_ssize_t __pyx_v_i;
  char __pyx_v_m;
  char __pyx_v_overOut;
  char __pyx_v_overIn;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  char __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "_element_graph.pyx":893
 *         cdef Py_ssize_t i
 *         cdef char m, overOut, overIn
 *         self.is_spliced = False                       # Default: the path has no discontinuities             # <<<<<<<<<<<<<<
 *         self.index = self.left = self.right = index   # Initialize left, right, and index
 *         self.number_of_elements = overlap.shape[0]    # Total number of nodes in the graph
 */
  __pyx_v_self->is_spliced = 0;

  /* "_element_graph.pyx":894
 *         cdef char m, overOut, overIn
 *         self.is_spliced = False                       # Default: the path has no discontinuities
 *         self.index = self.left = self.right = index   # Initialize left, right, and index             # <<<<<<<<<<<<<<
 *         self.number_of_elements = overlap.shape[0]    # Total number of nodes in the graph
 *         self.frag_len = frag_len                      # Length of the fragment is provided
 */
  __pyx_v_self->index = __pyx_v_index;
  __pyx_v_self->left = __pyx_v_index;
  __pyx_v_self->right = __pyx_v_index;

  /* "_element_graph.pyx":895
 *         self.is_spliced = False                       # Default: the path has no discontinuities
 *         self.index = self.left = self.right = index   # Initialize left, right, and index
 *         self.number_of_elements = overlap.shape[0]    # Total number of nodes in the graph             # <<<<<<<<<<<<<<
 *         self.frag_len = frag_len                      # Length of the fragment is provided
 *         self.number_of_members = frag_len.shape[0]-4
 */
  __pyx_v_self->number_of_elements = (__pyx_v_overlap->dimensions[0]);

  /* "_element_graph.pyx":896
 *         self.index = self.left = self.right = index   # Initialize left, right, and index
 *         self.number_of_elements = overlap.shape[0]    # Total number of nodes in the graph
 *         self.frag_len = frag_len                      # Length of the fragment is provided             # <<<<<<<<<<<<<<
 *         self.number_of_members = frag_len.shape[0]-4
 *         self.includes = set([self.index])             # Which Elements are part of this Element
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_frag_len));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_frag_len));
  __Pyx_GOTREF(__pyx_v_self->frag_len);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->frag_len));
  __pyx_v_self->frag_len = __pyx_v_frag_len;

  /* "_element_graph.pyx":897
 *         self.number_of_elements = overlap.shape[0]    # Total number of nodes in the graph
 *         self.frag_len = frag_len                      # Length of the fragment is provided
 *         self.number_of_members = frag_len.shape[0]-4             # <<<<<<<<<<<<<<
 *         self.includes = set([self.index])             # Which Elements are part of this Element
 *         self.excludes = set()                         # Which Elements are incompatible with this Element
 */
  __pyx_v_self->number_of_members = ((__pyx_v_frag_len->dimensions[0]) - 4);

  /* "_element_graph.pyx":898
 *         self.frag_len = frag_len                      # Length of the fragment is provided
 *         self.number_of_members = frag_len.shape[0]-4
 *         self.includes = set([self.index])             # Which Elements are part of this Element             # <<<<<<<<<<<<<<
 *         self.excludes = set()                         # Which Elements are incompatible with this Element
 *         self.source_weights = np.copy(source_weights) # Array of read coverage per Source
 */
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 898, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PySet_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 898, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PySet_Add(__pyx_t_2, __pyx_t_1) < 0) __PYX_ERR(0, 898, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->includes);
  __Pyx_DECREF(__pyx_v_self->includes);
  __pyx_v_self->includes = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "_element_graph.pyx":899
 *         self.number_of_members = frag_len.shape[0]-4
 *         self.includes = set([self.index])             # Which Elements are part of this Element
 *         self.excludes = set()                         # Which Elements are incompatible with this Element             # <<<<<<<<<<<<<<
 *         self.source_weights = np.copy(source_weights) # Array of read coverage per Source
 *         self.member_weights = np.copy(member_weights) # Array of read coverage of all members
 */
  __pyx_t_2 = PySet_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 899, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->excludes);
  __Pyx_DECREF(__pyx_v_self->excludes);
  __pyx_v_self->excludes = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "_element_graph.pyx":900
 *         self.includes = set([self.index])             # Which Elements are part of this Element
 *         self.excludes = set()                         # Which Elements are incompatible with this Element
 *         self.source_weights = np.copy(source_weights) # Array of read coverage per Source             # <<<<<<<<<<<<<<
 *         self.member_weights = np.copy(member_weights) # Array of read coverage of all members
 *         self.strand = strand                          # +1, -1, or 0 to indicate strand of path
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 900, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 900, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, ((PyObject *)__pyx_v_source_weights)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_source_weights));
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 900, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 900, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->source_weights);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->source_weights));
  __pyx_v_self->source_weights = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "_element_graph.pyx":901
 *         self.excludes = set()                         # Which Elements are incompatible with this Element
 *         self.source_weights = np.copy(source_weights) # Array of read coverage per Source
 *         self.member_weights = np.copy(member_weights) # Array of read coverage of all members             # <<<<<<<<<<<<<<
 *         self.strand = strand                          # +1, -1, or 0 to indicate strand of path
 *         self.length = 0                               # Number of nucleotides in the path
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 901, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_copy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 901, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, ((PyObject *)__pyx_v_member_weights)) : __Pyx_PyObject_CallOneArg(__pyx_t_1, ((PyObject *)__pyx_v_member_weights));
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 901, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 901, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->member_weights);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->member_weights));
  __pyx_v_self->member_weights = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "_element_graph.pyx":902
 *         self.source_weights = np.copy(source_weights) # Array of read coverage per Source
 *         self.member_weights = np.copy(member_weights) # Array of read coverage of all members
 *         self.strand = strand                          # +1, -1, or 0 to indicate strand of path             # <<<<<<<<<<<<<<
 *         self.length = 0                               # Number of nucleotides in the path
 *         self.complete = False                         # Represents an entire end-to-end transcript
 */
  __pyx_v_self->strand = __pyx_v_strand;

  /* "_element_graph.pyx":903
 *         self.member_weights = np.copy(member_weights) # Array of read coverage of all members
 *         self.strand = strand                          # +1, -1, or 0 to indicate strand of path
 *         self.length = 0                               # Number of nucleotides in the path             # <<<<<<<<<<<<<<
 *         self.complete = False                         # Represents an entire end-to-end transcript
 *         self.has_gaps = False                         # Is missing information
 */
  __pyx_v_self->length = 0;

  /* "_element_graph.pyx":904
 *         self.strand = strand                          # +1, -1, or 0 to indicate strand of path
 *         self.length = 0                               # Number of nucleotides in the path
 *         self.complete = False                         # Represents an entire end-to-end transcript             # <<<<<<<<<<<<<<
 *         self.has_gaps = False                         # Is missing information
 *         self.assigned_to = set()                      # Set of Path indices this Element is a part of
 */
  __pyx_v_self->complete = 0;

  /* "_element_graph.pyx":905
 *         self.length = 0                               # Number of nucleotides in the path
 *         self.complete = False                         # Represents an entire end-to-end transcript
 *         self.has_gaps = False                         # Is missing information             # <<<<<<<<<<<<<<
 *         self.assigned_to = set()                      # Set of Path indices this Element is a part of
 *         self.members = set()                          # Set of Member indices contained in this Element
 */
  __pyx_v_self->has_gaps = 0;

  /* "_element_graph.pyx":906
 *         self.complete = False                         # Represents an entire end-to-end transcript
 *         self.has_gaps = False                         # Is missing information
 *         self.assigned_to = set()                      # Set of Path indices this Element is a part of             # <<<<<<<<<<<<<<
 *         self.members = set()                          # Set of Member indices contained in this Element
 *         self.nonmembers = set()                       # Set of Members indices incompatible with this Element
 */
  __pyx_t_2 = PySet_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 906, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->assigned_to);
  __Pyx_DECREF(__pyx_v_self->assigned_to);
  __pyx_v_self->assigned_to = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "_element_graph.pyx":907
 *         self.has_gaps = False                         # Is missing information
 *         self.assigned_to = set()                      # Set of Path indices this Element is a part of
 *         self.members = set()                          # Set of Member indices contained in this Element             # <<<<<<<<<<<<<<
 *         self.nonmembers = set()                       # Set of Members indices incompatible with this Element
 *         self.ingroup = set()                          # Set of compatible upstream Elements
 */
  __pyx_t_2 = PySet_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 907, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->members);
  __Pyx_DECREF(__pyx_v_self->members);
  __pyx_v_self->members = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "_element_graph.pyx":908
 *         self.assigned_to = set()                      # Set of Path indices this Element is a part of
 *         self.members = set()                          # Set of Member indices contained in this Element
 *         self.nonmembers = set()                       # Set of Members indices incompatible with this Element             # <<<<<<<<<<<<<<
 *         self.ingroup = set()                          # Set of compatible upstream Elements
 *         self.outgroup = set()                         # Set of Compatible downstream Elements
 */
  __pyx_t_2 = PySet_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 908, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->nonmembers);
  __Pyx_DECREF(__pyx_v_self->nonmembers);
  __pyx_v_self->nonmembers = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "_element_graph.pyx":909
 *         self.members = set()                          # Set of Member indices contained in this Element
 *         self.nonmembers = set()                       # Set of Members indices incompatible with this Element
 *         self.ingroup = set()                          # Set of compatible upstream Elements             # <<<<<<<<<<<<<<
 *         self.outgroup = set()                         # Set of Compatible downstream Elements
 *         self.contains = set()
 */
  __pyx_t_2 = PySet_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 909, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->ingroup);
  __Pyx_DECREF(__pyx_v_self->ingroup);
  __pyx_v_self->ingroup = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "_element_graph.pyx":910
 *         self.nonmembers = set()                       # Set of Members indices incompatible with this Element
 *         self.ingroup = set()                          # Set of compatible upstream Elements
 *         self.outgroup = set()                         # Set of Compatible downstream Elements             # <<<<<<<<<<<<<<
 *         self.contains = set()
 *         self.contained = set()
 */
  __pyx_t_2 = PySet_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 910, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->outgroup);
  __Pyx_DECREF(__pyx_v_self->outgroup);
  __pyx_v_self->outgroup = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "_element_graph.pyx":911
 *         self.ingroup = set()                          # Set of compatible upstream Elements
 *         self.outgroup = set()                         # Set of Compatible downstream Elements
 *         self.contains = set()             # <<<<<<<<<<<<<<
 *         self.contained = set()
 *         self.trimmed_bases = 0
 */
  __pyx_t_2 = PySet_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 911, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->contains);
  __Pyx_DECREF(__pyx_v_self->contains);
  __pyx_v_self->contains = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "_element_graph.pyx":912
 *         self.outgroup = set()                         # Set of Compatible downstream Elements
 *         self.contains = set()
 *         self.contained = set()             # <<<<<<<<<<<<<<
 *         self.trimmed_bases = 0
 *         self.all = np.ones(shape=self.source_weights.shape[0], dtype=np.float32)
 */
  __pyx_t_2 = PySet_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 912, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->contained);
  __Pyx_DECREF(__pyx_v_self->contained);
  __pyx_v_self->contained = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "_element_graph.pyx":913
 *         self.contains = set()
 *         self.contained = set()
 *         self.trimmed_bases = 0             # <<<<<<<<<<<<<<
 *         self.all = np.ones(shape=self.source_weights.shape[0], dtype=np.float32)
 *         if index == -1:                               # Special Element emptyPath: placeholder for null values
 */
  __pyx_v_self->trimmed_bases = 0.0;

  /* "_element_graph.pyx":914
 *         self.contained = set()
 *         self.trimmed_bases = 0
 *         self.all = np.ones(shape=self.source_weights.shape[0], dtype=np.float32)             # <<<<<<<<<<<<<<
 *         if index == -1:                               # Special Element emptyPath: placeholder for null values
 *             self.empty = True
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 914, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ones); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 914, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 914, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_self->source_weights->dimensions[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 914, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_shape, __pyx_t_3) < 0) __PYX_ERR(0, 914, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 914, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_float32); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 914, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 914, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 914, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 914, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_4);
  __Pyx_GOTREF(__pyx_v_self->all);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->all));
  __pyx_v_self->all = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "_element_graph.pyx":915
 *         self.trimmed_bases = 0
 *         self.all = np.ones(shape=self.source_weights.shape[0], dtype=np.float32)
 *         if index == -1:                               # Special Element emptyPath: placeholder for null values             # <<<<<<<<<<<<<<
 *             self.empty = True
 *             self.maxIC = 0
 */
  __pyx_t_5 = ((__pyx_v_index == -1L) != 0);
  if (__pyx_t_5) {

    /* "_element_graph.pyx":916
 *         self.all = np.ones(shape=self.source_weights.shape[0], dtype=np.float32)
 *         if index == -1:                               # Special Element emptyPath: placeholder for null values
 *             self.empty = True             # <<<<<<<<<<<<<<
 *             self.maxIC = 0
 *             self.end_indices = set()
 */
    __pyx_v_self->empty = 1;

    /* "_element_graph.pyx":917
 *         if index == -1:                               # Special Element emptyPath: placeholder for null values
 *             self.empty = True
 *             self.maxIC = 0             # <<<<<<<<<<<<<<
 *             self.end_indices = set()
 *         else:
 */
    __pyx_v_self->maxIC = 0;

    /* "_element_graph.pyx":918
 *             self.empty = True
 *             self.maxIC = 0
 *             self.end_indices = set()             # <<<<<<<<<<<<<<
 *         else:
 *             self.empty = False
 */
    __pyx_t_4 = PySet_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 918, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __Pyx_GOTREF(__pyx_v_self->end_indices);
    __Pyx_DECREF(__pyx_v_self->end_indices);
    __pyx_v_self->end_indices = ((PyObject*)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "_element_graph.pyx":915
 *         self.trimmed_bases = 0
 *         self.all = np.ones(shape=self.source_weights.shape[0], dtype=np.float32)
 *         if index == -1:                               # Special Element emptyPath: placeholder for null values             # <<<<<<<<<<<<<<
 *             self.empty = True
 *             self.maxIC = 0
 */
    goto __pyx_L3;
  }

  /* "_element_graph.pyx":920
 *             self.end_indices = set()
 *         else:
 *             self.empty = False             # <<<<<<<<<<<<<<
 *             self.maxIC = maxIC
 *             self.end_indices = set(range(self.maxIC-4, self.maxIC))
 */
  /*else*/ {
    __pyx_v_self->empty = 0;

    /* "_element_graph.pyx":921
 *         else:
 *             self.empty = False
 *             self.maxIC = maxIC             # <<<<<<<<<<<<<<
 *             self.end_indices = set(range(self.maxIC-4, self.maxIC))
 *             for i in range(self.maxIC):
 */
    __pyx_v_self->maxIC = __pyx_v_maxIC;

    /* "_element_graph.pyx":922
 *             self.empty = False
 *             self.maxIC = maxIC
 *             self.end_indices = set(range(self.maxIC-4, self.maxIC))             # <<<<<<<<<<<<<<
 *             for i in range(self.maxIC):
 *                 m = membership[i]
 */
    __pyx_t_4 = __Pyx_PyInt_From_long((__pyx_v_self->maxIC - 4)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 922, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->maxIC); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 922, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 922, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
    __pyx_t_4 = 0;
    __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 922, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PySet_New(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 922, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GIVEREF(__pyx_t_1);
    __Pyx_GOTREF(__pyx_v_self->end_indices);
    __Pyx_DECREF(__pyx_v_self->end_indices);
    __pyx_v_self->end_indices = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "_element_graph.pyx":923
 *             self.maxIC = maxIC
 *             self.end_indices = set(range(self.maxIC-4, self.maxIC))
 *             for i in range(self.maxIC):             # <<<<<<<<<<<<<<
 *                 m = membership[i]
 *                 if m == 1:
 */
    __pyx_t_6 = __pyx_v_self->maxIC;
    __pyx_t_7 = __pyx_t_6;
    for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
      __pyx_v_i = __pyx_t_8;

      /* "_element_graph.pyx":924
 *             self.end_indices = set(range(self.maxIC-4, self.maxIC))
 *             for i in range(self.maxIC):
 *                 m = membership[i]             # <<<<<<<<<<<<<<
 *                 if m == 1:
 *                     self.members.add(i)
 */
      __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_membership), __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 924, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_9 = __Pyx_PyInt_As_char(__pyx_t_1); if (unlikely((__pyx_t_9 == (char)-1) && PyErr_Occurred())) __PYX_ERR(0, 924, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_m = __pyx_t_9;

      /* "_element_graph.pyx":925
 *             for i in range(self.maxIC):
 *                 m = membership[i]
 *                 if m == 1:             # <<<<<<<<<<<<<<
 *                     self.members.add(i)
 *                     self.length += self.frag_len[i]
 */
      switch (__pyx_v_m) {
        case 1:

        /* "_element_graph.pyx":926
 *                 m = membership[i]
 *                 if m == 1:
 *                     self.members.add(i)             # <<<<<<<<<<<<<<
 *                     self.length += self.frag_len[i]
 *                 elif m == -1:
 */
        if (unlikely(__pyx_v_self->members == Py_None)) {
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add");
          __PYX_ERR(0, 926, __pyx_L1_error)
        }
        __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 926, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_10 = PySet_Add(__pyx_v_self->members, __pyx_t_1); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 926, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "_element_graph.pyx":927
 *                 if m == 1:
 *                     self.members.add(i)
 *                     self.length += self.frag_len[i]             # <<<<<<<<<<<<<<
 *                 elif m == -1:
 *                     self.nonmembers.add(i)
 */
        __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 927, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->frag_len), __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 927, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 927, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 927, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_self->length = __pyx_t_11;

        /* "_element_graph.pyx":925
 *             for i in range(self.maxIC):
 *                 m = membership[i]
 *                 if m == 1:             # <<<<<<<<<<<<<<
 *                     self.members.add(i)
 *                     self.length += self.frag_len[i]
 */
        break;
        case -1L:

        /* "_element_graph.pyx":929
 *                     self.length += self.frag_len[i]
 *                 elif m == -1:
 *                     self.nonmembers.add(i)             # <<<<<<<<<<<<<<
 *                 else:
 *                     continue
 */
        if (unlikely(__pyx_v_self->nonmembers == Py_None)) {
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add");
          __PYX_ERR(0, 929, __pyx_L1_error)
        }
        __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 929, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_10 = PySet_Add(__pyx_v_self->nonmembers, __pyx_t_4); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 929, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "_element_graph.pyx":928
 *                     self.members.add(i)
 *                     self.length += self.frag_len[i]
 *                 elif m == -1:             # <<<<<<<<<<<<<<
 *                     self.nonmembers.add(i)
 *                 else:
 */
        break;
        default:

        /* "_element_graph.pyx":931
 *                     self.nonmembers.add(i)
 *                 else:
 *                     continue             # <<<<<<<<<<<<<<
 * 
 *             for i in range(self.number_of_elements):
 */
        goto __pyx_L4_continue;
        break;
      }
      __pyx_L4_continue:;
    }

    /* "_element_graph.pyx":933
 *                     continue
 * 
 *             for i in range(self.number_of_elements):             # <<<<<<<<<<<<<<
 *                 if i == self.index:
 *                     continue
 */
    __pyx_t_6 = __pyx_v_self->number_of_elements;
    __pyx_t_7 = __pyx_t_6;
    for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
      __pyx_v_i = __pyx_t_8;

      /* "_element_graph.pyx":934
 * 
 *             for i in range(self.number_of_elements):
 *                 if i == self.index:             # <<<<<<<<<<<<<<
 *                     continue
 * 
 */
      __pyx_t_5 = ((__pyx_v_i == __pyx_v_self->index) != 0);
      if (__pyx_t_5) {

        /* "_element_graph.pyx":935
 *             for i in range(self.number_of_elements):
 *                 if i == self.index:
 *                     continue             # <<<<<<<<<<<<<<
 * 
 *                 overOut = overlap[self.index, i]
 */
        goto __pyx_L6_continue;

        /* "_element_graph.pyx":934
 * 
 *             for i in range(self.number_of_elements):
 *                 if i == self.index:             # <<<<<<<<<<<<<<
 *                     continue
 * 
 */
      }

      /* "_element_graph.pyx":937
 *                     continue
 * 
 *                 overOut = overlap[self.index, i]             # <<<<<<<<<<<<<<
 *                 if overOut == -1:
 *                     self.excludes.add(i)
 */
      __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->index); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 937, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 937, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 937, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
      __pyx_t_4 = 0;
      __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_overlap), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 937, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_9 = __Pyx_PyInt_As_char(__pyx_t_2); if (unlikely((__pyx_t_9 == (char)-1) && PyErr_Occurred())) __PYX_ERR(0, 937, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_overOut = __pyx_t_9;

      /* "_element_graph.pyx":938
 * 
 *                 overOut = overlap[self.index, i]
 *                 if overOut == -1:             # <<<<<<<<<<<<<<
 *                     self.excludes.add(i)
 *                     continue
 */
      __pyx_t_5 = ((__pyx_v_overOut == -1L) != 0);
      if (__pyx_t_5) {

        /* "_element_graph.pyx":939
 *                 overOut = overlap[self.index, i]
 *                 if overOut == -1:
 *                     self.excludes.add(i)             # <<<<<<<<<<<<<<
 *                     continue
 *                 elif overOut >= 1:
 */
        if (unlikely(__pyx_v_self->excludes == Py_None)) {
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add");
          __PYX_ERR(0, 939, __pyx_L1_error)
        }
        __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 939, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_10 = PySet_Add(__pyx_v_self->excludes, __pyx_t_2); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 939, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "_element_graph.pyx":940
 *                 if overOut == -1:
 *                     self.excludes.add(i)
 *                     continue             # <<<<<<<<<<<<<<
 *                 elif overOut >= 1:
 *                     self.outgroup.add(i)
 */
        goto __pyx_L6_continue;

        /* "_element_graph.pyx":938
 * 
 *                 overOut = overlap[self.index, i]
 *                 if overOut == -1:             # <<<<<<<<<<<<<<
 *                     self.excludes.add(i)
 *                     continue
 */
      }

      /* "_element_graph.pyx":941
 *                     self.excludes.add(i)
 *                     continue
 *                 elif overOut >= 1:             # <<<<<<<<<<<<<<
 *                     self.outgroup.add(i)
 *                     if overOut == 2:
 */
      __pyx_t_5 = ((__pyx_v_overOut >= 1) != 0);
      if (__pyx_t_5) {

        /* "_element_graph.pyx":942
 *                     continue
 *                 elif overOut >= 1:
 *                     self.outgroup.add(i)             # <<<<<<<<<<<<<<
 *                     if overOut == 2:
 *                         self.contained.add(i)
 */
        if (unlikely(__pyx_v_self->outgroup == Py_None)) {
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add");
          __PYX_ERR(0, 942, __pyx_L1_error)
        }
        __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 942, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_10 = PySet_Add(__pyx_v_self->outgroup, __pyx_t_2); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 942, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "_element_graph.pyx":943
 *                 elif overOut >= 1:
 *                     self.outgroup.add(i)
 *                     if overOut == 2:             # <<<<<<<<<<<<<<
 *                         self.contained.add(i)
 * 
 */
        __pyx_t_5 = ((__pyx_v_overOut == 2) != 0);
        if (__pyx_t_5) {

          /* "_element_graph.pyx":944
 *                     self.outgroup.add(i)
 *                     if overOut == 2:
 *                         self.contained.add(i)             # <<<<<<<<<<<<<<
 * 
 *                 overIn = overlap[i, self.index]
 */
          if (unlikely(__pyx_v_self->contained == Py_None)) {
            PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add");
            __PYX_ERR(0, 944, __pyx_L1_error)
          }
          __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 944, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_10 = PySet_Add(__pyx_v_self->contained, __pyx_t_2); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 944, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

          /* "_element_graph.pyx":943
 *                 elif overOut >= 1:
 *                     self.outgroup.add(i)
 *                     if overOut == 2:             # <<<<<<<<<<<<<<
 *                         self.contained.add(i)
 * 
 */
        }

        /* "_element_graph.pyx":941
 *                     self.excludes.add(i)
 *                     continue
 *                 elif overOut >= 1:             # <<<<<<<<<<<<<<
 *                     self.outgroup.add(i)
 *                     if overOut == 2:
 */
      }

      /* "_element_graph.pyx":946
 *                         self.contained.add(i)
 * 
 *                 overIn = overlap[i, self.index]             # <<<<<<<<<<<<<<
 *                 if overIn >= 1:
 *                     self.ingroup.add(i)
 */
      __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 946, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 946, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 946, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
      __pyx_t_2 = 0;
      __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_overlap), __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 946, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_9 = __Pyx_PyInt_As_char(__pyx_t_1); if (unlikely((__pyx_t_9 == (char)-1) && PyErr_Occurred())) __PYX_ERR(0, 946, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_overIn = __pyx_t_9;

      /* "_element_graph.pyx":947
 * 
 *                 overIn = overlap[i, self.index]
 *                 if overIn >= 1:             # <<<<<<<<<<<<<<
 *                     self.ingroup.add(i)
 *                     if overIn == 2:
 */
      __pyx_t_5 = ((__pyx_v_overIn >= 1) != 0);
      if (__pyx_t_5) {

        /* "_element_graph.pyx":948
 *                 overIn = overlap[i, self.index]
 *                 if overIn >= 1:
 *                     self.ingroup.add(i)             # <<<<<<<<<<<<<<
 *                     if overIn == 2:
 *                         self.contains.add(i)
 */
        if (unlikely(__pyx_v_self->ingroup == Py_None)) {
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add");
          __PYX_ERR(0, 948, __pyx_L1_error)
        }
        __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 948, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_10 = PySet_Add(__pyx_v_self->ingroup, __pyx_t_1); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 948, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "_element_graph.pyx":949
 *                 if overIn >= 1:
 *                     self.ingroup.add(i)
 *                     if overIn == 2:             # <<<<<<<<<<<<<<
 *                         self.contains.add(i)
 * 
 */
        __pyx_t_5 = ((__pyx_v_overIn == 2) != 0);
        if (__pyx_t_5) {

          /* "_element_graph.pyx":950
 *                     self.ingroup.add(i)
 *                     if overIn == 2:
 *                         self.contains.add(i)             # <<<<<<<<<<<<<<
 * 
 *             self.update()
 */
          if (unlikely(__pyx_v_self->contains == Py_None)) {
            PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add");
            __PYX_ERR(0, 950, __pyx_L1_error)
          }
          __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 950, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_10 = PySet_Add(__pyx_v_self->contains, __pyx_t_1); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 950, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

          /* "_element_graph.pyx":949
 *                 if overIn >= 1:
 *                     self.ingroup.add(i)
 *                     if overIn == 2:             # <<<<<<<<<<<<<<
 *                         self.contains.add(i)
 * 
 */
        }

        /* "_element_graph.pyx":947
 * 
 *                 overIn = overlap[i, self.index]
 *                 if overIn >= 1:             # <<<<<<<<<<<<<<
 *                     self.ingroup.add(i)
 *                     if overIn == 2:
 */
      }
      __pyx_L6_continue:;
    }

    /* "_element_graph.pyx":952
 *                         self.contains.add(i)
 * 
 *             self.update()             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
    ((struct __pyx_vtabstruct_14_element_graph_Element *)__pyx_v_self->__pyx_vtab)->update(__pyx_v_self, 0);
  }
  __pyx_L3:;

  /* "_element_graph.pyx":890
 *     cdef public np.ndarray frag_len, source_weights, member_weights, all
 *     cdef public bint complete, s_tag, e_tag, empty, is_spliced, has_gaps
 *     def __init__(self, int index, np.ndarray source_weights, np.ndarray member_weights, char strand, np.ndarray membership, np.ndarray overlap, np.ndarray frag_len, int maxIC):             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t i
 *         cdef char m, overOut, overIn
 */

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

/* "_element_graph.pyx":954
 *             self.update()
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         chars = [' ']*self.maxIC
 *         strand = {-1:'-', 0:'.', 1:'+'}[self.strand]
 */

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_7Element_3__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14_element_graph_7Element_3__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_2__repr__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self));

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

static PyObject *__pyx_pf_14_element_graph_7Element_2__repr__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self) {
  PyObject *__pyx_v_chars = NULL;
  PyObject *__pyx_v_strand = NULL;
  PyObject *__pyx_v_m = NULL;
  PyObject *__pyx_v_n = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "_element_graph.pyx":955
 * 
 *     def __repr__(self):
 *         chars = [' ']*self.maxIC             # <<<<<<<<<<<<<<
 *         strand = {-1:'-', 0:'.', 1:'+'}[self.strand]
 *         for m in self.members:
 */
  __pyx_t_1 = PyList_New(1 * ((__pyx_v_self->maxIC<0) ? 0:__pyx_v_self->maxIC)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 955, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  { Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < __pyx_v_self->maxIC; __pyx_temp++) {
      __Pyx_INCREF(__pyx_kp_u__6);
      __Pyx_GIVEREF(__pyx_kp_u__6);
      PyList_SET_ITEM(__pyx_t_1, __pyx_temp, __pyx_kp_u__6);
    }
  }
  __pyx_v_chars = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "_element_graph.pyx":956
 *     def __repr__(self):
 *         chars = [' ']*self.maxIC
 *         strand = {-1:'-', 0:'.', 1:'+'}[self.strand]             # <<<<<<<<<<<<<<
 *         for m in self.members:
 *             chars[m] = '*'
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 956, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_int_neg_1, __pyx_kp_u__7) < 0) __PYX_ERR(0, 956, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_int_0, __pyx_kp_u__8) < 0) __PYX_ERR(0, 956, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_int_1, __pyx_kp_u__9) < 0) __PYX_ERR(0, 956, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyInt_From_char(__pyx_v_self->strand); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 956, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 956, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_strand = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "_element_graph.pyx":957
 *         chars = [' ']*self.maxIC
 *         strand = {-1:'-', 0:'.', 1:'+'}[self.strand]
 *         for m in self.members:             # <<<<<<<<<<<<<<
 *             chars[m] = '*'
 * 
 */
  __pyx_t_4 = 0;
  __pyx_t_2 = __Pyx_set_iterator(__pyx_v_self->members, 1, (&__pyx_t_5), (&__pyx_t_6)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 957, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __pyx_t_3 = __pyx_t_2;
  __pyx_t_2 = 0;
  while (1) {
    __pyx_t_7 = __Pyx_set_iter_next(__pyx_t_3, __pyx_t_5, &__pyx_t_4, &__pyx_t_2, __pyx_t_6);
    if (unlikely(__pyx_t_7 == 0)) break;
    if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 957, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF_SET(__pyx_v_m, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "_element_graph.pyx":958
 *         strand = {-1:'-', 0:'.', 1:'+'}[self.strand]
 *         for m in self.members:
 *             chars[m] = '*'             # <<<<<<<<<<<<<<
 * 
 *         for n in self.nonmembers:
 */
    if (unlikely(PyObject_SetItem(__pyx_v_chars, __pyx_v_m, __pyx_kp_u__10) < 0)) __PYX_ERR(0, 958, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "_element_graph.pyx":960
 *             chars[m] = '*'
 * 
 *         for n in self.nonmembers:             # <<<<<<<<<<<<<<
 *             chars[n] = '_'
 * 
 */
  __pyx_t_5 = 0;
  __pyx_t_2 = __Pyx_set_iterator(__pyx_v_self->nonmembers, 1, (&__pyx_t_4), (&__pyx_t_6)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 960, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __pyx_t_3 = __pyx_t_2;
  __pyx_t_2 = 0;
  while (1) {
    __pyx_t_7 = __Pyx_set_iter_next(__pyx_t_3, __pyx_t_4, &__pyx_t_5, &__pyx_t_2, __pyx_t_6);
    if (unlikely(__pyx_t_7 == 0)) break;
    if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 960, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "_element_graph.pyx":961
 * 
 *         for n in self.nonmembers:
 *             chars[n] = '_'             # <<<<<<<<<<<<<<
 * 
 *         return '|{}| {}-{} ({})'.format(''.join(chars),self.left,self.right,strand)
 */
    if (unlikely(PyObject_SetItem(__pyx_v_chars, __pyx_v_n, __pyx_n_u__3) < 0)) __PYX_ERR(0, 961, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "_element_graph.pyx":963
 *             chars[n] = '_'
 * 
 *         return '|{}| {}-{} ({})'.format(''.join(chars),self.left,self.right,strand)             # <<<<<<<<<<<<<<
 * 
 *     cdef str span_to_string(self, (int, int) span):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u__11, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 963, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyUnicode_Join(__pyx_kp_u__12, __pyx_v_chars); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 963, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_self->left); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 963, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_self->right); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 963, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_10)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_10);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[5] = {__pyx_t_10, __pyx_t_1, __pyx_t_8, __pyx_t_9, __pyx_v_strand};
    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 4+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 963, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[5] = {__pyx_t_10, __pyx_t_1, __pyx_t_8, __pyx_t_9, __pyx_v_strand};
    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 4+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 963, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  } else
  #endif
  {
    __pyx_t_11 = PyTuple_New(4+__pyx_t_6); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 963, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    if (__pyx_t_10) {
      __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); __pyx_t_10 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_6, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_6, __pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_9);
    PyTuple_SET_ITEM(__pyx_t_11, 2+__pyx_t_6, __pyx_t_9);
    __Pyx_INCREF(__pyx_v_strand);
    __Pyx_GIVEREF(__pyx_v_strand);
    PyTuple_SET_ITEM(__pyx_t_11, 3+__pyx_t_6, __pyx_v_strand);
    __pyx_t_1 = 0;
    __pyx_t_8 = 0;
    __pyx_t_9 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 963, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "_element_graph.pyx":954
 *             self.update()
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         chars = [' ']*self.maxIC
 *         strand = {-1:'-', 0:'.', 1:'+'}[self.strand]
 */

  /* 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_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("_element_graph.Element.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_chars);
  __Pyx_XDECREF(__pyx_v_strand);
  __Pyx_XDECREF(__pyx_v_m);
  __Pyx_XDECREF(__pyx_v_n);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_element_graph.pyx":965
 *         return '|{}| {}-{} ({})'.format(''.join(chars),self.left,self.right,strand)
 * 
 *     cdef str span_to_string(self, (int, int) span):             # <<<<<<<<<<<<<<
 *         """Converts a tuple of two ints to a string connected by ':'"""
 *         return '{}:{}'.format(span[0], span[1])
 */

static PyObject *__pyx_f_14_element_graph_7Element_span_to_string(CYTHON_UNUSED struct __pyx_obj_14_element_graph_Element *__pyx_v_self, __pyx_ctuple_int__and_int __pyx_v_span) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("span_to_string", 0);

  /* "_element_graph.pyx":967
 *     cdef str span_to_string(self, (int, int) span):
 *         """Converts a tuple of two ints to a string connected by ':'"""
 *         return '{}:{}'.format(span[0], span[1])             # <<<<<<<<<<<<<<
 * 
 *     cpdef str as_string(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u__13, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 967, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_span.f0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 967, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_span.f1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 967, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_3, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 967, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_3, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 967, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else
  #endif
  {
    __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 967, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_5) {
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_4);
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 967, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 967, __pyx_L1_error)
  __pyx_r = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "_element_graph.pyx":965
 *         return '|{}| {}-{} ({})'.format(''.join(chars),self.left,self.right,strand)
 * 
 *     cdef str span_to_string(self, (int, int) span):             # <<<<<<<<<<<<<<
 *         """Converts a tuple of two ints to a string connected by ':'"""
 *         return '{}:{}'.format(span[0], span[1])
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("_element_graph.Element.span_to_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_element_graph.pyx":969
 *         return '{}:{}'.format(span[0], span[1])
 * 
 *     cpdef str as_string(self):             # <<<<<<<<<<<<<<
 *         cdef str string = ''
 *         cdef int i
 */

static PyObject *__pyx_pw_14_element_graph_7Element_5as_string(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_14_element_graph_7Element_as_string(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_v_string = 0;
  int __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("as_string", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_as_string); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 969, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_14_element_graph_7Element_5as_string)) {
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 969, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 969, __pyx_L1_error)
        __pyx_r = ((PyObject*)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "_element_graph.pyx":970
 * 
 *     cpdef str as_string(self):
 *         cdef str string = ''             # <<<<<<<<<<<<<<
 *         cdef int i
 *         for i in range(self.number_of_elements):
 */
  __Pyx_INCREF(__pyx_kp_u__12);
  __pyx_v_string = __pyx_kp_u__12;

  /* "_element_graph.pyx":972
 *         cdef str string = ''
 *         cdef int i
 *         for i in range(self.number_of_elements):             # <<<<<<<<<<<<<<
 *             if i in self.includes:
 *                 string+='+'
 */
  __pyx_t_5 = __pyx_v_self->number_of_elements;
  __pyx_t_6 = __pyx_t_5;
  for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
    __pyx_v_i = __pyx_t_7;

    /* "_element_graph.pyx":973
 *         cdef int i
 *         for i in range(self.number_of_elements):
 *             if i in self.includes:             # <<<<<<<<<<<<<<
 *                 string+='+'
 *             elif i in self.excludes:
 */
    __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 973, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (unlikely(__pyx_v_self->includes == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(0, 973, __pyx_L1_error)
    }
    __pyx_t_8 = (__Pyx_PySet_ContainsTF(__pyx_t_1, __pyx_v_self->includes, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 973, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_9 = (__pyx_t_8 != 0);
    if (__pyx_t_9) {

      /* "_element_graph.pyx":974
 *         for i in range(self.number_of_elements):
 *             if i in self.includes:
 *                 string+='+'             # <<<<<<<<<<<<<<
 *             elif i in self.excludes:
 *                 string+='-'
 */
      __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_v_string, __pyx_kp_u__9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 974, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF_SET(__pyx_v_string, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "_element_graph.pyx":973
 *         cdef int i
 *         for i in range(self.number_of_elements):
 *             if i in self.includes:             # <<<<<<<<<<<<<<
 *                 string+='+'
 *             elif i in self.excludes:
 */
      goto __pyx_L5;
    }

    /* "_element_graph.pyx":975
 *             if i in self.includes:
 *                 string+='+'
 *             elif i in self.excludes:             # <<<<<<<<<<<<<<
 *                 string+='-'
 *             else:
 */
    __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 975, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (unlikely(__pyx_v_self->excludes == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(0, 975, __pyx_L1_error)
    }
    __pyx_t_9 = (__Pyx_PySet_ContainsTF(__pyx_t_1, __pyx_v_self->excludes, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 975, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_8 = (__pyx_t_9 != 0);
    if (__pyx_t_8) {

      /* "_element_graph.pyx":976
 *                 string+='+'
 *             elif i in self.excludes:
 *                 string+='-'             # <<<<<<<<<<<<<<
 *             else:
 *                 string+=' '
 */
      __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_v_string, __pyx_kp_u__7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 976, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF_SET(__pyx_v_string, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "_element_graph.pyx":975
 *             if i in self.includes:
 *                 string+='+'
 *             elif i in self.excludes:             # <<<<<<<<<<<<<<
 *                 string+='-'
 *             else:
 */
      goto __pyx_L5;
    }

    /* "_element_graph.pyx":978
 *                 string+='-'
 *             else:
 *                 string+=' '             # <<<<<<<<<<<<<<
 * 
 *         return string
 */
    /*else*/ {
      __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_v_string, __pyx_kp_u__6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 978, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF_SET(__pyx_v_string, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;
    }
    __pyx_L5:;
  }

  /* "_element_graph.pyx":980
 *                 string+=' '
 * 
 *         return string             # <<<<<<<<<<<<<<
 * 
 *     def __eq__(self, other): return self.cov == other.cov
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_string);
  __pyx_r = __pyx_v_string;
  goto __pyx_L0;

  /* "_element_graph.pyx":969
 *         return '{}:{}'.format(span[0], span[1])
 * 
 *     cpdef str as_string(self):             # <<<<<<<<<<<<<<
 *         cdef str string = ''
 *         cdef int i
 */

  /* 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("_element_graph.Element.as_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_string);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_7Element_5as_string(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_14_element_graph_7Element_5as_string(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_string (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_4as_string(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self));

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

static PyObject *__pyx_pf_14_element_graph_7Element_4as_string(struct __pyx_obj_14_element_graph_Element *__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("as_string", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_14_element_graph_7Element_as_string(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 969, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "_element_graph.pyx":982
 *         return string
 * 
 *     def __eq__(self, other): return self.cov == other.cov             # <<<<<<<<<<<<<<
 *     def __ne__(self, other): return self.cov != other.cov
 *     def __gt__(self, other): return self.cov >  other.cov
 */

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_7Element_7__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_14_element_graph_7Element_7__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__eq__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_6__eq__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self), ((PyObject *)__pyx_v_other));

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

static PyObject *__pyx_pf_14_element_graph_7Element_6__eq__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__eq__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->cov); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 982, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_cov); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 982, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 982, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

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

/* "_element_graph.pyx":983
 * 
 *     def __eq__(self, other): return self.cov == other.cov
 *     def __ne__(self, other): return self.cov != other.cov             # <<<<<<<<<<<<<<
 *     def __gt__(self, other): return self.cov >  other.cov
 *     def __ge__(self, other): return self.cov >= other.cov
 */

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_7Element_9__ne__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_14_element_graph_7Element_9__ne__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__ne__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_8__ne__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self), ((PyObject *)__pyx_v_other));

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

static PyObject *__pyx_pf_14_element_graph_7Element_8__ne__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__ne__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->cov); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 983, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_cov); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 983, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 983, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

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

/* "_element_graph.pyx":984
 *     def __eq__(self, other): return self.cov == other.cov
 *     def __ne__(self, other): return self.cov != other.cov
 *     def __gt__(self, other): return self.cov >  other.cov             # <<<<<<<<<<<<<<
 *     def __ge__(self, other): return self.cov >= other.cov
 *     def __lt__(self, other): return self.cov <  other.cov
 */

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_7Element_11__gt__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_14_element_graph_7Element_11__gt__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__gt__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_10__gt__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self), ((PyObject *)__pyx_v_other));

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

static PyObject *__pyx_pf_14_element_graph_7Element_10__gt__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__gt__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->cov); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 984, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_cov); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 984, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 984, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

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

/* "_element_graph.pyx":985
 *     def __ne__(self, other): return self.cov != other.cov
 *     def __gt__(self, other): return self.cov >  other.cov
 *     def __ge__(self, other): return self.cov >= other.cov             # <<<<<<<<<<<<<<
 *     def __lt__(self, other): return self.cov <  other.cov
 *     def __le__(self, other): return self.cov <= other.cov
 */

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_7Element_13__ge__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_14_element_graph_7Element_13__ge__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__ge__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_12__ge__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self), ((PyObject *)__pyx_v_other));

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

static PyObject *__pyx_pf_14_element_graph_7Element_12__ge__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__ge__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->cov); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 985, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_cov); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 985, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_GE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 985, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

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

/* "_element_graph.pyx":986
 *     def __gt__(self, other): return self.cov >  other.cov
 *     def __ge__(self, other): return self.cov >= other.cov
 *     def __lt__(self, other): return self.cov <  other.cov             # <<<<<<<<<<<<<<
 *     def __le__(self, other): return self.cov <= other.cov
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_7Element_15__lt__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_14_element_graph_7Element_15__lt__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__lt__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_14__lt__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self), ((PyObject *)__pyx_v_other));

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

static PyObject *__pyx_pf_14_element_graph_7Element_14__lt__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__lt__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->cov); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 986, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_cov); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 986, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 986, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

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

/* "_element_graph.pyx":987
 *     def __ge__(self, other): return self.cov >= other.cov
 *     def __lt__(self, other): return self.cov <  other.cov
 *     def __le__(self, other): return self.cov <= other.cov             # <<<<<<<<<<<<<<
 * 
 *     def __add__(self, other):
 */

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_7Element_17__le__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_14_element_graph_7Element_17__le__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__le__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_16__le__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self), ((PyObject *)__pyx_v_other));

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

static PyObject *__pyx_pf_14_element_graph_7Element_16__le__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__le__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->cov); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 987, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_cov); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 987, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_LE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 987, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

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

/* "_element_graph.pyx":989
 *     def __le__(self, other): return self.cov <= other.cov
 * 
 *     def __add__(self, other):             # <<<<<<<<<<<<<<
 *         if self.empty: # The special cast emptyPath defeats addition
 *             return self
 */

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_7Element_19__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_14_element_graph_7Element_19__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__add__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_18__add__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other));

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

static PyObject *__pyx_pf_14_element_graph_7Element_18__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_v_summed_element = NULL;
  CYTHON_UNUSED int __pyx_v_forward;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__add__", 0);

  /* "_element_graph.pyx":990
 * 
 *     def __add__(self, other):
 *         if self.empty: # The special cast emptyPath defeats addition             # <<<<<<<<<<<<<<
 *             return self
 *         elif other.empty:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 990, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 990, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "_element_graph.pyx":991
 *     def __add__(self, other):
 *         if self.empty: # The special cast emptyPath defeats addition
 *             return self             # <<<<<<<<<<<<<<
 *         elif other.empty:
 *             return other
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_self);
    __pyx_r = __pyx_v_self;
    goto __pyx_L0;

    /* "_element_graph.pyx":990
 * 
 *     def __add__(self, other):
 *         if self.empty: # The special cast emptyPath defeats addition             # <<<<<<<<<<<<<<
 *             return self
 *         elif other.empty:
 */
  }

  /* "_element_graph.pyx":992
 *         if self.empty: # The special cast emptyPath defeats addition
 *             return self
 *         elif other.empty:             # <<<<<<<<<<<<<<
 *             return other
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 992, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 992, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "_element_graph.pyx":993
 *             return self
 *         elif other.empty:
 *             return other             # <<<<<<<<<<<<<<
 * 
 *         summed_element = copy.deepcopy(self)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_other);
    __pyx_r = __pyx_v_other;
    goto __pyx_L0;

    /* "_element_graph.pyx":992
 *         if self.empty: # The special cast emptyPath defeats addition
 *             return self
 *         elif other.empty:             # <<<<<<<<<<<<<<
 *             return other
 * 
 */
  }

  /* "_element_graph.pyx":995
 *             return other
 * 
 *         summed_element = copy.deepcopy(self)             # <<<<<<<<<<<<<<
 *         if other.index in self.outgroup:
 *             forward = True
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 995, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_deepcopy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 995, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_v_self) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_self);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 995, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_summed_element = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "_element_graph.pyx":996
 * 
 *         summed_element = copy.deepcopy(self)
 *         if other.index in self.outgroup:             # <<<<<<<<<<<<<<
 *             forward = True
 *         elif other.index in self.ingroup:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 996, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_outgroup); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 996, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_t_4, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 996, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_5 = (__pyx_t_2 != 0);
  if (__pyx_t_5) {

    /* "_element_graph.pyx":997
 *         summed_element = copy.deepcopy(self)
 *         if other.index in self.outgroup:
 *             forward = True             # <<<<<<<<<<<<<<
 *         elif other.index in self.ingroup:
 *             forward = False
 */
    __pyx_v_forward = 1;

    /* "_element_graph.pyx":996
 * 
 *         summed_element = copy.deepcopy(self)
 *         if other.index in self.outgroup:             # <<<<<<<<<<<<<<
 *             forward = True
 *         elif other.index in self.ingroup:
 */
    goto __pyx_L4;
  }

  /* "_element_graph.pyx":998
 *         if other.index in self.outgroup:
 *             forward = True
 *         elif other.index in self.ingroup:             # <<<<<<<<<<<<<<
 *             forward = False
 *         else:
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 998, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ingroup); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 998, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_t_4, __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 998, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_2 = (__pyx_t_5 != 0);
  if (likely(__pyx_t_2)) {

    /* "_element_graph.pyx":999
 *             forward = True
 *         elif other.index in self.ingroup:
 *             forward = False             # <<<<<<<<<<<<<<
 *         else:
 *             raise Exception('Error: Element {} is not connected to Element {}'.format(other, self))
 */
    __pyx_v_forward = 0;

    /* "_element_graph.pyx":998
 *         if other.index in self.outgroup:
 *             forward = True
 *         elif other.index in self.ingroup:             # <<<<<<<<<<<<<<
 *             forward = False
 *         else:
 */
    goto __pyx_L4;
  }

  /* "_element_graph.pyx":1001
 *             forward = False
 *         else:
 *             raise Exception('Error: Element {} is not connected to Element {}'.format(other, self))             # <<<<<<<<<<<<<<
 * 
 *         summed_element.merge(other, self.all)
 */
  /*else*/ {
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Error_Element_is_not_connected_t, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1001, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_6 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_other, __pyx_v_self};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1001, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_other, __pyx_v_self};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1001, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    {
      __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1001, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (__pyx_t_3) {
        __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __pyx_t_3 = NULL;
      }
      __Pyx_INCREF(__pyx_v_other);
      __Pyx_GIVEREF(__pyx_v_other);
      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_other);
      __Pyx_INCREF(__pyx_v_self);
      __Pyx_GIVEREF(__pyx_v_self);
      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_self);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1001, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1001, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(0, 1001, __pyx_L1_error)
  }
  __pyx_L4:;

  /* "_element_graph.pyx":1003
 *             raise Exception('Error: Element {} is not connected to Element {}'.format(other, self))
 * 
 *         summed_element.merge(other, self.all)             # <<<<<<<<<<<<<<
 *         return summed_element
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_summed_element, __pyx_n_s_merge); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1003, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_all); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1003, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_3 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
      __pyx_t_6 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_1)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_other, __pyx_t_7};
    __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1003, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_other, __pyx_t_7};
    __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1003, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  } else
  #endif
  {
    __pyx_t_8 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1003, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(__pyx_v_other);
    __Pyx_GIVEREF(__pyx_v_other);
    PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_6, __pyx_v_other);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_6, __pyx_t_7);
    __pyx_t_7 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1003, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "_element_graph.pyx":1004
 * 
 *         summed_element.merge(other, self.all)
 *         return summed_element             # <<<<<<<<<<<<<<
 * 
 *     cpdef void update(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_summed_element);
  __pyx_r = __pyx_v_summed_element;
  goto __pyx_L0;

  /* "_element_graph.pyx":989
 *     def __le__(self, other): return self.cov <= other.cov
 * 
 *     def __add__(self, other):             # <<<<<<<<<<<<<<
 *         if self.empty: # The special cast emptyPath defeats addition
 *             return self
 */

  /* 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_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("_element_graph.Element.__add__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_summed_element);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_element_graph.pyx":1006
 *         return summed_element
 * 
 *     cpdef void update(self):             # <<<<<<<<<<<<<<
 *         cdef int n, lastn
 *         if self.empty or len(self.members) == 0:
 */

static PyObject *__pyx_pw_14_element_graph_7Element_21update(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static void __pyx_f_14_element_graph_7Element_update(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, int __pyx_skip_dispatch) {
  int __pyx_v_n;
  int __pyx_v_lastn;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  int __pyx_t_8;
  float __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  int __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("update", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_update); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1006, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_14_element_graph_7Element_21update)) {
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1006, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "_element_graph.pyx":1008
 *     cpdef void update(self):
 *         cdef int n, lastn
 *         if self.empty or len(self.members) == 0:             # <<<<<<<<<<<<<<
 *             return
 * 
 */
  __pyx_t_6 = (__pyx_v_self->empty != 0);
  if (!__pyx_t_6) {
  } else {
    __pyx_t_5 = __pyx_t_6;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_1 = __pyx_v_self->members;
  __Pyx_INCREF(__pyx_t_1);
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(0, 1008, __pyx_L1_error)
  }
  __pyx_t_7 = PySet_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1008, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = ((__pyx_t_7 == 0) != 0);
  __pyx_t_5 = __pyx_t_6;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_5) {

    /* "_element_graph.pyx":1009
 *         cdef int n, lastn
 *         if self.empty or len(self.members) == 0:
 *             return             # <<<<<<<<<<<<<<
 * 
 *         self.LM = min(self.members.difference(self.end_indices))
 */
    goto __pyx_L0;

    /* "_element_graph.pyx":1008
 *     cpdef void update(self):
 *         cdef int n, lastn
 *         if self.empty or len(self.members) == 0:             # <<<<<<<<<<<<<<
 *             return
 * 
 */
  }

  /* "_element_graph.pyx":1011
 *             return
 * 
 *         self.LM = min(self.members.difference(self.end_indices))             # <<<<<<<<<<<<<<
 *         self.RM = max(self.members.difference(self.end_indices))
 *         if self.strand == 1:
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->members, __pyx_n_s_difference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1011, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_self->end_indices) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_self->end_indices);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1011, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_min, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1011, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1011, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_self->LM = __pyx_t_8;

  /* "_element_graph.pyx":1012
 * 
 *         self.LM = min(self.members.difference(self.end_indices))
 *         self.RM = max(self.members.difference(self.end_indices))             # <<<<<<<<<<<<<<
 *         if self.strand == 1:
 *             self.s_tag = self.maxIC - 4 in self.members # has + start
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->members, __pyx_n_s_difference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1012, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_v_self->end_indices) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_self->end_indices);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1012, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_max, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1012, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1012, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_self->RM = __pyx_t_8;

  /* "_element_graph.pyx":1013
 *         self.LM = min(self.members.difference(self.end_indices))
 *         self.RM = max(self.members.difference(self.end_indices))
 *         if self.strand == 1:             # <<<<<<<<<<<<<<
 *             self.s_tag = self.maxIC - 4 in self.members # has + start
 *             self.e_tag = self.maxIC - 3 in self.members # has + end
 */
  switch (__pyx_v_self->strand) {
    case 1:

    /* "_element_graph.pyx":1014
 *         self.RM = max(self.members.difference(self.end_indices))
 *         if self.strand == 1:
 *             self.s_tag = self.maxIC - 4 in self.members # has + start             # <<<<<<<<<<<<<<
 *             self.e_tag = self.maxIC - 3 in self.members # has + end
 *         elif self.strand == -1:
 */
    __pyx_t_1 = __Pyx_PyInt_From_long((__pyx_v_self->maxIC - 4)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1014, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (unlikely(__pyx_v_self->members == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(0, 1014, __pyx_L1_error)
    }
    __pyx_t_5 = (__Pyx_PySet_ContainsTF(__pyx_t_1, __pyx_v_self->members, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1014, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_self->s_tag = __pyx_t_5;

    /* "_element_graph.pyx":1015
 *         if self.strand == 1:
 *             self.s_tag = self.maxIC - 4 in self.members # has + start
 *             self.e_tag = self.maxIC - 3 in self.members # has + end             # <<<<<<<<<<<<<<
 *         elif self.strand == -1:
 *             self.s_tag = self.maxIC - 2 in self.members # has + start
 */
    __pyx_t_1 = __Pyx_PyInt_From_long((__pyx_v_self->maxIC - 3)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1015, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (unlikely(__pyx_v_self->members == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(0, 1015, __pyx_L1_error)
    }
    __pyx_t_5 = (__Pyx_PySet_ContainsTF(__pyx_t_1, __pyx_v_self->members, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1015, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_self->e_tag = __pyx_t_5;

    /* "_element_graph.pyx":1013
 *         self.LM = min(self.members.difference(self.end_indices))
 *         self.RM = max(self.members.difference(self.end_indices))
 *         if self.strand == 1:             # <<<<<<<<<<<<<<
 *             self.s_tag = self.maxIC - 4 in self.members # has + start
 *             self.e_tag = self.maxIC - 3 in self.members # has + end
 */
    break;
    case -1L:

    /* "_element_graph.pyx":1017
 *             self.e_tag = self.maxIC - 3 in self.members # has + end
 *         elif self.strand == -1:
 *             self.s_tag = self.maxIC - 2 in self.members # has + start             # <<<<<<<<<<<<<<
 *             self.e_tag = self.maxIC - 1 in self.members # has + end
 * 
 */
    __pyx_t_1 = __Pyx_PyInt_From_long((__pyx_v_self->maxIC - 2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1017, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (unlikely(__pyx_v_self->members == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(0, 1017, __pyx_L1_error)
    }
    __pyx_t_5 = (__Pyx_PySet_ContainsTF(__pyx_t_1, __pyx_v_self->members, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1017, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_self->s_tag = __pyx_t_5;

    /* "_element_graph.pyx":1018
 *         elif self.strand == -1:
 *             self.s_tag = self.maxIC - 2 in self.members # has + start
 *             self.e_tag = self.maxIC - 1 in self.members # has + end             # <<<<<<<<<<<<<<
 * 
 *         self.bases = sum(self.source_weights)*self.length
 */
    __pyx_t_1 = __Pyx_PyInt_From_long((__pyx_v_self->maxIC - 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1018, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (unlikely(__pyx_v_self->members == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(0, 1018, __pyx_L1_error)
    }
    __pyx_t_5 = (__Pyx_PySet_ContainsTF(__pyx_t_1, __pyx_v_self->members, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1018, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_self->e_tag = __pyx_t_5;

    /* "_element_graph.pyx":1016
 *             self.s_tag = self.maxIC - 4 in self.members # has + start
 *             self.e_tag = self.maxIC - 3 in self.members # has + end
 *         elif self.strand == -1:             # <<<<<<<<<<<<<<
 *             self.s_tag = self.maxIC - 2 in self.members # has + start
 *             self.e_tag = self.maxIC - 1 in self.members # has + end
 */
    break;
    default: break;
  }

  /* "_element_graph.pyx":1020
 *             self.e_tag = self.maxIC - 1 in self.members # has + end
 * 
 *         self.bases = sum(self.source_weights)*self.length             # <<<<<<<<<<<<<<
 *         self.IC = len(self.members) + len(self.nonmembers)
 *         if self.IC == self.maxIC:
 */
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, ((PyObject *)__pyx_v_self->source_weights)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1020, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->length); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1020, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1020, __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_9 = __pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_9 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 1020, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_self->bases = __pyx_t_9;

  /* "_element_graph.pyx":1021
 * 
 *         self.bases = sum(self.source_weights)*self.length
 *         self.IC = len(self.members) + len(self.nonmembers)             # <<<<<<<<<<<<<<
 *         if self.IC == self.maxIC:
 *             self.complete = True
 */
  __pyx_t_3 = __pyx_v_self->members;
  __Pyx_INCREF(__pyx_t_3);
  if (unlikely(__pyx_t_3 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(0, 1021, __pyx_L1_error)
  }
  __pyx_t_7 = PySet_GET_SIZE(__pyx_t_3); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1021, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __pyx_v_self->nonmembers;
  __Pyx_INCREF(__pyx_t_3);
  if (unlikely(__pyx_t_3 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(0, 1021, __pyx_L1_error)
  }
  __pyx_t_10 = PySet_GET_SIZE(__pyx_t_3); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1021, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_self->IC = (__pyx_t_7 + __pyx_t_10);

  /* "_element_graph.pyx":1022
 *         self.bases = sum(self.source_weights)*self.length
 *         self.IC = len(self.members) + len(self.nonmembers)
 *         if self.IC == self.maxIC:             # <<<<<<<<<<<<<<
 *             self.complete = True
 *         else:
 */
  __pyx_t_5 = ((__pyx_v_self->IC == __pyx_v_self->maxIC) != 0);
  if (__pyx_t_5) {

    /* "_element_graph.pyx":1023
 *         self.IC = len(self.members) + len(self.nonmembers)
 *         if self.IC == self.maxIC:
 *             self.complete = True             # <<<<<<<<<<<<<<
 *         else:
 *             self.complete = False
 */
    __pyx_v_self->complete = 1;

    /* "_element_graph.pyx":1022
 *         self.bases = sum(self.source_weights)*self.length
 *         self.IC = len(self.members) + len(self.nonmembers)
 *         if self.IC == self.maxIC:             # <<<<<<<<<<<<<<
 *             self.complete = True
 *         else:
 */
    goto __pyx_L6;
  }

  /* "_element_graph.pyx":1025
 *             self.complete = True
 *         else:
 *             self.complete = False             # <<<<<<<<<<<<<<
 *             self.has_gaps = not set(range(self.LM, self.RM)).issubset(self.members|self.nonmembers)
 * 
 */
  /*else*/ {
    __pyx_v_self->complete = 0;

    /* "_element_graph.pyx":1026
 *         else:
 *             self.complete = False
 *             self.has_gaps = not set(range(self.LM, self.RM)).issubset(self.members|self.nonmembers)             # <<<<<<<<<<<<<<
 * 
 *         self.covered_indices = self.members.difference(self.end_indices) # Covered regions (excluding starts/ends)
 */
    __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->LM); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1026, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->RM); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1026, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1026, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
    __pyx_t_2 = 0;
    __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1026, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PySet_New(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1026, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_issubset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1026, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_Or(__pyx_v_self->members, __pyx_v_self->nonmembers); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1026, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1026, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1026, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_self->has_gaps = (!__pyx_t_5);
  }
  __pyx_L6:;

  /* "_element_graph.pyx":1028
 *             self.has_gaps = not set(range(self.LM, self.RM)).issubset(self.members|self.nonmembers)
 * 
 *         self.covered_indices = self.members.difference(self.end_indices) # Covered regions (excluding starts/ends)             # <<<<<<<<<<<<<<
 *         for n in sorted(self.nonmembers):
 *             lastn = -1
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->members, __pyx_n_s_difference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1028, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_4, __pyx_v_self->end_indices) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_self->end_indices);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1028, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!(likely(PySet_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(0, 1028, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_GOTREF(__pyx_v_self->covered_indices);
  __Pyx_DECREF(__pyx_v_self->covered_indices);
  __pyx_v_self->covered_indices = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "_element_graph.pyx":1029
 * 
 *         self.covered_indices = self.members.difference(self.end_indices) # Covered regions (excluding starts/ends)
 *         for n in sorted(self.nonmembers):             # <<<<<<<<<<<<<<
 *             lastn = -1
 *             if n > self.LM and n < self.RM:
 */
  __pyx_t_1 = __pyx_v_self->nonmembers;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_4 = PySequence_List(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1029, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_11 = PyList_Sort(__pyx_t_3); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 1029, __pyx_L1_error)
  if (unlikely(__pyx_t_3 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(0, 1029, __pyx_L1_error)
  }
  __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  for (;;) {
    if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_4)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 1029, __pyx_L1_error)
    #else
    __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1029, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1029, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_n = __pyx_t_8;

    /* "_element_graph.pyx":1030
 *         self.covered_indices = self.members.difference(self.end_indices) # Covered regions (excluding starts/ends)
 *         for n in sorted(self.nonmembers):
 *             lastn = -1             # <<<<<<<<<<<<<<
 *             if n > self.LM and n < self.RM:
 *                 self.is_spliced = True
 */
    __pyx_v_lastn = -1;

    /* "_element_graph.pyx":1031
 *         for n in sorted(self.nonmembers):
 *             lastn = -1
 *             if n > self.LM and n < self.RM:             # <<<<<<<<<<<<<<
 *                 self.is_spliced = True
 *                 if n > lastn+1: # Only add one representative nonmember per intron
 */
    __pyx_t_6 = ((__pyx_v_n > __pyx_v_self->LM) != 0);
    if (__pyx_t_6) {
    } else {
      __pyx_t_5 = __pyx_t_6;
      goto __pyx_L10_bool_binop_done;
    }
    __pyx_t_6 = ((__pyx_v_n < __pyx_v_self->RM) != 0);
    __pyx_t_5 = __pyx_t_6;
    __pyx_L10_bool_binop_done:;
    if (__pyx_t_5) {

      /* "_element_graph.pyx":1032
 *             lastn = -1
 *             if n > self.LM and n < self.RM:
 *                 self.is_spliced = True             # <<<<<<<<<<<<<<
 *                 if n > lastn+1: # Only add one representative nonmember per intron
 *                     self.covered_indices.add(n)
 */
      __pyx_v_self->is_spliced = 1;

      /* "_element_graph.pyx":1033
 *             if n > self.LM and n < self.RM:
 *                 self.is_spliced = True
 *                 if n > lastn+1: # Only add one representative nonmember per intron             # <<<<<<<<<<<<<<
 *                     self.covered_indices.add(n)
 * 
 */
      __pyx_t_5 = ((__pyx_v_n > (__pyx_v_lastn + 1)) != 0);
      if (__pyx_t_5) {

        /* "_element_graph.pyx":1034
 *                 self.is_spliced = True
 *                 if n > lastn+1: # Only add one representative nonmember per intron
 *                     self.covered_indices.add(n)             # <<<<<<<<<<<<<<
 * 
 *         if len(self.covered_indices) > 0:
 */
        if (unlikely(__pyx_v_self->covered_indices == Py_None)) {
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add");
          __PYX_ERR(0, 1034, __pyx_L1_error)
        }
        __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1034, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_11 = PySet_Add(__pyx_v_self->covered_indices, __pyx_t_3); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 1034, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

        /* "_element_graph.pyx":1033
 *             if n > self.LM and n < self.RM:
 *                 self.is_spliced = True
 *                 if n > lastn+1: # Only add one representative nonmember per intron             # <<<<<<<<<<<<<<
 *                     self.covered_indices.add(n)
 * 
 */
      }

      /* "_element_graph.pyx":1031
 *         for n in sorted(self.nonmembers):
 *             lastn = -1
 *             if n > self.LM and n < self.RM:             # <<<<<<<<<<<<<<
 *                 self.is_spliced = True
 *                 if n > lastn+1: # Only add one representative nonmember per intron
 */
    }

    /* "_element_graph.pyx":1029
 * 
 *         self.covered_indices = self.members.difference(self.end_indices) # Covered regions (excluding starts/ends)
 *         for n in sorted(self.nonmembers):             # <<<<<<<<<<<<<<
 *             lastn = -1
 *             if n > self.LM and n < self.RM:
 */
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "_element_graph.pyx":1036
 *                     self.covered_indices.add(n)
 * 
 *         if len(self.covered_indices) > 0:             # <<<<<<<<<<<<<<
 *             self.cov = np.max(self.member_weights[sorted(self.covered_indices)])
 *         else:
 */
  __pyx_t_4 = __pyx_v_self->covered_indices;
  __Pyx_INCREF(__pyx_t_4);
  if (unlikely(__pyx_t_4 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(0, 1036, __pyx_L1_error)
  }
  __pyx_t_10 = PySet_GET_SIZE(__pyx_t_4); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1036, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_5 = ((__pyx_t_10 > 0) != 0);
  if (__pyx_t_5) {

    /* "_element_graph.pyx":1037
 * 
 *         if len(self.covered_indices) > 0:
 *             self.cov = np.max(self.member_weights[sorted(self.covered_indices)])             # <<<<<<<<<<<<<<
 *         else:
 *             self.cov = 0
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1037, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_max); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1037, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_2 = __pyx_v_self->covered_indices;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_12 = PySequence_List(__pyx_t_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1037, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_3 = ((PyObject*)__pyx_t_12);
    __pyx_t_12 = 0;
    __pyx_t_11 = PyList_Sort(__pyx_t_3); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 1037, __pyx_L1_error)
    __pyx_t_12 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->member_weights), __pyx_t_3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1037, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_4 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_t_12) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_12);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1037, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_9 = __pyx_PyFloat_AsFloat(__pyx_t_4); if (unlikely((__pyx_t_9 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 1037, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_self->cov = __pyx_t_9;

    /* "_element_graph.pyx":1036
 *                     self.covered_indices.add(n)
 * 
 *         if len(self.covered_indices) > 0:             # <<<<<<<<<<<<<<
 *             self.cov = np.max(self.member_weights[sorted(self.covered_indices)])
 *         else:
 */
    goto __pyx_L13;
  }

  /* "_element_graph.pyx":1039
 *             self.cov = np.max(self.member_weights[sorted(self.covered_indices)])
 *         else:
 *             self.cov = 0             # <<<<<<<<<<<<<<
 * 
 *         # self.bottleneck_weight = np.min(self.member_weights[sorted(self.covered_indices)])
 */
  /*else*/ {
    __pyx_v_self->cov = 0.0;
  }
  __pyx_L13:;

  /* "_element_graph.pyx":1006
 *         return summed_element
 * 
 *     cpdef void update(self):             # <<<<<<<<<<<<<<
 *         cdef int n, lastn
 *         if self.empty or len(self.members) == 0:
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_WriteUnraisable("_element_graph.Element.update", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_7Element_21update(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_14_element_graph_7Element_21update(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("update (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_20update(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self));

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

static PyObject *__pyx_pf_14_element_graph_7Element_20update(struct __pyx_obj_14_element_graph_Element *__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("update", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_14_element_graph_7Element_update(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1006, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "_element_graph.pyx":1044
 *         # self.bottleneck = set(np.where(self.member_weights == self.bottleneck_weight)[0])
 * 
 *     cpdef set uniqueMembers(self, Element other):             # <<<<<<<<<<<<<<
 *         """Given a second Element, return a set of frags that
 *         are only in self and not in other"""
 */

static PyObject *__pyx_pw_14_element_graph_7Element_23uniqueMembers(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_f_14_element_graph_7Element_uniqueMembers(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, struct __pyx_obj_14_element_graph_Element *__pyx_v_other, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("uniqueMembers", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_uniqueMembers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1044, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_14_element_graph_7Element_23uniqueMembers)) {
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, ((PyObject *)__pyx_v_other)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_other));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1044, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (!(likely(PySet_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 1044, __pyx_L1_error)
        __pyx_r = ((PyObject*)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "_element_graph.pyx":1047
 *         """Given a second Element, return a set of frags that
 *         are only in self and not in other"""
 *         return self.members.difference(other.members)             # <<<<<<<<<<<<<<
 * 
 *     cpdef set uniqueNonmembers(self, Element other):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->members, __pyx_n_s_difference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1047, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_other->members) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_other->members);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1047, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!(likely(PySet_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 1047, __pyx_L1_error)
  __pyx_r = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "_element_graph.pyx":1044
 *         # self.bottleneck = set(np.where(self.member_weights == self.bottleneck_weight)[0])
 * 
 *     cpdef set uniqueMembers(self, Element other):             # <<<<<<<<<<<<<<
 *         """Given a second Element, return a set of frags that
 *         are only in self and not in other"""
 */

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

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_7Element_23uniqueMembers(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static char __pyx_doc_14_element_graph_7Element_22uniqueMembers[] = "Given a second Element, return a set of frags that\n        are only in self and not in other";
static PyObject *__pyx_pw_14_element_graph_7Element_23uniqueMembers(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("uniqueMembers (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_14_element_graph_Element, 1, "other", 0))) __PYX_ERR(0, 1044, __pyx_L1_error)
  __pyx_r = __pyx_pf_14_element_graph_7Element_22uniqueMembers(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self), ((struct __pyx_obj_14_element_graph_Element *)__pyx_v_other));

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

static PyObject *__pyx_pf_14_element_graph_7Element_22uniqueMembers(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, struct __pyx_obj_14_element_graph_Element *__pyx_v_other) {
  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("uniqueMembers", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_14_element_graph_7Element_uniqueMembers(__pyx_v_self, __pyx_v_other, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1044, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "_element_graph.pyx":1049
 *         return self.members.difference(other.members)
 * 
 *     cpdef set uniqueNonmembers(self, Element other):             # <<<<<<<<<<<<<<
 *         """Given a second Element, return a set of frags that
 *         are only in self and not in other"""
 */

static PyObject *__pyx_pw_14_element_graph_7Element_25uniqueNonmembers(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_f_14_element_graph_7Element_uniqueNonmembers(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, struct __pyx_obj_14_element_graph_Element *__pyx_v_other, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("uniqueNonmembers", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_uniqueNonmembers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1049, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_14_element_graph_7Element_25uniqueNonmembers)) {
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, ((PyObject *)__pyx_v_other)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_other));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1049, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (!(likely(PySet_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 1049, __pyx_L1_error)
        __pyx_r = ((PyObject*)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "_element_graph.pyx":1052
 *         """Given a second Element, return a set of frags that
 *         are only in self and not in other"""
 *         return self.nonmembers.difference(other.nonmembers)             # <<<<<<<<<<<<<<
 * 
 *     cpdef int uniqueInformation(self, Element other):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->nonmembers, __pyx_n_s_difference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1052, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_other->nonmembers) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_other->nonmembers);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1052, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!(likely(PySet_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 1052, __pyx_L1_error)
  __pyx_r = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "_element_graph.pyx":1049
 *         return self.members.difference(other.members)
 * 
 *     cpdef set uniqueNonmembers(self, Element other):             # <<<<<<<<<<<<<<
 *         """Given a second Element, return a set of frags that
 *         are only in self and not in other"""
 */

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

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_7Element_25uniqueNonmembers(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static char __pyx_doc_14_element_graph_7Element_24uniqueNonmembers[] = "Given a second Element, return a set of frags that\n        are only in self and not in other";
static PyObject *__pyx_pw_14_element_graph_7Element_25uniqueNonmembers(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("uniqueNonmembers (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_14_element_graph_Element, 1, "other", 0))) __PYX_ERR(0, 1049, __pyx_L1_error)
  __pyx_r = __pyx_pf_14_element_graph_7Element_24uniqueNonmembers(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self), ((struct __pyx_obj_14_element_graph_Element *)__pyx_v_other));

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

static PyObject *__pyx_pf_14_element_graph_7Element_24uniqueNonmembers(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, struct __pyx_obj_14_element_graph_Element *__pyx_v_other) {
  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("uniqueNonmembers", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_14_element_graph_7Element_uniqueNonmembers(__pyx_v_self, __pyx_v_other, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1049, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "_element_graph.pyx":1054
 *         return self.nonmembers.difference(other.nonmembers)
 * 
 *     cpdef int uniqueInformation(self, Element other):             # <<<<<<<<<<<<<<
 *         """Given a second Element, return a set of frags that
 *         are only in self and not in other"""
 */

static PyObject *__pyx_pw_14_element_graph_7Element_27uniqueInformation(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static int __pyx_f_14_element_graph_7Element_uniqueInformation(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, struct __pyx_obj_14_element_graph_Element *__pyx_v_other, int __pyx_skip_dispatch) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("uniqueInformation", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_uniqueInformation); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1054, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_14_element_graph_7Element_27uniqueInformation)) {
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, ((PyObject *)__pyx_v_other)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_other));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1054, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1054, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_5;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "_element_graph.pyx":1057
 *         """Given a second Element, return a set of frags that
 *         are only in self and not in other"""
 *         return len(self.uniqueMembers(other)|self.uniqueNonmembers(other))             # <<<<<<<<<<<<<<
 * 
 *     cpdef int uniqueLength(self, Element other):
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_14_element_graph_Element *)__pyx_v_self->__pyx_vtab)->uniqueMembers(__pyx_v_self, __pyx_v_other, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1057, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = ((struct __pyx_vtabstruct_14_element_graph_Element *)__pyx_v_self->__pyx_vtab)->uniqueNonmembers(__pyx_v_self, __pyx_v_other, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1057, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyNumber_Or(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1057, __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_6 = PySet_GET_SIZE(__pyx_t_3); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1057, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_6;
  goto __pyx_L0;

  /* "_element_graph.pyx":1054
 *         return self.nonmembers.difference(other.nonmembers)
 * 
 *     cpdef int uniqueInformation(self, Element other):             # <<<<<<<<<<<<<<
 *         """Given a second Element, return a set of frags that
 *         are only in self and not in other"""
 */

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

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_7Element_27uniqueInformation(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static char __pyx_doc_14_element_graph_7Element_26uniqueInformation[] = "Given a second Element, return a set of frags that\n        are only in self and not in other";
static PyObject *__pyx_pw_14_element_graph_7Element_27uniqueInformation(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("uniqueInformation (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_14_element_graph_Element, 1, "other", 0))) __PYX_ERR(0, 1054, __pyx_L1_error)
  __pyx_r = __pyx_pf_14_element_graph_7Element_26uniqueInformation(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self), ((struct __pyx_obj_14_element_graph_Element *)__pyx_v_other));

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

static PyObject *__pyx_pf_14_element_graph_7Element_26uniqueInformation(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, struct __pyx_obj_14_element_graph_Element *__pyx_v_other) {
  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("uniqueInformation", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_f_14_element_graph_7Element_uniqueInformation(__pyx_v_self, __pyx_v_other, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1054, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "_element_graph.pyx":1059
 *         return len(self.uniqueMembers(other)|self.uniqueNonmembers(other))
 * 
 *     cpdef int uniqueLength(self, Element other):             # <<<<<<<<<<<<<<
 *         """Given a second Element, return the total length that is unique
 *         to self (summed length of uniqueMembers)."""
 */

static PyObject *__pyx_pw_14_element_graph_7Element_29uniqueLength(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static int __pyx_f_14_element_graph_7Element_uniqueLength(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, struct __pyx_obj_14_element_graph_Element *__pyx_v_other, int __pyx_skip_dispatch) {
  int __pyx_v_length;
  PyObject *__pyx_v_m = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("uniqueLength", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_uniqueLength); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1059, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_14_element_graph_7Element_29uniqueLength)) {
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, ((PyObject *)__pyx_v_other)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_other));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1059, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1059, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_5;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "_element_graph.pyx":1062
 *         """Given a second Element, return the total length that is unique
 *         to self (summed length of uniqueMembers)."""
 *         cdef int length = 0             # <<<<<<<<<<<<<<
 *         for m in self.uniqueMembers(other):
 *             length += self.frag_len[m]
 */
  __pyx_v_length = 0;

  /* "_element_graph.pyx":1063
 *         to self (summed length of uniqueMembers)."""
 *         cdef int length = 0
 *         for m in self.uniqueMembers(other):             # <<<<<<<<<<<<<<
 *             length += self.frag_len[m]
 * 
 */
  __pyx_t_6 = 0;
  __pyx_t_2 = ((struct __pyx_vtabstruct_14_element_graph_Element *)__pyx_v_self->__pyx_vtab)->uniqueMembers(__pyx_v_self, __pyx_v_other, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1063, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_set_iterator(__pyx_t_2, 1, (&__pyx_t_7), (&__pyx_t_5)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1063, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_XDECREF(__pyx_t_1);
  __pyx_t_1 = __pyx_t_3;
  __pyx_t_3 = 0;
  while (1) {
    __pyx_t_8 = __Pyx_set_iter_next(__pyx_t_1, __pyx_t_7, &__pyx_t_6, &__pyx_t_3, __pyx_t_5);
    if (unlikely(__pyx_t_8 == 0)) break;
    if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 1063, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_m, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "_element_graph.pyx":1064
 *         cdef int length = 0
 *         for m in self.uniqueMembers(other):
 *             length += self.frag_len[m]             # <<<<<<<<<<<<<<
 * 
 *         return length
 */
    __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1064, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->frag_len), __pyx_v_m); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1064, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1064, __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_8 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1064, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_length = __pyx_t_8;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_element_graph.pyx":1066
 *             length += self.frag_len[m]
 * 
 *         return length             # <<<<<<<<<<<<<<
 * 
 *     cpdef bint compatible(self, Element other):
 */
  __pyx_r = __pyx_v_length;
  goto __pyx_L0;

  /* "_element_graph.pyx":1059
 *         return len(self.uniqueMembers(other)|self.uniqueNonmembers(other))
 * 
 *     cpdef int uniqueLength(self, Element other):             # <<<<<<<<<<<<<<
 *         """Given a second Element, return the total length that is unique
 *         to self (summed length of uniqueMembers)."""
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("_element_graph.Element.uniqueLength", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_m);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_7Element_29uniqueLength(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static char __pyx_doc_14_element_graph_7Element_28uniqueLength[] = "Given a second Element, return the total length that is unique\n        to self (summed length of uniqueMembers).";
static PyObject *__pyx_pw_14_element_graph_7Element_29uniqueLength(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("uniqueLength (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_14_element_graph_Element, 1, "other", 0))) __PYX_ERR(0, 1059, __pyx_L1_error)
  __pyx_r = __pyx_pf_14_element_graph_7Element_28uniqueLength(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self), ((struct __pyx_obj_14_element_graph_Element *)__pyx_v_other));

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

static PyObject *__pyx_pf_14_element_graph_7Element_28uniqueLength(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, struct __pyx_obj_14_element_graph_Element *__pyx_v_other) {
  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("uniqueLength", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_f_14_element_graph_7Element_uniqueLength(__pyx_v_self, __pyx_v_other, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1059, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "_element_graph.pyx":1068
 *         return length
 * 
 *     cpdef bint compatible(self, Element other):             # <<<<<<<<<<<<<<
 *         """Returns a boolean of whether or not self and other could be
 *         subpaths in a shared path."""
 */

static PyObject *__pyx_pw_14_element_graph_7Element_31compatible(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static int __pyx_f_14_element_graph_7Element_compatible(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, struct __pyx_obj_14_element_graph_Element *__pyx_v_other, int __pyx_skip_dispatch) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("compatible", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_compatible); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1068, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_14_element_graph_7Element_31compatible)) {
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, ((PyObject *)__pyx_v_other)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_other));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1068, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1068, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_5;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "_element_graph.pyx":1071
 *         """Returns a boolean of whether or not self and other could be
 *         subpaths in a shared path."""
 *         if self.empty: # emptyPath is incompatible with everything             # <<<<<<<<<<<<<<
 *             return False
 * 
 */
  __pyx_t_5 = (__pyx_v_self->empty != 0);
  if (__pyx_t_5) {

    /* "_element_graph.pyx":1072
 *         subpaths in a shared path."""
 *         if self.empty: # emptyPath is incompatible with everything
 *             return False             # <<<<<<<<<<<<<<
 * 
 *         if self.strand != 0 and other.strand != 0 and self.strand != other.strand:
 */
    __pyx_r = 0;
    goto __pyx_L0;

    /* "_element_graph.pyx":1071
 *         """Returns a boolean of whether or not self and other could be
 *         subpaths in a shared path."""
 *         if self.empty: # emptyPath is incompatible with everything             # <<<<<<<<<<<<<<
 *             return False
 * 
 */
  }

  /* "_element_graph.pyx":1074
 *             return False
 * 
 *         if self.strand != 0 and other.strand != 0 and self.strand != other.strand:             # <<<<<<<<<<<<<<
 *             # self and other are on opposite strands
 *             return False
 */
  __pyx_t_6 = ((__pyx_v_self->strand != 0) != 0);
  if (__pyx_t_6) {
  } else {
    __pyx_t_5 = __pyx_t_6;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_6 = ((__pyx_v_other->strand != 0) != 0);
  if (__pyx_t_6) {
  } else {
    __pyx_t_5 = __pyx_t_6;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_6 = ((__pyx_v_self->strand != __pyx_v_other->strand) != 0);
  __pyx_t_5 = __pyx_t_6;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_5) {

    /* "_element_graph.pyx":1076
 *         if self.strand != 0 and other.strand != 0 and self.strand != other.strand:
 *             # self and other are on opposite strands
 *             return False             # <<<<<<<<<<<<<<
 * 
 *         if self.members.isdisjoint(other.nonmembers): # Must not contain any excluded frags
 */
    __pyx_r = 0;
    goto __pyx_L0;

    /* "_element_graph.pyx":1074
 *             return False
 * 
 *         if self.strand != 0 and other.strand != 0 and self.strand != other.strand:             # <<<<<<<<<<<<<<
 *             # self and other are on opposite strands
 *             return False
 */
  }

  /* "_element_graph.pyx":1078
 *             return False
 * 
 *         if self.members.isdisjoint(other.nonmembers): # Must not contain any excluded frags             # <<<<<<<<<<<<<<
 *             if other.members.isdisjoint(self.nonmembers): # Check reciprocal
 *                 return True
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->members, __pyx_n_s_isdisjoint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1078, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_other->nonmembers) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_other->nonmembers);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1078, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1078, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_5) {

    /* "_element_graph.pyx":1079
 * 
 *         if self.members.isdisjoint(other.nonmembers): # Must not contain any excluded frags
 *             if other.members.isdisjoint(self.nonmembers): # Check reciprocal             # <<<<<<<<<<<<<<
 *                 return True
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_other->members, __pyx_n_s_isdisjoint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1079, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_self->nonmembers) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_self->nonmembers);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1079, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1079, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_5) {

      /* "_element_graph.pyx":1080
 *         if self.members.isdisjoint(other.nonmembers): # Must not contain any excluded frags
 *             if other.members.isdisjoint(self.nonmembers): # Check reciprocal
 *                 return True             # <<<<<<<<<<<<<<
 * 
 *         return False
 */
      __pyx_r = 1;
      goto __pyx_L0;

      /* "_element_graph.pyx":1079
 * 
 *         if self.members.isdisjoint(other.nonmembers): # Must not contain any excluded frags
 *             if other.members.isdisjoint(self.nonmembers): # Check reciprocal             # <<<<<<<<<<<<<<
 *                 return True
 * 
 */
    }

    /* "_element_graph.pyx":1078
 *             return False
 * 
 *         if self.members.isdisjoint(other.nonmembers): # Must not contain any excluded frags             # <<<<<<<<<<<<<<
 *             if other.members.isdisjoint(self.nonmembers): # Check reciprocal
 *                 return True
 */
  }

  /* "_element_graph.pyx":1082
 *                 return True
 * 
 *         return False             # <<<<<<<<<<<<<<
 * 
 *     cpdef list get_introns(self):
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "_element_graph.pyx":1068
 *         return length
 * 
 *     cpdef bint compatible(self, Element other):             # <<<<<<<<<<<<<<
 *         """Returns a boolean of whether or not self and other could be
 *         subpaths in a shared path."""
 */

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

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_7Element_31compatible(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static char __pyx_doc_14_element_graph_7Element_30compatible[] = "Returns a boolean of whether or not self and other could be\n        subpaths in a shared path.";
static PyObject *__pyx_pw_14_element_graph_7Element_31compatible(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("compatible (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_14_element_graph_Element, 1, "other", 0))) __PYX_ERR(0, 1068, __pyx_L1_error)
  __pyx_r = __pyx_pf_14_element_graph_7Element_30compatible(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self), ((struct __pyx_obj_14_element_graph_Element *)__pyx_v_other));

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

static PyObject *__pyx_pf_14_element_graph_7Element_30compatible(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, struct __pyx_obj_14_element_graph_Element *__pyx_v_other) {
  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("compatible", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_14_element_graph_7Element_compatible(__pyx_v_self, __pyx_v_other, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1068, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "_element_graph.pyx":1084
 *         return False
 * 
 *     cpdef list get_introns(self):             # <<<<<<<<<<<<<<
 *         """Returns a list of membership index pairs that mark the
 *         start and end of each internal gap (intron) in the path."""
 */

static PyObject *__pyx_pw_14_element_graph_7Element_33get_introns(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_14_element_graph_7Element_get_introns(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, int __pyx_skip_dispatch) {
  int __pyx_v_istart;
  int __pyx_v_iend;
  int __pyx_v_i;
  PyObject *__pyx_v_introns = 0;
  PyObject *__pyx_v_internal_skips = 0;
  int __pyx_9genexpr27__pyx_v_n;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_introns", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_introns); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1084, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_14_element_graph_7Element_33get_introns)) {
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1084, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 1084, __pyx_L1_error)
        __pyx_r = ((PyObject*)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "_element_graph.pyx":1091
 *             list introns, internal_skips
 * 
 *         introns = []             # <<<<<<<<<<<<<<
 *         internal_skips = sorted([n for n in self.nonmembers if n > self.LM and n < self.RM])
 *         istart = iend = -1
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1091, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_introns = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "_element_graph.pyx":1092
 * 
 *         introns = []
 *         internal_skips = sorted([n for n in self.nonmembers if n > self.LM and n < self.RM])             # <<<<<<<<<<<<<<
 *         istart = iend = -1
 *         for i in internal_skips:
 */
  { /* enter inner scope */
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1092, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = 0;
    __pyx_t_4 = __Pyx_set_iterator(__pyx_v_self->nonmembers, 1, (&__pyx_t_6), (&__pyx_t_7)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1092, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3);
    __pyx_t_3 = __pyx_t_4;
    __pyx_t_4 = 0;
    while (1) {
      __pyx_t_8 = __Pyx_set_iter_next(__pyx_t_3, __pyx_t_6, &__pyx_t_5, &__pyx_t_4, __pyx_t_7);
      if (unlikely(__pyx_t_8 == 0)) break;
      if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 1092, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1092, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_9genexpr27__pyx_v_n = __pyx_t_8;
      __pyx_t_10 = ((__pyx_9genexpr27__pyx_v_n > __pyx_v_self->LM) != 0);
      if (__pyx_t_10) {
      } else {
        __pyx_t_9 = __pyx_t_10;
        goto __pyx_L6_bool_binop_done;
      }
      __pyx_t_10 = ((__pyx_9genexpr27__pyx_v_n < __pyx_v_self->RM) != 0);
      __pyx_t_9 = __pyx_t_10;
      __pyx_L6_bool_binop_done:;
      if (__pyx_t_9) {
        __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_9genexpr27__pyx_v_n); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1092, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 1092, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } /* exit inner scope */
  __pyx_t_1 = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_11 = PyList_Sort(__pyx_t_1); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 1092, __pyx_L1_error)
  __pyx_v_internal_skips = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "_element_graph.pyx":1093
 *         introns = []
 *         internal_skips = sorted([n for n in self.nonmembers if n > self.LM and n < self.RM])
 *         istart = iend = -1             # <<<<<<<<<<<<<<
 *         for i in internal_skips:
 *             if iend == -1: # Uninitialized
 */
  __pyx_v_istart = -1;
  __pyx_v_iend = -1;

  /* "_element_graph.pyx":1094
 *         internal_skips = sorted([n for n in self.nonmembers if n > self.LM and n < self.RM])
 *         istart = iend = -1
 *         for i in internal_skips:             # <<<<<<<<<<<<<<
 *             if iend == -1: # Uninitialized
 *                 istart = iend = i
 */
  if (unlikely(__pyx_v_internal_skips == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(0, 1094, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_v_internal_skips; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0;
  for (;;) {
    if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1094, __pyx_L1_error)
    #else
    __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1094, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
    __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1094, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_i = __pyx_t_7;

    /* "_element_graph.pyx":1095
 *         istart = iend = -1
 *         for i in internal_skips:
 *             if iend == -1: # Uninitialized             # <<<<<<<<<<<<<<
 *                 istart = iend = i
 *             elif i == iend + 1: # Contiguous
 */
    __pyx_t_9 = ((__pyx_v_iend == -1L) != 0);
    if (__pyx_t_9) {

      /* "_element_graph.pyx":1096
 *         for i in internal_skips:
 *             if iend == -1: # Uninitialized
 *                 istart = iend = i             # <<<<<<<<<<<<<<
 *             elif i == iend + 1: # Contiguous
 *                 iend = i
 */
      __pyx_v_istart = __pyx_v_i;
      __pyx_v_iend = __pyx_v_i;

      /* "_element_graph.pyx":1095
 *         istart = iend = -1
 *         for i in internal_skips:
 *             if iend == -1: # Uninitialized             # <<<<<<<<<<<<<<
 *                 istart = iend = i
 *             elif i == iend + 1: # Contiguous
 */
      goto __pyx_L10;
    }

    /* "_element_graph.pyx":1097
 *             if iend == -1: # Uninitialized
 *                 istart = iend = i
 *             elif i == iend + 1: # Contiguous             # <<<<<<<<<<<<<<
 *                 iend = i
 *             else: # Gapped
 */
    __pyx_t_9 = ((__pyx_v_i == (__pyx_v_iend + 1)) != 0);
    if (__pyx_t_9) {

      /* "_element_graph.pyx":1098
 *                 istart = iend = i
 *             elif i == iend + 1: # Contiguous
 *                 iend = i             # <<<<<<<<<<<<<<
 *             else: # Gapped
 *                 introns.append((istart,iend))
 */
      __pyx_v_iend = __pyx_v_i;

      /* "_element_graph.pyx":1097
 *             if iend == -1: # Uninitialized
 *                 istart = iend = i
 *             elif i == iend + 1: # Contiguous             # <<<<<<<<<<<<<<
 *                 iend = i
 *             else: # Gapped
 */
      goto __pyx_L10;
    }

    /* "_element_graph.pyx":1100
 *                 iend = i
 *             else: # Gapped
 *                 introns.append((istart,iend))             # <<<<<<<<<<<<<<
 *                 istart = iend = i
 * 
 */
    /*else*/ {
      __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_istart); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1100, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_iend); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1100, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1100, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
      __pyx_t_2 = 0;
      __pyx_t_3 = 0;
      __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_introns, __pyx_t_4); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 1100, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "_element_graph.pyx":1101
 *             else: # Gapped
 *                 introns.append((istart,iend))
 *                 istart = iend = i             # <<<<<<<<<<<<<<
 * 
 *         if istart != -1:
 */
      __pyx_v_istart = __pyx_v_i;
      __pyx_v_iend = __pyx_v_i;
    }
    __pyx_L10:;

    /* "_element_graph.pyx":1094
 *         internal_skips = sorted([n for n in self.nonmembers if n > self.LM and n < self.RM])
 *         istart = iend = -1
 *         for i in internal_skips:             # <<<<<<<<<<<<<<
 *             if iend == -1: # Uninitialized
 *                 istart = iend = i
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_element_graph.pyx":1103
 *                 istart = iend = i
 * 
 *         if istart != -1:             # <<<<<<<<<<<<<<
 *             introns.append((istart,iend))
 * 
 */
  __pyx_t_9 = ((__pyx_v_istart != -1L) != 0);
  if (__pyx_t_9) {

    /* "_element_graph.pyx":1104
 * 
 *         if istart != -1:
 *             introns.append((istart,iend))             # <<<<<<<<<<<<<<
 * 
 *         return introns
 */
    __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_istart); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1104, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_iend); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1104, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1104, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4);
    __pyx_t_1 = 0;
    __pyx_t_4 = 0;
    __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_introns, __pyx_t_3); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 1104, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "_element_graph.pyx":1103
 *                 istart = iend = i
 * 
 *         if istart != -1:             # <<<<<<<<<<<<<<
 *             introns.append((istart,iend))
 * 
 */
  }

  /* "_element_graph.pyx":1106
 *             introns.append((istart,iend))
 * 
 *         return introns             # <<<<<<<<<<<<<<
 * 
 *     cpdef list get_exons(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_introns);
  __pyx_r = __pyx_v_introns;
  goto __pyx_L0;

  /* "_element_graph.pyx":1084
 *         return False
 * 
 *     cpdef list get_introns(self):             # <<<<<<<<<<<<<<
 *         """Returns a list of membership index pairs that mark the
 *         start and end of each internal gap (intron) in the path."""
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("_element_graph.Element.get_introns", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_introns);
  __Pyx_XDECREF(__pyx_v_internal_skips);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_7Element_33get_introns(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_14_element_graph_7Element_32get_introns[] = "Returns a list of membership index pairs that mark the\n        start and end of each internal gap (intron) in the path.";
static PyObject *__pyx_pw_14_element_graph_7Element_33get_introns(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_introns (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_32get_introns(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self));

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

static PyObject *__pyx_pf_14_element_graph_7Element_32get_introns(struct __pyx_obj_14_element_graph_Element *__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_introns", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_14_element_graph_7Element_get_introns(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1084, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "_element_graph.pyx":1108
 *         return introns
 * 
 *     cpdef list get_exons(self):             # <<<<<<<<<<<<<<
 *         """Returns a list of membership index pairs that mark the
 *         start and end of each contiguous stretch (exon) in the path."""
 */

static PyObject *__pyx_pw_14_element_graph_7Element_35get_exons(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_14_element_graph_7Element_get_exons(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, int __pyx_skip_dispatch) {
  int __pyx_v_istart;
  int __pyx_v_iend;
  int __pyx_v_i;
  PyObject *__pyx_v_exons = 0;
  PyObject *__pyx_v_internal_members = 0;
  int __pyx_9genexpr28__pyx_v_m;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_exons", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_exons); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1108, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_14_element_graph_7Element_35get_exons)) {
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1108, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 1108, __pyx_L1_error)
        __pyx_r = ((PyObject*)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "_element_graph.pyx":1115
 *             list exons, internal_members
 * 
 *         exons = []             # <<<<<<<<<<<<<<
 *         internal_members = sorted([m for m in self.members if m >= self.LM and m <= self.RM])
 *         istart = iend = -1
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1115, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_exons = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "_element_graph.pyx":1116
 * 
 *         exons = []
 *         internal_members = sorted([m for m in self.members if m >= self.LM and m <= self.RM])             # <<<<<<<<<<<<<<
 *         istart = iend = -1
 *         for i in internal_members:
 */
  { /* enter inner scope */
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1116, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = 0;
    __pyx_t_4 = __Pyx_set_iterator(__pyx_v_self->members, 1, (&__pyx_t_6), (&__pyx_t_7)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1116, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3);
    __pyx_t_3 = __pyx_t_4;
    __pyx_t_4 = 0;
    while (1) {
      __pyx_t_8 = __Pyx_set_iter_next(__pyx_t_3, __pyx_t_6, &__pyx_t_5, &__pyx_t_4, __pyx_t_7);
      if (unlikely(__pyx_t_8 == 0)) break;
      if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 1116, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1116, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_9genexpr28__pyx_v_m = __pyx_t_8;
      __pyx_t_10 = ((__pyx_9genexpr28__pyx_v_m >= __pyx_v_self->LM) != 0);
      if (__pyx_t_10) {
      } else {
        __pyx_t_9 = __pyx_t_10;
        goto __pyx_L6_bool_binop_done;
      }
      __pyx_t_10 = ((__pyx_9genexpr28__pyx_v_m <= __pyx_v_self->RM) != 0);
      __pyx_t_9 = __pyx_t_10;
      __pyx_L6_bool_binop_done:;
      if (__pyx_t_9) {
        __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_9genexpr28__pyx_v_m); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1116, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 1116, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } /* exit inner scope */
  __pyx_t_1 = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_11 = PyList_Sort(__pyx_t_1); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 1116, __pyx_L1_error)
  __pyx_v_internal_members = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "_element_graph.pyx":1117
 *         exons = []
 *         internal_members = sorted([m for m in self.members if m >= self.LM and m <= self.RM])
 *         istart = iend = -1             # <<<<<<<<<<<<<<
 *         for i in internal_members:
 *             if iend == -1: # Uninitialized
 */
  __pyx_v_istart = -1;
  __pyx_v_iend = -1;

  /* "_element_graph.pyx":1118
 *         internal_members = sorted([m for m in self.members if m >= self.LM and m <= self.RM])
 *         istart = iend = -1
 *         for i in internal_members:             # <<<<<<<<<<<<<<
 *             if iend == -1: # Uninitialized
 *                 istart = iend = i
 */
  if (unlikely(__pyx_v_internal_members == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(0, 1118, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_v_internal_members; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0;
  for (;;) {
    if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1118, __pyx_L1_error)
    #else
    __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1118, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
    __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1118, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_i = __pyx_t_7;

    /* "_element_graph.pyx":1119
 *         istart = iend = -1
 *         for i in internal_members:
 *             if iend == -1: # Uninitialized             # <<<<<<<<<<<<<<
 *                 istart = iend = i
 *             elif i == iend + 1: # Contiguous
 */
    __pyx_t_9 = ((__pyx_v_iend == -1L) != 0);
    if (__pyx_t_9) {

      /* "_element_graph.pyx":1120
 *         for i in internal_members:
 *             if iend == -1: # Uninitialized
 *                 istart = iend = i             # <<<<<<<<<<<<<<
 *             elif i == iend + 1: # Contiguous
 *                 iend = i
 */
      __pyx_v_istart = __pyx_v_i;
      __pyx_v_iend = __pyx_v_i;

      /* "_element_graph.pyx":1119
 *         istart = iend = -1
 *         for i in internal_members:
 *             if iend == -1: # Uninitialized             # <<<<<<<<<<<<<<
 *                 istart = iend = i
 *             elif i == iend + 1: # Contiguous
 */
      goto __pyx_L10;
    }

    /* "_element_graph.pyx":1121
 *             if iend == -1: # Uninitialized
 *                 istart = iend = i
 *             elif i == iend + 1: # Contiguous             # <<<<<<<<<<<<<<
 *                 iend = i
 *             else: # Gapped
 */
    __pyx_t_9 = ((__pyx_v_i == (__pyx_v_iend + 1)) != 0);
    if (__pyx_t_9) {

      /* "_element_graph.pyx":1122
 *                 istart = iend = i
 *             elif i == iend + 1: # Contiguous
 *                 iend = i             # <<<<<<<<<<<<<<
 *             else: # Gapped
 *                 exons.append((istart,iend))
 */
      __pyx_v_iend = __pyx_v_i;

      /* "_element_graph.pyx":1121
 *             if iend == -1: # Uninitialized
 *                 istart = iend = i
 *             elif i == iend + 1: # Contiguous             # <<<<<<<<<<<<<<
 *                 iend = i
 *             else: # Gapped
 */
      goto __pyx_L10;
    }

    /* "_element_graph.pyx":1124
 *                 iend = i
 *             else: # Gapped
 *                 exons.append((istart,iend))             # <<<<<<<<<<<<<<
 *                 istart = iend = i
 * 
 */
    /*else*/ {
      __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_istart); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1124, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_iend); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1124, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1124, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
      __pyx_t_2 = 0;
      __pyx_t_3 = 0;
      __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_exons, __pyx_t_4); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 1124, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "_element_graph.pyx":1125
 *             else: # Gapped
 *                 exons.append((istart,iend))
 *                 istart = iend = i             # <<<<<<<<<<<<<<
 * 
 *         if istart != -1:
 */
      __pyx_v_istart = __pyx_v_i;
      __pyx_v_iend = __pyx_v_i;
    }
    __pyx_L10:;

    /* "_element_graph.pyx":1118
 *         internal_members = sorted([m for m in self.members if m >= self.LM and m <= self.RM])
 *         istart = iend = -1
 *         for i in internal_members:             # <<<<<<<<<<<<<<
 *             if iend == -1: # Uninitialized
 *                 istart = iend = i
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_element_graph.pyx":1127
 *                 istart = iend = i
 * 
 *         if istart != -1:             # <<<<<<<<<<<<<<
 *             exons.append((istart,iend))
 * 
 */
  __pyx_t_9 = ((__pyx_v_istart != -1L) != 0);
  if (__pyx_t_9) {

    /* "_element_graph.pyx":1128
 * 
 *         if istart != -1:
 *             exons.append((istart,iend))             # <<<<<<<<<<<<<<
 * 
 *         return exons
 */
    __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_istart); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1128, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_iend); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1128, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1128, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4);
    __pyx_t_1 = 0;
    __pyx_t_4 = 0;
    __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_exons, __pyx_t_3); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 1128, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "_element_graph.pyx":1127
 *                 istart = iend = i
 * 
 *         if istart != -1:             # <<<<<<<<<<<<<<
 *             exons.append((istart,iend))
 * 
 */
  }

  /* "_element_graph.pyx":1130
 *             exons.append((istart,iend))
 * 
 *         return exons             # <<<<<<<<<<<<<<
 * 
 *     cpdef void merge(self, Element other, np.ndarray proportion):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_exons);
  __pyx_r = __pyx_v_exons;
  goto __pyx_L0;

  /* "_element_graph.pyx":1108
 *         return introns
 * 
 *     cpdef list get_exons(self):             # <<<<<<<<<<<<<<
 *         """Returns a list of membership index pairs that mark the
 *         start and end of each contiguous stretch (exon) in the path."""
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("_element_graph.Element.get_exons", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_exons);
  __Pyx_XDECREF(__pyx_v_internal_members);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_7Element_35get_exons(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_14_element_graph_7Element_34get_exons[] = "Returns a list of membership index pairs that mark the\n        start and end of each contiguous stretch (exon) in the path.";
static PyObject *__pyx_pw_14_element_graph_7Element_35get_exons(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_exons (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_34get_exons(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self));

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

static PyObject *__pyx_pf_14_element_graph_7Element_34get_exons(struct __pyx_obj_14_element_graph_Element *__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_exons", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_14_element_graph_7Element_get_exons(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "_element_graph.pyx":1132
 *         return exons
 * 
 *     cpdef void merge(self, Element other, np.ndarray proportion):             # <<<<<<<<<<<<<<
 *         """Add an Element to this one, combining their membership and reads
 *         through in-place updates of self."""
 */

static PyObject *__pyx_pw_14_element_graph_7Element_37merge(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_14_element_graph_7Element_merge(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, struct __pyx_obj_14_element_graph_Element *__pyx_v_other, PyArrayObject *__pyx_v_proportion, int __pyx_skip_dispatch) {
  PyObject *__pyx_v_unique = 0;
  float __pyx_v_old_length;
  PyObject *__pyx_v_f = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  char __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  int __pyx_t_13;
  int __pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("merge", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_merge); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1132, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_14_element_graph_7Element_37merge)) {
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        __pyx_t_5 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
            __pyx_t_5 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[3] = {__pyx_t_4, ((PyObject *)__pyx_v_other), ((PyObject *)__pyx_v_proportion)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1132, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[3] = {__pyx_t_4, ((PyObject *)__pyx_v_other), ((PyObject *)__pyx_v_proportion)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1132, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1132, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          if (__pyx_t_4) {
            __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
          }
          __Pyx_INCREF(((PyObject *)__pyx_v_other));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_other));
          PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, ((PyObject *)__pyx_v_other));
          __Pyx_INCREF(((PyObject *)__pyx_v_proportion));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_proportion));
          PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, ((PyObject *)__pyx_v_proportion));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1132, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        }
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "_element_graph.pyx":1139
 *         cdef int o, i, leftMember, rightMember
 *         cdef float old_length
 *         if self.empty:             # <<<<<<<<<<<<<<
 *             return
 * 
 */
  __pyx_t_7 = (__pyx_v_self->empty != 0);
  if (__pyx_t_7) {

    /* "_element_graph.pyx":1140
 *         cdef float old_length
 *         if self.empty:
 *             return             # <<<<<<<<<<<<<<
 * 
 *         if not self.compatible(other):
 */
    goto __pyx_L0;

    /* "_element_graph.pyx":1139
 *         cdef int o, i, leftMember, rightMember
 *         cdef float old_length
 *         if self.empty:             # <<<<<<<<<<<<<<
 *             return
 * 
 */
  }

  /* "_element_graph.pyx":1142
 *             return
 * 
 *         if not self.compatible(other):             # <<<<<<<<<<<<<<
 *             print('ERROR: {} incompatible with {}'.format(self, other))
 *             self.outgroup.discard(other.index)
 */
  __pyx_t_7 = ((!(((struct __pyx_vtabstruct_14_element_graph_Element *)__pyx_v_self->__pyx_vtab)->compatible(__pyx_v_self, __pyx_v_other, 0) != 0)) != 0);
  if (__pyx_t_7) {

    /* "_element_graph.pyx":1143
 * 
 *         if not self.compatible(other):
 *             print('ERROR: {} incompatible with {}'.format(self, other))             # <<<<<<<<<<<<<<
 *             self.outgroup.discard(other.index)
 *             self.ingroup.discard(other.index)
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_ERROR_incompatible_with, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1143, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    __pyx_t_5 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_5 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other)};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1143, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other)};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1143, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    {
      __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1143, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (__pyx_t_3) {
        __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
      }
      __Pyx_INCREF(((PyObject *)__pyx_v_self));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
      PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, ((PyObject *)__pyx_v_self));
      __Pyx_INCREF(((PyObject *)__pyx_v_other));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_other));
      PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, ((PyObject *)__pyx_v_other));
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1143, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1143, __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;

    /* "_element_graph.pyx":1144
 *         if not self.compatible(other):
 *             print('ERROR: {} incompatible with {}'.format(self, other))
 *             self.outgroup.discard(other.index)             # <<<<<<<<<<<<<<
 *             self.ingroup.discard(other.index)
 *             other.outgroup.discard(self.index)
 */
    if (unlikely(__pyx_v_self->outgroup == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "discard");
      __PYX_ERR(0, 1144, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_other->index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1144, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_8 = __Pyx_PySet_Discard(__pyx_v_self->outgroup, __pyx_t_2); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 1144, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "_element_graph.pyx":1145
 *             print('ERROR: {} incompatible with {}'.format(self, other))
 *             self.outgroup.discard(other.index)
 *             self.ingroup.discard(other.index)             # <<<<<<<<<<<<<<
 *             other.outgroup.discard(self.index)
 *             other.ingroup.discard(self.index)
 */
    if (unlikely(__pyx_v_self->ingroup == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "discard");
      __PYX_ERR(0, 1145, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_other->index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1145, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_8 = __Pyx_PySet_Discard(__pyx_v_self->ingroup, __pyx_t_2); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 1145, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "_element_graph.pyx":1146
 *             self.outgroup.discard(other.index)
 *             self.ingroup.discard(other.index)
 *             other.outgroup.discard(self.index)             # <<<<<<<<<<<<<<
 *             other.ingroup.discard(self.index)
 *             return
 */
    if (unlikely(__pyx_v_other->outgroup == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "discard");
      __PYX_ERR(0, 1146, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1146, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_8 = __Pyx_PySet_Discard(__pyx_v_other->outgroup, __pyx_t_2); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 1146, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "_element_graph.pyx":1147
 *             self.ingroup.discard(other.index)
 *             other.outgroup.discard(self.index)
 *             other.ingroup.discard(self.index)             # <<<<<<<<<<<<<<
 *             return
 * 
 */
    if (unlikely(__pyx_v_other->ingroup == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "discard");
      __PYX_ERR(0, 1147, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1147, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_8 = __Pyx_PySet_Discard(__pyx_v_other->ingroup, __pyx_t_2); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 1147, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "_element_graph.pyx":1148
 *             other.outgroup.discard(self.index)
 *             other.ingroup.discard(self.index)
 *             return             # <<<<<<<<<<<<<<
 * 
 *         if self.strand == 0 and other.strand != 0:
 */
    goto __pyx_L0;

    /* "_element_graph.pyx":1142
 *             return
 * 
 *         if not self.compatible(other):             # <<<<<<<<<<<<<<
 *             print('ERROR: {} incompatible with {}'.format(self, other))
 *             self.outgroup.discard(other.index)
 */
  }

  /* "_element_graph.pyx":1150
 *             return
 * 
 *         if self.strand == 0 and other.strand != 0:             # <<<<<<<<<<<<<<
 *             self.strand = other.strand
 * 
 */
  __pyx_t_9 = ((__pyx_v_self->strand == 0) != 0);
  if (__pyx_t_9) {
  } else {
    __pyx_t_7 = __pyx_t_9;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_9 = ((__pyx_v_other->strand != 0) != 0);
  __pyx_t_7 = __pyx_t_9;
  __pyx_L6_bool_binop_done:;
  if (__pyx_t_7) {

    /* "_element_graph.pyx":1151
 * 
 *         if self.strand == 0 and other.strand != 0:
 *             self.strand = other.strand             # <<<<<<<<<<<<<<
 * 
 *         old_length = self.length
 */
    __pyx_t_10 = __pyx_v_other->strand;
    __pyx_v_self->strand = __pyx_t_10;

    /* "_element_graph.pyx":1150
 *             return
 * 
 *         if self.strand == 0 and other.strand != 0:             # <<<<<<<<<<<<<<
 *             self.strand = other.strand
 * 
 */
  }

  /* "_element_graph.pyx":1153
 *             self.strand = other.strand
 * 
 *         old_length = self.length             # <<<<<<<<<<<<<<
 *         self.contains.update(other.contains)
 *         self.contained.intersection_update(other.contained)
 */
  __pyx_t_5 = __pyx_v_self->length;
  __pyx_v_old_length = __pyx_t_5;

  /* "_element_graph.pyx":1154
 * 
 *         old_length = self.length
 *         self.contains.update(other.contains)             # <<<<<<<<<<<<<<
 *         self.contained.intersection_update(other.contained)
 *         unique = other.uniqueMembers(self)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->contains, __pyx_n_s_update); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_6, __pyx_v_other->contains) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_other->contains);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1154, __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;

  /* "_element_graph.pyx":1155
 *         old_length = self.length
 *         self.contains.update(other.contains)
 *         self.contained.intersection_update(other.contained)             # <<<<<<<<<<<<<<
 *         unique = other.uniqueMembers(self)
 *         # Update Membership
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->contained, __pyx_n_s_intersection_update); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1155, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_6, __pyx_v_other->contained) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_other->contained);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1155, __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;

  /* "_element_graph.pyx":1156
 *         self.contains.update(other.contains)
 *         self.contained.intersection_update(other.contained)
 *         unique = other.uniqueMembers(self)             # <<<<<<<<<<<<<<
 *         # Update Membership
 *         self.nonmembers.update(other.nonmembers)
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_14_element_graph_Element *)__pyx_v_other->__pyx_vtab)->uniqueMembers(__pyx_v_other, __pyx_v_self, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1156, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_unique = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "_element_graph.pyx":1158
 *         unique = other.uniqueMembers(self)
 *         # Update Membership
 *         self.nonmembers.update(other.nonmembers)             # <<<<<<<<<<<<<<
 *         # Update Overlaps
 *         self.excludes.update(other.excludes) # Sum of exclusions
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->nonmembers, __pyx_n_s_update); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1158, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_6, __pyx_v_other->nonmembers) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_other->nonmembers);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1158, __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;

  /* "_element_graph.pyx":1160
 *         self.nonmembers.update(other.nonmembers)
 *         # Update Overlaps
 *         self.excludes.update(other.excludes) # Sum of exclusions             # <<<<<<<<<<<<<<
 *         self.includes.update(other.includes) # Sum of inclusions
 *         self.contains.update(self.includes)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->excludes, __pyx_n_s_update); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1160, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_6, __pyx_v_other->excludes) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_other->excludes);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1160, __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;

  /* "_element_graph.pyx":1161
 *         # Update Overlaps
 *         self.excludes.update(other.excludes) # Sum of exclusions
 *         self.includes.update(other.includes) # Sum of inclusions             # <<<<<<<<<<<<<<
 *         self.contains.update(self.includes)
 *         if len(unique) > 0:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->includes, __pyx_n_s_update); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1161, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_6, __pyx_v_other->includes) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_other->includes);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1161, __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;

  /* "_element_graph.pyx":1162
 *         self.excludes.update(other.excludes) # Sum of exclusions
 *         self.includes.update(other.includes) # Sum of inclusions
 *         self.contains.update(self.includes)             # <<<<<<<<<<<<<<
 *         if len(unique) > 0:
 *             self.outgroup.update(other.outgroup.difference(self.excludes))
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->contains, __pyx_n_s_update); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1162, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_6, __pyx_v_self->includes) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_self->includes);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1162, __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;

  /* "_element_graph.pyx":1163
 *         self.includes.update(other.includes) # Sum of inclusions
 *         self.contains.update(self.includes)
 *         if len(unique) > 0:             # <<<<<<<<<<<<<<
 *             self.outgroup.update(other.outgroup.difference(self.excludes))
 *             self.ingroup.update(other.ingroup.difference(self.excludes))
 */
  if (unlikely(__pyx_v_unique == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(0, 1163, __pyx_L1_error)
  }
  __pyx_t_11 = PySet_GET_SIZE(__pyx_v_unique); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1163, __pyx_L1_error)
  __pyx_t_7 = ((__pyx_t_11 > 0) != 0);
  if (__pyx_t_7) {

    /* "_element_graph.pyx":1164
 *         self.contains.update(self.includes)
 *         if len(unique) > 0:
 *             self.outgroup.update(other.outgroup.difference(self.excludes))             # <<<<<<<<<<<<<<
 *             self.ingroup.update(other.ingroup.difference(self.excludes))
 *             for f in unique: # Append each frag from other to self
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->outgroup, __pyx_n_s_update); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1164, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other->outgroup, __pyx_n_s_difference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1164, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_self->excludes) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_self->excludes);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1164, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __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, 1164, __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;

    /* "_element_graph.pyx":1165
 *         if len(unique) > 0:
 *             self.outgroup.update(other.outgroup.difference(self.excludes))
 *             self.ingroup.update(other.ingroup.difference(self.excludes))             # <<<<<<<<<<<<<<
 *             for f in unique: # Append each frag from other to self
 *                 self.members.add(f)
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->ingroup, __pyx_n_s_update); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1165, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other->ingroup, __pyx_n_s_difference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1165, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_self->excludes) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_self->excludes);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1165, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __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, 1165, __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;

    /* "_element_graph.pyx":1166
 *             self.outgroup.update(other.outgroup.difference(self.excludes))
 *             self.ingroup.update(other.ingroup.difference(self.excludes))
 *             for f in unique: # Append each frag from other to self             # <<<<<<<<<<<<<<
 *                 self.members.add(f)
 *                 self.length += self.frag_len[f]
 */
    __pyx_t_11 = 0;
    __pyx_t_1 = __Pyx_set_iterator(__pyx_v_unique, 1, (&__pyx_t_12), (&__pyx_t_5)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1166, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __pyx_t_2 = __pyx_t_1;
    __pyx_t_1 = 0;
    while (1) {
      __pyx_t_13 = __Pyx_set_iter_next(__pyx_t_2, __pyx_t_12, &__pyx_t_11, &__pyx_t_1, __pyx_t_5);
      if (unlikely(__pyx_t_13 == 0)) break;
      if (unlikely(__pyx_t_13 == -1)) __PYX_ERR(0, 1166, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_XDECREF_SET(__pyx_v_f, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "_element_graph.pyx":1167
 *             self.ingroup.update(other.ingroup.difference(self.excludes))
 *             for f in unique: # Append each frag from other to self
 *                 self.members.add(f)             # <<<<<<<<<<<<<<
 *                 self.length += self.frag_len[f]
 * 
 */
      if (unlikely(__pyx_v_self->members == Py_None)) {
        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add");
        __PYX_ERR(0, 1167, __pyx_L1_error)
      }
      __pyx_t_8 = PySet_Add(__pyx_v_self->members, __pyx_v_f); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 1167, __pyx_L1_error)

      /* "_element_graph.pyx":1168
 *             for f in unique: # Append each frag from other to self
 *                 self.members.add(f)
 *                 self.length += self.frag_len[f]             # <<<<<<<<<<<<<<
 * 
 *             # Update the left and right borders of the Element
 */
      __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1168, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->frag_len), __pyx_v_f); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1168, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1168, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1168, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_self->length = __pyx_t_13;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "_element_graph.pyx":1171
 * 
 *             # Update the left and right borders of the Element
 *             self.right = max(self.right, other.right)             # <<<<<<<<<<<<<<
 *             self.left = min(self.left, other.left)
 * 
 */
    __pyx_t_5 = __pyx_v_other->right;
    __pyx_t_13 = __pyx_v_self->right;
    if (((__pyx_t_5 > __pyx_t_13) != 0)) {
      __pyx_t_14 = __pyx_t_5;
    } else {
      __pyx_t_14 = __pyx_t_13;
    }
    __pyx_v_self->right = __pyx_t_14;

    /* "_element_graph.pyx":1172
 *             # Update the left and right borders of the Element
 *             self.right = max(self.right, other.right)
 *             self.left = min(self.left, other.left)             # <<<<<<<<<<<<<<
 * 
 *         self.outgroup.difference_update(self.contains|self.excludes)
 */
    __pyx_t_14 = __pyx_v_other->left;
    __pyx_t_5 = __pyx_v_self->left;
    if (((__pyx_t_14 < __pyx_t_5) != 0)) {
      __pyx_t_13 = __pyx_t_14;
    } else {
      __pyx_t_13 = __pyx_t_5;
    }
    __pyx_v_self->left = __pyx_t_13;

    /* "_element_graph.pyx":1163
 *         self.includes.update(other.includes) # Sum of inclusions
 *         self.contains.update(self.includes)
 *         if len(unique) > 0:             # <<<<<<<<<<<<<<
 *             self.outgroup.update(other.outgroup.difference(self.excludes))
 *             self.ingroup.update(other.ingroup.difference(self.excludes))
 */
  }

  /* "_element_graph.pyx":1174
 *             self.left = min(self.left, other.left)
 * 
 *         self.outgroup.difference_update(self.contains|self.excludes)             # <<<<<<<<<<<<<<
 *         self.ingroup.difference_update(self.contains|self.excludes)
 *         self.source_weights = (other.source_weights*other.length*proportion + self.source_weights*old_length)/self.length
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->outgroup, __pyx_n_s_difference_update); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1174, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = PyNumber_Or(__pyx_v_self->contains, __pyx_v_self->excludes); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1174, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1174, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "_element_graph.pyx":1175
 * 
 *         self.outgroup.difference_update(self.contains|self.excludes)
 *         self.ingroup.difference_update(self.contains|self.excludes)             # <<<<<<<<<<<<<<
 *         self.source_weights = (other.source_weights*other.length*proportion + self.source_weights*old_length)/self.length
 *         self.member_weights += other.member_weights*np.sum(other.source_weights*proportion)/np.sum(other.source_weights)
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->ingroup, __pyx_n_s_difference_update); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1175, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = PyNumber_Or(__pyx_v_self->contains, __pyx_v_self->excludes); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1175, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1175, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "_element_graph.pyx":1176
 *         self.outgroup.difference_update(self.contains|self.excludes)
 *         self.ingroup.difference_update(self.contains|self.excludes)
 *         self.source_weights = (other.source_weights*other.length*proportion + self.source_weights*old_length)/self.length             # <<<<<<<<<<<<<<
 *         self.member_weights += other.member_weights*np.sum(other.source_weights*proportion)/np.sum(other.source_weights)
 *         self.right = max(self.right, other.right)
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_other->length); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyNumber_Multiply(((PyObject *)__pyx_v_other->source_weights), __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Multiply(__pyx_t_3, ((PyObject *)__pyx_v_proportion)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_old_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = PyNumber_Multiply(((PyObject *)__pyx_v_self->source_weights), __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_self->length); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1176, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->source_weights);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->source_weights));
  __pyx_v_self->source_weights = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "_element_graph.pyx":1177
 *         self.ingroup.difference_update(self.contains|self.excludes)
 *         self.source_weights = (other.source_weights*other.length*proportion + self.source_weights*old_length)/self.length
 *         self.member_weights += other.member_weights*np.sum(other.source_weights*proportion)/np.sum(other.source_weights)             # <<<<<<<<<<<<<<
 *         self.right = max(self.right, other.right)
 *         self.left = min(self.left, other.left)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_sum); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyNumber_Multiply(((PyObject *)__pyx_v_other->source_weights), ((PyObject *)__pyx_v_proportion)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Multiply(((PyObject *)__pyx_v_other->member_weights), __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_sum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_6, ((PyObject *)__pyx_v_other->source_weights)) : __Pyx_PyObject_CallOneArg(__pyx_t_1, ((PyObject *)__pyx_v_other->source_weights));
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_InPlaceAdd(((PyObject *)__pyx_v_self->member_weights), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1177, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->member_weights);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->member_weights));
  __pyx_v_self->member_weights = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "_element_graph.pyx":1178
 *         self.source_weights = (other.source_weights*other.length*proportion + self.source_weights*old_length)/self.length
 *         self.member_weights += other.member_weights*np.sum(other.source_weights*proportion)/np.sum(other.source_weights)
 *         self.right = max(self.right, other.right)             # <<<<<<<<<<<<<<
 *         self.left = min(self.left, other.left)
 *         self.update()
 */
  __pyx_t_13 = __pyx_v_other->right;
  __pyx_t_14 = __pyx_v_self->right;
  if (((__pyx_t_13 > __pyx_t_14) != 0)) {
    __pyx_t_5 = __pyx_t_13;
  } else {
    __pyx_t_5 = __pyx_t_14;
  }
  __pyx_v_self->right = __pyx_t_5;

  /* "_element_graph.pyx":1179
 *         self.member_weights += other.member_weights*np.sum(other.source_weights*proportion)/np.sum(other.source_weights)
 *         self.right = max(self.right, other.right)
 *         self.left = min(self.left, other.left)             # <<<<<<<<<<<<<<
 *         self.update()
 *         # if self.strand == 1: # Enforce directionality of edges
 */
  __pyx_t_5 = __pyx_v_other->left;
  __pyx_t_13 = __pyx_v_self->left;
  if (((__pyx_t_5 < __pyx_t_13) != 0)) {
    __pyx_t_14 = __pyx_t_5;
  } else {
    __pyx_t_14 = __pyx_t_13;
  }
  __pyx_v_self->left = __pyx_t_14;

  /* "_element_graph.pyx":1180
 *         self.right = max(self.right, other.right)
 *         self.left = min(self.left, other.left)
 *         self.update()             # <<<<<<<<<<<<<<
 *         # if self.strand == 1: # Enforce directionality of edges
 *         #     self.outgroup = set([o for o in self.outgroup if o > self.right])
 */
  ((struct __pyx_vtabstruct_14_element_graph_Element *)__pyx_v_self->__pyx_vtab)->update(__pyx_v_self, 0);

  /* "_element_graph.pyx":1132
 *         return exons
 * 
 *     cpdef void merge(self, Element other, np.ndarray proportion):             # <<<<<<<<<<<<<<
 *         """Add an Element to this one, combining their membership and reads
 *         through in-place updates of self."""
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_WriteUnraisable("_element_graph.Element.merge", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_unique);
  __Pyx_XDECREF(__pyx_v_f);
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_7Element_37merge(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_14_element_graph_7Element_36merge[] = "Add an Element to this one, combining their membership and reads\n        through in-place updates of self.";
static PyObject *__pyx_pw_14_element_graph_7Element_37merge(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_14_element_graph_Element *__pyx_v_other = 0;
  PyArrayObject *__pyx_v_proportion = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("merge (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,&__pyx_n_s_proportion,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_proportion)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("merge", 1, 2, 2, 1); __PYX_ERR(0, 1132, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "merge") < 0)) __PYX_ERR(0, 1132, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_other = ((struct __pyx_obj_14_element_graph_Element *)values[0]);
    __pyx_v_proportion = ((PyArrayObject *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("merge", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1132, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("_element_graph.Element.merge", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_14_element_graph_Element, 1, "other", 0))) __PYX_ERR(0, 1132, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_proportion), __pyx_ptype_5numpy_ndarray, 1, "proportion", 0))) __PYX_ERR(0, 1132, __pyx_L1_error)
  __pyx_r = __pyx_pf_14_element_graph_7Element_36merge(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self), __pyx_v_other, __pyx_v_proportion);

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

static PyObject *__pyx_pf_14_element_graph_7Element_36merge(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, struct __pyx_obj_14_element_graph_Element *__pyx_v_other, PyArrayObject *__pyx_v_proportion) {
  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("merge", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_14_element_graph_7Element_merge(__pyx_v_self, __pyx_v_other, __pyx_v_proportion, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "_element_graph.pyx":884
 * cdef class Element:
 *     """Represents a read or collection of reads in a Locus."""
 *     cdef public int index, length, IC, maxIC, left, right, number_of_elements, number_of_members, LM, RM             # <<<<<<<<<<<<<<
 *     cdef public char strand
 *     cdef public float cov, bases, bottleneck_weight, trimmed_bases
 */

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_7Element_5index_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14_element_graph_7Element_5index_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_5index___get__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self));

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

static PyObject *__pyx_pf_14_element_graph_7Element_5index___get__(struct __pyx_obj_14_element_graph_Element *__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);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 884, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_7Element_5index_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_14_element_graph_7Element_5index_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_5index_2__set__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_14_element_graph_7Element_5index_2__set__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 884, __pyx_L1_error)
  __pyx_v_self->index = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("_element_graph.Element.index.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_7Element_6length_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14_element_graph_7Element_6length_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_6length___get__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self));

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

static PyObject *__pyx_pf_14_element_graph_7Element_6length___get__(struct __pyx_obj_14_element_graph_Element *__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);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 884, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_7Element_6length_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_14_element_graph_7Element_6length_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_6length_2__set__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_14_element_graph_7Element_6length_2__set__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 884, __pyx_L1_error)
  __pyx_v_self->length = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("_element_graph.Element.length.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_7Element_2IC_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14_element_graph_7Element_2IC_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_2IC___get__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self));

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

static PyObject *__pyx_pf_14_element_graph_7Element_2IC___get__(struct __pyx_obj_14_element_graph_Element *__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);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->IC); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 884, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_7Element_2IC_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_14_element_graph_7Element_2IC_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_2IC_2__set__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_14_element_graph_7Element_2IC_2__set__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 884, __pyx_L1_error)
  __pyx_v_self->IC = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("_element_graph.Element.IC.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_7Element_5maxIC_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14_element_graph_7Element_5maxIC_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_5maxIC___get__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self));

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

static PyObject *__pyx_pf_14_element_graph_7Element_5maxIC___get__(struct __pyx_obj_14_element_graph_Element *__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);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->maxIC); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 884, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_7Element_5maxIC_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_14_element_graph_7Element_5maxIC_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_5maxIC_2__set__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_14_element_graph_7Element_5maxIC_2__set__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 884, __pyx_L1_error)
  __pyx_v_self->maxIC = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("_element_graph.Element.maxIC.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_7Element_4left_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14_element_graph_7Element_4left_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_4left___get__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self));

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

static PyObject *__pyx_pf_14_element_graph_7Element_4left___get__(struct __pyx_obj_14_element_graph_Element *__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);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->left); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 884, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_7Element_4left_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_14_element_graph_7Element_4left_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_4left_2__set__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_14_element_graph_7Element_4left_2__set__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 884, __pyx_L1_error)
  __pyx_v_self->left = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("_element_graph.Element.left.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_7Element_5right_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14_element_graph_7Element_5right_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_5right___get__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self));

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

static PyObject *__pyx_pf_14_element_graph_7Element_5right___get__(struct __pyx_obj_14_element_graph_Element *__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);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->right); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 884, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_7Element_5right_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_14_element_graph_7Element_5right_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_5right_2__set__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_14_element_graph_7Element_5right_2__set__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 884, __pyx_L1_error)
  __pyx_v_self->right = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("_element_graph.Element.right.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_7Element_18number_of_elements_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14_element_graph_7Element_18number_of_elements_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_18number_of_elements___get__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self));

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

static PyObject *__pyx_pf_14_element_graph_7Element_18number_of_elements___get__(struct __pyx_obj_14_element_graph_Element *__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);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->number_of_elements); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 884, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_7Element_18number_of_elements_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_14_element_graph_7Element_18number_of_elements_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_18number_of_elements_2__set__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_14_element_graph_7Element_18number_of_elements_2__set__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 884, __pyx_L1_error)
  __pyx_v_self->number_of_elements = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("_element_graph.Element.number_of_elements.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_7Element_17number_of_members_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14_element_graph_7Element_17number_of_members_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_17number_of_members___get__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self));

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

static PyObject *__pyx_pf_14_element_graph_7Element_17number_of_members___get__(struct __pyx_obj_14_element_graph_Element *__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);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->number_of_members); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 884, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_7Element_17number_of_members_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_14_element_graph_7Element_17number_of_members_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_17number_of_members_2__set__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_14_element_graph_7Element_17number_of_members_2__set__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 884, __pyx_L1_error)
  __pyx_v_self->number_of_members = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("_element_graph.Element.number_of_members.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_7Element_2LM_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14_element_graph_7Element_2LM_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_2LM___get__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self));

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

static PyObject *__pyx_pf_14_element_graph_7Element_2LM___get__(struct __pyx_obj_14_element_graph_Element *__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);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->LM); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 884, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_7Element_2LM_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_14_element_graph_7Element_2LM_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_2LM_2__set__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_14_element_graph_7Element_2LM_2__set__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 884, __pyx_L1_error)
  __pyx_v_self->LM = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("_element_graph.Element.LM.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_7Element_2RM_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14_element_graph_7Element_2RM_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_2RM___get__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self));

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

static PyObject *__pyx_pf_14_element_graph_7Element_2RM___get__(struct __pyx_obj_14_element_graph_Element *__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);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->RM); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 884, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_7Element_2RM_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_14_element_graph_7Element_2RM_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_2RM_2__set__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_14_element_graph_7Element_2RM_2__set__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 884, __pyx_L1_error)
  __pyx_v_self->RM = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("_element_graph.Element.RM.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_element_graph.pyx":885
 *     """Represents a read or collection of reads in a Locus."""
 *     cdef public int index, length, IC, maxIC, left, right, number_of_elements, number_of_members, LM, RM
 *     cdef public char strand             # <<<<<<<<<<<<<<
 *     cdef public float cov, bases, bottleneck_weight, trimmed_bases
 *     cdef public set members, nonmembers, ingroup, outgroup, contains, contained, excludes, includes, end_indices, covered_indices, bottleneck, assigned_to
 */

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_7Element_6strand_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14_element_graph_7Element_6strand_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_6strand___get__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self));

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

static PyObject *__pyx_pf_14_element_graph_7Element_6strand___get__(struct __pyx_obj_14_element_graph_Element *__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);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_char(__pyx_v_self->strand); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 885, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_7Element_6strand_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_14_element_graph_7Element_6strand_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_6strand_2__set__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_14_element_graph_7Element_6strand_2__set__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  char __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_char(__pyx_v_value); if (unlikely((__pyx_t_1 == (char)-1) && PyErr_Occurred())) __PYX_ERR(0, 885, __pyx_L1_error)
  __pyx_v_self->strand = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("_element_graph.Element.strand.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_element_graph.pyx":886
 *     cdef public int index, length, IC, maxIC, left, right, number_of_elements, number_of_members, LM, RM
 *     cdef public char strand
 *     cdef public float cov, bases, bottleneck_weight, trimmed_bases             # <<<<<<<<<<<<<<
 *     cdef public set members, nonmembers, ingroup, outgroup, contains, contained, excludes, includes, end_indices, covered_indices, bottleneck, assigned_to
 *     cdef public np.ndarray frag_len, source_weights, member_weights, all
 */

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_7Element_3cov_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14_element_graph_7Element_3cov_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_3cov___get__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self));

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

static PyObject *__pyx_pf_14_element_graph_7Element_3cov___get__(struct __pyx_obj_14_element_graph_Element *__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);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->cov); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 886, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_7Element_3cov_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_14_element_graph_7Element_3cov_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_3cov_2__set__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_14_element_graph_7Element_3cov_2__set__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  float __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __pyx_PyFloat_AsFloat(__pyx_v_value); if (unlikely((__pyx_t_1 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 886, __pyx_L1_error)
  __pyx_v_self->cov = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("_element_graph.Element.cov.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_7Element_5bases_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14_element_graph_7Element_5bases_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_5bases___get__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self));

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

static PyObject *__pyx_pf_14_element_graph_7Element_5bases___get__(struct __pyx_obj_14_element_graph_Element *__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);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->bases); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 886, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_7Element_5bases_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_14_element_graph_7Element_5bases_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_5bases_2__set__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_14_element_graph_7Element_5bases_2__set__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  float __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __pyx_PyFloat_AsFloat(__pyx_v_value); if (unlikely((__pyx_t_1 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 886, __pyx_L1_error)
  __pyx_v_self->bases = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("_element_graph.Element.bases.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_7Element_17bottleneck_weight_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14_element_graph_7Element_17bottleneck_weight_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_17bottleneck_weight___get__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self));

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

static PyObject *__pyx_pf_14_element_graph_7Element_17bottleneck_weight___get__(struct __pyx_obj_14_element_graph_Element *__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);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->bottleneck_weight); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 886, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_7Element_17bottleneck_weight_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_14_element_graph_7Element_17bottleneck_weight_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_17bottleneck_weight_2__set__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_14_element_graph_7Element_17bottleneck_weight_2__set__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  float __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __pyx_PyFloat_AsFloat(__pyx_v_value); if (unlikely((__pyx_t_1 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 886, __pyx_L1_error)
  __pyx_v_self->bottleneck_weight = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("_element_graph.Element.bottleneck_weight.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_7Element_13trimmed_bases_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14_element_graph_7Element_13trimmed_bases_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_13trimmed_bases___get__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self));

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

static PyObject *__pyx_pf_14_element_graph_7Element_13trimmed_bases___get__(struct __pyx_obj_14_element_graph_Element *__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);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->trimmed_bases); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 886, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_7Element_13trimmed_bases_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_14_element_graph_7Element_13trimmed_bases_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_13trimmed_bases_2__set__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_14_element_graph_7Element_13trimmed_bases_2__set__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  float __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __pyx_PyFloat_AsFloat(__pyx_v_value); if (unlikely((__pyx_t_1 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 886, __pyx_L1_error)
  __pyx_v_self->trimmed_bases = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("_element_graph.Element.trimmed_bases.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_element_graph.pyx":887
 *     cdef public char strand
 *     cdef public float cov, bases, bottleneck_weight, trimmed_bases
 *     cdef public set members, nonmembers, ingroup, outgroup, contains, contained, excludes, includes, end_indices, covered_indices, bottleneck, assigned_to             # <<<<<<<<<<<<<<
 *     cdef public np.ndarray frag_len, source_weights, member_weights, all
 *     cdef public bint complete, s_tag, e_tag, empty, is_spliced, has_gaps
 */

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_7Element_7members_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14_element_graph_7Element_7members_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_7members___get__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self));

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

static PyObject *__pyx_pf_14_element_graph_7Element_7members___get__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->members);
  __pyx_r = __pyx_v_self->members;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_7Element_7members_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_14_element_graph_7Element_7members_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_7members_2__set__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_14_element_graph_7Element_7members_2__set__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PySet_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(0, 887, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->members);
  __Pyx_DECREF(__pyx_v_self->members);
  __pyx_v_self->members = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_7Element_7members_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_14_element_graph_7Element_7members_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_7members_4__del__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self));

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

static int __pyx_pf_14_element_graph_7Element_7members_4__del__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->members);
  __Pyx_DECREF(__pyx_v_self->members);
  __pyx_v_self->members = ((PyObject*)Py_None);

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

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_7Element_10nonmembers_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14_element_graph_7Element_10nonmembers_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_10nonmembers___get__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self));

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

static PyObject *__pyx_pf_14_element_graph_7Element_10nonmembers___get__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->nonmembers);
  __pyx_r = __pyx_v_self->nonmembers;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_7Element_10nonmembers_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_14_element_graph_7Element_10nonmembers_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_10nonmembers_2__set__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_14_element_graph_7Element_10nonmembers_2__set__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PySet_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(0, 887, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->nonmembers);
  __Pyx_DECREF(__pyx_v_self->nonmembers);
  __pyx_v_self->nonmembers = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_7Element_10nonmembers_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_14_element_graph_7Element_10nonmembers_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_10nonmembers_4__del__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self));

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

static int __pyx_pf_14_element_graph_7Element_10nonmembers_4__del__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->nonmembers);
  __Pyx_DECREF(__pyx_v_self->nonmembers);
  __pyx_v_self->nonmembers = ((PyObject*)Py_None);

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

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_7Element_7ingroup_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14_element_graph_7Element_7ingroup_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_7ingroup___get__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self));

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

static PyObject *__pyx_pf_14_element_graph_7Element_7ingroup___get__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->ingroup);
  __pyx_r = __pyx_v_self->ingroup;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_7Element_7ingroup_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_14_element_graph_7Element_7ingroup_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_7ingroup_2__set__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_14_element_graph_7Element_7ingroup_2__set__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PySet_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(0, 887, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->ingroup);
  __Pyx_DECREF(__pyx_v_self->ingroup);
  __pyx_v_self->ingroup = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_7Element_7ingroup_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_14_element_graph_7Element_7ingroup_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_7ingroup_4__del__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self));

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

static int __pyx_pf_14_element_graph_7Element_7ingroup_4__del__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->ingroup);
  __Pyx_DECREF(__pyx_v_self->ingroup);
  __pyx_v_self->ingroup = ((PyObject*)Py_None);

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

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_7Element_8outgroup_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14_element_graph_7Element_8outgroup_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_8outgroup___get__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self));

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

static PyObject *__pyx_pf_14_element_graph_7Element_8outgroup___get__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->outgroup);
  __pyx_r = __pyx_v_self->outgroup;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_7Element_8outgroup_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_14_element_graph_7Element_8outgroup_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_8outgroup_2__set__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_14_element_graph_7Element_8outgroup_2__set__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PySet_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(0, 887, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->outgroup);
  __Pyx_DECREF(__pyx_v_self->outgroup);
  __pyx_v_self->outgroup = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_7Element_8outgroup_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_14_element_graph_7Element_8outgroup_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_8outgroup_4__del__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self));

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

static int __pyx_pf_14_element_graph_7Element_8outgroup_4__del__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->outgroup);
  __Pyx_DECREF(__pyx_v_self->outgroup);
  __pyx_v_self->outgroup = ((PyObject*)Py_None);

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

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_7Element_8contains_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14_element_graph_7Element_8contains_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_8contains___get__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self));

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

static PyObject *__pyx_pf_14_element_graph_7Element_8contains___get__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->contains);
  __pyx_r = __pyx_v_self->contains;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_7Element_8contains_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_14_element_graph_7Element_8contains_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_8contains_2__set__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_14_element_graph_7Element_8contains_2__set__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PySet_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(0, 887, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->contains);
  __Pyx_DECREF(__pyx_v_self->contains);
  __pyx_v_self->contains = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_7Element_8contains_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_14_element_graph_7Element_8contains_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_8contains_4__del__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self));

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

static int __pyx_pf_14_element_graph_7Element_8contains_4__del__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->contains);
  __Pyx_DECREF(__pyx_v_self->contains);
  __pyx_v_self->contains = ((PyObject*)Py_None);

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

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_7Element_9contained_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14_element_graph_7Element_9contained_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_9contained___get__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self));

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

static PyObject *__pyx_pf_14_element_graph_7Element_9contained___get__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->contained);
  __pyx_r = __pyx_v_self->contained;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_7Element_9contained_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_14_element_graph_7Element_9contained_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_9contained_2__set__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_14_element_graph_7Element_9contained_2__set__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PySet_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(0, 887, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->contained);
  __Pyx_DECREF(__pyx_v_self->contained);
  __pyx_v_self->contained = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_7Element_9contained_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_14_element_graph_7Element_9contained_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_9contained_4__del__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self));

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

static int __pyx_pf_14_element_graph_7Element_9contained_4__del__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->contained);
  __Pyx_DECREF(__pyx_v_self->contained);
  __pyx_v_self->contained = ((PyObject*)Py_None);

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

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_7Element_8excludes_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14_element_graph_7Element_8excludes_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_8excludes___get__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self));

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

static PyObject *__pyx_pf_14_element_graph_7Element_8excludes___get__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->excludes);
  __pyx_r = __pyx_v_self->excludes;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_7Element_8excludes_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_14_element_graph_7Element_8excludes_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_8excludes_2__set__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_14_element_graph_7Element_8excludes_2__set__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PySet_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(0, 887, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->excludes);
  __Pyx_DECREF(__pyx_v_self->excludes);
  __pyx_v_self->excludes = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_7Element_8excludes_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_14_element_graph_7Element_8excludes_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_8excludes_4__del__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self));

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

static int __pyx_pf_14_element_graph_7Element_8excludes_4__del__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->excludes);
  __Pyx_DECREF(__pyx_v_self->excludes);
  __pyx_v_self->excludes = ((PyObject*)Py_None);

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

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_7Element_8includes_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14_element_graph_7Element_8includes_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_8includes___get__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self));

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

static PyObject *__pyx_pf_14_element_graph_7Element_8includes___get__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->includes);
  __pyx_r = __pyx_v_self->includes;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_7Element_8includes_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_14_element_graph_7Element_8includes_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_8includes_2__set__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_14_element_graph_7Element_8includes_2__set__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PySet_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(0, 887, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->includes);
  __Pyx_DECREF(__pyx_v_self->includes);
  __pyx_v_self->includes = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_7Element_8includes_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_14_element_graph_7Element_8includes_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_8includes_4__del__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self));

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

static int __pyx_pf_14_element_graph_7Element_8includes_4__del__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->includes);
  __Pyx_DECREF(__pyx_v_self->includes);
  __pyx_v_self->includes = ((PyObject*)Py_None);

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

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_7Element_11end_indices_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14_element_graph_7Element_11end_indices_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_11end_indices___get__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self));

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

static PyObject *__pyx_pf_14_element_graph_7Element_11end_indices___get__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->end_indices);
  __pyx_r = __pyx_v_self->end_indices;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_7Element_11end_indices_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_14_element_graph_7Element_11end_indices_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_11end_indices_2__set__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_14_element_graph_7Element_11end_indices_2__set__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PySet_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(0, 887, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->end_indices);
  __Pyx_DECREF(__pyx_v_self->end_indices);
  __pyx_v_self->end_indices = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_7Element_11end_indices_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_14_element_graph_7Element_11end_indices_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_11end_indices_4__del__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self));

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

static int __pyx_pf_14_element_graph_7Element_11end_indices_4__del__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->end_indices);
  __Pyx_DECREF(__pyx_v_self->end_indices);
  __pyx_v_self->end_indices = ((PyObject*)Py_None);

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

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_7Element_15covered_indices_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14_element_graph_7Element_15covered_indices_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_15covered_indices___get__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self));

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

static PyObject *__pyx_pf_14_element_graph_7Element_15covered_indices___get__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->covered_indices);
  __pyx_r = __pyx_v_self->covered_indices;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_7Element_15covered_indices_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_14_element_graph_7Element_15covered_indices_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_15covered_indices_2__set__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_14_element_graph_7Element_15covered_indices_2__set__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PySet_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(0, 887, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->covered_indices);
  __Pyx_DECREF(__pyx_v_self->covered_indices);
  __pyx_v_self->covered_indices = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_7Element_15covered_indices_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_14_element_graph_7Element_15covered_indices_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_15covered_indices_4__del__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self));

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

static int __pyx_pf_14_element_graph_7Element_15covered_indices_4__del__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->covered_indices);
  __Pyx_DECREF(__pyx_v_self->covered_indices);
  __pyx_v_self->covered_indices = ((PyObject*)Py_None);

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

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_7Element_10bottleneck_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14_element_graph_7Element_10bottleneck_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_10bottleneck___get__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self));

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

static PyObject *__pyx_pf_14_element_graph_7Element_10bottleneck___get__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->bottleneck);
  __pyx_r = __pyx_v_self->bottleneck;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_7Element_10bottleneck_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_14_element_graph_7Element_10bottleneck_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_10bottleneck_2__set__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_14_element_graph_7Element_10bottleneck_2__set__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PySet_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(0, 887, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->bottleneck);
  __Pyx_DECREF(__pyx_v_self->bottleneck);
  __pyx_v_self->bottleneck = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_7Element_10bottleneck_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_14_element_graph_7Element_10bottleneck_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_10bottleneck_4__del__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self));

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

static int __pyx_pf_14_element_graph_7Element_10bottleneck_4__del__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->bottleneck);
  __Pyx_DECREF(__pyx_v_self->bottleneck);
  __pyx_v_self->bottleneck = ((PyObject*)Py_None);

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

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_7Element_11assigned_to_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14_element_graph_7Element_11assigned_to_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_11assigned_to___get__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self));

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

static PyObject *__pyx_pf_14_element_graph_7Element_11assigned_to___get__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->assigned_to);
  __pyx_r = __pyx_v_self->assigned_to;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_7Element_11assigned_to_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_14_element_graph_7Element_11assigned_to_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_11assigned_to_2__set__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_14_element_graph_7Element_11assigned_to_2__set__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PySet_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(0, 887, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->assigned_to);
  __Pyx_DECREF(__pyx_v_self->assigned_to);
  __pyx_v_self->assigned_to = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_7Element_11assigned_to_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_14_element_graph_7Element_11assigned_to_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_11assigned_to_4__del__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self));

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

static int __pyx_pf_14_element_graph_7Element_11assigned_to_4__del__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->assigned_to);
  __Pyx_DECREF(__pyx_v_self->assigned_to);
  __pyx_v_self->assigned_to = ((PyObject*)Py_None);

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

/* "_element_graph.pyx":888
 *     cdef public float cov, bases, bottleneck_weight, trimmed_bases
 *     cdef public set members, nonmembers, ingroup, outgroup, contains, contained, excludes, includes, end_indices, covered_indices, bottleneck, assigned_to
 *     cdef public np.ndarray frag_len, source_weights, member_weights, all             # <<<<<<<<<<<<<<
 *     cdef public bint complete, s_tag, e_tag, empty, is_spliced, has_gaps
 *     def __init__(self, int index, np.ndarray source_weights, np.ndarray member_weights, char strand, np.ndarray membership, np.ndarray overlap, np.ndarray frag_len, int maxIC):
 */

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_7Element_8frag_len_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14_element_graph_7Element_8frag_len_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_8frag_len___get__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self));

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

static PyObject *__pyx_pf_14_element_graph_7Element_8frag_len___get__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->frag_len));
  __pyx_r = ((PyObject *)__pyx_v_self->frag_len);
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_7Element_8frag_len_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_14_element_graph_7Element_8frag_len_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_8frag_len_2__set__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_14_element_graph_7Element_8frag_len_2__set__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 888, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->frag_len);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->frag_len));
  __pyx_v_self->frag_len = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_7Element_8frag_len_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_14_element_graph_7Element_8frag_len_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_8frag_len_4__del__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self));

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

static int __pyx_pf_14_element_graph_7Element_8frag_len_4__del__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->frag_len);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->frag_len));
  __pyx_v_self->frag_len = ((PyArrayObject *)Py_None);

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

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_7Element_14source_weights_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14_element_graph_7Element_14source_weights_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_14source_weights___get__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self));

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

static PyObject *__pyx_pf_14_element_graph_7Element_14source_weights___get__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->source_weights));
  __pyx_r = ((PyObject *)__pyx_v_self->source_weights);
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_7Element_14source_weights_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_14_element_graph_7Element_14source_weights_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_14source_weights_2__set__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_14_element_graph_7Element_14source_weights_2__set__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 888, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->source_weights);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->source_weights));
  __pyx_v_self->source_weights = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_7Element_14source_weights_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_14_element_graph_7Element_14source_weights_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_14source_weights_4__del__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self));

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

static int __pyx_pf_14_element_graph_7Element_14source_weights_4__del__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->source_weights);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->source_weights));
  __pyx_v_self->source_weights = ((PyArrayObject *)Py_None);

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

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_7Element_14member_weights_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14_element_graph_7Element_14member_weights_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_14member_weights___get__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self));

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

static PyObject *__pyx_pf_14_element_graph_7Element_14member_weights___get__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->member_weights));
  __pyx_r = ((PyObject *)__pyx_v_self->member_weights);
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_7Element_14member_weights_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_14_element_graph_7Element_14member_weights_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_14member_weights_2__set__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_14_element_graph_7Element_14member_weights_2__set__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 888, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->member_weights);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->member_weights));
  __pyx_v_self->member_weights = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_7Element_14member_weights_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_14_element_graph_7Element_14member_weights_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_14member_weights_4__del__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self));

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

static int __pyx_pf_14_element_graph_7Element_14member_weights_4__del__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->member_weights);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->member_weights));
  __pyx_v_self->member_weights = ((PyArrayObject *)Py_None);

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

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_7Element_3all_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14_element_graph_7Element_3all_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_3all___get__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self));

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

static PyObject *__pyx_pf_14_element_graph_7Element_3all___get__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->all));
  __pyx_r = ((PyObject *)__pyx_v_self->all);
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_7Element_3all_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_14_element_graph_7Element_3all_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_3all_2__set__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_14_element_graph_7Element_3all_2__set__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 888, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->all);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->all));
  __pyx_v_self->all = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_7Element_3all_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_14_element_graph_7Element_3all_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_3all_4__del__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self));

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

static int __pyx_pf_14_element_graph_7Element_3all_4__del__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->all);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->all));
  __pyx_v_self->all = ((PyArrayObject *)Py_None);

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

/* "_element_graph.pyx":889
 *     cdef public set members, nonmembers, ingroup, outgroup, contains, contained, excludes, includes, end_indices, covered_indices, bottleneck, assigned_to
 *     cdef public np.ndarray frag_len, source_weights, member_weights, all
 *     cdef public bint complete, s_tag, e_tag, empty, is_spliced, has_gaps             # <<<<<<<<<<<<<<
 *     def __init__(self, int index, np.ndarray source_weights, np.ndarray member_weights, char strand, np.ndarray membership, np.ndarray overlap, np.ndarray frag_len, int maxIC):
 *         cdef Py_ssize_t i
 */

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_7Element_8complete_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14_element_graph_7Element_8complete_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_8complete___get__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self));

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

static PyObject *__pyx_pf_14_element_graph_7Element_8complete___get__(struct __pyx_obj_14_element_graph_Element *__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);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->complete); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 889, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_7Element_8complete_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_14_element_graph_7Element_8complete_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_8complete_2__set__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_14_element_graph_7Element_8complete_2__set__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 889, __pyx_L1_error)
  __pyx_v_self->complete = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("_element_graph.Element.complete.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_7Element_5s_tag_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14_element_graph_7Element_5s_tag_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_5s_tag___get__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self));

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

static PyObject *__pyx_pf_14_element_graph_7Element_5s_tag___get__(struct __pyx_obj_14_element_graph_Element *__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);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->s_tag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 889, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_7Element_5s_tag_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_14_element_graph_7Element_5s_tag_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_5s_tag_2__set__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_14_element_graph_7Element_5s_tag_2__set__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 889, __pyx_L1_error)
  __pyx_v_self->s_tag = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("_element_graph.Element.s_tag.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_7Element_5e_tag_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14_element_graph_7Element_5e_tag_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_5e_tag___get__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self));

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

static PyObject *__pyx_pf_14_element_graph_7Element_5e_tag___get__(struct __pyx_obj_14_element_graph_Element *__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);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->e_tag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 889, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_7Element_5e_tag_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_14_element_graph_7Element_5e_tag_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_5e_tag_2__set__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_14_element_graph_7Element_5e_tag_2__set__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 889, __pyx_L1_error)
  __pyx_v_self->e_tag = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("_element_graph.Element.e_tag.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_7Element_5empty_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14_element_graph_7Element_5empty_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_5empty___get__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self));

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

static PyObject *__pyx_pf_14_element_graph_7Element_5empty___get__(struct __pyx_obj_14_element_graph_Element *__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);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->empty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 889, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_7Element_5empty_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_14_element_graph_7Element_5empty_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_5empty_2__set__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_14_element_graph_7Element_5empty_2__set__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 889, __pyx_L1_error)
  __pyx_v_self->empty = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("_element_graph.Element.empty.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_7Element_10is_spliced_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14_element_graph_7Element_10is_spliced_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_10is_spliced___get__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self));

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

static PyObject *__pyx_pf_14_element_graph_7Element_10is_spliced___get__(struct __pyx_obj_14_element_graph_Element *__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);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->is_spliced); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 889, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_7Element_10is_spliced_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_14_element_graph_7Element_10is_spliced_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_10is_spliced_2__set__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_14_element_graph_7Element_10is_spliced_2__set__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 889, __pyx_L1_error)
  __pyx_v_self->is_spliced = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("_element_graph.Element.is_spliced.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_7Element_8has_gaps_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14_element_graph_7Element_8has_gaps_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_8has_gaps___get__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self));

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

static PyObject *__pyx_pf_14_element_graph_7Element_8has_gaps___get__(struct __pyx_obj_14_element_graph_Element *__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);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->has_gaps); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 889, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_14_element_graph_7Element_8has_gaps_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_14_element_graph_7Element_8has_gaps_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_8has_gaps_2__set__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_14_element_graph_7Element_8has_gaps_2__set__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 889, __pyx_L1_error)
  __pyx_v_self->has_gaps = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("_element_graph.Element.has_gaps.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_7Element_39__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_14_element_graph_7Element_39__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_38__reduce_cython__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self));

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

static PyObject *__pyx_pf_14_element_graph_7Element_38__reduce_cython__(struct __pyx_obj_14_element_graph_Element *__pyx_v_self) {
  PyObject *__pyx_v_state = 0;
  PyObject *__pyx_v__dict = 0;
  int __pyx_v_use_setstate;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  int __pyx_t_23;
  int __pyx_t_24;
  int __pyx_t_25;
  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
 *     state = (self.IC, self.LM, self.RM, self.all, self.assigned_to, self.bases, self.bottleneck, self.bottleneck_weight, self.complete, self.contained, self.contains, self.cov, self.covered_indices, self.e_tag, self.empty, self.end_indices, self.excludes, self.frag_len, self.has_gaps, self.includes, self.index, self.ingroup, self.is_spliced, self.left, self.length, self.maxIC, self.member_weights, self.members, self.nonmembers, self.number_of_elements, self.number_of_members, self.outgroup, self.right, self.s_tag, self.source_weights, self.strand, self.trimmed_bases)             # <<<<<<<<<<<<<<
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 */
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->IC); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->LM); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->RM); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyFloat_FromDouble(__pyx_v_self->bases); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyFloat_FromDouble(__pyx_v_self->bottleneck_weight); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_v_self->complete); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = PyFloat_FromDouble(__pyx_v_self->cov); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_PyBool_FromLong(__pyx_v_self->e_tag); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = __Pyx_PyBool_FromLong(__pyx_v_self->empty); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = __Pyx_PyBool_FromLong(__pyx_v_self->has_gaps); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_self->index); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_self->is_spliced); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_self->left); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_14 = __Pyx_PyInt_From_int(__pyx_v_self->length); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_15 = __Pyx_PyInt_From_int(__pyx_v_self->maxIC); if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __pyx_t_16 = __Pyx_PyInt_From_int(__pyx_v_self->number_of_elements); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_self->number_of_members); if (unlikely(!__pyx_t_17)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_self->right); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_19 = __Pyx_PyBool_FromLong(__pyx_v_self->s_tag); if (unlikely(!__pyx_t_19)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_20 = __Pyx_PyInt_From_char(__pyx_v_self->strand); if (unlikely(!__pyx_t_20)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __pyx_t_21 = PyFloat_FromDouble(__pyx_v_self->trimmed_bases); if (unlikely(!__pyx_t_21)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_21);
  __pyx_t_22 = PyTuple_New(37); if (unlikely(!__pyx_t_22)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_22);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_22, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_22, 2, __pyx_t_3);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->all));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->all));
  PyTuple_SET_ITEM(__pyx_t_22, 3, ((PyObject *)__pyx_v_self->all));
  __Pyx_INCREF(__pyx_v_self->assigned_to);
  __Pyx_GIVEREF(__pyx_v_self->assigned_to);
  PyTuple_SET_ITEM(__pyx_t_22, 4, __pyx_v_self->assigned_to);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_22, 5, __pyx_t_4);
  __Pyx_INCREF(__pyx_v_self->bottleneck);
  __Pyx_GIVEREF(__pyx_v_self->bottleneck);
  PyTuple_SET_ITEM(__pyx_t_22, 6, __pyx_v_self->bottleneck);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_22, 7, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_22, 8, __pyx_t_6);
  __Pyx_INCREF(__pyx_v_self->contained);
  __Pyx_GIVEREF(__pyx_v_self->contained);
  PyTuple_SET_ITEM(__pyx_t_22, 9, __pyx_v_self->contained);
  __Pyx_INCREF(__pyx_v_self->contains);
  __Pyx_GIVEREF(__pyx_v_self->contains);
  PyTuple_SET_ITEM(__pyx_t_22, 10, __pyx_v_self->contains);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_22, 11, __pyx_t_7);
  __Pyx_INCREF(__pyx_v_self->covered_indices);
  __Pyx_GIVEREF(__pyx_v_self->covered_indices);
  PyTuple_SET_ITEM(__pyx_t_22, 12, __pyx_v_self->covered_indices);
  __Pyx_GIVEREF(__pyx_t_8);
  PyTuple_SET_ITEM(__pyx_t_22, 13, __pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_9);
  PyTuple_SET_ITEM(__pyx_t_22, 14, __pyx_t_9);
  __Pyx_INCREF(__pyx_v_self->end_indices);
  __Pyx_GIVEREF(__pyx_v_self->end_indices);
  PyTuple_SET_ITEM(__pyx_t_22, 15, __pyx_v_self->end_indices);
  __Pyx_INCREF(__pyx_v_self->excludes);
  __Pyx_GIVEREF(__pyx_v_self->excludes);
  PyTuple_SET_ITEM(__pyx_t_22, 16, __pyx_v_self->excludes);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->frag_len));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->frag_len));
  PyTuple_SET_ITEM(__pyx_t_22, 17, ((PyObject *)__pyx_v_self->frag_len));
  __Pyx_GIVEREF(__pyx_t_10);
  PyTuple_SET_ITEM(__pyx_t_22, 18, __pyx_t_10);
  __Pyx_INCREF(__pyx_v_self->includes);
  __Pyx_GIVEREF(__pyx_v_self->includes);
  PyTuple_SET_ITEM(__pyx_t_22, 19, __pyx_v_self->includes);
  __Pyx_GIVEREF(__pyx_t_11);
  PyTuple_SET_ITEM(__pyx_t_22, 20, __pyx_t_11);
  __Pyx_INCREF(__pyx_v_self->ingroup);
  __Pyx_GIVEREF(__pyx_v_self->ingroup);
  PyTuple_SET_ITEM(__pyx_t_22, 21, __pyx_v_self->ingroup);
  __Pyx_GIVEREF(__pyx_t_12);
  PyTuple_SET_ITEM(__pyx_t_22, 22, __pyx_t_12);
  __Pyx_GIVEREF(__pyx_t_13);
  PyTuple_SET_ITEM(__pyx_t_22, 23, __pyx_t_13);
  __Pyx_GIVEREF(__pyx_t_14);
  PyTuple_SET_ITEM(__pyx_t_22, 24, __pyx_t_14);
  __Pyx_GIVEREF(__pyx_t_15);
  PyTuple_SET_ITEM(__pyx_t_22, 25, __pyx_t_15);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->member_weights));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->member_weights));
  PyTuple_SET_ITEM(__pyx_t_22, 26, ((PyObject *)__pyx_v_self->member_weights));
  __Pyx_INCREF(__pyx_v_self->members);
  __Pyx_GIVEREF(__pyx_v_self->members);
  PyTuple_SET_ITEM(__pyx_t_22, 27, __pyx_v_self->members);
  __Pyx_INCREF(__pyx_v_self->nonmembers);
  __Pyx_GIVEREF(__pyx_v_self->nonmembers);
  PyTuple_SET_ITEM(__pyx_t_22, 28, __pyx_v_self->nonmembers);
  __Pyx_GIVEREF(__pyx_t_16);
  PyTuple_SET_ITEM(__pyx_t_22, 29, __pyx_t_16);
  __Pyx_GIVEREF(__pyx_t_17);
  PyTuple_SET_ITEM(__pyx_t_22, 30, __pyx_t_17);
  __Pyx_INCREF(__pyx_v_self->outgroup);
  __Pyx_GIVEREF(__pyx_v_self->outgroup);
  PyTuple_SET_ITEM(__pyx_t_22, 31, __pyx_v_self->outgroup);
  __Pyx_GIVEREF(__pyx_t_18);
  PyTuple_SET_ITEM(__pyx_t_22, 32, __pyx_t_18);
  __Pyx_GIVEREF(__pyx_t_19);
  PyTuple_SET_ITEM(__pyx_t_22, 33, __pyx_t_19);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->source_weights));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->source_weights));
  PyTuple_SET_ITEM(__pyx_t_22, 34, ((PyObject *)__pyx_v_self->source_weights));
  __Pyx_GIVEREF(__pyx_t_20);
  PyTuple_SET_ITEM(__pyx_t_22, 35, __pyx_t_20);
  __Pyx_GIVEREF(__pyx_t_21);
  PyTuple_SET_ITEM(__pyx_t_22, 36, __pyx_t_21);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_5 = 0;
  __pyx_t_6 = 0;
  __pyx_t_7 = 0;
  __pyx_t_8 = 0;
  __pyx_t_9 = 0;
  __pyx_t_10 = 0;
  __pyx_t_11 = 0;
  __pyx_t_12 = 0;
  __pyx_t_13 = 0;
  __pyx_t_14 = 0;
  __pyx_t_15 = 0;
  __pyx_t_16 = 0;
  __pyx_t_17 = 0;
  __pyx_t_18 = 0;
  __pyx_t_19 = 0;
  __pyx_t_20 = 0;
  __pyx_t_21 = 0;
  __pyx_v_state = ((PyObject*)__pyx_t_22);
  __pyx_t_22 = 0;

  /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     state = (self.IC, self.LM, self.RM, self.all, self.assigned_to, self.bases, self.bottleneck, self.bottleneck_weight, self.complete, self.contained, self.contains, self.cov, self.covered_indices, self.e_tag, self.empty, self.end_indices, self.excludes, self.frag_len, self.has_gaps, self.includes, self.index, self.ingroup, self.is_spliced, self.left, self.length, self.maxIC, self.member_weights, self.members, self.nonmembers, self.number_of_elements, self.number_of_members, self.outgroup, self.right, self.s_tag, self.source_weights, self.strand, self.trimmed_bases)
 *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None:
 *         state += (_dict,)
 */
  __pyx_t_22 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_22)) __PYX_ERR(1, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_22);
  __pyx_v__dict = __pyx_t_22;
  __pyx_t_22 = 0;

  /* "(tree fragment)":7
 *     state = (self.IC, self.LM, self.RM, self.all, self.assigned_to, self.bases, self.bottleneck, self.bottleneck_weight, self.complete, self.contained, self.contains, self.cov, self.covered_indices, self.e_tag, self.empty, self.end_indices, self.excludes, self.frag_len, self.has_gaps, self.includes, self.index, self.ingroup, self.is_spliced, self.left, self.length, self.maxIC, self.member_weights, self.members, self.nonmembers, self.number_of_elements, self.number_of_members, self.outgroup, self.right, self.s_tag, self.source_weights, self.strand, self.trimmed_bases)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
  __pyx_t_23 = (__pyx_v__dict != Py_None);
  __pyx_t_24 = (__pyx_t_23 != 0);
  if (__pyx_t_24) {

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

    /* "(tree fragment)":9
 *     if _dict is not None:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = self.all is not None or self.assigned_to is not None or self.bottleneck is not None or self.contained is not None or self.contains is not None or self.covered_indices is not None or self.end_indices is not None or self.excludes is not None or self.frag_len is not None or self.includes is not None or self.ingroup is not None or self.member_weights is not None or self.members is not None or self.nonmembers is not None or self.outgroup is not None or self.source_weights is not None
 */
    __pyx_v_use_setstate = 1;

    /* "(tree fragment)":7
 *     state = (self.IC, self.LM, self.RM, self.all, self.assigned_to, self.bases, self.bottleneck, self.bottleneck_weight, self.complete, self.contained, self.contains, self.cov, self.covered_indices, self.e_tag, self.empty, self.end_indices, self.excludes, self.frag_len, self.has_gaps, self.includes, self.index, self.ingroup, self.is_spliced, self.left, self.length, self.maxIC, self.member_weights, self.members, self.nonmembers, self.number_of_elements, self.number_of_members, self.outgroup, self.right, self.s_tag, self.source_weights, self.strand, self.trimmed_bases)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
    goto __pyx_L3;
  }

  /* "(tree fragment)":11
 *         use_setstate = True
 *     else:
 *         use_setstate = self.all is not None or self.assigned_to is not None or self.bottleneck is not None or self.contained is not None or self.contains is not None or self.covered_indices is not None or self.end_indices is not None or self.excludes is not None or self.frag_len is not None or self.includes is not None or self.ingroup is not None or self.member_weights is not None or self.members is not None or self.nonmembers is not None or self.outgroup is not None or self.source_weights is not None             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle_Element, (type(self), 0x45d473d, None), state
 */
  /*else*/ {
    __pyx_t_23 = (((PyObject *)__pyx_v_self->all) != Py_None);
    __pyx_t_25 = (__pyx_t_23 != 0);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (__pyx_v_self->assigned_to != ((PyObject*)Py_None));
    __pyx_t_23 = (__pyx_t_25 != 0);
    if (!__pyx_t_23) {
    } else {
      __pyx_t_24 = __pyx_t_23;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_23 = (__pyx_v_self->bottleneck != ((PyObject*)Py_None));
    __pyx_t_25 = (__pyx_t_23 != 0);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (__pyx_v_self->contained != ((PyObject*)Py_None));
    __pyx_t_23 = (__pyx_t_25 != 0);
    if (!__pyx_t_23) {
    } else {
      __pyx_t_24 = __pyx_t_23;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_23 = (__pyx_v_self->contains != ((PyObject*)Py_None));
    __pyx_t_25 = (__pyx_t_23 != 0);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (__pyx_v_self->covered_indices != ((PyObject*)Py_None));
    __pyx_t_23 = (__pyx_t_25 != 0);
    if (!__pyx_t_23) {
    } else {
      __pyx_t_24 = __pyx_t_23;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_23 = (__pyx_v_self->end_indices != ((PyObject*)Py_None));
    __pyx_t_25 = (__pyx_t_23 != 0);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (__pyx_v_self->excludes != ((PyObject*)Py_None));
    __pyx_t_23 = (__pyx_t_25 != 0);
    if (!__pyx_t_23) {
    } else {
      __pyx_t_24 = __pyx_t_23;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_23 = (((PyObject *)__pyx_v_self->frag_len) != Py_None);
    __pyx_t_25 = (__pyx_t_23 != 0);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (__pyx_v_self->includes != ((PyObject*)Py_None));
    __pyx_t_23 = (__pyx_t_25 != 0);
    if (!__pyx_t_23) {
    } else {
      __pyx_t_24 = __pyx_t_23;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_23 = (__pyx_v_self->ingroup != ((PyObject*)Py_None));
    __pyx_t_25 = (__pyx_t_23 != 0);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->member_weights) != Py_None);
    __pyx_t_23 = (__pyx_t_25 != 0);
    if (!__pyx_t_23) {
    } else {
      __pyx_t_24 = __pyx_t_23;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_23 = (__pyx_v_self->members != ((PyObject*)Py_None));
    __pyx_t_25 = (__pyx_t_23 != 0);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (__pyx_v_self->nonmembers != ((PyObject*)Py_None));
    __pyx_t_23 = (__pyx_t_25 != 0);
    if (!__pyx_t_23) {
    } else {
      __pyx_t_24 = __pyx_t_23;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_23 = (__pyx_v_self->outgroup != ((PyObject*)Py_None));
    __pyx_t_25 = (__pyx_t_23 != 0);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->source_weights) != Py_None);
    __pyx_t_23 = (__pyx_t_25 != 0);
    __pyx_t_24 = __pyx_t_23;
    __pyx_L4_bool_binop_done:;
    __pyx_v_use_setstate = __pyx_t_24;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = self.all is not None or self.assigned_to is not None or self.bottleneck is not None or self.contained is not None or self.contains is not None or self.covered_indices is not None or self.end_indices is not None or self.excludes is not None or self.frag_len is not None or self.includes is not None or self.ingroup is not None or self.member_weights is not None or self.members is not None or self.nonmembers is not None or self.outgroup is not None or self.source_weights is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_Element, (type(self), 0x45d473d, None), state
 *     else:
 */
  __pyx_t_24 = (__pyx_v_use_setstate != 0);
  if (__pyx_t_24) {

    /* "(tree fragment)":13
 *         use_setstate = self.all is not None or self.assigned_to is not None or self.bottleneck is not None or self.contained is not None or self.contains is not None or self.covered_indices is not None or self.end_indices is not None or self.excludes is not None or self.frag_len is not None or self.includes is not None or self.ingroup is not None or self.member_weights is not None or self.members is not None or self.nonmembers is not None or self.outgroup is not None or self.source_weights is not None
 *     if use_setstate:
 *         return __pyx_unpickle_Element, (type(self), 0x45d473d, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_Element, (type(self), 0x45d473d, state)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_21, __pyx_n_s_pyx_unpickle_Element); if (unlikely(!__pyx_t_21)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_21);
    __pyx_t_22 = PyTuple_New(3); if (unlikely(!__pyx_t_22)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_22);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    PyTuple_SET_ITEM(__pyx_t_22, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_INCREF(__pyx_int_73221949);
    __Pyx_GIVEREF(__pyx_int_73221949);
    PyTuple_SET_ITEM(__pyx_t_22, 1, __pyx_int_73221949);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    PyTuple_SET_ITEM(__pyx_t_22, 2, Py_None);
    __pyx_t_20 = PyTuple_New(3); if (unlikely(!__pyx_t_20)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_20);
    __Pyx_GIVEREF(__pyx_t_21);
    PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_21);
    __Pyx_GIVEREF(__pyx_t_22);
    PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_t_22);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    PyTuple_SET_ITEM(__pyx_t_20, 2, __pyx_v_state);
    __pyx_t_21 = 0;
    __pyx_t_22 = 0;
    __pyx_r = __pyx_t_20;
    __pyx_t_20 = 0;
    goto __pyx_L0;

    /* "(tree fragment)":12
 *     else:
 *         use_setstate = self.all is not None or self.assigned_to is not None or self.bottleneck is not None or self.contained is not None or self.contains is not None or self.covered_indices is not None or self.end_indices is not None or self.excludes is not None or self.frag_len is not None or self.includes is not None or self.ingroup is not None or self.member_weights is not None or self.members is not None or self.nonmembers is not None or self.outgroup is not None or self.source_weights is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_Element, (type(self), 0x45d473d, None), state
 *     else:
 */
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_Element, (type(self), 0x45d473d, None), state
 *     else:
 *         return __pyx_unpickle_Element, (type(self), 0x45d473d, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_Element__set_state(self, __pyx_state)
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_20, __pyx_n_s_pyx_unpickle_Element); if (unlikely(!__pyx_t_20)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_20);
    __pyx_t_22 = PyTuple_New(3); if (unlikely(!__pyx_t_22)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_22);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    PyTuple_SET_ITEM(__pyx_t_22, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_INCREF(__pyx_int_73221949);
    __Pyx_GIVEREF(__pyx_int_73221949);
    PyTuple_SET_ITEM(__pyx_t_22, 1, __pyx_int_73221949);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    PyTuple_SET_ITEM(__pyx_t_22, 2, __pyx_v_state);
    __pyx_t_21 = PyTuple_New(2); if (unlikely(!__pyx_t_21)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_21);
    __Pyx_GIVEREF(__pyx_t_20);
    PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_20);
    __Pyx_GIVEREF(__pyx_t_22);
    PyTuple_SET_ITEM(__pyx_t_21, 1, __pyx_t_22);
    __pyx_t_20 = 0;
    __pyx_t_22 = 0;
    __pyx_r = __pyx_t_21;
    __pyx_t_21 = 0;
    goto __pyx_L0;
  }

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_XDECREF(__pyx_t_18);
  __Pyx_XDECREF(__pyx_t_19);
  __Pyx_XDECREF(__pyx_t_20);
  __Pyx_XDECREF(__pyx_t_21);
  __Pyx_XDECREF(__pyx_t_22);
  __Pyx_AddTraceback("_element_graph.Element.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v__dict);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_Element, (type(self), 0x45d473d, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_Element__set_state(self, __pyx_state)
 */

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_7Element_41__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyObject *__pyx_pw_14_element_graph_7Element_41__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_14_element_graph_7Element_40__setstate_cython__(((struct __pyx_obj_14_element_graph_Element *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

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

  /* "(tree fragment)":17
 *         return __pyx_unpickle_Element, (type(self), 0x45d473d, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_Element__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
 */
  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
  __pyx_t_1 = __pyx_f_14_element_graph___pyx_unpickle_Element__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_Element, (type(self), 0x45d473d, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_Element__set_state(self, __pyx_state)
 */

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

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

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_1__pyx_unpickle_ElementGraph(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_14_element_graph_1__pyx_unpickle_ElementGraph = {"__pyx_unpickle_ElementGraph", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_14_element_graph_1__pyx_unpickle_ElementGraph, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_14_element_graph_1__pyx_unpickle_ElementGraph(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle_ElementGraph (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_ElementGraph", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_ElementGraph", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_ElementGraph") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
    __pyx_v___pyx_state = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_ElementGraph", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("_element_graph.__pyx_unpickle_ElementGraph", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_14_element_graph___pyx_unpickle_ElementGraph(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

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

static PyObject *__pyx_pf_14_element_graph___pyx_unpickle_ElementGraph(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_v___pyx_PickleError = 0;
  PyObject *__pyx_v___pyx_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_ElementGraph", 0);

  /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum not in (0xb5283f6, 0x714eccd, 0x7829ade):             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb5283f6, 0x714eccd, 0x7829ade) = (EM, EMmembers, EP, EPmembers, SM, SMmembers, SP, SPmembers, allow_incomplete, assignments, bases, dead_end_penalty, elements, emptyPath, end_elements, end_reachability, ignore_ends, input_bases, intron_filter, maxIC, max_isos, naive, no_ends, number_of_elements, overlap, partial_coverage, paths, truncation_filter))" % __pyx_checksum)
 */
  __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple__14, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "(tree fragment)":5
 *     cdef object __pyx_result
 *     if __pyx_checksum not in (0xb5283f6, 0x714eccd, 0x7829ade):
 *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
 *         raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb5283f6, 0x714eccd, 0x7829ade) = (EM, EMmembers, EP, EPmembers, SM, SMmembers, SP, SPmembers, allow_incomplete, assignments, bases, dead_end_penalty, elements, emptyPath, end_elements, end_reachability, ignore_ends, input_bases, intron_filter, maxIC, max_isos, naive, no_ends, number_of_elements, overlap, partial_coverage, paths, truncation_filter))" % __pyx_checksum)
 *     __pyx_result = ElementGraph.__new__(__pyx_type)
 */
    __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_n_s_PickleError);
    __Pyx_GIVEREF(__pyx_n_s_PickleError);
    PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError);
    __pyx_t_4 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_v___pyx_PickleError = __pyx_t_1;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "(tree fragment)":6
 *     if __pyx_checksum not in (0xb5283f6, 0x714eccd, 0x7829ade):
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb5283f6, 0x714eccd, 0x7829ade) = (EM, EMmembers, EP, EPmembers, SM, SMmembers, SP, SPmembers, allow_incomplete, assignments, bases, dead_end_penalty, elements, emptyPath, end_elements, end_reachability, ignore_ends, input_bases, intron_filter, maxIC, max_isos, naive, no_ends, number_of_elements, overlap, partial_coverage, paths, truncation_filter))" % __pyx_checksum)             # <<<<<<<<<<<<<<
 *     __pyx_result = ElementGraph.__new__(__pyx_type)
 *     if __pyx_state is not None:
 */
    __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_INCREF(__pyx_v___pyx_PickleError);
    __pyx_t_1 = __pyx_v___pyx_PickleError; __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(1, 6, __pyx_L1_error)

    /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum not in (0xb5283f6, 0x714eccd, 0x7829ade):             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb5283f6, 0x714eccd, 0x7829ade) = (EM, EMmembers, EP, EPmembers, SM, SMmembers, SP, SPmembers, allow_incomplete, assignments, bases, dead_end_penalty, elements, emptyPath, end_elements, end_reachability, ignore_ends, input_bases, intron_filter, maxIC, max_isos, naive, no_ends, number_of_elements, overlap, partial_coverage, paths, truncation_filter))" % __pyx_checksum)
 */
  }

  /* "(tree fragment)":7
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb5283f6, 0x714eccd, 0x7829ade) = (EM, EMmembers, EP, EPmembers, SM, SMmembers, SP, SPmembers, allow_incomplete, assignments, bases, dead_end_penalty, elements, emptyPath, end_elements, end_reachability, ignore_ends, input_bases, intron_filter, maxIC, max_isos, naive, no_ends, number_of_elements, overlap, partial_coverage, paths, truncation_filter))" % __pyx_checksum)
 *     __pyx_result = ElementGraph.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_ElementGraph__set_state(<ElementGraph> __pyx_result, __pyx_state)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_14_element_graph_ElementGraph), __pyx_n_s_new); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v___pyx_type);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "(tree fragment)":8
 *         raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb5283f6, 0x714eccd, 0x7829ade) = (EM, EMmembers, EP, EPmembers, SM, SMmembers, SP, SPmembers, allow_incomplete, assignments, bases, dead_end_penalty, elements, emptyPath, end_elements, end_reachability, ignore_ends, input_bases, intron_filter, maxIC, max_isos, naive, no_ends, number_of_elements, overlap, partial_coverage, paths, truncation_filter))" % __pyx_checksum)
 *     __pyx_result = ElementGraph.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_ElementGraph__set_state(<ElementGraph> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  __pyx_t_3 = (__pyx_v___pyx_state != Py_None);
  __pyx_t_2 = (__pyx_t_3 != 0);
  if (__pyx_t_2) {

    /* "(tree fragment)":9
 *     __pyx_result = ElementGraph.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle_ElementGraph__set_state(<ElementGraph> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle_ElementGraph__set_state(ElementGraph __pyx_result, tuple __pyx_state):
 */
    if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
    __pyx_t_4 = __pyx_f_14_element_graph___pyx_unpickle_ElementGraph__set_state(((struct __pyx_obj_14_element_graph_ElementGraph *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "(tree fragment)":8
 *         raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb5283f6, 0x714eccd, 0x7829ade) = (EM, EMmembers, EP, EPmembers, SM, SMmembers, SP, SPmembers, allow_incomplete, assignments, bases, dead_end_penalty, elements, emptyPath, end_elements, end_reachability, ignore_ends, input_bases, intron_filter, maxIC, max_isos, naive, no_ends, number_of_elements, overlap, partial_coverage, paths, truncation_filter))" % __pyx_checksum)
 *     __pyx_result = ElementGraph.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_ElementGraph__set_state(<ElementGraph> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle_ElementGraph__set_state(<ElementGraph> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle_ElementGraph__set_state(ElementGraph __pyx_result, tuple __pyx_state):
 *     __pyx_result.EM = __pyx_state[0]; __pyx_result.EMmembers = __pyx_state[1]; __pyx_result.EP = __pyx_state[2]; __pyx_result.EPmembers = __pyx_state[3]; __pyx_result.SM = __pyx_state[4]; __pyx_result.SMmembers = __pyx_state[5]; __pyx_result.SP = __pyx_state[6]; __pyx_result.SPmembers = __pyx_state[7]; __pyx_result.allow_incomplete = __pyx_state[8]; __pyx_result.assignments = __pyx_state[9]; __pyx_result.bases = __pyx_state[10]; __pyx_result.dead_end_penalty = __pyx_state[11]; __pyx_result.elements = __pyx_state[12]; __pyx_result.emptyPath = __pyx_state[13]; __pyx_result.end_elements = __pyx_state[14]; __pyx_result.end_reachability = __pyx_state[15]; __pyx_result.ignore_ends = __pyx_state[16]; __pyx_result.input_bases = __pyx_state[17]; __pyx_result.intron_filter = __pyx_state[18]; __pyx_result.maxIC = __pyx_state[19]; __pyx_result.max_isos = __pyx_state[20]; __pyx_result.naive = __pyx_state[21]; __pyx_result.no_ends = __pyx_state[22]; __pyx_result.number_of_elements = __pyx_state[23]; __pyx_result.overlap = __pyx_state[24]; __pyx_result.partial_coverage = __pyx_state[25]; __pyx_result.paths = __pyx_state[26]; __pyx_result.truncation_filter = __pyx_state[27]
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___pyx_result);
  __pyx_r = __pyx_v___pyx_result;
  goto __pyx_L0;

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

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

/* "(tree fragment)":11
 *         __pyx_unpickle_ElementGraph__set_state(<ElementGraph> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_ElementGraph__set_state(ElementGraph __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.EM = __pyx_state[0]; __pyx_result.EMmembers = __pyx_state[1]; __pyx_result.EP = __pyx_state[2]; __pyx_result.EPmembers = __pyx_state[3]; __pyx_result.SM = __pyx_state[4]; __pyx_result.SMmembers = __pyx_state[5]; __pyx_result.SP = __pyx_state[6]; __pyx_result.SPmembers = __pyx_state[7]; __pyx_result.allow_incomplete = __pyx_state[8]; __pyx_result.assignments = __pyx_state[9]; __pyx_result.bases = __pyx_state[10]; __pyx_result.dead_end_penalty = __pyx_state[11]; __pyx_result.elements = __pyx_state[12]; __pyx_result.emptyPath = __pyx_state[13]; __pyx_result.end_elements = __pyx_state[14]; __pyx_result.end_reachability = __pyx_state[15]; __pyx_result.ignore_ends = __pyx_state[16]; __pyx_result.input_bases = __pyx_state[17]; __pyx_result.intron_filter = __pyx_state[18]; __pyx_result.maxIC = __pyx_state[19]; __pyx_result.max_isos = __pyx_state[20]; __pyx_result.naive = __pyx_state[21]; __pyx_result.no_ends = __pyx_state[22]; __pyx_result.number_of_elements = __pyx_state[23]; __pyx_result.overlap = __pyx_state[24]; __pyx_result.partial_coverage = __pyx_state[25]; __pyx_result.paths = __pyx_state[26]; __pyx_result.truncation_filter = __pyx_state[27]
 *     if len(__pyx_state) > 28 and hasattr(__pyx_result, '__dict__'):
 */

static PyObject *__pyx_f_14_element_graph___pyx_unpickle_ElementGraph__set_state(struct __pyx_obj_14_element_graph_ElementGraph *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  float __pyx_t_3;
  int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_ElementGraph__set_state", 0);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle_ElementGraph__set_state(ElementGraph __pyx_result, tuple __pyx_state):
 *     __pyx_result.EM = __pyx_state[0]; __pyx_result.EMmembers = __pyx_state[1]; __pyx_result.EP = __pyx_state[2]; __pyx_result.EPmembers = __pyx_state[3]; __pyx_result.SM = __pyx_state[4]; __pyx_result.SMmembers = __pyx_state[5]; __pyx_result.SP = __pyx_state[6]; __pyx_result.SPmembers = __pyx_state[7]; __pyx_result.allow_incomplete = __pyx_state[8]; __pyx_result.assignments = __pyx_state[9]; __pyx_result.bases = __pyx_state[10]; __pyx_result.dead_end_penalty = __pyx_state[11]; __pyx_result.elements = __pyx_state[12]; __pyx_result.emptyPath = __pyx_state[13]; __pyx_result.end_elements = __pyx_state[14]; __pyx_result.end_reachability = __pyx_state[15]; __pyx_result.ignore_ends = __pyx_state[16]; __pyx_result.input_bases = __pyx_state[17]; __pyx_result.intron_filter = __pyx_state[18]; __pyx_result.maxIC = __pyx_state[19]; __pyx_result.max_isos = __pyx_state[20]; __pyx_result.naive = __pyx_state[21]; __pyx_result.no_ends = __pyx_state[22]; __pyx_result.number_of_elements = __pyx_state[23]; __pyx_result.overlap = __pyx_state[24]; __pyx_result.partial_coverage = __pyx_state[25]; __pyx_result.paths = __pyx_state[26]; __pyx_result.truncation_filter = __pyx_state[27]             # <<<<<<<<<<<<<<
 *     if len(__pyx_state) > 28 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[28])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PySet_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->EM);
  __Pyx_DECREF(__pyx_v___pyx_result->EM);
  __pyx_v___pyx_result->EM = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PySet_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->EMmembers);
  __Pyx_DECREF(__pyx_v___pyx_result->EMmembers);
  __pyx_v___pyx_result->EMmembers = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PySet_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->EP);
  __Pyx_DECREF(__pyx_v___pyx_result->EP);
  __pyx_v___pyx_result->EP = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PySet_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->EPmembers);
  __Pyx_DECREF(__pyx_v___pyx_result->EPmembers);
  __pyx_v___pyx_result->EPmembers = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PySet_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->SM);
  __Pyx_DECREF(__pyx_v___pyx_result->SM);
  __pyx_v___pyx_result->SM = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PySet_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->SMmembers);
  __Pyx_DECREF(__pyx_v___pyx_result->SMmembers);
  __pyx_v___pyx_result->SMmembers = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PySet_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->SP);
  __Pyx_DECREF(__pyx_v___pyx_result->SP);
  __pyx_v___pyx_result->SP = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 7, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PySet_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->SPmembers);
  __Pyx_DECREF(__pyx_v___pyx_result->SPmembers);
  __pyx_v___pyx_result->SPmembers = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 8, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->allow_incomplete = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 9, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->assignments);
  __Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->assignments));
  __pyx_v___pyx_result->assignments = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 10, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_3 == (float)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->bases = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 11, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_3 == (float)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->dead_end_penalty = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 12, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->elements);
  __Pyx_DECREF(__pyx_v___pyx_result->elements);
  __pyx_v___pyx_result->elements = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 13, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_14_element_graph_Element))))) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->emptyPath);
  __Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->emptyPath));
  __pyx_v___pyx_result->emptyPath = ((struct __pyx_obj_14_element_graph_Element *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 14, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PySet_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->end_elements);
  __Pyx_DECREF(__pyx_v___pyx_result->end_elements);
  __pyx_v___pyx_result->end_elements = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 15, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->end_reachability);
  __Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->end_reachability));
  __pyx_v___pyx_result->end_reachability = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 16, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->ignore_ends = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 17, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_3 == (float)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->input_bases = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 18, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_3 == (float)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->intron_filter = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 19, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->maxIC = __pyx_t_4;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 20, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->max_isos = __pyx_t_4;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 21, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->naive = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 22, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->no_ends = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 23, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->number_of_elements = __pyx_t_4;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 24, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->overlap);
  __Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->overlap));
  __pyx_v___pyx_result->overlap = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 25, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->partial_coverage = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 26, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->paths);
  __Pyx_DECREF(__pyx_v___pyx_result->paths);
  __pyx_v___pyx_result->paths = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 27, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_3 == (float)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->truncation_filter = __pyx_t_3;

  /* "(tree fragment)":13
 * cdef __pyx_unpickle_ElementGraph__set_state(ElementGraph __pyx_result, tuple __pyx_state):
 *     __pyx_result.EM = __pyx_state[0]; __pyx_result.EMmembers = __pyx_state[1]; __pyx_result.EP = __pyx_state[2]; __pyx_result.EPmembers = __pyx_state[3]; __pyx_result.SM = __pyx_state[4]; __pyx_result.SMmembers = __pyx_state[5]; __pyx_result.SP = __pyx_state[6]; __pyx_result.SPmembers = __pyx_state[7]; __pyx_result.allow_incomplete = __pyx_state[8]; __pyx_result.assignments = __pyx_state[9]; __pyx_result.bases = __pyx_state[10]; __pyx_result.dead_end_penalty = __pyx_state[11]; __pyx_result.elements = __pyx_state[12]; __pyx_result.emptyPath = __pyx_state[13]; __pyx_result.end_elements = __pyx_state[14]; __pyx_result.end_reachability = __pyx_state[15]; __pyx_result.ignore_ends = __pyx_state[16]; __pyx_result.input_bases = __pyx_state[17]; __pyx_result.intron_filter = __pyx_state[18]; __pyx_result.maxIC = __pyx_state[19]; __pyx_result.max_isos = __pyx_state[20]; __pyx_result.naive = __pyx_state[21]; __pyx_result.no_ends = __pyx_state[22]; __pyx_result.number_of_elements = __pyx_state[23]; __pyx_result.overlap = __pyx_state[24]; __pyx_result.partial_coverage = __pyx_state[25]; __pyx_result.paths = __pyx_state[26]; __pyx_result.truncation_filter = __pyx_state[27]
 *     if len(__pyx_state) > 28 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[28])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(1, 13, __pyx_L1_error)
  }
  __pyx_t_5 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
  __pyx_t_6 = ((__pyx_t_5 > 28) != 0);
  if (__pyx_t_6) {
  } else {
    __pyx_t_2 = __pyx_t_6;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_6 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
  __pyx_t_7 = (__pyx_t_6 != 0);
  __pyx_t_2 = __pyx_t_7;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "(tree fragment)":14
 *     __pyx_result.EM = __pyx_state[0]; __pyx_result.EMmembers = __pyx_state[1]; __pyx_result.EP = __pyx_state[2]; __pyx_result.EPmembers = __pyx_state[3]; __pyx_result.SM = __pyx_state[4]; __pyx_result.SMmembers = __pyx_state[5]; __pyx_result.SP = __pyx_state[6]; __pyx_result.SPmembers = __pyx_state[7]; __pyx_result.allow_incomplete = __pyx_state[8]; __pyx_result.assignments = __pyx_state[9]; __pyx_result.bases = __pyx_state[10]; __pyx_result.dead_end_penalty = __pyx_state[11]; __pyx_result.elements = __pyx_state[12]; __pyx_result.emptyPath = __pyx_state[13]; __pyx_result.end_elements = __pyx_state[14]; __pyx_result.end_reachability = __pyx_state[15]; __pyx_result.ignore_ends = __pyx_state[16]; __pyx_result.input_bases = __pyx_state[17]; __pyx_result.intron_filter = __pyx_state[18]; __pyx_result.maxIC = __pyx_state[19]; __pyx_result.max_isos = __pyx_state[20]; __pyx_result.naive = __pyx_state[21]; __pyx_result.no_ends = __pyx_state[22]; __pyx_result.number_of_elements = __pyx_state[23]; __pyx_result.overlap = __pyx_state[24]; __pyx_result.partial_coverage = __pyx_state[25]; __pyx_result.paths = __pyx_state[26]; __pyx_result.truncation_filter = __pyx_state[27]
 *     if len(__pyx_state) > 28 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[28])             # <<<<<<<<<<<<<<
 */
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_update); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(1, 14, __pyx_L1_error)
    }
    __pyx_t_8 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 28, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_10 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
      if (likely(__pyx_t_10)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_9, function);
      }
    }
    __pyx_t_1 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_10, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_8);
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "(tree fragment)":13
 * cdef __pyx_unpickle_ElementGraph__set_state(ElementGraph __pyx_result, tuple __pyx_state):
 *     __pyx_result.EM = __pyx_state[0]; __pyx_result.EMmembers = __pyx_state[1]; __pyx_result.EP = __pyx_state[2]; __pyx_result.EPmembers = __pyx_state[3]; __pyx_result.SM = __pyx_state[4]; __pyx_result.SMmembers = __pyx_state[5]; __pyx_result.SP = __pyx_state[6]; __pyx_result.SPmembers = __pyx_state[7]; __pyx_result.allow_incomplete = __pyx_state[8]; __pyx_result.assignments = __pyx_state[9]; __pyx_result.bases = __pyx_state[10]; __pyx_result.dead_end_penalty = __pyx_state[11]; __pyx_result.elements = __pyx_state[12]; __pyx_result.emptyPath = __pyx_state[13]; __pyx_result.end_elements = __pyx_state[14]; __pyx_result.end_reachability = __pyx_state[15]; __pyx_result.ignore_ends = __pyx_state[16]; __pyx_result.input_bases = __pyx_state[17]; __pyx_result.intron_filter = __pyx_state[18]; __pyx_result.maxIC = __pyx_state[19]; __pyx_result.max_isos = __pyx_state[20]; __pyx_result.naive = __pyx_state[21]; __pyx_result.no_ends = __pyx_state[22]; __pyx_result.number_of_elements = __pyx_state[23]; __pyx_result.overlap = __pyx_state[24]; __pyx_result.partial_coverage = __pyx_state[25]; __pyx_result.paths = __pyx_state[26]; __pyx_result.truncation_filter = __pyx_state[27]
 *     if len(__pyx_state) > 28 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[28])
 */
  }

  /* "(tree fragment)":11
 *         __pyx_unpickle_ElementGraph__set_state(<ElementGraph> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_ElementGraph__set_state(ElementGraph __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.EM = __pyx_state[0]; __pyx_result.EMmembers = __pyx_state[1]; __pyx_result.EP = __pyx_state[2]; __pyx_result.EPmembers = __pyx_state[3]; __pyx_result.SM = __pyx_state[4]; __pyx_result.SMmembers = __pyx_state[5]; __pyx_result.SP = __pyx_state[6]; __pyx_result.SPmembers = __pyx_state[7]; __pyx_result.allow_incomplete = __pyx_state[8]; __pyx_result.assignments = __pyx_state[9]; __pyx_result.bases = __pyx_state[10]; __pyx_result.dead_end_penalty = __pyx_state[11]; __pyx_result.elements = __pyx_state[12]; __pyx_result.emptyPath = __pyx_state[13]; __pyx_result.end_elements = __pyx_state[14]; __pyx_result.end_reachability = __pyx_state[15]; __pyx_result.ignore_ends = __pyx_state[16]; __pyx_result.input_bases = __pyx_state[17]; __pyx_result.intron_filter = __pyx_state[18]; __pyx_result.maxIC = __pyx_state[19]; __pyx_result.max_isos = __pyx_state[20]; __pyx_result.naive = __pyx_state[21]; __pyx_result.no_ends = __pyx_state[22]; __pyx_result.number_of_elements = __pyx_state[23]; __pyx_result.overlap = __pyx_state[24]; __pyx_result.partial_coverage = __pyx_state[25]; __pyx_result.paths = __pyx_state[26]; __pyx_result.truncation_filter = __pyx_state[27]
 *     if len(__pyx_state) > 28 and hasattr(__pyx_result, '__dict__'):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("_element_graph.__pyx_unpickle_ElementGraph__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_14_element_graph_3__pyx_unpickle_Element(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_14_element_graph_3__pyx_unpickle_Element = {"__pyx_unpickle_Element", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_14_element_graph_3__pyx_unpickle_Element, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_14_element_graph_3__pyx_unpickle_Element(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle_Element (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Element", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Element", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_Element") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
    __pyx_v___pyx_state = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Element", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("_element_graph.__pyx_unpickle_Element", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_14_element_graph_2__pyx_unpickle_Element(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

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

static PyObject *__pyx_pf_14_element_graph_2__pyx_unpickle_Element(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_v___pyx_PickleError = 0;
  PyObject *__pyx_v___pyx_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_Element", 0);

  /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum not in (0x45d473d, 0xdc335b6, 0xa50ee75):             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (0x%x vs (0x45d473d, 0xdc335b6, 0xa50ee75) = (IC, LM, RM, all, assigned_to, bases, bottleneck, bottleneck_weight, complete, contained, contains, cov, covered_indices, e_tag, empty, end_indices, excludes, frag_len, has_gaps, includes, index, ingroup, is_spliced, left, length, maxIC, member_weights, members, nonmembers, number_of_elements, number_of_members, outgroup, right, s_tag, source_weights, strand, trimmed_bases))" % __pyx_checksum)
 */
  __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple__15, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "(tree fragment)":5
 *     cdef object __pyx_result
 *     if __pyx_checksum not in (0x45d473d, 0xdc335b6, 0xa50ee75):
 *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
 *         raise __pyx_PickleError("Incompatible checksums (0x%x vs (0x45d473d, 0xdc335b6, 0xa50ee75) = (IC, LM, RM, all, assigned_to, bases, bottleneck, bottleneck_weight, complete, contained, contains, cov, covered_indices, e_tag, empty, end_indices, excludes, frag_len, has_gaps, includes, index, ingroup, is_spliced, left, length, maxIC, member_weights, members, nonmembers, number_of_elements, number_of_members, outgroup, right, s_tag, source_weights, strand, trimmed_bases))" % __pyx_checksum)
 *     __pyx_result = Element.__new__(__pyx_type)
 */
    __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_n_s_PickleError);
    __Pyx_GIVEREF(__pyx_n_s_PickleError);
    PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError);
    __pyx_t_4 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_v___pyx_PickleError = __pyx_t_1;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "(tree fragment)":6
 *     if __pyx_checksum not in (0x45d473d, 0xdc335b6, 0xa50ee75):
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (0x%x vs (0x45d473d, 0xdc335b6, 0xa50ee75) = (IC, LM, RM, all, assigned_to, bases, bottleneck, bottleneck_weight, complete, contained, contains, cov, covered_indices, e_tag, empty, end_indices, excludes, frag_len, has_gaps, includes, index, ingroup, is_spliced, left, length, maxIC, member_weights, members, nonmembers, number_of_elements, number_of_members, outgroup, right, s_tag, source_weights, strand, trimmed_bases))" % __pyx_checksum)             # <<<<<<<<<<<<<<
 *     __pyx_result = Element.__new__(__pyx_type)
 *     if __pyx_state is not None:
 */
    __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_0x_x_vs_0_2, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_INCREF(__pyx_v___pyx_PickleError);
    __pyx_t_1 = __pyx_v___pyx_PickleError; __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(1, 6, __pyx_L1_error)

    /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum not in (0x45d473d, 0xdc335b6, 0xa50ee75):             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (0x%x vs (0x45d473d, 0xdc335b6, 0xa50ee75) = (IC, LM, RM, all, assigned_to, bases, bottleneck, bottleneck_weight, complete, contained, contains, cov, covered_indices, e_tag, empty, end_indices, excludes, frag_len, has_gaps, includes, index, ingroup, is_spliced, left, length, maxIC, member_weights, members, nonmembers, number_of_elements, number_of_members, outgroup, right, s_tag, source_weights, strand, trimmed_bases))" % __pyx_checksum)
 */
  }

  /* "(tree fragment)":7
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (0x%x vs (0x45d473d, 0xdc335b6, 0xa50ee75) = (IC, LM, RM, all, assigned_to, bases, bottleneck, bottleneck_weight, complete, contained, contains, cov, covered_indices, e_tag, empty, end_indices, excludes, frag_len, has_gaps, includes, index, ingroup, is_spliced, left, length, maxIC, member_weights, members, nonmembers, number_of_elements, number_of_members, outgroup, right, s_tag, source_weights, strand, trimmed_bases))" % __pyx_checksum)
 *     __pyx_result = Element.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_Element__set_state(<Element> __pyx_result, __pyx_state)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_14_element_graph_Element), __pyx_n_s_new); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v___pyx_type);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "(tree fragment)":8
 *         raise __pyx_PickleError("Incompatible checksums (0x%x vs (0x45d473d, 0xdc335b6, 0xa50ee75) = (IC, LM, RM, all, assigned_to, bases, bottleneck, bottleneck_weight, complete, contained, contains, cov, covered_indices, e_tag, empty, end_indices, excludes, frag_len, has_gaps, includes, index, ingroup, is_spliced, left, length, maxIC, member_weights, members, nonmembers, number_of_elements, number_of_members, outgroup, right, s_tag, source_weights, strand, trimmed_bases))" % __pyx_checksum)
 *     __pyx_result = Element.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_Element__set_state(<Element> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  __pyx_t_3 = (__pyx_v___pyx_state != Py_None);
  __pyx_t_2 = (__pyx_t_3 != 0);
  if (__pyx_t_2) {

    /* "(tree fragment)":9
 *     __pyx_result = Element.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle_Element__set_state(<Element> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle_Element__set_state(Element __pyx_result, tuple __pyx_state):
 */
    if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
    __pyx_t_4 = __pyx_f_14_element_graph___pyx_unpickle_Element__set_state(((struct __pyx_obj_14_element_graph_Element *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "(tree fragment)":8
 *         raise __pyx_PickleError("Incompatible checksums (0x%x vs (0x45d473d, 0xdc335b6, 0xa50ee75) = (IC, LM, RM, all, assigned_to, bases, bottleneck, bottleneck_weight, complete, contained, contains, cov, covered_indices, e_tag, empty, end_indices, excludes, frag_len, has_gaps, includes, index, ingroup, is_spliced, left, length, maxIC, member_weights, members, nonmembers, number_of_elements, number_of_members, outgroup, right, s_tag, source_weights, strand, trimmed_bases))" % __pyx_checksum)
 *     __pyx_result = Element.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_Element__set_state(<Element> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle_Element__set_state(<Element> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle_Element__set_state(Element __pyx_result, tuple __pyx_state):
 *     __pyx_result.IC = __pyx_state[0]; __pyx_result.LM = __pyx_state[1]; __pyx_result.RM = __pyx_state[2]; __pyx_result.all = __pyx_state[3]; __pyx_result.assigned_to = __pyx_state[4]; __pyx_result.bases = __pyx_state[5]; __pyx_result.bottleneck = __pyx_state[6]; __pyx_result.bottleneck_weight = __pyx_state[7]; __pyx_result.complete = __pyx_state[8]; __pyx_result.contained = __pyx_state[9]; __pyx_result.contains = __pyx_state[10]; __pyx_result.cov = __pyx_state[11]; __pyx_result.covered_indices = __pyx_state[12]; __pyx_result.e_tag = __pyx_state[13]; __pyx_result.empty = __pyx_state[14]; __pyx_result.end_indices = __pyx_state[15]; __pyx_result.excludes = __pyx_state[16]; __pyx_result.frag_len = __pyx_state[17]; __pyx_result.has_gaps = __pyx_state[18]; __pyx_result.includes = __pyx_state[19]; __pyx_result.index = __pyx_state[20]; __pyx_result.ingroup = __pyx_state[21]; __pyx_result.is_spliced = __pyx_state[22]; __pyx_result.left = __pyx_state[23]; __pyx_result.length = __pyx_state[24]; __pyx_result.maxIC = __pyx_state[25]; __pyx_result.member_weights = __pyx_state[26]; __pyx_result.members = __pyx_state[27]; __pyx_result.nonmembers = __pyx_state[28]; __pyx_result.number_of_elements = __pyx_state[29]; __pyx_result.number_of_members = __pyx_state[30]; __pyx_result.outgroup = __pyx_state[31]; __pyx_result.right = __pyx_state[32]; __pyx_result.s_tag = __pyx_state[33]; __pyx_result.source_weights = __pyx_state[34]; __pyx_result.strand = __pyx_state[35]; __pyx_result.trimmed_bases = __pyx_state[36]
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___pyx_result);
  __pyx_r = __pyx_v___pyx_result;
  goto __pyx_L0;

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

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

/* "(tree fragment)":11
 *         __pyx_unpickle_Element__set_state(<Element> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_Element__set_state(Element __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.IC = __pyx_state[0]; __pyx_result.LM = __pyx_state[1]; __pyx_result.RM = __pyx_state[2]; __pyx_result.all = __pyx_state[3]; __pyx_result.assigned_to = __pyx_state[4]; __pyx_result.bases = __pyx_state[5]; __pyx_result.bottleneck = __pyx_state[6]; __pyx_result.bottleneck_weight = __pyx_state[7]; __pyx_result.complete = __pyx_state[8]; __pyx_result.contained = __pyx_state[9]; __pyx_result.contains = __pyx_state[10]; __pyx_result.cov = __pyx_state[11]; __pyx_result.covered_indices = __pyx_state[12]; __pyx_result.e_tag = __pyx_state[13]; __pyx_result.empty = __pyx_state[14]; __pyx_result.end_indices = __pyx_state[15]; __pyx_result.excludes = __pyx_state[16]; __pyx_result.frag_len = __pyx_state[17]; __pyx_result.has_gaps = __pyx_state[18]; __pyx_result.includes = __pyx_state[19]; __pyx_result.index = __pyx_state[20]; __pyx_result.ingroup = __pyx_state[21]; __pyx_result.is_spliced = __pyx_state[22]; __pyx_result.left = __pyx_state[23]; __pyx_result.length = __pyx_state[24]; __pyx_result.maxIC = __pyx_state[25]; __pyx_result.member_weights = __pyx_state[26]; __pyx_result.members = __pyx_state[27]; __pyx_result.nonmembers = __pyx_state[28]; __pyx_result.number_of_elements = __pyx_state[29]; __pyx_result.number_of_members = __pyx_state[30]; __pyx_result.outgroup = __pyx_state[31]; __pyx_result.right = __pyx_state[32]; __pyx_result.s_tag = __pyx_state[33]; __pyx_result.source_weights = __pyx_state[34]; __pyx_result.strand = __pyx_state[35]; __pyx_result.trimmed_bases = __pyx_state[36]
 *     if len(__pyx_state) > 37 and hasattr(__pyx_result, '__dict__'):
 */

static PyObject *__pyx_f_14_element_graph___pyx_unpickle_Element__set_state(struct __pyx_obj_14_element_graph_Element *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  float __pyx_t_3;
  int __pyx_t_4;
  char __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_Element__set_state", 0);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle_Element__set_state(Element __pyx_result, tuple __pyx_state):
 *     __pyx_result.IC = __pyx_state[0]; __pyx_result.LM = __pyx_state[1]; __pyx_result.RM = __pyx_state[2]; __pyx_result.all = __pyx_state[3]; __pyx_result.assigned_to = __pyx_state[4]; __pyx_result.bases = __pyx_state[5]; __pyx_result.bottleneck = __pyx_state[6]; __pyx_result.bottleneck_weight = __pyx_state[7]; __pyx_result.complete = __pyx_state[8]; __pyx_result.contained = __pyx_state[9]; __pyx_result.contains = __pyx_state[10]; __pyx_result.cov = __pyx_state[11]; __pyx_result.covered_indices = __pyx_state[12]; __pyx_result.e_tag = __pyx_state[13]; __pyx_result.empty = __pyx_state[14]; __pyx_result.end_indices = __pyx_state[15]; __pyx_result.excludes = __pyx_state[16]; __pyx_result.frag_len = __pyx_state[17]; __pyx_result.has_gaps = __pyx_state[18]; __pyx_result.includes = __pyx_state[19]; __pyx_result.index = __pyx_state[20]; __pyx_result.ingroup = __pyx_state[21]; __pyx_result.is_spliced = __pyx_state[22]; __pyx_result.left = __pyx_state[23]; __pyx_result.length = __pyx_state[24]; __pyx_result.maxIC = __pyx_state[25]; __pyx_result.member_weights = __pyx_state[26]; __pyx_result.members = __pyx_state[27]; __pyx_result.nonmembers = __pyx_state[28]; __pyx_result.number_of_elements = __pyx_state[29]; __pyx_result.number_of_members = __pyx_state[30]; __pyx_result.outgroup = __pyx_state[31]; __pyx_result.right = __pyx_state[32]; __pyx_result.s_tag = __pyx_state[33]; __pyx_result.source_weights = __pyx_state[34]; __pyx_result.strand = __pyx_state[35]; __pyx_result.trimmed_bases = __pyx_state[36]             # <<<<<<<<<<<<<<
 *     if len(__pyx_state) > 37 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[37])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->IC = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->LM = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->RM = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->all);
  __Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->all));
  __pyx_v___pyx_result->all = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PySet_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->assigned_to);
  __Pyx_DECREF(__pyx_v___pyx_result->assigned_to);
  __pyx_v___pyx_result->assigned_to = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_3 == (float)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->bases = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PySet_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->bottleneck);
  __Pyx_DECREF(__pyx_v___pyx_result->bottleneck);
  __pyx_v___pyx_result->bottleneck = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 7, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_3 == (float)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->bottleneck_weight = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 8, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->complete = __pyx_t_4;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 9, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PySet_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->contained);
  __Pyx_DECREF(__pyx_v___pyx_result->contained);
  __pyx_v___pyx_result->contained = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 10, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PySet_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->contains);
  __Pyx_DECREF(__pyx_v___pyx_result->contains);
  __pyx_v___pyx_result->contains = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 11, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_3 == (float)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->cov = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 12, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PySet_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->covered_indices);
  __Pyx_DECREF(__pyx_v___pyx_result->covered_indices);
  __pyx_v___pyx_result->covered_indices = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 13, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->e_tag = __pyx_t_4;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 14, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->empty = __pyx_t_4;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 15, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PySet_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->end_indices);
  __Pyx_DECREF(__pyx_v___pyx_result->end_indices);
  __pyx_v___pyx_result->end_indices = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 16, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PySet_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->excludes);
  __Pyx_DECREF(__pyx_v___pyx_result->excludes);
  __pyx_v___pyx_result->excludes = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 17, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->frag_len);
  __Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->frag_len));
  __pyx_v___pyx_result->frag_len = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 18, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->has_gaps = __pyx_t_4;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 19, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PySet_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->includes);
  __Pyx_DECREF(__pyx_v___pyx_result->includes);
  __pyx_v___pyx_result->includes = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 20, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->index = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 21, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PySet_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->ingroup);
  __Pyx_DECREF(__pyx_v___pyx_result->ingroup);
  __pyx_v___pyx_result->ingroup = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 22, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->is_spliced = __pyx_t_4;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 23, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->left = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 24, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->length = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 25, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->maxIC = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 26, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->member_weights);
  __Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->member_weights));
  __pyx_v___pyx_result->member_weights = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 27, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PySet_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->members);
  __Pyx_DECREF(__pyx_v___pyx_result->members);
  __pyx_v___pyx_result->members = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 28, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PySet_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->nonmembers);
  __Pyx_DECREF(__pyx_v___pyx_result->nonmembers);
  __pyx_v___pyx_result->nonmembers = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 29, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->number_of_elements = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 30, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->number_of_members = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 31, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PySet_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->outgroup);
  __Pyx_DECREF(__pyx_v___pyx_result->outgroup);
  __pyx_v___pyx_result->outgroup = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 32, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->right = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 33, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->s_tag = __pyx_t_4;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 34, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->source_weights);
  __Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->source_weights));
  __pyx_v___pyx_result->source_weights = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 35, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyInt_As_char(__pyx_t_1); if (unlikely((__pyx_t_5 == (char)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->strand = __pyx_t_5;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 36, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_3 == (float)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->trimmed_bases = __pyx_t_3;

  /* "(tree fragment)":13
 * cdef __pyx_unpickle_Element__set_state(Element __pyx_result, tuple __pyx_state):
 *     __pyx_result.IC = __pyx_state[0]; __pyx_result.LM = __pyx_state[1]; __pyx_result.RM = __pyx_state[2]; __pyx_result.all = __pyx_state[3]; __pyx_result.assigned_to = __pyx_state[4]; __pyx_result.bases = __pyx_state[5]; __pyx_result.bottleneck = __pyx_state[6]; __pyx_result.bottleneck_weight = __pyx_state[7]; __pyx_result.complete = __pyx_state[8]; __pyx_result.contained = __pyx_state[9]; __pyx_result.contains = __pyx_state[10]; __pyx_result.cov = __pyx_state[11]; __pyx_result.covered_indices = __pyx_state[12]; __pyx_result.e_tag = __pyx_state[13]; __pyx_result.empty = __pyx_state[14]; __pyx_result.end_indices = __pyx_state[15]; __pyx_result.excludes = __pyx_state[16]; __pyx_result.frag_len = __pyx_state[17]; __pyx_result.has_gaps = __pyx_state[18]; __pyx_result.includes = __pyx_state[19]; __pyx_result.index = __pyx_state[20]; __pyx_result.ingroup = __pyx_state[21]; __pyx_result.is_spliced = __pyx_state[22]; __pyx_result.left = __pyx_state[23]; __pyx_result.length = __pyx_state[24]; __pyx_result.maxIC = __pyx_state[25]; __pyx_result.member_weights = __pyx_state[26]; __pyx_result.members = __pyx_state[27]; __pyx_result.nonmembers = __pyx_state[28]; __pyx_result.number_of_elements = __pyx_state[29]; __pyx_result.number_of_members = __pyx_state[30]; __pyx_result.outgroup = __pyx_state[31]; __pyx_result.right = __pyx_state[32]; __pyx_result.s_tag = __pyx_state[33]; __pyx_result.source_weights = __pyx_state[34]; __pyx_result.strand = __pyx_state[35]; __pyx_result.trimmed_bases = __pyx_state[36]
 *     if len(__pyx_state) > 37 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[37])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(1, 13, __pyx_L1_error)
  }
  __pyx_t_6 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
  __pyx_t_7 = ((__pyx_t_6 > 37) != 0);
  if (__pyx_t_7) {
  } else {
    __pyx_t_4 = __pyx_t_7;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_7 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
  __pyx_t_8 = (__pyx_t_7 != 0);
  __pyx_t_4 = __pyx_t_8;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_4) {

    /* "(tree fragment)":14
 *     __pyx_result.IC = __pyx_state[0]; __pyx_result.LM = __pyx_state[1]; __pyx_result.RM = __pyx_state[2]; __pyx_result.all = __pyx_state[3]; __pyx_result.assigned_to = __pyx_state[4]; __pyx_result.bases = __pyx_state[5]; __pyx_result.bottleneck = __pyx_state[6]; __pyx_result.bottleneck_weight = __pyx_state[7]; __pyx_result.complete = __pyx_state[8]; __pyx_result.contained = __pyx_state[9]; __pyx_result.contains = __pyx_state[10]; __pyx_result.cov = __pyx_state[11]; __pyx_result.covered_indices = __pyx_state[12]; __pyx_result.e_tag = __pyx_state[13]; __pyx_result.empty = __pyx_state[14]; __pyx_result.end_indices = __pyx_state[15]; __pyx_result.excludes = __pyx_state[16]; __pyx_result.frag_len = __pyx_state[17]; __pyx_result.has_gaps = __pyx_state[18]; __pyx_result.includes = __pyx_state[19]; __pyx_result.index = __pyx_state[20]; __pyx_result.ingroup = __pyx_state[21]; __pyx_result.is_spliced = __pyx_state[22]; __pyx_result.left = __pyx_state[23]; __pyx_result.length = __pyx_state[24]; __pyx_result.maxIC = __pyx_state[25]; __pyx_result.member_weights = __pyx_state[26]; __pyx_result.members = __pyx_state[27]; __pyx_result.nonmembers = __pyx_state[28]; __pyx_result.number_of_elements = __pyx_state[29]; __pyx_result.number_of_members = __pyx_state[30]; __pyx_result.outgroup = __pyx_state[31]; __pyx_result.right = __pyx_state[32]; __pyx_result.s_tag = __pyx_state[33]; __pyx_result.source_weights = __pyx_state[34]; __pyx_result.strand = __pyx_state[35]; __pyx_result.trimmed_bases = __pyx_state[36]
 *     if len(__pyx_state) > 37 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[37])             # <<<<<<<<<<<<<<
 */
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_update); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(1, 14, __pyx_L1_error)
    }
    __pyx_t_9 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 37, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_11 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
      __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10);
      if (likely(__pyx_t_11)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
        __Pyx_INCREF(__pyx_t_11);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_10, function);
      }
    }
    __pyx_t_1 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_11, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_9);
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "(tree fragment)":13
 * cdef __pyx_unpickle_Element__set_state(Element __pyx_result, tuple __pyx_state):
 *     __pyx_result.IC = __pyx_state[0]; __pyx_result.LM = __pyx_state[1]; __pyx_result.RM = __pyx_state[2]; __pyx_result.all = __pyx_state[3]; __pyx_result.assigned_to = __pyx_state[4]; __pyx_result.bases = __pyx_state[5]; __pyx_result.bottleneck = __pyx_state[6]; __pyx_result.bottleneck_weight = __pyx_state[7]; __pyx_result.complete = __pyx_state[8]; __pyx_result.contained = __pyx_state[9]; __pyx_result.contains = __pyx_state[10]; __pyx_result.cov = __pyx_state[11]; __pyx_result.covered_indices = __pyx_state[12]; __pyx_result.e_tag = __pyx_state[13]; __pyx_result.empty = __pyx_state[14]; __pyx_result.end_indices = __pyx_state[15]; __pyx_result.excludes = __pyx_state[16]; __pyx_result.frag_len = __pyx_state[17]; __pyx_result.has_gaps = __pyx_state[18]; __pyx_result.includes = __pyx_state[19]; __pyx_result.index = __pyx_state[20]; __pyx_result.ingroup = __pyx_state[21]; __pyx_result.is_spliced = __pyx_state[22]; __pyx_result.left = __pyx_state[23]; __pyx_result.length = __pyx_state[24]; __pyx_result.maxIC = __pyx_state[25]; __pyx_result.member_weights = __pyx_state[26]; __pyx_result.members = __pyx_state[27]; __pyx_result.nonmembers = __pyx_state[28]; __pyx_result.number_of_elements = __pyx_state[29]; __pyx_result.number_of_members = __pyx_state[30]; __pyx_result.outgroup = __pyx_state[31]; __pyx_result.right = __pyx_state[32]; __pyx_result.s_tag = __pyx_state[33]; __pyx_result.source_weights = __pyx_state[34]; __pyx_result.strand = __pyx_state[35]; __pyx_result.trimmed_bases = __pyx_state[36]
 *     if len(__pyx_state) > 37 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[37])
 */
  }

  /* "(tree fragment)":11
 *         __pyx_unpickle_Element__set_state(<Element> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_Element__set_state(Element __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.IC = __pyx_state[0]; __pyx_result.LM = __pyx_state[1]; __pyx_result.RM = __pyx_state[2]; __pyx_result.all = __pyx_state[3]; __pyx_result.assigned_to = __pyx_state[4]; __pyx_result.bases = __pyx_state[5]; __pyx_result.bottleneck = __pyx_state[6]; __pyx_result.bottleneck_weight = __pyx_state[7]; __pyx_result.complete = __pyx_state[8]; __pyx_result.contained = __pyx_state[9]; __pyx_result.contains = __pyx_state[10]; __pyx_result.cov = __pyx_state[11]; __pyx_result.covered_indices = __pyx_state[12]; __pyx_result.e_tag = __pyx_state[13]; __pyx_result.empty = __pyx_state[14]; __pyx_result.end_indices = __pyx_state[15]; __pyx_result.excludes = __pyx_state[16]; __pyx_result.frag_len = __pyx_state[17]; __pyx_result.has_gaps = __pyx_state[18]; __pyx_result.includes = __pyx_state[19]; __pyx_result.index = __pyx_state[20]; __pyx_result.ingroup = __pyx_state[21]; __pyx_result.is_spliced = __pyx_state[22]; __pyx_result.left = __pyx_state[23]; __pyx_result.length = __pyx_state[24]; __pyx_result.maxIC = __pyx_state[25]; __pyx_result.member_weights = __pyx_state[26]; __pyx_result.members = __pyx_state[27]; __pyx_result.nonmembers = __pyx_state[28]; __pyx_result.number_of_elements = __pyx_state[29]; __pyx_result.number_of_members = __pyx_state[30]; __pyx_result.outgroup = __pyx_state[31]; __pyx_result.right = __pyx_state[32]; __pyx_result.s_tag = __pyx_state[33]; __pyx_result.source_weights = __pyx_state[34]; __pyx_result.strand = __pyx_state[35]; __pyx_result.trimmed_bases = __pyx_state[36]
 *     if len(__pyx_state) > 37 and hasattr(__pyx_result, '__dict__'):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("_element_graph.__pyx_unpickle_Element__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":735
 * ctypedef npy_cdouble     complex_t
 * 
 * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(1, <void*>a)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
  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("PyArray_MultiIterNew1", 0);

  /* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":736
 * 
 * cdef inline object PyArray_MultiIterNew1(a):
 *     return PyArray_MultiIterNew(1, <void*>a)             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew2(a, b):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 736, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":735
 * ctypedef npy_cdouble     complex_t
 * 
 * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(1, <void*>a)
 * 
 */

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

/* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":738
 *     return PyArray_MultiIterNew(1, <void*>a)
 * 
 * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__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("PyArray_MultiIterNew2", 0);

  /* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":739
 * 
 * cdef inline object PyArray_MultiIterNew2(a, b):
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew3(a, b, c):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 739, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":738
 *     return PyArray_MultiIterNew(1, <void*>a)
 * 
 * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
 * 
 */

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

/* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":741
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
 * 
 * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
  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("PyArray_MultiIterNew3", 0);

  /* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":742
 * 
 * cdef inline object PyArray_MultiIterNew3(a, b, c):
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 742, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":741
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
 * 
 * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
 * 
 */

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

/* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":744
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
 * 
 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
  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("PyArray_MultiIterNew4", 0);

  /* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":745
 * 
 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 745, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":744
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
 * 
 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
 * 
 */

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

/* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":747
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
 * 
 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
  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("PyArray_MultiIterNew5", 0);

  /* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":748
 * 
 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)             # <<<<<<<<<<<<<<
 * 
 * cdef inline tuple PyDataType_SHAPE(dtype d):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 748, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":747
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
 * 
 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
 * 
 */

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

/* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":750
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
 * 
 * cdef inline tuple PyDataType_SHAPE(dtype d):             # <<<<<<<<<<<<<<
 *     if PyDataType_HASSUBARRAY(d):
 *         return <tuple>d.subarray.shape
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0);

  /* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":751
 * 
 * cdef inline tuple PyDataType_SHAPE(dtype d):
 *     if PyDataType_HASSUBARRAY(d):             # <<<<<<<<<<<<<<
 *         return <tuple>d.subarray.shape
 *     else:
 */
  __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
  if (__pyx_t_1) {

    /* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":752
 * cdef inline tuple PyDataType_SHAPE(dtype d):
 *     if PyDataType_HASSUBARRAY(d):
 *         return <tuple>d.subarray.shape             # <<<<<<<<<<<<<<
 *     else:
 *         return ()
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
    __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
    goto __pyx_L0;

    /* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":751
 * 
 * cdef inline tuple PyDataType_SHAPE(dtype d):
 *     if PyDataType_HASSUBARRAY(d):             # <<<<<<<<<<<<<<
 *         return <tuple>d.subarray.shape
 *     else:
 */
  }

  /* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":754
 *         return <tuple>d.subarray.shape
 *     else:
 *         return ()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_empty_tuple);
    __pyx_r = __pyx_empty_tuple;
    goto __pyx_L0;
  }

  /* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":750
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
 * 
 * cdef inline tuple PyDataType_SHAPE(dtype d):             # <<<<<<<<<<<<<<
 *     if PyDataType_HASSUBARRAY(d):
 *         return <tuple>d.subarray.shape
 */

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

/* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":929
 *     int _import_umath() except -1
 * 
 * cdef inline void set_array_base(ndarray arr, object base):             # <<<<<<<<<<<<<<
 *     Py_INCREF(base) # important to do this before stealing the reference below!
 *     PyArray_SetBaseObject(arr, base)
 */

static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_array_base", 0);

  /* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":930
 * 
 * cdef inline void set_array_base(ndarray arr, object base):
 *     Py_INCREF(base) # important to do this before stealing the reference below!             # <<<<<<<<<<<<<<
 *     PyArray_SetBaseObject(arr, base)
 * 
 */
  Py_INCREF(__pyx_v_base);

  /* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":931
 * cdef inline void set_array_base(ndarray arr, object base):
 *     Py_INCREF(base) # important to do this before stealing the reference below!
 *     PyArray_SetBaseObject(arr, base)             # <<<<<<<<<<<<<<
 * 
 * cdef inline object get_array_base(ndarray arr):
 */
  (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));

  /* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":929
 *     int _import_umath() except -1
 * 
 * cdef inline void set_array_base(ndarray arr, object base):             # <<<<<<<<<<<<<<
 *     Py_INCREF(base) # important to do this before stealing the reference below!
 *     PyArray_SetBaseObject(arr, base)
 */

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

/* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":933
 *     PyArray_SetBaseObject(arr, base)
 * 
 * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
 *     base = PyArray_BASE(arr)
 *     if base is NULL:
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
  PyObject *__pyx_v_base;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("get_array_base", 0);

  /* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":934
 * 
 * cdef inline object get_array_base(ndarray arr):
 *     base = PyArray_BASE(arr)             # <<<<<<<<<<<<<<
 *     if base is NULL:
 *         return None
 */
  __pyx_v_base = PyArray_BASE(__pyx_v_arr);

  /* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":935
 * cdef inline object get_array_base(ndarray arr):
 *     base = PyArray_BASE(arr)
 *     if base is NULL:             # <<<<<<<<<<<<<<
 *         return None
 *     return <object>base
 */
  __pyx_t_1 = ((__pyx_v_base == NULL) != 0);
  if (__pyx_t_1) {

    /* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":936
 *     base = PyArray_BASE(arr)
 *     if base is NULL:
 *         return None             # <<<<<<<<<<<<<<
 *     return <object>base
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":935
 * cdef inline object get_array_base(ndarray arr):
 *     base = PyArray_BASE(arr)
 *     if base is NULL:             # <<<<<<<<<<<<<<
 *         return None
 *     return <object>base
 */
  }

  /* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":937
 *     if base is NULL:
 *         return None
 *     return <object>base             # <<<<<<<<<<<<<<
 * 
 * # Versions of the import_* functions which are more suitable for
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_base));
  __pyx_r = ((PyObject *)__pyx_v_base);
  goto __pyx_L0;

  /* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":933
 *     PyArray_SetBaseObject(arr, base)
 * 
 * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
 *     base = PyArray_BASE(arr)
 *     if base is NULL:
 */

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

/* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":941
 * # Versions of the import_* functions which are more suitable for
 * # Cython code.
 * cdef inline int import_array() except -1:             # <<<<<<<<<<<<<<
 *     try:
 *         __pyx_import_array()
 */

static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("import_array", 0);

  /* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":942
 * # Cython code.
 * cdef inline int import_array() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         __pyx_import_array()
 *     except Exception:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":943
 * cdef inline int import_array() except -1:
 *     try:
 *         __pyx_import_array()             # <<<<<<<<<<<<<<
 *     except Exception:
 *         raise ImportError("numpy.core.multiarray failed to import")
 */
      __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 943, __pyx_L3_error)

      /* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":942
 * # Cython code.
 * cdef inline int import_array() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         __pyx_import_array()
 *     except Exception:
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;

    /* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":944
 *     try:
 *         __pyx_import_array()
 *     except Exception:             # <<<<<<<<<<<<<<
 *         raise ImportError("numpy.core.multiarray failed to import")
 * 
 */
    __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_4) {
      __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 944, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);

      /* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":945
 *         __pyx_import_array()
 *     except Exception:
 *         raise ImportError("numpy.core.multiarray failed to import")             # <<<<<<<<<<<<<<
 * 
 * cdef inline int import_umath() except -1:
 */
      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 945, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_Raise(__pyx_t_8, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __PYX_ERR(2, 945, __pyx_L5_except_error)
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":942
 * # Cython code.
 * cdef inline int import_array() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         __pyx_import_array()
 *     except Exception:
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L8_try_end:;
  }

  /* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":941
 * # Versions of the import_* functions which are more suitable for
 * # Cython code.
 * cdef inline int import_array() except -1:             # <<<<<<<<<<<<<<
 *     try:
 *         __pyx_import_array()
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":947
 *         raise ImportError("numpy.core.multiarray failed to import")
 * 
 * cdef inline int import_umath() except -1:             # <<<<<<<<<<<<<<
 *     try:
 *         _import_umath()
 */

static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("import_umath", 0);

  /* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":948
 * 
 * cdef inline int import_umath() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         _import_umath()
 *     except Exception:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":949
 * cdef inline int import_umath() except -1:
 *     try:
 *         _import_umath()             # <<<<<<<<<<<<<<
 *     except Exception:
 *         raise ImportError("numpy.core.umath failed to import")
 */
      __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 949, __pyx_L3_error)

      /* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":948
 * 
 * cdef inline int import_umath() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         _import_umath()
 *     except Exception:
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;

    /* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":950
 *     try:
 *         _import_umath()
 *     except Exception:             # <<<<<<<<<<<<<<
 *         raise ImportError("numpy.core.umath failed to import")
 * 
 */
    __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_4) {
      __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 950, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);

      /* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":951
 *         _import_umath()
 *     except Exception:
 *         raise ImportError("numpy.core.umath failed to import")             # <<<<<<<<<<<<<<
 * 
 * cdef inline int import_ufunc() except -1:
 */
      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 951, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_Raise(__pyx_t_8, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __PYX_ERR(2, 951, __pyx_L5_except_error)
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":948
 * 
 * cdef inline int import_umath() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         _import_umath()
 *     except Exception:
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L8_try_end:;
  }

  /* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":947
 *         raise ImportError("numpy.core.multiarray failed to import")
 * 
 * cdef inline int import_umath() except -1:             # <<<<<<<<<<<<<<
 *     try:
 *         _import_umath()
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":953
 *         raise ImportError("numpy.core.umath failed to import")
 * 
 * cdef inline int import_ufunc() except -1:             # <<<<<<<<<<<<<<
 *     try:
 *         _import_umath()
 */

static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("import_ufunc", 0);

  /* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":954
 * 
 * cdef inline int import_ufunc() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         _import_umath()
 *     except Exception:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":955
 * cdef inline int import_ufunc() except -1:
 *     try:
 *         _import_umath()             # <<<<<<<<<<<<<<
 *     except Exception:
 *         raise ImportError("numpy.core.umath failed to import")
 */
      __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 955, __pyx_L3_error)

      /* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":954
 * 
 * cdef inline int import_ufunc() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         _import_umath()
 *     except Exception:
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;

    /* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":956
 *     try:
 *         _import_umath()
 *     except Exception:             # <<<<<<<<<<<<<<
 *         raise ImportError("numpy.core.umath failed to import")
 * 
 */
    __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_4) {
      __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 956, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);

      /* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":957
 *         _import_umath()
 *     except Exception:
 *         raise ImportError("numpy.core.umath failed to import")             # <<<<<<<<<<<<<<
 * 
 * cdef extern from *:
 */
      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 957, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_Raise(__pyx_t_8, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __PYX_ERR(2, 957, __pyx_L5_except_error)
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":954
 * 
 * cdef inline int import_ufunc() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         _import_umath()
 *     except Exception:
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L8_try_end:;
  }

  /* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":953
 *         raise ImportError("numpy.core.umath failed to import")
 * 
 * cdef inline int import_ufunc() except -1:             # <<<<<<<<<<<<<<
 *     try:
 *         _import_umath()
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":967
 * 
 * 
 * cdef inline bint is_timedelta64_object(object obj):             # <<<<<<<<<<<<<<
 *     """
 *     Cython equivalent of `isinstance(obj, np.timedelta64)`
 */

static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_timedelta64_object", 0);

  /* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":979
 *     bool
 *     """
 *     return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type));
  goto __pyx_L0;

  /* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":967
 * 
 * 
 * cdef inline bint is_timedelta64_object(object obj):             # <<<<<<<<<<<<<<
 *     """
 *     Cython equivalent of `isinstance(obj, np.timedelta64)`
 */

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

/* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":982
 * 
 * 
 * cdef inline bint is_datetime64_object(object obj):             # <<<<<<<<<<<<<<
 *     """
 *     Cython equivalent of `isinstance(obj, np.datetime64)`
 */

static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_datetime64_object", 0);

  /* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":994
 *     bool
 *     """
 *     return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type));
  goto __pyx_L0;

  /* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":982
 * 
 * 
 * cdef inline bint is_datetime64_object(object obj):             # <<<<<<<<<<<<<<
 *     """
 *     Cython equivalent of `isinstance(obj, np.datetime64)`
 */

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

/* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":997
 * 
 * 
 * cdef inline npy_datetime get_datetime64_value(object obj) nogil:             # <<<<<<<<<<<<<<
 *     """
 *     returns the int64 value underlying scalar numpy datetime64 object
 */

static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) {
  npy_datetime __pyx_r;

  /* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":1004
 *     also needed.  That can be found using `get_datetime64_unit`.
 *     """
 *     return (<PyDatetimeScalarObject*>obj).obval             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval;
  goto __pyx_L0;

  /* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":997
 * 
 * 
 * cdef inline npy_datetime get_datetime64_value(object obj) nogil:             # <<<<<<<<<<<<<<
 *     """
 *     returns the int64 value underlying scalar numpy datetime64 object
 */

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

/* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":1007
 * 
 * 
 * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil:             # <<<<<<<<<<<<<<
 *     """
 *     returns the int64 value underlying scalar numpy timedelta64 object
 */

static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) {
  npy_timedelta __pyx_r;

  /* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":1011
 *     returns the int64 value underlying scalar numpy timedelta64 object
 *     """
 *     return (<PyTimedeltaScalarObject*>obj).obval             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval;
  goto __pyx_L0;

  /* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":1007
 * 
 * 
 * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil:             # <<<<<<<<<<<<<<
 *     """
 *     returns the int64 value underlying scalar numpy timedelta64 object
 */

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

/* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":1014
 * 
 * 
 * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil:             # <<<<<<<<<<<<<<
 *     """
 *     returns the unit part of the dtype for a numpy datetime64 object.
 */

static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) {
  NPY_DATETIMEUNIT __pyx_r;

  /* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":1018
 *     returns the unit part of the dtype for a numpy datetime64 object.
 *     """
 *     return <NPY_DATETIMEUNIT>(<PyDatetimeScalarObject*>obj).obmeta.base             # <<<<<<<<<<<<<<
 */
  __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base);
  goto __pyx_L0;

  /* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":1014
 * 
 * 
 * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil:             # <<<<<<<<<<<<<<
 *     """
 *     returns the unit part of the dtype for a numpy datetime64 object.
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}
static struct __pyx_vtabstruct_14_element_graph_ElementGraph __pyx_vtable_14_element_graph_ElementGraph;

static PyObject *__pyx_tp_new_14_element_graph_ElementGraph(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_14_element_graph_ElementGraph *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_14_element_graph_ElementGraph *)o);
  p->__pyx_vtab = __pyx_vtabptr_14_element_graph_ElementGraph;
  p->elements = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->paths = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->assignments = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->overlap = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->end_reachability = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->emptyPath = ((struct __pyx_obj_14_element_graph_Element *)Py_None); Py_INCREF(Py_None);
  p->SP = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->SM = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->EP = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->EM = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->end_elements = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->SPmembers = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->SMmembers = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->EPmembers = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->EMmembers = ((PyObject*)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_14_element_graph_ElementGraph(PyObject *o) {
  struct __pyx_obj_14_element_graph_ElementGraph *p = (struct __pyx_obj_14_element_graph_ElementGraph *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->elements);
  Py_CLEAR(p->paths);
  Py_CLEAR(p->assignments);
  Py_CLEAR(p->overlap);
  Py_CLEAR(p->end_reachability);
  Py_CLEAR(p->emptyPath);
  Py_CLEAR(p->SP);
  Py_CLEAR(p->SM);
  Py_CLEAR(p->EP);
  Py_CLEAR(p->EM);
  Py_CLEAR(p->end_elements);
  Py_CLEAR(p->SPmembers);
  Py_CLEAR(p->SMmembers);
  Py_CLEAR(p->EPmembers);
  Py_CLEAR(p->EMmembers);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_14_element_graph_ElementGraph(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_14_element_graph_ElementGraph *p = (struct __pyx_obj_14_element_graph_ElementGraph *)o;
  if (p->elements) {
    e = (*v)(p->elements, a); if (e) return e;
  }
  if (p->paths) {
    e = (*v)(p->paths, a); if (e) return e;
  }
  if (p->assignments) {
    e = (*v)(((PyObject *)p->assignments), a); if (e) return e;
  }
  if (p->overlap) {
    e = (*v)(((PyObject *)p->overlap), a); if (e) return e;
  }
  if (p->end_reachability) {
    e = (*v)(((PyObject *)p->end_reachability), a); if (e) return e;
  }
  if (p->emptyPath) {
    e = (*v)(((PyObject *)p->emptyPath), a); if (e) return e;
  }
  if (p->SP) {
    e = (*v)(p->SP, a); if (e) return e;
  }
  if (p->SM) {
    e = (*v)(p->SM, a); if (e) return e;
  }
  if (p->EP) {
    e = (*v)(p->EP, a); if (e) return e;
  }
  if (p->EM) {
    e = (*v)(p->EM, a); if (e) return e;
  }
  if (p->end_elements) {
    e = (*v)(p->end_elements, a); if (e) return e;
  }
  if (p->SPmembers) {
    e = (*v)(p->SPmembers, a); if (e) return e;
  }
  if (p->SMmembers) {
    e = (*v)(p->SMmembers, a); if (e) return e;
  }
  if (p->EPmembers) {
    e = (*v)(p->EPmembers, a); if (e) return e;
  }
  if (p->EMmembers) {
    e = (*v)(p->EMmembers, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_14_element_graph_ElementGraph(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_14_element_graph_ElementGraph *p = (struct __pyx_obj_14_element_graph_ElementGraph *)o;
  tmp = ((PyObject*)p->elements);
  p->elements = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->paths);
  p->paths = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->assignments);
  p->assignments = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->overlap);
  p->overlap = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->end_reachability);
  p->end_reachability = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->emptyPath);
  p->emptyPath = ((struct __pyx_obj_14_element_graph_Element *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->SP);
  p->SP = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->SM);
  p->SM = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->EP);
  p->EP = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->EM);
  p->EM = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->end_elements);
  p->end_elements = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->SPmembers);
  p->SPmembers = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->SMmembers);
  p->SMmembers = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->EPmembers);
  p->EPmembers = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->EMmembers);
  p->EMmembers = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_14_element_graph_12ElementGraph_elements(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14_element_graph_12ElementGraph_8elements_1__get__(o);
}

static int __pyx_setprop_14_element_graph_12ElementGraph_elements(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_14_element_graph_12ElementGraph_8elements_3__set__(o, v);
  }
  else {
    return __pyx_pw_14_element_graph_12ElementGraph_8elements_5__del__(o);
  }
}

static PyObject *__pyx_getprop_14_element_graph_12ElementGraph_paths(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14_element_graph_12ElementGraph_5paths_1__get__(o);
}

static int __pyx_setprop_14_element_graph_12ElementGraph_paths(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_14_element_graph_12ElementGraph_5paths_3__set__(o, v);
  }
  else {
    return __pyx_pw_14_element_graph_12ElementGraph_5paths_5__del__(o);
  }
}

static PyObject *__pyx_getprop_14_element_graph_12ElementGraph_assignments(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14_element_graph_12ElementGraph_11assignments_1__get__(o);
}

static int __pyx_setprop_14_element_graph_12ElementGraph_assignments(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_14_element_graph_12ElementGraph_11assignments_3__set__(o, v);
  }
  else {
    return __pyx_pw_14_element_graph_12ElementGraph_11assignments_5__del__(o);
  }
}

static PyObject *__pyx_getprop_14_element_graph_12ElementGraph_overlap(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14_element_graph_12ElementGraph_7overlap_1__get__(o);
}

static int __pyx_setprop_14_element_graph_12ElementGraph_overlap(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_14_element_graph_12ElementGraph_7overlap_3__set__(o, v);
  }
  else {
    return __pyx_pw_14_element_graph_12ElementGraph_7overlap_5__del__(o);
  }
}

static PyObject *__pyx_getprop_14_element_graph_12ElementGraph_end_reachability(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14_element_graph_12ElementGraph_16end_reachability_1__get__(o);
}

static int __pyx_setprop_14_element_graph_12ElementGraph_end_reachability(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_14_element_graph_12ElementGraph_16end_reachability_3__set__(o, v);
  }
  else {
    return __pyx_pw_14_element_graph_12ElementGraph_16end_reachability_5__del__(o);
  }
}

static PyObject *__pyx_getprop_14_element_graph_12ElementGraph_number_of_elements(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14_element_graph_12ElementGraph_18number_of_elements_1__get__(o);
}

static PyObject *__pyx_getprop_14_element_graph_12ElementGraph_maxIC(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14_element_graph_12ElementGraph_5maxIC_1__get__(o);
}

static PyObject *__pyx_getprop_14_element_graph_12ElementGraph_max_isos(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14_element_graph_12ElementGraph_8max_isos_1__get__(o);
}

static PyObject *__pyx_getprop_14_element_graph_12ElementGraph_bases(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14_element_graph_12ElementGraph_5bases_1__get__(o);
}

static int __pyx_setprop_14_element_graph_12ElementGraph_bases(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_14_element_graph_12ElementGraph_5bases_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_14_element_graph_12ElementGraph_input_bases(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14_element_graph_12ElementGraph_11input_bases_1__get__(o);
}

static int __pyx_setprop_14_element_graph_12ElementGraph_input_bases(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_14_element_graph_12ElementGraph_11input_bases_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_14_element_graph_12ElementGraph_dead_end_penalty(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14_element_graph_12ElementGraph_16dead_end_penalty_1__get__(o);
}

static int __pyx_setprop_14_element_graph_12ElementGraph_dead_end_penalty(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_14_element_graph_12ElementGraph_16dead_end_penalty_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_14_element_graph_12ElementGraph_intron_filter(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14_element_graph_12ElementGraph_13intron_filter_1__get__(o);
}

static int __pyx_setprop_14_element_graph_12ElementGraph_intron_filter(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_14_element_graph_12ElementGraph_13intron_filter_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_14_element_graph_12ElementGraph_truncation_filter(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14_element_graph_12ElementGraph_17truncation_filter_1__get__(o);
}

static int __pyx_setprop_14_element_graph_12ElementGraph_truncation_filter(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_14_element_graph_12ElementGraph_17truncation_filter_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_14_element_graph_12ElementGraph_SP(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14_element_graph_12ElementGraph_2SP_1__get__(o);
}

static int __pyx_setprop_14_element_graph_12ElementGraph_SP(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_14_element_graph_12ElementGraph_2SP_3__set__(o, v);
  }
  else {
    return __pyx_pw_14_element_graph_12ElementGraph_2SP_5__del__(o);
  }
}

static PyObject *__pyx_getprop_14_element_graph_12ElementGraph_SM(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14_element_graph_12ElementGraph_2SM_1__get__(o);
}

static int __pyx_setprop_14_element_graph_12ElementGraph_SM(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_14_element_graph_12ElementGraph_2SM_3__set__(o, v);
  }
  else {
    return __pyx_pw_14_element_graph_12ElementGraph_2SM_5__del__(o);
  }
}

static PyObject *__pyx_getprop_14_element_graph_12ElementGraph_EP(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14_element_graph_12ElementGraph_2EP_1__get__(o);
}

static int __pyx_setprop_14_element_graph_12ElementGraph_EP(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_14_element_graph_12ElementGraph_2EP_3__set__(o, v);
  }
  else {
    return __pyx_pw_14_element_graph_12ElementGraph_2EP_5__del__(o);
  }
}

static PyObject *__pyx_getprop_14_element_graph_12ElementGraph_EM(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14_element_graph_12ElementGraph_2EM_1__get__(o);
}

static int __pyx_setprop_14_element_graph_12ElementGraph_EM(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_14_element_graph_12ElementGraph_2EM_3__set__(o, v);
  }
  else {
    return __pyx_pw_14_element_graph_12ElementGraph_2EM_5__del__(o);
  }
}

static PyObject *__pyx_getprop_14_element_graph_12ElementGraph_end_elements(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14_element_graph_12ElementGraph_12end_elements_1__get__(o);
}

static int __pyx_setprop_14_element_graph_12ElementGraph_end_elements(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_14_element_graph_12ElementGraph_12end_elements_3__set__(o, v);
  }
  else {
    return __pyx_pw_14_element_graph_12ElementGraph_12end_elements_5__del__(o);
  }
}

static PyObject *__pyx_getprop_14_element_graph_12ElementGraph_SPmembers(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14_element_graph_12ElementGraph_9SPmembers_1__get__(o);
}

static int __pyx_setprop_14_element_graph_12ElementGraph_SPmembers(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_14_element_graph_12ElementGraph_9SPmembers_3__set__(o, v);
  }
  else {
    return __pyx_pw_14_element_graph_12ElementGraph_9SPmembers_5__del__(o);
  }
}

static PyObject *__pyx_getprop_14_element_graph_12ElementGraph_SMmembers(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14_element_graph_12ElementGraph_9SMmembers_1__get__(o);
}

static int __pyx_setprop_14_element_graph_12ElementGraph_SMmembers(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_14_element_graph_12ElementGraph_9SMmembers_3__set__(o, v);
  }
  else {
    return __pyx_pw_14_element_graph_12ElementGraph_9SMmembers_5__del__(o);
  }
}

static PyObject *__pyx_getprop_14_element_graph_12ElementGraph_EPmembers(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14_element_graph_12ElementGraph_9EPmembers_1__get__(o);
}

static int __pyx_setprop_14_element_graph_12ElementGraph_EPmembers(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_14_element_graph_12ElementGraph_9EPmembers_3__set__(o, v);
  }
  else {
    return __pyx_pw_14_element_graph_12ElementGraph_9EPmembers_5__del__(o);
  }
}

static PyObject *__pyx_getprop_14_element_graph_12ElementGraph_EMmembers(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14_element_graph_12ElementGraph_9EMmembers_1__get__(o);
}

static int __pyx_setprop_14_element_graph_12ElementGraph_EMmembers(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_14_element_graph_12ElementGraph_9EMmembers_3__set__(o, v);
  }
  else {
    return __pyx_pw_14_element_graph_12ElementGraph_9EMmembers_5__del__(o);
  }
}

static PyObject *__pyx_getprop_14_element_graph_12ElementGraph_no_ends(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14_element_graph_12ElementGraph_7no_ends_1__get__(o);
}

static int __pyx_setprop_14_element_graph_12ElementGraph_no_ends(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_14_element_graph_12ElementGraph_7no_ends_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_14_element_graph_12ElementGraph_ignore_ends(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14_element_graph_12ElementGraph_11ignore_ends_1__get__(o);
}

static int __pyx_setprop_14_element_graph_12ElementGraph_ignore_ends(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_14_element_graph_12ElementGraph_11ignore_ends_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_14_element_graph_12ElementGraph_naive(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14_element_graph_12ElementGraph_5naive_1__get__(o);
}

static int __pyx_setprop_14_element_graph_12ElementGraph_naive(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_14_element_graph_12ElementGraph_5naive_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_14_element_graph_12ElementGraph_partial_coverage(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14_element_graph_12ElementGraph_16partial_coverage_1__get__(o);
}

static int __pyx_setprop_14_element_graph_12ElementGraph_partial_coverage(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_14_element_graph_12ElementGraph_16partial_coverage_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_14_element_graph_12ElementGraph_allow_incomplete(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14_element_graph_12ElementGraph_16allow_incomplete_1__get__(o);
}

static int __pyx_setprop_14_element_graph_12ElementGraph_allow_incomplete(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_14_element_graph_12ElementGraph_16allow_incomplete_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyMethodDef __pyx_methods_14_element_graph_ElementGraph[] = {
  {"penalize_dead_ends", (PyCFunction)__pyx_pw_14_element_graph_12ElementGraph_3penalize_dead_ends, METH_NOARGS, __pyx_doc_14_element_graph_12ElementGraph_2penalize_dead_ends},
  {"check_for_full_paths", (PyCFunction)__pyx_pw_14_element_graph_12ElementGraph_5check_for_full_paths, METH_NOARGS, __pyx_doc_14_element_graph_12ElementGraph_4check_for_full_paths},
  {"resolve_containment", (PyCFunction)__pyx_pw_14_element_graph_12ElementGraph_7resolve_containment, METH_NOARGS, __pyx_doc_14_element_graph_12ElementGraph_6resolve_containment},
  {"zero_element", (PyCFunction)__pyx_pw_14_element_graph_12ElementGraph_9zero_element, METH_O, __pyx_doc_14_element_graph_12ElementGraph_8zero_element},
  {"assign_weights", (PyCFunction)__pyx_pw_14_element_graph_12ElementGraph_11assign_weights, METH_NOARGS, __pyx_doc_14_element_graph_12ElementGraph_10assign_weights},
  {"assemble", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_14_element_graph_12ElementGraph_13assemble, METH_VARARGS|METH_KEYWORDS, __pyx_doc_14_element_graph_12ElementGraph_12assemble},
  {"remove_bad_assemblies", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_14_element_graph_12ElementGraph_15remove_bad_assemblies, METH_VARARGS|METH_KEYWORDS, 0},
  {"available_proportion", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_14_element_graph_12ElementGraph_17available_proportion, METH_VARARGS|METH_KEYWORDS, __pyx_doc_14_element_graph_12ElementGraph_16available_proportion},
  {"available_bases", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_14_element_graph_12ElementGraph_19available_bases, METH_VARARGS|METH_KEYWORDS, __pyx_doc_14_element_graph_12ElementGraph_18available_bases},
  {"extend_path", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_14_element_graph_12ElementGraph_21extend_path, METH_VARARGS|METH_KEYWORDS, __pyx_doc_14_element_graph_12ElementGraph_20extend_path},
  {"get_heaviest_element", (PyCFunction)__pyx_pw_14_element_graph_12ElementGraph_23get_heaviest_element, METH_NOARGS, 0},
  {"dead_end", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_14_element_graph_12ElementGraph_25dead_end, METH_VARARGS|METH_KEYWORDS, __pyx_doc_14_element_graph_12ElementGraph_24dead_end},
  {"generate_extensions", (PyCFunction)__pyx_pw_14_element_graph_12ElementGraph_27generate_extensions, METH_O, __pyx_doc_14_element_graph_12ElementGraph_26generate_extensions},
  {"best_extension", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_14_element_graph_12ElementGraph_29best_extension, METH_VARARGS|METH_KEYWORDS, 0},
  {"calculate_extension_score", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_14_element_graph_12ElementGraph_31calculate_extension_score, METH_VARARGS|METH_KEYWORDS, __pyx_doc_14_element_graph_12ElementGraph_30calculate_extension_score},
  {"find_optimal_path", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_14_element_graph_12ElementGraph_33find_optimal_path, METH_VARARGS|METH_KEYWORDS, __pyx_doc_14_element_graph_12ElementGraph_32find_optimal_path},
  {"rescue_ends", (PyCFunction)__pyx_pw_14_element_graph_12ElementGraph_35rescue_ends, METH_O, __pyx_doc_14_element_graph_12ElementGraph_34rescue_ends},
  {"add_path", (PyCFunction)__pyx_pw_14_element_graph_12ElementGraph_37add_path, METH_O, __pyx_doc_14_element_graph_12ElementGraph_36add_path},
  {"remove_paths", (PyCFunction)__pyx_pw_14_element_graph_12ElementGraph_39remove_paths, METH_O, __pyx_doc_14_element_graph_12ElementGraph_38remove_paths},
  {"normalize", (PyCFunction)__pyx_pw_14_element_graph_12ElementGraph_41normalize, METH_O, 0},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_14_element_graph_12ElementGraph_43__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_14_element_graph_12ElementGraph_45__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_14_element_graph_ElementGraph[] = {
  {(char *)"elements", __pyx_getprop_14_element_graph_12ElementGraph_elements, __pyx_setprop_14_element_graph_12ElementGraph_elements, (char *)0, 0},
  {(char *)"paths", __pyx_getprop_14_element_graph_12ElementGraph_paths, __pyx_setprop_14_element_graph_12ElementGraph_paths, (char *)0, 0},
  {(char *)"assignments", __pyx_getprop_14_element_graph_12ElementGraph_assignments, __pyx_setprop_14_element_graph_12ElementGraph_assignments, (char *)0, 0},
  {(char *)"overlap", __pyx_getprop_14_element_graph_12ElementGraph_overlap, __pyx_setprop_14_element_graph_12ElementGraph_overlap, (char *)0, 0},
  {(char *)"end_reachability", __pyx_getprop_14_element_graph_12ElementGraph_end_reachability, __pyx_setprop_14_element_graph_12ElementGraph_end_reachability, (char *)0, 0},
  {(char *)"number_of_elements", __pyx_getprop_14_element_graph_12ElementGraph_number_of_elements, 0, (char *)0, 0},
  {(char *)"maxIC", __pyx_getprop_14_element_graph_12ElementGraph_maxIC, 0, (char *)0, 0},
  {(char *)"max_isos", __pyx_getprop_14_element_graph_12ElementGraph_max_isos, 0, (char *)0, 0},
  {(char *)"bases", __pyx_getprop_14_element_graph_12ElementGraph_bases, __pyx_setprop_14_element_graph_12ElementGraph_bases, (char *)0, 0},
  {(char *)"input_bases", __pyx_getprop_14_element_graph_12ElementGraph_input_bases, __pyx_setprop_14_element_graph_12ElementGraph_input_bases, (char *)0, 0},
  {(char *)"dead_end_penalty", __pyx_getprop_14_element_graph_12ElementGraph_dead_end_penalty, __pyx_setprop_14_element_graph_12ElementGraph_dead_end_penalty, (char *)0, 0},
  {(char *)"intron_filter", __pyx_getprop_14_element_graph_12ElementGraph_intron_filter, __pyx_setprop_14_element_graph_12ElementGraph_intron_filter, (char *)0, 0},
  {(char *)"truncation_filter", __pyx_getprop_14_element_graph_12ElementGraph_truncation_filter, __pyx_setprop_14_element_graph_12ElementGraph_truncation_filter, (char *)0, 0},
  {(char *)"SP", __pyx_getprop_14_element_graph_12ElementGraph_SP, __pyx_setprop_14_element_graph_12ElementGraph_SP, (char *)0, 0},
  {(char *)"SM", __pyx_getprop_14_element_graph_12ElementGraph_SM, __pyx_setprop_14_element_graph_12ElementGraph_SM, (char *)0, 0},
  {(char *)"EP", __pyx_getprop_14_element_graph_12ElementGraph_EP, __pyx_setprop_14_element_graph_12ElementGraph_EP, (char *)0, 0},
  {(char *)"EM", __pyx_getprop_14_element_graph_12ElementGraph_EM, __pyx_setprop_14_element_graph_12ElementGraph_EM, (char *)0, 0},
  {(char *)"end_elements", __pyx_getprop_14_element_graph_12ElementGraph_end_elements, __pyx_setprop_14_element_graph_12ElementGraph_end_elements, (char *)0, 0},
  {(char *)"SPmembers", __pyx_getprop_14_element_graph_12ElementGraph_SPmembers, __pyx_setprop_14_element_graph_12ElementGraph_SPmembers, (char *)0, 0},
  {(char *)"SMmembers", __pyx_getprop_14_element_graph_12ElementGraph_SMmembers, __pyx_setprop_14_element_graph_12ElementGraph_SMmembers, (char *)0, 0},
  {(char *)"EPmembers", __pyx_getprop_14_element_graph_12ElementGraph_EPmembers, __pyx_setprop_14_element_graph_12ElementGraph_EPmembers, (char *)0, 0},
  {(char *)"EMmembers", __pyx_getprop_14_element_graph_12ElementGraph_EMmembers, __pyx_setprop_14_element_graph_12ElementGraph_EMmembers, (char *)0, 0},
  {(char *)"no_ends", __pyx_getprop_14_element_graph_12ElementGraph_no_ends, __pyx_setprop_14_element_graph_12ElementGraph_no_ends, (char *)0, 0},
  {(char *)"ignore_ends", __pyx_getprop_14_element_graph_12ElementGraph_ignore_ends, __pyx_setprop_14_element_graph_12ElementGraph_ignore_ends, (char *)0, 0},
  {(char *)"naive", __pyx_getprop_14_element_graph_12ElementGraph_naive, __pyx_setprop_14_element_graph_12ElementGraph_naive, (char *)0, 0},
  {(char *)"partial_coverage", __pyx_getprop_14_element_graph_12ElementGraph_partial_coverage, __pyx_setprop_14_element_graph_12ElementGraph_partial_coverage, (char *)0, 0},
  {(char *)"allow_incomplete", __pyx_getprop_14_element_graph_12ElementGraph_allow_incomplete, __pyx_setprop_14_element_graph_12ElementGraph_allow_incomplete, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_14_element_graph_ElementGraph = {
  PyVarObject_HEAD_INIT(0, 0)
  "_element_graph.ElementGraph", /*tp_name*/
  sizeof(struct __pyx_obj_14_element_graph_ElementGraph), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_14_element_graph_ElementGraph, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_14_element_graph_ElementGraph, /*tp_traverse*/
  __pyx_tp_clear_14_element_graph_ElementGraph, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_14_element_graph_ElementGraph, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_14_element_graph_ElementGraph, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_14_element_graph_12ElementGraph_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_14_element_graph_ElementGraph, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
  0, /*tp_pypy_flags*/
  #endif
};
static struct __pyx_vtabstruct_14_element_graph_Element __pyx_vtable_14_element_graph_Element;

static PyObject *__pyx_tp_new_14_element_graph_Element(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_14_element_graph_Element *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_14_element_graph_Element *)o);
  p->__pyx_vtab = __pyx_vtabptr_14_element_graph_Element;
  p->members = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->nonmembers = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->ingroup = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->outgroup = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->contains = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->contained = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->excludes = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->includes = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->end_indices = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->covered_indices = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->bottleneck = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->assigned_to = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->frag_len = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->source_weights = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->member_weights = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->all = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_14_element_graph_Element(PyObject *o) {
  struct __pyx_obj_14_element_graph_Element *p = (struct __pyx_obj_14_element_graph_Element *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->members);
  Py_CLEAR(p->nonmembers);
  Py_CLEAR(p->ingroup);
  Py_CLEAR(p->outgroup);
  Py_CLEAR(p->contains);
  Py_CLEAR(p->contained);
  Py_CLEAR(p->excludes);
  Py_CLEAR(p->includes);
  Py_CLEAR(p->end_indices);
  Py_CLEAR(p->covered_indices);
  Py_CLEAR(p->bottleneck);
  Py_CLEAR(p->assigned_to);
  Py_CLEAR(p->frag_len);
  Py_CLEAR(p->source_weights);
  Py_CLEAR(p->member_weights);
  Py_CLEAR(p->all);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_14_element_graph_Element(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_14_element_graph_Element *p = (struct __pyx_obj_14_element_graph_Element *)o;
  if (p->members) {
    e = (*v)(p->members, a); if (e) return e;
  }
  if (p->nonmembers) {
    e = (*v)(p->nonmembers, a); if (e) return e;
  }
  if (p->ingroup) {
    e = (*v)(p->ingroup, a); if (e) return e;
  }
  if (p->outgroup) {
    e = (*v)(p->outgroup, a); if (e) return e;
  }
  if (p->contains) {
    e = (*v)(p->contains, a); if (e) return e;
  }
  if (p->contained) {
    e = (*v)(p->contained, a); if (e) return e;
  }
  if (p->excludes) {
    e = (*v)(p->excludes, a); if (e) return e;
  }
  if (p->includes) {
    e = (*v)(p->includes, a); if (e) return e;
  }
  if (p->end_indices) {
    e = (*v)(p->end_indices, a); if (e) return e;
  }
  if (p->covered_indices) {
    e = (*v)(p->covered_indices, a); if (e) return e;
  }
  if (p->bottleneck) {
    e = (*v)(p->bottleneck, a); if (e) return e;
  }
  if (p->assigned_to) {
    e = (*v)(p->assigned_to, a); if (e) return e;
  }
  if (p->frag_len) {
    e = (*v)(((PyObject *)p->frag_len), a); if (e) return e;
  }
  if (p->source_weights) {
    e = (*v)(((PyObject *)p->source_weights), a); if (e) return e;
  }
  if (p->member_weights) {
    e = (*v)(((PyObject *)p->member_weights), a); if (e) return e;
  }
  if (p->all) {
    e = (*v)(((PyObject *)p->all), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_14_element_graph_Element(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_14_element_graph_Element *p = (struct __pyx_obj_14_element_graph_Element *)o;
  tmp = ((PyObject*)p->members);
  p->members = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->nonmembers);
  p->nonmembers = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->ingroup);
  p->ingroup = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->outgroup);
  p->outgroup = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->contains);
  p->contains = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->contained);
  p->contained = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->excludes);
  p->excludes = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->includes);
  p->includes = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->end_indices);
  p->end_indices = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->covered_indices);
  p->covered_indices = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->bottleneck);
  p->bottleneck = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->assigned_to);
  p->assigned_to = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->frag_len);
  p->frag_len = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->source_weights);
  p->source_weights = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->member_weights);
  p->member_weights = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->all);
  p->all = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_tp_richcompare_14_element_graph_Element(PyObject *o1, PyObject *o2, int op) {
  switch (op) {
    case Py_EQ: {
      return __pyx_pw_14_element_graph_7Element_7__eq__(o1, o2);
    }
    case Py_NE: {
      return __pyx_pw_14_element_graph_7Element_9__ne__(o1, o2);
    }
    case Py_LT: {
      return __pyx_pw_14_element_graph_7Element_15__lt__(o1, o2);
    }
    case Py_GT: {
      return __pyx_pw_14_element_graph_7Element_11__gt__(o1, o2);
    }
    case Py_LE: {
      return __pyx_pw_14_element_graph_7Element_17__le__(o1, o2);
    }
    case Py_GE: {
      return __pyx_pw_14_element_graph_7Element_13__ge__(o1, o2);
    }
    default: {
      return __Pyx_NewRef(Py_NotImplemented);
    }
  }
}

static PyObject *__pyx_getprop_14_element_graph_7Element_index(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14_element_graph_7Element_5index_1__get__(o);
}

static int __pyx_setprop_14_element_graph_7Element_index(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_14_element_graph_7Element_5index_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_14_element_graph_7Element_length(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14_element_graph_7Element_6length_1__get__(o);
}

static int __pyx_setprop_14_element_graph_7Element_length(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_14_element_graph_7Element_6length_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_14_element_graph_7Element_IC(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14_element_graph_7Element_2IC_1__get__(o);
}

static int __pyx_setprop_14_element_graph_7Element_IC(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_14_element_graph_7Element_2IC_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_14_element_graph_7Element_maxIC(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14_element_graph_7Element_5maxIC_1__get__(o);
}

static int __pyx_setprop_14_element_graph_7Element_maxIC(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_14_element_graph_7Element_5maxIC_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_14_element_graph_7Element_left(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14_element_graph_7Element_4left_1__get__(o);
}

static int __pyx_setprop_14_element_graph_7Element_left(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_14_element_graph_7Element_4left_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_14_element_graph_7Element_right(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14_element_graph_7Element_5right_1__get__(o);
}

static int __pyx_setprop_14_element_graph_7Element_right(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_14_element_graph_7Element_5right_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_14_element_graph_7Element_number_of_elements(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14_element_graph_7Element_18number_of_elements_1__get__(o);
}

static int __pyx_setprop_14_element_graph_7Element_number_of_elements(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_14_element_graph_7Element_18number_of_elements_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_14_element_graph_7Element_number_of_members(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14_element_graph_7Element_17number_of_members_1__get__(o);
}

static int __pyx_setprop_14_element_graph_7Element_number_of_members(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_14_element_graph_7Element_17number_of_members_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_14_element_graph_7Element_LM(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14_element_graph_7Element_2LM_1__get__(o);
}

static int __pyx_setprop_14_element_graph_7Element_LM(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_14_element_graph_7Element_2LM_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_14_element_graph_7Element_RM(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14_element_graph_7Element_2RM_1__get__(o);
}

static int __pyx_setprop_14_element_graph_7Element_RM(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_14_element_graph_7Element_2RM_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_14_element_graph_7Element_strand(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14_element_graph_7Element_6strand_1__get__(o);
}

static int __pyx_setprop_14_element_graph_7Element_strand(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_14_element_graph_7Element_6strand_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_14_element_graph_7Element_cov(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14_element_graph_7Element_3cov_1__get__(o);
}

static int __pyx_setprop_14_element_graph_7Element_cov(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_14_element_graph_7Element_3cov_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_14_element_graph_7Element_bases(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14_element_graph_7Element_5bases_1__get__(o);
}

static int __pyx_setprop_14_element_graph_7Element_bases(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_14_element_graph_7Element_5bases_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_14_element_graph_7Element_bottleneck_weight(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14_element_graph_7Element_17bottleneck_weight_1__get__(o);
}

static int __pyx_setprop_14_element_graph_7Element_bottleneck_weight(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_14_element_graph_7Element_17bottleneck_weight_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_14_element_graph_7Element_trimmed_bases(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14_element_graph_7Element_13trimmed_bases_1__get__(o);
}

static int __pyx_setprop_14_element_graph_7Element_trimmed_bases(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_14_element_graph_7Element_13trimmed_bases_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_14_element_graph_7Element_members(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14_element_graph_7Element_7members_1__get__(o);
}

static int __pyx_setprop_14_element_graph_7Element_members(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_14_element_graph_7Element_7members_3__set__(o, v);
  }
  else {
    return __pyx_pw_14_element_graph_7Element_7members_5__del__(o);
  }
}

static PyObject *__pyx_getprop_14_element_graph_7Element_nonmembers(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14_element_graph_7Element_10nonmembers_1__get__(o);
}

static int __pyx_setprop_14_element_graph_7Element_nonmembers(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_14_element_graph_7Element_10nonmembers_3__set__(o, v);
  }
  else {
    return __pyx_pw_14_element_graph_7Element_10nonmembers_5__del__(o);
  }
}

static PyObject *__pyx_getprop_14_element_graph_7Element_ingroup(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14_element_graph_7Element_7ingroup_1__get__(o);
}

static int __pyx_setprop_14_element_graph_7Element_ingroup(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_14_element_graph_7Element_7ingroup_3__set__(o, v);
  }
  else {
    return __pyx_pw_14_element_graph_7Element_7ingroup_5__del__(o);
  }
}

static PyObject *__pyx_getprop_14_element_graph_7Element_outgroup(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14_element_graph_7Element_8outgroup_1__get__(o);
}

static int __pyx_setprop_14_element_graph_7Element_outgroup(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_14_element_graph_7Element_8outgroup_3__set__(o, v);
  }
  else {
    return __pyx_pw_14_element_graph_7Element_8outgroup_5__del__(o);
  }
}

static PyObject *__pyx_getprop_14_element_graph_7Element_contains(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14_element_graph_7Element_8contains_1__get__(o);
}

static int __pyx_setprop_14_element_graph_7Element_contains(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_14_element_graph_7Element_8contains_3__set__(o, v);
  }
  else {
    return __pyx_pw_14_element_graph_7Element_8contains_5__del__(o);
  }
}

static PyObject *__pyx_getprop_14_element_graph_7Element_contained(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14_element_graph_7Element_9contained_1__get__(o);
}

static int __pyx_setprop_14_element_graph_7Element_contained(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_14_element_graph_7Element_9contained_3__set__(o, v);
  }
  else {
    return __pyx_pw_14_element_graph_7Element_9contained_5__del__(o);
  }
}

static PyObject *__pyx_getprop_14_element_graph_7Element_excludes(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14_element_graph_7Element_8excludes_1__get__(o);
}

static int __pyx_setprop_14_element_graph_7Element_excludes(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_14_element_graph_7Element_8excludes_3__set__(o, v);
  }
  else {
    return __pyx_pw_14_element_graph_7Element_8excludes_5__del__(o);
  }
}

static PyObject *__pyx_getprop_14_element_graph_7Element_includes(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14_element_graph_7Element_8includes_1__get__(o);
}

static int __pyx_setprop_14_element_graph_7Element_includes(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_14_element_graph_7Element_8includes_3__set__(o, v);
  }
  else {
    return __pyx_pw_14_element_graph_7Element_8includes_5__del__(o);
  }
}

static PyObject *__pyx_getprop_14_element_graph_7Element_end_indices(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14_element_graph_7Element_11end_indices_1__get__(o);
}

static int __pyx_setprop_14_element_graph_7Element_end_indices(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_14_element_graph_7Element_11end_indices_3__set__(o, v);
  }
  else {
    return __pyx_pw_14_element_graph_7Element_11end_indices_5__del__(o);
  }
}

static PyObject *__pyx_getprop_14_element_graph_7Element_covered_indices(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14_element_graph_7Element_15covered_indices_1__get__(o);
}

static int __pyx_setprop_14_element_graph_7Element_covered_indices(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_14_element_graph_7Element_15covered_indices_3__set__(o, v);
  }
  else {
    return __pyx_pw_14_element_graph_7Element_15covered_indices_5__del__(o);
  }
}

static PyObject *__pyx_getprop_14_element_graph_7Element_bottleneck(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14_element_graph_7Element_10bottleneck_1__get__(o);
}

static int __pyx_setprop_14_element_graph_7Element_bottleneck(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_14_element_graph_7Element_10bottleneck_3__set__(o, v);
  }
  else {
    return __pyx_pw_14_element_graph_7Element_10bottleneck_5__del__(o);
  }
}

static PyObject *__pyx_getprop_14_element_graph_7Element_assigned_to(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14_element_graph_7Element_11assigned_to_1__get__(o);
}

static int __pyx_setprop_14_element_graph_7Element_assigned_to(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_14_element_graph_7Element_11assigned_to_3__set__(o, v);
  }
  else {
    return __pyx_pw_14_element_graph_7Element_11assigned_to_5__del__(o);
  }
}

static PyObject *__pyx_getprop_14_element_graph_7Element_frag_len(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14_element_graph_7Element_8frag_len_1__get__(o);
}

static int __pyx_setprop_14_element_graph_7Element_frag_len(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_14_element_graph_7Element_8frag_len_3__set__(o, v);
  }
  else {
    return __pyx_pw_14_element_graph_7Element_8frag_len_5__del__(o);
  }
}

static PyObject *__pyx_getprop_14_element_graph_7Element_source_weights(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14_element_graph_7Element_14source_weights_1__get__(o);
}

static int __pyx_setprop_14_element_graph_7Element_source_weights(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_14_element_graph_7Element_14source_weights_3__set__(o, v);
  }
  else {
    return __pyx_pw_14_element_graph_7Element_14source_weights_5__del__(o);
  }
}

static PyObject *__pyx_getprop_14_element_graph_7Element_member_weights(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14_element_graph_7Element_14member_weights_1__get__(o);
}

static int __pyx_setprop_14_element_graph_7Element_member_weights(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_14_element_graph_7Element_14member_weights_3__set__(o, v);
  }
  else {
    return __pyx_pw_14_element_graph_7Element_14member_weights_5__del__(o);
  }
}

static PyObject *__pyx_getprop_14_element_graph_7Element_all(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14_element_graph_7Element_3all_1__get__(o);
}

static int __pyx_setprop_14_element_graph_7Element_all(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_14_element_graph_7Element_3all_3__set__(o, v);
  }
  else {
    return __pyx_pw_14_element_graph_7Element_3all_5__del__(o);
  }
}

static PyObject *__pyx_getprop_14_element_graph_7Element_complete(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14_element_graph_7Element_8complete_1__get__(o);
}

static int __pyx_setprop_14_element_graph_7Element_complete(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_14_element_graph_7Element_8complete_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_14_element_graph_7Element_s_tag(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14_element_graph_7Element_5s_tag_1__get__(o);
}

static int __pyx_setprop_14_element_graph_7Element_s_tag(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_14_element_graph_7Element_5s_tag_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_14_element_graph_7Element_e_tag(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14_element_graph_7Element_5e_tag_1__get__(o);
}

static int __pyx_setprop_14_element_graph_7Element_e_tag(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_14_element_graph_7Element_5e_tag_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_14_element_graph_7Element_empty(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14_element_graph_7Element_5empty_1__get__(o);
}

static int __pyx_setprop_14_element_graph_7Element_empty(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_14_element_graph_7Element_5empty_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_14_element_graph_7Element_is_spliced(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14_element_graph_7Element_10is_spliced_1__get__(o);
}

static int __pyx_setprop_14_element_graph_7Element_is_spliced(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_14_element_graph_7Element_10is_spliced_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_14_element_graph_7Element_has_gaps(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14_element_graph_7Element_8has_gaps_1__get__(o);
}

static int __pyx_setprop_14_element_graph_7Element_has_gaps(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_14_element_graph_7Element_8has_gaps_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyMethodDef __pyx_methods_14_element_graph_Element[] = {
  {"as_string", (PyCFunction)__pyx_pw_14_element_graph_7Element_5as_string, METH_NOARGS, 0},
  {"update", (PyCFunction)__pyx_pw_14_element_graph_7Element_21update, METH_NOARGS, 0},
  {"uniqueMembers", (PyCFunction)__pyx_pw_14_element_graph_7Element_23uniqueMembers, METH_O, __pyx_doc_14_element_graph_7Element_22uniqueMembers},
  {"uniqueNonmembers", (PyCFunction)__pyx_pw_14_element_graph_7Element_25uniqueNonmembers, METH_O, __pyx_doc_14_element_graph_7Element_24uniqueNonmembers},
  {"uniqueInformation", (PyCFunction)__pyx_pw_14_element_graph_7Element_27uniqueInformation, METH_O, __pyx_doc_14_element_graph_7Element_26uniqueInformation},
  {"uniqueLength", (PyCFunction)__pyx_pw_14_element_graph_7Element_29uniqueLength, METH_O, __pyx_doc_14_element_graph_7Element_28uniqueLength},
  {"compatible", (PyCFunction)__pyx_pw_14_element_graph_7Element_31compatible, METH_O, __pyx_doc_14_element_graph_7Element_30compatible},
  {"get_introns", (PyCFunction)__pyx_pw_14_element_graph_7Element_33get_introns, METH_NOARGS, __pyx_doc_14_element_graph_7Element_32get_introns},
  {"get_exons", (PyCFunction)__pyx_pw_14_element_graph_7Element_35get_exons, METH_NOARGS, __pyx_doc_14_element_graph_7Element_34get_exons},
  {"merge", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_14_element_graph_7Element_37merge, METH_VARARGS|METH_KEYWORDS, __pyx_doc_14_element_graph_7Element_36merge},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_14_element_graph_7Element_39__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_14_element_graph_7Element_41__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_14_element_graph_Element[] = {
  {(char *)"index", __pyx_getprop_14_element_graph_7Element_index, __pyx_setprop_14_element_graph_7Element_index, (char *)0, 0},
  {(char *)"length", __pyx_getprop_14_element_graph_7Element_length, __pyx_setprop_14_element_graph_7Element_length, (char *)0, 0},
  {(char *)"IC", __pyx_getprop_14_element_graph_7Element_IC, __pyx_setprop_14_element_graph_7Element_IC, (char *)0, 0},
  {(char *)"maxIC", __pyx_getprop_14_element_graph_7Element_maxIC, __pyx_setprop_14_element_graph_7Element_maxIC, (char *)0, 0},
  {(char *)"left", __pyx_getprop_14_element_graph_7Element_left, __pyx_setprop_14_element_graph_7Element_left, (char *)0, 0},
  {(char *)"right", __pyx_getprop_14_element_graph_7Element_right, __pyx_setprop_14_element_graph_7Element_right, (char *)0, 0},
  {(char *)"number_of_elements", __pyx_getprop_14_element_graph_7Element_number_of_elements, __pyx_setprop_14_element_graph_7Element_number_of_elements, (char *)0, 0},
  {(char *)"number_of_members", __pyx_getprop_14_element_graph_7Element_number_of_members, __pyx_setprop_14_element_graph_7Element_number_of_members, (char *)0, 0},
  {(char *)"LM", __pyx_getprop_14_element_graph_7Element_LM, __pyx_setprop_14_element_graph_7Element_LM, (char *)0, 0},
  {(char *)"RM", __pyx_getprop_14_element_graph_7Element_RM, __pyx_setprop_14_element_graph_7Element_RM, (char *)0, 0},
  {(char *)"strand", __pyx_getprop_14_element_graph_7Element_strand, __pyx_setprop_14_element_graph_7Element_strand, (char *)0, 0},
  {(char *)"cov", __pyx_getprop_14_element_graph_7Element_cov, __pyx_setprop_14_element_graph_7Element_cov, (char *)0, 0},
  {(char *)"bases", __pyx_getprop_14_element_graph_7Element_bases, __pyx_setprop_14_element_graph_7Element_bases, (char *)0, 0},
  {(char *)"bottleneck_weight", __pyx_getprop_14_element_graph_7Element_bottleneck_weight, __pyx_setprop_14_element_graph_7Element_bottleneck_weight, (char *)0, 0},
  {(char *)"trimmed_bases", __pyx_getprop_14_element_graph_7Element_trimmed_bases, __pyx_setprop_14_element_graph_7Element_trimmed_bases, (char *)0, 0},
  {(char *)"members", __pyx_getprop_14_element_graph_7Element_members, __pyx_setprop_14_element_graph_7Element_members, (char *)0, 0},
  {(char *)"nonmembers", __pyx_getprop_14_element_graph_7Element_nonmembers, __pyx_setprop_14_element_graph_7Element_nonmembers, (char *)0, 0},
  {(char *)"ingroup", __pyx_getprop_14_element_graph_7Element_ingroup, __pyx_setprop_14_element_graph_7Element_ingroup, (char *)0, 0},
  {(char *)"outgroup", __pyx_getprop_14_element_graph_7Element_outgroup, __pyx_setprop_14_element_graph_7Element_outgroup, (char *)0, 0},
  {(char *)"contains", __pyx_getprop_14_element_graph_7Element_contains, __pyx_setprop_14_element_graph_7Element_contains, (char *)0, 0},
  {(char *)"contained", __pyx_getprop_14_element_graph_7Element_contained, __pyx_setprop_14_element_graph_7Element_contained, (char *)0, 0},
  {(char *)"excludes", __pyx_getprop_14_element_graph_7Element_excludes, __pyx_setprop_14_element_graph_7Element_excludes, (char *)0, 0},
  {(char *)"includes", __pyx_getprop_14_element_graph_7Element_includes, __pyx_setprop_14_element_graph_7Element_includes, (char *)0, 0},
  {(char *)"end_indices", __pyx_getprop_14_element_graph_7Element_end_indices, __pyx_setprop_14_element_graph_7Element_end_indices, (char *)0, 0},
  {(char *)"covered_indices", __pyx_getprop_14_element_graph_7Element_covered_indices, __pyx_setprop_14_element_graph_7Element_covered_indices, (char *)0, 0},
  {(char *)"bottleneck", __pyx_getprop_14_element_graph_7Element_bottleneck, __pyx_setprop_14_element_graph_7Element_bottleneck, (char *)0, 0},
  {(char *)"assigned_to", __pyx_getprop_14_element_graph_7Element_assigned_to, __pyx_setprop_14_element_graph_7Element_assigned_to, (char *)0, 0},
  {(char *)"frag_len", __pyx_getprop_14_element_graph_7Element_frag_len, __pyx_setprop_14_element_graph_7Element_frag_len, (char *)0, 0},
  {(char *)"source_weights", __pyx_getprop_14_element_graph_7Element_source_weights, __pyx_setprop_14_element_graph_7Element_source_weights, (char *)0, 0},
  {(char *)"member_weights", __pyx_getprop_14_element_graph_7Element_member_weights, __pyx_setprop_14_element_graph_7Element_member_weights, (char *)0, 0},
  {(char *)"all", __pyx_getprop_14_element_graph_7Element_all, __pyx_setprop_14_element_graph_7Element_all, (char *)0, 0},
  {(char *)"complete", __pyx_getprop_14_element_graph_7Element_complete, __pyx_setprop_14_element_graph_7Element_complete, (char *)0, 0},
  {(char *)"s_tag", __pyx_getprop_14_element_graph_7Element_s_tag, __pyx_setprop_14_element_graph_7Element_s_tag, (char *)0, 0},
  {(char *)"e_tag", __pyx_getprop_14_element_graph_7Element_e_tag, __pyx_setprop_14_element_graph_7Element_e_tag, (char *)0, 0},
  {(char *)"empty", __pyx_getprop_14_element_graph_7Element_empty, __pyx_setprop_14_element_graph_7Element_empty, (char *)0, 0},
  {(char *)"is_spliced", __pyx_getprop_14_element_graph_7Element_is_spliced, __pyx_setprop_14_element_graph_7Element_is_spliced, (char *)0, 0},
  {(char *)"has_gaps", __pyx_getprop_14_element_graph_7Element_has_gaps, __pyx_setprop_14_element_graph_7Element_has_gaps, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_Element = {
  __pyx_pw_14_element_graph_7Element_19__add__, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
  0, /*nb_inplace_divide*/
  #endif
  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*/
  #if PY_VERSION_HEX >= 0x03050000
  0, /*nb_matrix_multiply*/
  #endif
  #if PY_VERSION_HEX >= 0x03050000
  0, /*nb_inplace_matrix_multiply*/
  #endif
};

static PyTypeObject __pyx_type_14_element_graph_Element = {
  PyVarObject_HEAD_INIT(0, 0)
  "_element_graph.Element", /*tp_name*/
  sizeof(struct __pyx_obj_14_element_graph_Element), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_14_element_graph_Element, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_14_element_graph_7Element_3__repr__, /*tp_repr*/
  &__pyx_tp_as_number_Element, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "Represents a read or collection of reads in a Locus.", /*tp_doc*/
  __pyx_tp_traverse_14_element_graph_Element, /*tp_traverse*/
  __pyx_tp_clear_14_element_graph_Element, /*tp_clear*/
  __pyx_tp_richcompare_14_element_graph_Element, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_14_element_graph_Element, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_14_element_graph_Element, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_14_element_graph_7Element_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_14_element_graph_Element, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
  0, /*tp_pypy_flags*/
  #endif
};

static PyMethodDef __pyx_methods[] = {
  {0, 0, 0, 0}
};

#if PY_MAJOR_VERSION >= 3
#if CYTHON_PEP489_MULTI_PHASE_INIT
static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
static int __pyx_pymod_exec__element_graph(PyObject* module); /*proto*/
static PyModuleDef_Slot __pyx_moduledef_slots[] = {
  {Py_mod_create, (void*)__pyx_pymod_create},
  {Py_mod_exec, (void*)__pyx_pymod_exec__element_graph},
  {0, NULL}
};
#endif

static struct PyModuleDef __pyx_moduledef = {
    PyModuleDef_HEAD_INIT,
    "_element_graph",
    0, /* m_doc */
  #if CYTHON_PEP489_MULTI_PHASE_INIT
    0, /* m_size */
  #else
    -1, /* m_size */
  #endif
    __pyx_methods /* m_methods */,
  #if CYTHON_PEP489_MULTI_PHASE_INIT
    __pyx_moduledef_slots, /* m_slots */
  #else
    NULL, /* m_reload */
  #endif
    NULL, /* m_traverse */
    NULL, /* m_clear */
    NULL /* m_free */
};
#endif
#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

static __Pyx_StringTabEntry __pyx_string_tab[] = {
  {&__pyx_kp_u_ERROR_incompatible_with, __pyx_k_ERROR_incompatible_with, sizeof(__pyx_k_ERROR_incompatible_with), 0, 1, 0, 0},
  {&__pyx_n_s_Element, __pyx_k_Element, sizeof(__pyx_k_Element), 0, 0, 1, 1},
  {&__pyx_n_s_ElementGraph, __pyx_k_ElementGraph, sizeof(__pyx_k_ElementGraph), 0, 0, 1, 1},
  {&__pyx_kp_u_Error_Element_is_not_connected_t, __pyx_k_Error_Element_is_not_connected_t, sizeof(__pyx_k_Error_Element_is_not_connected_t), 0, 1, 0, 0},
  {&__pyx_n_s_IC, __pyx_k_IC, sizeof(__pyx_k_IC), 0, 0, 1, 1},
  {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
  {&__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_k_Incompatible_checksums_0x_x_vs_0, sizeof(__pyx_k_Incompatible_checksums_0x_x_vs_0), 0, 0, 1, 0},
  {&__pyx_kp_s_Incompatible_checksums_0x_x_vs_0_2, __pyx_k_Incompatible_checksums_0x_x_vs_0_2, sizeof(__pyx_k_Incompatible_checksums_0x_x_vs_0_2), 0, 0, 1, 0},
  {&__pyx_n_u_Inf, __pyx_k_Inf, sizeof(__pyx_k_Inf), 0, 1, 0, 1},
  {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
  {&__pyx_kp_u_Removing_fusion, __pyx_k_Removing_fusion, sizeof(__pyx_k_Removing_fusion), 0, 1, 0, 0},
  {&__pyx_kp_u_Removing_incomplete, __pyx_k_Removing_incomplete, sizeof(__pyx_k_Removing_incomplete), 0, 1, 0, 0},
  {&__pyx_kp_u_Removing_intron_retention, __pyx_k_Removing_intron_retention, sizeof(__pyx_k_Removing_intron_retention), 0, 1, 0, 0},
  {&__pyx_kp_u_Removing_low_abundance, __pyx_k_Removing_low_abundance, sizeof(__pyx_k_Removing_low_abundance), 0, 1, 0, 0},
  {&__pyx_kp_u_Removing_truncation, __pyx_k_Removing_truncation, sizeof(__pyx_k_Removing_truncation), 0, 1, 0, 0},
  {&__pyx_kp_u__10, __pyx_k__10, sizeof(__pyx_k__10), 0, 1, 0, 0},
  {&__pyx_kp_u__11, __pyx_k__11, sizeof(__pyx_k__11), 0, 1, 0, 0},
  {&__pyx_kp_u__12, __pyx_k__12, sizeof(__pyx_k__12), 0, 1, 0, 0},
  {&__pyx_kp_u__13, __pyx_k__13, sizeof(__pyx_k__13), 0, 1, 0, 0},
  {&__pyx_n_u__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 1, 0, 1},
  {&__pyx_kp_u__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 1, 0, 0},
  {&__pyx_kp_u__5, __pyx_k__5, sizeof(__pyx_k__5), 0, 1, 0, 0},
  {&__pyx_kp_u__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 1, 0, 0},
  {&__pyx_kp_u__7, __pyx_k__7, sizeof(__pyx_k__7), 0, 1, 0, 0},
  {&__pyx_kp_u__8, __pyx_k__8, sizeof(__pyx_k__8), 0, 1, 0, 0},
  {&__pyx_kp_u__9, __pyx_k__9, sizeof(__pyx_k__9), 0, 1, 0, 0},
  {&__pyx_n_s_abs, __pyx_k_abs, sizeof(__pyx_k_abs), 0, 0, 1, 1},
  {&__pyx_n_s_add, __pyx_k_add, sizeof(__pyx_k_add), 0, 0, 1, 1},
  {&__pyx_n_s_add_path, __pyx_k_add_path, sizeof(__pyx_k_add_path), 0, 0, 1, 1},
  {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1},
  {&__pyx_n_s_allow_incomplete, __pyx_k_allow_incomplete, sizeof(__pyx_k_allow_incomplete), 0, 0, 1, 1},
  {&__pyx_n_s_any, __pyx_k_any, sizeof(__pyx_k_any), 0, 0, 1, 1},
  {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1},
  {&__pyx_n_s_apply_along_axis, __pyx_k_apply_along_axis, sizeof(__pyx_k_apply_along_axis), 0, 0, 1, 1},
  {&__pyx_n_s_argsort, __pyx_k_argsort, sizeof(__pyx_k_argsort), 0, 0, 1, 1},
  {&__pyx_n_s_array, __pyx_k_array, sizeof(__pyx_k_array), 0, 0, 1, 1},
  {&__pyx_n_s_as_string, __pyx_k_as_string, sizeof(__pyx_k_as_string), 0, 0, 1, 1},
  {&__pyx_n_s_assemble, __pyx_k_assemble, sizeof(__pyx_k_assemble), 0, 0, 1, 1},
  {&__pyx_n_s_assign_weights, __pyx_k_assign_weights, sizeof(__pyx_k_assign_weights), 0, 0, 1, 1},
  {&__pyx_n_s_assigned_to, __pyx_k_assigned_to, sizeof(__pyx_k_assigned_to), 0, 0, 1, 1},
  {&__pyx_n_s_available_bases, __pyx_k_available_bases, sizeof(__pyx_k_available_bases), 0, 0, 1, 1},
  {&__pyx_n_s_available_proportion, __pyx_k_available_proportion, sizeof(__pyx_k_available_proportion), 0, 0, 1, 1},
  {&__pyx_n_s_axis, __pyx_k_axis, sizeof(__pyx_k_axis), 0, 0, 1, 1},
  {&__pyx_n_s_bases, __pyx_k_bases, sizeof(__pyx_k_bases), 0, 0, 1, 1},
  {&__pyx_n_s_best_extension, __pyx_k_best_extension, sizeof(__pyx_k_best_extension), 0, 0, 1, 1},
  {&__pyx_n_s_calculate_extension_score, __pyx_k_calculate_extension_score, sizeof(__pyx_k_calculate_extension_score), 0, 0, 1, 1},
  {&__pyx_n_s_check_for_full_paths, __pyx_k_check_for_full_paths, sizeof(__pyx_k_check_for_full_paths), 0, 0, 1, 1},
  {&__pyx_n_s_clear, __pyx_k_clear, sizeof(__pyx_k_clear), 0, 0, 1, 1},
  {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
  {&__pyx_n_s_collections, __pyx_k_collections, sizeof(__pyx_k_collections), 0, 0, 1, 1},
  {&__pyx_n_s_compatible, __pyx_k_compatible, sizeof(__pyx_k_compatible), 0, 0, 1, 1},
  {&__pyx_n_s_complete, __pyx_k_complete, sizeof(__pyx_k_complete), 0, 0, 1, 1},
  {&__pyx_n_s_contained, __pyx_k_contained, sizeof(__pyx_k_contained), 0, 0, 1, 1},
  {&__pyx_n_s_contains, __pyx_k_contains, sizeof(__pyx_k_contains), 0, 0, 1, 1},
  {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1},
  {&__pyx_n_s_cov, __pyx_k_cov, sizeof(__pyx_k_cov), 0, 0, 1, 1},
  {&__pyx_n_s_dead_end, __pyx_k_dead_end, sizeof(__pyx_k_dead_end), 0, 0, 1, 1},
  {&__pyx_n_s_dead_end_penalty, __pyx_k_dead_end_penalty, sizeof(__pyx_k_dead_end_penalty), 0, 0, 1, 1},
  {&__pyx_n_s_deepcopy, __pyx_k_deepcopy, sizeof(__pyx_k_deepcopy), 0, 0, 1, 1},
  {&__pyx_n_s_deque, __pyx_k_deque, sizeof(__pyx_k_deque), 0, 0, 1, 1},
  {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
  {&__pyx_n_s_difference, __pyx_k_difference, sizeof(__pyx_k_difference), 0, 0, 1, 1},
  {&__pyx_n_s_difference_update, __pyx_k_difference_update, sizeof(__pyx_k_difference_update), 0, 0, 1, 1},
  {&__pyx_n_s_discard, __pyx_k_discard, sizeof(__pyx_k_discard), 0, 0, 1, 1},
  {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1},
  {&__pyx_n_s_element, __pyx_k_element, sizeof(__pyx_k_element), 0, 0, 1, 1},
  {&__pyx_n_s_element_graph, __pyx_k_element_graph, sizeof(__pyx_k_element_graph), 0, 0, 1, 1},
  {&__pyx_n_s_empty, __pyx_k_empty, sizeof(__pyx_k_empty), 0, 0, 1, 1},
  {&__pyx_n_s_excludes, __pyx_k_excludes, sizeof(__pyx_k_excludes), 0, 0, 1, 1},
  {&__pyx_n_s_extend, __pyx_k_extend, sizeof(__pyx_k_extend), 0, 0, 1, 1},
  {&__pyx_n_s_extend_path, __pyx_k_extend_path, sizeof(__pyx_k_extend_path), 0, 0, 1, 1},
  {&__pyx_n_s_extension, __pyx_k_extension, sizeof(__pyx_k_extension), 0, 0, 1, 1},
  {&__pyx_n_s_extensions, __pyx_k_extensions, sizeof(__pyx_k_extensions), 0, 0, 1, 1},
  {&__pyx_n_s_fill_value, __pyx_k_fill_value, sizeof(__pyx_k_fill_value), 0, 0, 1, 1},
  {&__pyx_n_s_find_optimal_path, __pyx_k_find_optimal_path, sizeof(__pyx_k_find_optimal_path), 0, 0, 1, 1},
  {&__pyx_n_s_float32, __pyx_k_float32, sizeof(__pyx_k_float32), 0, 0, 1, 1},
  {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
  {&__pyx_n_s_frag_len, __pyx_k_frag_len, sizeof(__pyx_k_frag_len), 0, 0, 1, 1},
  {&__pyx_n_s_full, __pyx_k_full, sizeof(__pyx_k_full), 0, 0, 1, 1},
  {&__pyx_n_s_generate_extensions, __pyx_k_generate_extensions, sizeof(__pyx_k_generate_extensions), 0, 0, 1, 1},
  {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1},
  {&__pyx_n_s_get_exons, __pyx_k_get_exons, sizeof(__pyx_k_get_exons), 0, 0, 1, 1},
  {&__pyx_n_s_get_heaviest_element, __pyx_k_get_heaviest_element, sizeof(__pyx_k_get_heaviest_element), 0, 0, 1, 1},
  {&__pyx_n_s_get_introns, __pyx_k_get_introns, sizeof(__pyx_k_get_introns), 0, 0, 1, 1},
  {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
  {&__pyx_n_s_has_gaps, __pyx_k_has_gaps, sizeof(__pyx_k_has_gaps), 0, 0, 1, 1},
  {&__pyx_n_s_ignore_ends, __pyx_k_ignore_ends, sizeof(__pyx_k_ignore_ends), 0, 0, 1, 1},
  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
  {&__pyx_n_s_includes, __pyx_k_includes, sizeof(__pyx_k_includes), 0, 0, 1, 1},
  {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1},
  {&__pyx_n_s_inf, __pyx_k_inf, sizeof(__pyx_k_inf), 0, 0, 1, 1},
  {&__pyx_n_s_ingroup, __pyx_k_ingroup, sizeof(__pyx_k_ingroup), 0, 0, 1, 1},
  {&__pyx_n_s_int32, __pyx_k_int32, sizeof(__pyx_k_int32), 0, 0, 1, 1},
  {&__pyx_n_s_intersection, __pyx_k_intersection, sizeof(__pyx_k_intersection), 0, 0, 1, 1},
  {&__pyx_n_s_intersection_update, __pyx_k_intersection_update, sizeof(__pyx_k_intersection_update), 0, 0, 1, 1},
  {&__pyx_n_s_intron_filter, __pyx_k_intron_filter, sizeof(__pyx_k_intron_filter), 0, 0, 1, 1},
  {&__pyx_n_s_isdisjoint, __pyx_k_isdisjoint, sizeof(__pyx_k_isdisjoint), 0, 0, 1, 1},
  {&__pyx_n_s_issubset, __pyx_k_issubset, sizeof(__pyx_k_issubset), 0, 0, 1, 1},
  {&__pyx_n_s_json, __pyx_k_json, sizeof(__pyx_k_json), 0, 0, 1, 1},
  {&__pyx_n_s_keepdims, __pyx_k_keepdims, sizeof(__pyx_k_keepdims), 0, 0, 1, 1},
  {&__pyx_n_s_lengths, __pyx_k_lengths, sizeof(__pyx_k_lengths), 0, 0, 1, 1},
  {&__pyx_n_s_logical_or, __pyx_k_logical_or, sizeof(__pyx_k_logical_or), 0, 0, 1, 1},
  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
  {&__pyx_n_s_max, __pyx_k_max, sizeof(__pyx_k_max), 0, 0, 1, 1},
  {&__pyx_n_s_maxIC, __pyx_k_maxIC, sizeof(__pyx_k_maxIC), 0, 0, 1, 1},
  {&__pyx_n_s_max_isos, __pyx_k_max_isos, sizeof(__pyx_k_max_isos), 0, 0, 1, 1},
  {&__pyx_n_s_maxlen, __pyx_k_maxlen, sizeof(__pyx_k_maxlen), 0, 0, 1, 1},
  {&__pyx_n_s_mean, __pyx_k_mean, sizeof(__pyx_k_mean), 0, 0, 1, 1},
  {&__pyx_n_s_member_weight_array, __pyx_k_member_weight_array, sizeof(__pyx_k_member_weight_array), 0, 0, 1, 1},
  {&__pyx_n_s_member_weights, __pyx_k_member_weights, sizeof(__pyx_k_member_weights), 0, 0, 1, 1},
  {&__pyx_n_s_membership, __pyx_k_membership, sizeof(__pyx_k_membership), 0, 0, 1, 1},
  {&__pyx_n_s_membership_matrix, __pyx_k_membership_matrix, sizeof(__pyx_k_membership_matrix), 0, 0, 1, 1},
  {&__pyx_n_s_merge, __pyx_k_merge, sizeof(__pyx_k_merge), 0, 0, 1, 1},
  {&__pyx_n_s_min, __pyx_k_min, sizeof(__pyx_k_min), 0, 0, 1, 1},
  {&__pyx_n_s_minimum_proportion, __pyx_k_minimum_proportion, sizeof(__pyx_k_minimum_proportion), 0, 0, 1, 1},
  {&__pyx_n_s_naive, __pyx_k_naive, sizeof(__pyx_k_naive), 0, 0, 1, 1},
  {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
  {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
  {&__pyx_n_s_normalize, __pyx_k_normalize, sizeof(__pyx_k_normalize), 0, 0, 1, 1},
  {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
  {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
  {&__pyx_kp_u_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to, sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 1, 0, 0},
  {&__pyx_kp_u_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor, sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 1, 0, 0},
  {&__pyx_n_s_ones, __pyx_k_ones, sizeof(__pyx_k_ones), 0, 0, 1, 1},
  {&__pyx_n_s_other, __pyx_k_other, sizeof(__pyx_k_other), 0, 0, 1, 1},
  {&__pyx_n_s_outgroup, __pyx_k_outgroup, sizeof(__pyx_k_outgroup), 0, 0, 1, 1},
  {&__pyx_n_s_overlap, __pyx_k_overlap, sizeof(__pyx_k_overlap), 0, 0, 1, 1},
  {&__pyx_n_s_overlap_matrix, __pyx_k_overlap_matrix, sizeof(__pyx_k_overlap_matrix), 0, 0, 1, 1},
  {&__pyx_n_s_partial_coverage, __pyx_k_partial_coverage, sizeof(__pyx_k_partial_coverage), 0, 0, 1, 1},
  {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1},
  {&__pyx_n_s_penalize_dead_ends, __pyx_k_penalize_dead_ends, sizeof(__pyx_k_penalize_dead_ends), 0, 0, 1, 1},
  {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
  {&__pyx_n_s_popleft, __pyx_k_popleft, sizeof(__pyx_k_popleft), 0, 0, 1, 1},
  {&__pyx_n_s_print, __pyx_k_print, sizeof(__pyx_k_print), 0, 0, 1, 1},
  {&__pyx_n_s_proportion, __pyx_k_proportion, sizeof(__pyx_k_proportion), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_unpickle_Element, __pyx_k_pyx_unpickle_Element, sizeof(__pyx_k_pyx_unpickle_Element), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_unpickle_ElementGraph, __pyx_k_pyx_unpickle_ElementGraph, sizeof(__pyx_k_pyx_unpickle_ElementGraph), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
  {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
  {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
  {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
  {&__pyx_n_s_remove_bad_assemblies, __pyx_k_remove_bad_assemblies, sizeof(__pyx_k_remove_bad_assemblies), 0, 0, 1, 1},
  {&__pyx_n_s_remove_paths, __pyx_k_remove_paths, sizeof(__pyx_k_remove_paths), 0, 0, 1, 1},
  {&__pyx_n_s_rescue_ends, __pyx_k_rescue_ends, sizeof(__pyx_k_rescue_ends), 0, 0, 1, 1},
  {&__pyx_n_s_resolve_containment, __pyx_k_resolve_containment, sizeof(__pyx_k_resolve_containment), 0, 0, 1, 1},
  {&__pyx_n_s_reverse, __pyx_k_reverse, sizeof(__pyx_k_reverse), 0, 0, 1, 1},
  {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
  {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
  {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
  {&__pyx_n_s_simplify, __pyx_k_simplify, sizeof(__pyx_k_simplify), 0, 0, 1, 1},
  {&__pyx_n_s_sorted, __pyx_k_sorted, sizeof(__pyx_k_sorted), 0, 0, 1, 1},
  {&__pyx_n_s_source_weight_array, __pyx_k_source_weight_array, sizeof(__pyx_k_source_weight_array), 0, 0, 1, 1},
  {&__pyx_n_s_source_weights, __pyx_k_source_weights, sizeof(__pyx_k_source_weights), 0, 0, 1, 1},
  {&__pyx_n_s_strand, __pyx_k_strand, sizeof(__pyx_k_strand), 0, 0, 1, 1},
  {&__pyx_n_s_strands, __pyx_k_strands, sizeof(__pyx_k_strands), 0, 0, 1, 1},
  {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
  {&__pyx_n_s_sum, __pyx_k_sum, sizeof(__pyx_k_sum), 0, 0, 1, 1},
  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
  {&__pyx_n_s_truncation_filter, __pyx_k_truncation_filter, sizeof(__pyx_k_truncation_filter), 0, 0, 1, 1},
  {&__pyx_n_s_union, __pyx_k_union, sizeof(__pyx_k_union), 0, 0, 1, 1},
  {&__pyx_n_s_uniqueInformation, __pyx_k_uniqueInformation, sizeof(__pyx_k_uniqueInformation), 0, 0, 1, 1},
  {&__pyx_n_s_uniqueLength, __pyx_k_uniqueLength, sizeof(__pyx_k_uniqueLength), 0, 0, 1, 1},
  {&__pyx_n_s_uniqueMembers, __pyx_k_uniqueMembers, sizeof(__pyx_k_uniqueMembers), 0, 0, 1, 1},
  {&__pyx_n_s_uniqueNonmembers, __pyx_k_uniqueNonmembers, sizeof(__pyx_k_uniqueNonmembers), 0, 0, 1, 1},
  {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
  {&__pyx_n_s_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 1, 1},
  {&__pyx_n_s_verbose, __pyx_k_verbose, sizeof(__pyx_k_verbose), 0, 0, 1, 1},
  {&__pyx_n_s_weights, __pyx_k_weights, sizeof(__pyx_k_weights), 0, 0, 1, 1},
  {&__pyx_n_s_where, __pyx_k_where, sizeof(__pyx_k_where), 0, 0, 1, 1},
  {&__pyx_n_s_zero_element, __pyx_k_zero_element, sizeof(__pyx_k_zero_element), 0, 0, 1, 1},
  {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1},
  {0, 0, 0, 0, 0, 0, 0}
};
static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_sum = __Pyx_GetBuiltinName(__pyx_n_s_sum); if (!__pyx_builtin_sum) __PYX_ERR(0, 50, __pyx_L1_error)
  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 47, __pyx_L1_error)
  __pyx_builtin_print = __Pyx_GetBuiltinName(__pyx_n_s_print); if (!__pyx_builtin_print) __PYX_ERR(0, 344, __pyx_L1_error)
  __pyx_builtin_sorted = __Pyx_GetBuiltinName(__pyx_n_s_sorted); if (!__pyx_builtin_sorted) __PYX_ERR(0, 633, __pyx_L1_error)
  __pyx_builtin_any = __Pyx_GetBuiltinName(__pyx_n_s_any); if (!__pyx_builtin_any) __PYX_ERR(0, 644, __pyx_L1_error)
  __pyx_builtin_max = __Pyx_GetBuiltinName(__pyx_n_s_max); if (!__pyx_builtin_max) __PYX_ERR(0, 759, __pyx_L1_error)
  __pyx_builtin_min = __Pyx_GetBuiltinName(__pyx_n_s_min); if (!__pyx_builtin_min) __PYX_ERR(0, 768, __pyx_L1_error)
  __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 945, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}

static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);

  /* "_element_graph.pyx":45
 * 
 *         self.elements = [Element(
 *             i, source_weight_array[i,:], member_weight_array[i,:], strands[i],             # <<<<<<<<<<<<<<
 *             membership_matrix[i,:], self.overlap, lengths, self.maxIC
 *         ) for i in range(self.number_of_elements)] # Generate an array of Element objects
 */
  __pyx_slice_ = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice_)) __PYX_ERR(0, 45, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice_);
  __Pyx_GIVEREF(__pyx_slice_);

  /* "_element_graph.pyx":67
 *         cdef set strand
 *         self.end_reachability = np.zeros(shape=(4,len(self.elements)), dtype=bool)
 *         Sp, Ep, Sm, Em = range(4)             # <<<<<<<<<<<<<<
 *         queue = deque(maxlen=len(self.elements))
 *         strand = set([0,1])
 */
  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_int_4); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 67, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__2);
  __Pyx_GIVEREF(__pyx_tuple__2);

  /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum not in (0xb5283f6, 0x714eccd, 0x7829ade):             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb5283f6, 0x714eccd, 0x7829ade) = (EM, EMmembers, EP, EPmembers, SM, SMmembers, SP, SPmembers, allow_incomplete, assignments, bases, dead_end_penalty, elements, emptyPath, end_elements, end_reachability, ignore_ends, input_bases, intron_filter, maxIC, max_isos, naive, no_ends, number_of_elements, overlap, partial_coverage, paths, truncation_filter))" % __pyx_checksum)
 */
  __pyx_tuple__14 = PyTuple_Pack(3, __pyx_int_189957110, __pyx_int_118811853, __pyx_int_125999838); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__14);
  __Pyx_GIVEREF(__pyx_tuple__14);
  __pyx_tuple__15 = PyTuple_Pack(3, __pyx_int_73221949, __pyx_int_230897078, __pyx_int_173076085); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__15);
  __Pyx_GIVEREF(__pyx_tuple__15);

  /* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":945
 *         __pyx_import_array()
 *     except Exception:
 *         raise ImportError("numpy.core.multiarray failed to import")             # <<<<<<<<<<<<<<
 * 
 * cdef inline int import_umath() except -1:
 */
  __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(2, 945, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__16);
  __Pyx_GIVEREF(__pyx_tuple__16);

  /* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":951
 *         _import_umath()
 *     except Exception:
 *         raise ImportError("numpy.core.umath failed to import")             # <<<<<<<<<<<<<<
 * 
 * cdef inline int import_ufunc() except -1:
 */
  __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(2, 951, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__17);
  __Pyx_GIVEREF(__pyx_tuple__17);

  /* "(tree fragment)":1
 * def __pyx_unpickle_ElementGraph(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */
  __pyx_tuple__18 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__18);
  __Pyx_GIVEREF(__pyx_tuple__18);
  __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_ElementGraph, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(1, 1, __pyx_L1_error)
  __pyx_tuple__20 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__20);
  __Pyx_GIVEREF(__pyx_tuple__20);
  __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Element, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
  __pyx_umethod_PyDict_Type_get.type = (PyObject*)&PyDict_Type;
  __pyx_umethod_PyDict_Type_values.type = (PyObject*)&PyDict_Type;
  __pyx_umethod_PySet_Type_difference.type = (PyObject*)&PySet_Type;
  __pyx_umethod_PySet_Type_difference_update.type = (PyObject*)&PySet_Type;
  __pyx_umethod_PySet_Type_intersection_update.type = (PyObject*)&PySet_Type;
  __pyx_umethod_PySet_Type_issubset.type = (PyObject*)&PySet_Type;
  __pyx_umethod_PySet_Type_update.type = (PyObject*)&PySet_Type;
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  __pyx_float__5 = PyFloat_FromDouble(.5); if (unlikely(!__pyx_float__5)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_float_1_ = PyFloat_FromDouble(1.); if (unlikely(!__pyx_float_1_)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_float_0_1 = PyFloat_FromDouble(0.1); if (unlikely(!__pyx_float_0_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_10 = PyInt_FromLong(10); if (unlikely(!__pyx_int_10)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_73221949 = PyInt_FromLong(73221949L); if (unlikely(!__pyx_int_73221949)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_118811853 = PyInt_FromLong(118811853L); if (unlikely(!__pyx_int_118811853)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_125999838 = PyInt_FromLong(125999838L); if (unlikely(!__pyx_int_125999838)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_173076085 = PyInt_FromLong(173076085L); if (unlikely(!__pyx_int_173076085)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_189957110 = PyInt_FromLong(189957110L); if (unlikely(!__pyx_int_189957110)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_230897078 = PyInt_FromLong(230897078L); if (unlikely(!__pyx_int_230897078)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}

static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/

static int __Pyx_modinit_global_init_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
  /*--- Global init code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_variable_export_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
  /*--- Variable export code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_function_export_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
  /*--- Function export code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_type_init_code(void) {
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
  /*--- Type init code ---*/
  __pyx_vtabptr_14_element_graph_ElementGraph = &__pyx_vtable_14_element_graph_ElementGraph;
  __pyx_vtable_14_element_graph_ElementGraph.penalize_dead_ends = (void (*)(struct __pyx_obj_14_element_graph_ElementGraph *, int __pyx_skip_dispatch))__pyx_f_14_element_graph_12ElementGraph_penalize_dead_ends;
  __pyx_vtable_14_element_graph_ElementGraph.check_for_full_paths = (void (*)(struct __pyx_obj_14_element_graph_ElementGraph *, int __pyx_skip_dispatch))__pyx_f_14_element_graph_12ElementGraph_check_for_full_paths;
  __pyx_vtable_14_element_graph_ElementGraph.resolve_containment = (void (*)(struct __pyx_obj_14_element_graph_ElementGraph *, int __pyx_skip_dispatch))__pyx_f_14_element_graph_12ElementGraph_resolve_containment;
  __pyx_vtable_14_element_graph_ElementGraph.zero_element = (void (*)(struct __pyx_obj_14_element_graph_ElementGraph *, int, int __pyx_skip_dispatch))__pyx_f_14_element_graph_12ElementGraph_zero_element;
  __pyx_vtable_14_element_graph_ElementGraph.assign_weights = (void (*)(struct __pyx_obj_14_element_graph_ElementGraph *, int __pyx_skip_dispatch))__pyx_f_14_element_graph_12ElementGraph_assign_weights;
  __pyx_vtable_14_element_graph_ElementGraph.assemble = (void (*)(struct __pyx_obj_14_element_graph_ElementGraph *, float, int __pyx_skip_dispatch, struct __pyx_opt_args_14_element_graph_12ElementGraph_assemble *__pyx_optional_args))__pyx_f_14_element_graph_12ElementGraph_assemble;
  __pyx_vtable_14_element_graph_ElementGraph.remove_bad_assemblies = (void (*)(struct __pyx_obj_14_element_graph_ElementGraph *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_14_element_graph_12ElementGraph_remove_bad_assemblies *__pyx_optional_args))__pyx_f_14_element_graph_12ElementGraph_remove_bad_assemblies;
  __pyx_vtable_14_element_graph_ElementGraph.available_proportion = (PyArrayObject *(*)(struct __pyx_obj_14_element_graph_ElementGraph *, PyArrayObject *, struct __pyx_obj_14_element_graph_Element *, int __pyx_skip_dispatch))__pyx_f_14_element_graph_12ElementGraph_available_proportion;
  __pyx_vtable_14_element_graph_ElementGraph.available_bases = (float (*)(struct __pyx_obj_14_element_graph_ElementGraph *, PyArrayObject *, struct __pyx_obj_14_element_graph_Element *, int __pyx_skip_dispatch))__pyx_f_14_element_graph_12ElementGraph_available_bases;
  __pyx_vtable_14_element_graph_ElementGraph.extend_path = (void (*)(struct __pyx_obj_14_element_graph_ElementGraph *, struct __pyx_obj_14_element_graph_Element *, PyObject *, int __pyx_skip_dispatch))__pyx_f_14_element_graph_12ElementGraph_extend_path;
  __pyx_vtable_14_element_graph_ElementGraph.get_heaviest_element = (struct __pyx_obj_14_element_graph_Element *(*)(struct __pyx_obj_14_element_graph_ElementGraph *, int __pyx_skip_dispatch))__pyx_f_14_element_graph_12ElementGraph_get_heaviest_element;
  __pyx_vtable_14_element_graph_ElementGraph.dead_end = (float (*)(struct __pyx_obj_14_element_graph_ElementGraph *, struct __pyx_obj_14_element_graph_Element *, PyObject *, int __pyx_skip_dispatch))__pyx_f_14_element_graph_12ElementGraph_dead_end;
  __pyx_vtable_14_element_graph_ElementGraph.generate_extensions = (PyObject *(*)(struct __pyx_obj_14_element_graph_ElementGraph *, struct __pyx_obj_14_element_graph_Element *, int __pyx_skip_dispatch))__pyx_f_14_element_graph_12ElementGraph_generate_extensions;
  __pyx_vtable_14_element_graph_ElementGraph.best_extension = (PyObject *(*)(struct __pyx_obj_14_element_graph_ElementGraph *, struct __pyx_obj_14_element_graph_Element *, PyObject *, float, int __pyx_skip_dispatch))__pyx_f_14_element_graph_12ElementGraph_best_extension;
  __pyx_vtable_14_element_graph_ElementGraph.calculate_extension_score = (float (*)(struct __pyx_obj_14_element_graph_ElementGraph *, struct __pyx_obj_14_element_graph_Element *, PyObject *, float, int __pyx_skip_dispatch))__pyx_f_14_element_graph_12ElementGraph_calculate_extension_score;
  __pyx_vtable_14_element_graph_ElementGraph.find_optimal_path = (struct __pyx_obj_14_element_graph_Element *(*)(struct __pyx_obj_14_element_graph_ElementGraph *, float, int __pyx_skip_dispatch, struct __pyx_opt_args_14_element_graph_12ElementGraph_find_optimal_path *__pyx_optional_args))__pyx_f_14_element_graph_12ElementGraph_find_optimal_path;
  __pyx_vtable_14_element_graph_ElementGraph.rescue_ends = (void (*)(struct __pyx_obj_14_element_graph_ElementGraph *, struct __pyx_obj_14_element_graph_Element *, int __pyx_skip_dispatch))__pyx_f_14_element_graph_12ElementGraph_rescue_ends;
  __pyx_vtable_14_element_graph_ElementGraph.add_path = (float (*)(struct __pyx_obj_14_element_graph_ElementGraph *, struct __pyx_obj_14_element_graph_Element *, int __pyx_skip_dispatch))__pyx_f_14_element_graph_12ElementGraph_add_path;
  __pyx_vtable_14_element_graph_ElementGraph.remove_paths = (void (*)(struct __pyx_obj_14_element_graph_ElementGraph *, PyObject *, int __pyx_skip_dispatch))__pyx_f_14_element_graph_12ElementGraph_remove_paths;
  __pyx_vtable_14_element_graph_ElementGraph.normalize = (PyArrayObject *(*)(struct __pyx_obj_14_element_graph_ElementGraph *, PyArrayObject *, int __pyx_skip_dispatch))__pyx_f_14_element_graph_12ElementGraph_normalize;
  if (PyType_Ready(&__pyx_type_14_element_graph_ElementGraph) < 0) __PYX_ERR(0, 12, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_14_element_graph_ElementGraph.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_14_element_graph_ElementGraph.tp_dictoffset && __pyx_type_14_element_graph_ElementGraph.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_14_element_graph_ElementGraph.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #if CYTHON_UPDATE_DESCRIPTOR_DOC
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_14_element_graph_ElementGraph, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 12, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_14_element_graph_12ElementGraph___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_14_element_graph_12ElementGraph___init__.doc = __pyx_doc_14_element_graph_12ElementGraph___init__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_14_element_graph_12ElementGraph___init__;
    }
  }
  #endif
  if (__Pyx_SetVtable(__pyx_type_14_element_graph_ElementGraph.tp_dict, __pyx_vtabptr_14_element_graph_ElementGraph) < 0) __PYX_ERR(0, 12, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ElementGraph, (PyObject *)&__pyx_type_14_element_graph_ElementGraph) < 0) __PYX_ERR(0, 12, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_14_element_graph_ElementGraph) < 0) __PYX_ERR(0, 12, __pyx_L1_error)
  __pyx_ptype_14_element_graph_ElementGraph = &__pyx_type_14_element_graph_ElementGraph;
  __pyx_vtabptr_14_element_graph_Element = &__pyx_vtable_14_element_graph_Element;
  __pyx_vtable_14_element_graph_Element.span_to_string = (PyObject *(*)(struct __pyx_obj_14_element_graph_Element *, __pyx_ctuple_int__and_int))__pyx_f_14_element_graph_7Element_span_to_string;
  __pyx_vtable_14_element_graph_Element.as_string = (PyObject *(*)(struct __pyx_obj_14_element_graph_Element *, int __pyx_skip_dispatch))__pyx_f_14_element_graph_7Element_as_string;
  __pyx_vtable_14_element_graph_Element.update = (void (*)(struct __pyx_obj_14_element_graph_Element *, int __pyx_skip_dispatch))__pyx_f_14_element_graph_7Element_update;
  __pyx_vtable_14_element_graph_Element.uniqueMembers = (PyObject *(*)(struct __pyx_obj_14_element_graph_Element *, struct __pyx_obj_14_element_graph_Element *, int __pyx_skip_dispatch))__pyx_f_14_element_graph_7Element_uniqueMembers;
  __pyx_vtable_14_element_graph_Element.uniqueNonmembers = (PyObject *(*)(struct __pyx_obj_14_element_graph_Element *, struct __pyx_obj_14_element_graph_Element *, int __pyx_skip_dispatch))__pyx_f_14_element_graph_7Element_uniqueNonmembers;
  __pyx_vtable_14_element_graph_Element.uniqueInformation = (int (*)(struct __pyx_obj_14_element_graph_Element *, struct __pyx_obj_14_element_graph_Element *, int __pyx_skip_dispatch))__pyx_f_14_element_graph_7Element_uniqueInformation;
  __pyx_vtable_14_element_graph_Element.uniqueLength = (int (*)(struct __pyx_obj_14_element_graph_Element *, struct __pyx_obj_14_element_graph_Element *, int __pyx_skip_dispatch))__pyx_f_14_element_graph_7Element_uniqueLength;
  __pyx_vtable_14_element_graph_Element.compatible = (int (*)(struct __pyx_obj_14_element_graph_Element *, struct __pyx_obj_14_element_graph_Element *, int __pyx_skip_dispatch))__pyx_f_14_element_graph_7Element_compatible;
  __pyx_vtable_14_element_graph_Element.get_introns = (PyObject *(*)(struct __pyx_obj_14_element_graph_Element *, int __pyx_skip_dispatch))__pyx_f_14_element_graph_7Element_get_introns;
  __pyx_vtable_14_element_graph_Element.get_exons = (PyObject *(*)(struct __pyx_obj_14_element_graph_Element *, int __pyx_skip_dispatch))__pyx_f_14_element_graph_7Element_get_exons;
  __pyx_vtable_14_element_graph_Element.merge = (void (*)(struct __pyx_obj_14_element_graph_Element *, struct __pyx_obj_14_element_graph_Element *, PyArrayObject *, int __pyx_skip_dispatch))__pyx_f_14_element_graph_7Element_merge;
  if (PyType_Ready(&__pyx_type_14_element_graph_Element) < 0) __PYX_ERR(0, 882, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_14_element_graph_Element.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_14_element_graph_Element.tp_dictoffset && __pyx_type_14_element_graph_Element.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_14_element_graph_Element.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_14_element_graph_Element.tp_dict, __pyx_vtabptr_14_element_graph_Element) < 0) __PYX_ERR(0, 882, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Element, (PyObject *)&__pyx_type_14_element_graph_Element) < 0) __PYX_ERR(0, 882, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_14_element_graph_Element) < 0) __PYX_ERR(0, 882, __pyx_L1_error)
  __pyx_ptype_14_element_graph_Element = &__pyx_type_14_element_graph_Element;
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_type_import_code(void) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
  /*--- Type import code ---*/
  __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", 
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyTypeObject),
  #else
  sizeof(PyHeapTypeObject),
  #endif
  __Pyx_ImportType_CheckSize_Warn);
   if (!__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("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 200, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore);
   if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(2, 200, __pyx_L1_error)
  __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Ignore);
   if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(2, 223, __pyx_L1_error)
  __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Ignore);
   if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(2, 227, __pyx_L1_error)
  __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore);
   if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(2, 239, __pyx_L1_error)
  __pyx_ptype_5numpy_generic = __Pyx_ImportType(__pyx_t_1, "numpy", "generic", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
   if (!__pyx_ptype_5numpy_generic) __PYX_ERR(2, 771, __pyx_L1_error)
  __pyx_ptype_5numpy_number = __Pyx_ImportType(__pyx_t_1, "numpy", "number", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
   if (!__pyx_ptype_5numpy_number) __PYX_ERR(2, 773, __pyx_L1_error)
  __pyx_ptype_5numpy_integer = __Pyx_ImportType(__pyx_t_1, "numpy", "integer", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
   if (!__pyx_ptype_5numpy_integer) __PYX_ERR(2, 775, __pyx_L1_error)
  __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType(__pyx_t_1, "numpy", "signedinteger", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
   if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(2, 777, __pyx_L1_error)
  __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType(__pyx_t_1, "numpy", "unsignedinteger", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
   if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(2, 779, __pyx_L1_error)
  __pyx_ptype_5numpy_inexact = __Pyx_ImportType(__pyx_t_1, "numpy", "inexact", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
   if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(2, 781, __pyx_L1_error)
  __pyx_ptype_5numpy_floating = __Pyx_ImportType(__pyx_t_1, "numpy", "floating", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
   if (!__pyx_ptype_5numpy_floating) __PYX_ERR(2, 783, __pyx_L1_error)
  __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType(__pyx_t_1, "numpy", "complexfloating", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
   if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(2, 785, __pyx_L1_error)
  __pyx_ptype_5numpy_flexible = __Pyx_ImportType(__pyx_t_1, "numpy", "flexible", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
   if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(2, 787, __pyx_L1_error)
  __pyx_ptype_5numpy_character = __Pyx_ImportType(__pyx_t_1, "numpy", "character", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
   if (!__pyx_ptype_5numpy_character) __PYX_ERR(2, 789, __pyx_L1_error)
  __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Ignore);
   if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(2, 827, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_variable_import_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
  /*--- Variable import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_function_import_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
  /*--- Function import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}


#ifndef CYTHON_NO_PYINIT_EXPORT
#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
#elif PY_MAJOR_VERSION < 3
#ifdef __cplusplus
#define __Pyx_PyMODINIT_FUNC extern "C" void
#else
#define __Pyx_PyMODINIT_FUNC void
#endif
#else
#ifdef __cplusplus
#define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
#else
#define __Pyx_PyMODINIT_FUNC PyObject *
#endif
#endif


#if PY_MAJOR_VERSION < 3
__Pyx_PyMODINIT_FUNC init_element_graph(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC init_element_graph(void)
#else
__Pyx_PyMODINIT_FUNC PyInit__element_graph(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC PyInit__element_graph(void)
#if CYTHON_PEP489_MULTI_PHASE_INIT
{
  return PyModuleDef_Init(&__pyx_moduledef);
}
static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
    #if PY_VERSION_HEX >= 0x030700A1
    static PY_INT64_T main_interpreter_id = -1;
    PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
    if (main_interpreter_id == -1) {
        main_interpreter_id = current_id;
        return (unlikely(current_id == -1)) ? -1 : 0;
    } else if (unlikely(main_interpreter_id != current_id))
    #else
    static PyInterpreterState *main_interpreter = NULL;
    PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
    if (!main_interpreter) {
        main_interpreter = current_interpreter;
    } else if (unlikely(main_interpreter != current_interpreter))
    #endif
    {
        PyErr_SetString(
            PyExc_ImportError,
            "Interpreter change detected - this module can only be loaded into one interpreter per process.");
        return -1;
    }
    return 0;
}
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, CYTHON_UNUSED PyModuleDef *def) {
    PyObject *module = NULL, *moddict, *modname;
    if (__Pyx_check_single_interpreter())
        return NULL;
    if (__pyx_m)
        return __Pyx_NewRef(__pyx_m);
    modname = PyObject_GetAttrString(spec, "name");
    if (unlikely(!modname)) goto bad;
    module = PyModule_NewObject(modname);
    Py_DECREF(modname);
    if (unlikely(!module)) goto bad;
    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__element_graph(PyObject *__pyx_pyinit_module)
#endif
#endif
{
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  if (__pyx_m) {
    if (__pyx_m == __pyx_pyinit_module) return 0;
    PyErr_SetString(PyExc_RuntimeError, "Module '_element_graph' has already been imported. Re-initialisation is not supported.");
    return -1;
  }
  #elif PY_MAJOR_VERSION >= 3
  if (__pyx_m) return __Pyx_NewRef(__pyx_m);
  #endif
  #if CYTHON_REFNANNY
__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
if (!__Pyx_RefNanny) {
  PyErr_Clear();
  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
  if (!__Pyx_RefNanny)
      Py_FatalError("failed to import 'refnanny' module");
}
#endif
  __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit__element_graph(void)", 0);
  if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #ifdef __Pxy_PyFrame_Initialize_Offsets
  __Pxy_PyFrame_Initialize_Offsets();
  #endif
  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
  #ifdef __Pyx_CyFunction_USED
  if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_FusedFunction_USED
  if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Coroutine_USED
  if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Generator_USED
  if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_AsyncGen_USED
  if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_StopAsyncIteration_USED
  if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  /*--- Library function declarations ---*/
  /*--- Threads initialization code ---*/
  #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  PyEval_InitThreads();
  #endif
  /*--- Module creation code ---*/
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  __pyx_m = __pyx_pyinit_module;
  Py_INCREF(__pyx_m);
  #else
  #if PY_MAJOR_VERSION < 3
  __pyx_m = Py_InitModule4("_element_graph", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
  #else
  __pyx_m = PyModule_Create(&__pyx_moduledef);
  #endif
  if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
  Py_INCREF(__pyx_d);
  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
  Py_INCREF(__pyx_b);
  __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
  Py_INCREF(__pyx_cython_runtime);
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  /*--- Initialize various global constants etc. ---*/
  if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
  if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  if (__pyx_module_is_main__element_graph) {
    if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  }
  #if PY_MAJOR_VERSION >= 3
  {
    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
    if (!PyDict_GetItemString(modules, "_element_graph")) {
      if (unlikely(PyDict_SetItemString(modules, "_element_graph", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
    }
  }
  #endif
  /*--- Builtin init code ---*/
  if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Constants init code ---*/
  if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Global type/function init code ---*/
  (void)__Pyx_modinit_global_init_code();
  (void)__Pyx_modinit_variable_export_code();
  (void)__Pyx_modinit_function_export_code();
  if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
  if (unlikely(__Pyx_modinit_type_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
  (void)__Pyx_modinit_variable_import_code();
  (void)__Pyx_modinit_function_import_code();
  /*--- Execution code ---*/
  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
  if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif

  /* "_element_graph.pyx":2
 * #cython: language_level=3
 * import json             # <<<<<<<<<<<<<<
 * import cython
 * import numpy as np
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_json, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_json, __pyx_t_1) < 0) __PYX_ERR(0, 2, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_element_graph.pyx":4
 * import json
 * import cython
 * import numpy as np             # <<<<<<<<<<<<<<
 * cimport numpy as np
 * import copy
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_element_graph.pyx":6
 * import numpy as np
 * cimport numpy as np
 * import copy             # <<<<<<<<<<<<<<
 * #from networkx import DiGraph
 * from collections import deque
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_copy, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_copy, __pyx_t_1) < 0) __PYX_ERR(0, 6, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_element_graph.pyx":8
 * import copy
 * #from networkx import DiGraph
 * from collections import deque             # <<<<<<<<<<<<<<
 * 
 * inf = float('Inf')
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 8, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_deque);
  __Pyx_GIVEREF(__pyx_n_s_deque);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_deque);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_collections, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_deque); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 8, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_deque, __pyx_t_1) < 0) __PYX_ERR(0, 8, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "_element_graph.pyx":10
 * from collections import deque
 * 
 * inf = float('Inf')             # <<<<<<<<<<<<<<
 * 
 * cdef class ElementGraph:
 */
  __pyx_t_2 = __Pyx_PyNumber_Float(__pyx_n_u_Inf); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_inf, __pyx_t_2) < 0) __PYX_ERR(0, 10, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":1
 * def __pyx_unpickle_ElementGraph(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_14_element_graph_1__pyx_unpickle_ElementGraph, NULL, __pyx_n_s_element_graph); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_ElementGraph, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":11
 *         __pyx_unpickle_ElementGraph__set_state(<ElementGraph> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_ElementGraph__set_state(ElementGraph __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.EM = __pyx_state[0]; __pyx_result.EMmembers = __pyx_state[1]; __pyx_result.EP = __pyx_state[2]; __pyx_result.EPmembers = __pyx_state[3]; __pyx_result.SM = __pyx_state[4]; __pyx_result.SMmembers = __pyx_state[5]; __pyx_result.SP = __pyx_state[6]; __pyx_result.SPmembers = __pyx_state[7]; __pyx_result.allow_incomplete = __pyx_state[8]; __pyx_result.assignments = __pyx_state[9]; __pyx_result.bases = __pyx_state[10]; __pyx_result.dead_end_penalty = __pyx_state[11]; __pyx_result.elements = __pyx_state[12]; __pyx_result.emptyPath = __pyx_state[13]; __pyx_result.end_elements = __pyx_state[14]; __pyx_result.end_reachability = __pyx_state[15]; __pyx_result.ignore_ends = __pyx_state[16]; __pyx_result.input_bases = __pyx_state[17]; __pyx_result.intron_filter = __pyx_state[18]; __pyx_result.maxIC = __pyx_state[19]; __pyx_result.max_isos = __pyx_state[20]; __pyx_result.naive = __pyx_state[21]; __pyx_result.no_ends = __pyx_state[22]; __pyx_result.number_of_elements = __pyx_state[23]; __pyx_result.overlap = __pyx_state[24]; __pyx_result.partial_coverage = __pyx_state[25]; __pyx_result.paths = __pyx_state[26]; __pyx_result.truncation_filter = __pyx_state[27]
 *     if len(__pyx_state) > 28 and hasattr(__pyx_result, '__dict__'):
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_14_element_graph_3__pyx_unpickle_Element, NULL, __pyx_n_s_element_graph); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Element, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "_element_graph.pyx":1
 * #cython: language_level=3             # <<<<<<<<<<<<<<
 * import json
 * import cython
 */
  __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_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "../../../../../../../../../../home/schon035/anaconda3/lib/python3.7/site-packages/numpy/__init__.pxd":1014
 * 
 * 
 * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil:             # <<<<<<<<<<<<<<
 *     """
 *     returns the unit part of the dtype for a numpy datetime64 object.
 */

  /*--- Wrapped vars code ---*/

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  if (__pyx_m) {
    if (__pyx_d) {
      __Pyx_AddTraceback("init _element_graph", __pyx_clineno, __pyx_lineno, __pyx_filename);
    }
    Py_CLEAR(__pyx_m);
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init _element_graph");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  return (__pyx_m != NULL) ? 0 : -1;
  #elif PY_MAJOR_VERSION >= 3
  return __pyx_m;
  #else
  return;
  #endif
}

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

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

/* GetBuiltinName */
static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
    PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
    if (unlikely(!result)) {
        PyErr_Format(PyExc_NameError,
#if PY_MAJOR_VERSION >= 3
            "name '%U' is not defined", name);
#else
            "name '%.200s' is not defined", PyString_AS_STRING(name));
#endif
    }
    return result;
}

/* RaiseArgTupleInvalid */
static void __Pyx_RaiseArgtupleInvalid(
    const char* func_name,
    int exact,
    Py_ssize_t num_min,
    Py_ssize_t num_max,
    Py_ssize_t num_found)
{
    Py_ssize_t num_expected;
    const char *more_or_less;
    if (num_found < num_min) {
        num_expected = num_min;
        more_or_less = "at least";
    } else {
        num_expected = num_max;
        more_or_less = "at most";
    }
    if (exact) {
        more_or_less = "exactly";
    }
    PyErr_Format(PyExc_TypeError,
                 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
                 func_name, more_or_less, num_expected,
                 (num_expected == 1) ? "" : "s", num_found);
}

/* RaiseDoubleKeywords */
static void __Pyx_RaiseDoubleKeywordsError(
    const char* func_name,
    PyObject* kw_name)
{
    PyErr_Format(PyExc_TypeError,
        #if PY_MAJOR_VERSION >= 3
        "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
        #else
        "%s() got multiple values for keyword argument '%s'", func_name,
        PyString_AsString(kw_name));
        #endif
}

/* ParseKeywords */
static int __Pyx_ParseOptionalKeywords(
    PyObject *kwds,
    PyObject **argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    const char* function_name)
{
    PyObject *key = 0, *value = 0;
    Py_ssize_t pos = 0;
    PyObject*** name;
    PyObject*** first_kw_arg = argnames + num_pos_args;
    while (PyDict_Next(kwds, &pos, &key, &value)) {
        name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (*name) {
            values[name-argnames] = value;
            continue;
        }
        name = first_kw_arg;
        #if PY_MAJOR_VERSION < 3
        if (likely(PyString_Check(key))) {
            while (*name) {
                if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
                        && _PyString_Eq(**name, key)) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    if ((**argname == key) || (
                            (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
                             && _PyString_Eq(**argname, key))) {
                        goto arg_passed_twice;
                    }
                    argname++;
                }
            }
        } else
        #endif
        if (likely(PyUnicode_Check(key))) {
            while (*name) {
                int cmp = (**name == key) ? 0 :
                #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                    (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
                #endif
                    PyUnicode_Compare(**name, key);
                if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                if (cmp == 0) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    int cmp = (**argname == key) ? 0 :
                    #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                        (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
                    #endif
                        PyUnicode_Compare(**argname, key);
                    if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                    if (cmp == 0) goto arg_passed_twice;
                    argname++;
                }
            }
        } else
            goto invalid_keyword_type;
        if (kwds2) {
            if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
        } else {
            goto invalid_keyword;
        }
    }
    return 0;
arg_passed_twice:
    __Pyx_RaiseDoubleKeywordsError(function_name, key);
    goto bad;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%.200s() keywords must be strings", function_name);
    goto bad;
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%.200s() got an unexpected keyword argument '%.200s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
bad:
    return -1;
}

/* ArgTypeTest */
static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
{
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return 0;
    }
    else if (exact) {
        #if PY_MAJOR_VERSION == 2
        if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
        #endif
    }
    else {
        if (likely(__Pyx_TypeCheck(obj, type))) return 1;
    }
    PyErr_Format(PyExc_TypeError,
        "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
        name, type->tp_name, Py_TYPE(obj)->tp_name);
    return 0;
}

/* PyDictVersioning */
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
    PyObject *dict = Py_TYPE(obj)->tp_dict;
    return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
}
static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
    PyObject **dictptr = NULL;
    Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
    if (offset) {
#if CYTHON_COMPILING_IN_CPYTHON
        dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
#else
        dictptr = _PyObject_GetDictPtr(obj);
#endif
    }
    return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
}
static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
    PyObject *dict = Py_TYPE(obj)->tp_dict;
    if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
        return 0;
    return obj_dict_version == __Pyx_get_object_dict_version(obj);
}
#endif

/* GetModuleGlobalName */
#if CYTHON_USE_DICT_VERSIONS
static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
#else
static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
#endif
{
    PyObject *result;
#if !CYTHON_AVOID_BORROWED_REFS
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
    result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
    __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return __Pyx_NewRef(result);
    } else if (unlikely(PyErr_Occurred())) {
        return NULL;
    }
#else
    result = PyDict_GetItem(__pyx_d, name);
    __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return __Pyx_NewRef(result);
    }
#endif
#else
    result = PyObject_GetItem(__pyx_d, name);
    __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return __Pyx_NewRef(result);
    }
    PyErr_Clear();
#endif
    return __Pyx_GetBuiltinName(name);
}

/* PyCFunctionFastCall */
#if CYTHON_FAST_PYCCALL
static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
    PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
    PyCFunction meth = PyCFunction_GET_FUNCTION(func);
    PyObject *self = PyCFunction_GET_SELF(func);
    int flags = PyCFunction_GET_FLAGS(func);
    assert(PyCFunction_Check(func));
    assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
    assert(nargs >= 0);
    assert(nargs == 0 || args != NULL);
    /* _PyCFunction_FastCallDict() must not be called with an exception set,
       because it may clear it (directly or indirectly) and so the
       caller loses its exception */
    assert(!PyErr_Occurred());
    if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
        return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
    } else {
        return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
    }
}
#endif

/* PyFunctionFastCall */
#if CYTHON_FAST_PYCALL
static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
                                               PyObject *globals) {
    PyFrameObject *f;
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    PyObject **fastlocals;
    Py_ssize_t i;
    PyObject *result;
    assert(globals != NULL);
    /* XXX Perhaps we should create a specialized
       PyFrame_New() that doesn't take locals, but does
       take builtins without sanity checking them.
       */
    assert(tstate != NULL);
    f = PyFrame_New(tstate, co, globals, NULL);
    if (f == NULL) {
        return NULL;
    }
    fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
    for (i = 0; i < na; i++) {
        Py_INCREF(*args);
        fastlocals[i] = *args++;
    }
    result = PyEval_EvalFrameEx(f,0);
    ++tstate->recursion_depth;
    Py_DECREF(f);
    --tstate->recursion_depth;
    return result;
}
#if 1 || PY_VERSION_HEX < 0x030600B1
static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
    PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
    PyObject *globals = PyFunction_GET_GLOBALS(func);
    PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
    PyObject *closure;
#if PY_MAJOR_VERSION >= 3
    PyObject *kwdefs;
#endif
    PyObject *kwtuple, **k;
    PyObject **d;
    Py_ssize_t nd;
    Py_ssize_t nk;
    PyObject *result;
    assert(kwargs == NULL || PyDict_Check(kwargs));
    nk = kwargs ? PyDict_Size(kwargs) : 0;
    if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
        return NULL;
    }
    if (
#if PY_MAJOR_VERSION >= 3
            co->co_kwonlyargcount == 0 &&
#endif
            likely(kwargs == NULL || nk == 0) &&
            co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
        if (argdefs == NULL && co->co_argcount == nargs) {
            result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
            goto done;
        }
        else if (nargs == 0 && argdefs != NULL
                 && co->co_argcount == Py_SIZE(argdefs)) {
            /* function called with no arguments, but all parameters have
               a default value: use default values as arguments .*/
            args = &PyTuple_GET_ITEM(argdefs, 0);
            result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
            goto done;
        }
    }
    if (kwargs != NULL) {
        Py_ssize_t pos, i;
        kwtuple = PyTuple_New(2 * nk);
        if (kwtuple == NULL) {
            result = NULL;
            goto done;
        }
        k = &PyTuple_GET_ITEM(kwtuple, 0);
        pos = i = 0;
        while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
            Py_INCREF(k[i]);
            Py_INCREF(k[i+1]);
            i += 2;
        }
        nk = i / 2;
    }
    else {
        kwtuple = NULL;
        k = NULL;
    }
    closure = PyFunction_GET_CLOSURE(func);
#if PY_MAJOR_VERSION >= 3
    kwdefs = PyFunction_GET_KW_DEFAULTS(func);
#endif
    if (argdefs != NULL) {
        d = &PyTuple_GET_ITEM(argdefs, 0);
        nd = Py_SIZE(argdefs);
    }
    else {
        d = NULL;
        nd = 0;
    }
#if PY_MAJOR_VERSION >= 3
    result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
                               args, (int)nargs,
                               k, (int)nk,
                               d, (int)nd, kwdefs, closure);
#else
    result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
                               args, (int)nargs,
                               k, (int)nk,
                               d, (int)nd, closure);
#endif
    Py_XDECREF(kwtuple);
done:
    Py_LeaveRecursiveCall();
    return result;
}
#endif
#endif

/* PyObjectCall */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyObject *result;
    ternaryfunc call = Py_TYPE(func)->tp_call;
    if (unlikely(!call))
        return PyObject_Call(func, arg, kw);
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    result = (*call)(func, arg, kw);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

/* PyObjectCall2Args */
static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
    PyObject *args, *result = NULL;
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(function)) {
        PyObject *args[2] = {arg1, arg2};
        return __Pyx_PyFunction_FastCall(function, args, 2);
    }
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(function)) {
        PyObject *args[2] = {arg1, arg2};
        return __Pyx_PyCFunction_FastCall(function, args, 2);
    }
    #endif
    args = PyTuple_New(2);
    if (unlikely(!args)) goto done;
    Py_INCREF(arg1);
    PyTuple_SET_ITEM(args, 0, arg1);
    Py_INCREF(arg2);
    PyTuple_SET_ITEM(args, 1, arg2);
    Py_INCREF(function);
    result = __Pyx_PyObject_Call(function, args, NULL);
    Py_DECREF(args);
    Py_DECREF(function);
done:
    return result;
}

/* PyObjectCallMethO */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
    PyObject *self, *result;
    PyCFunction cfunc;
    cfunc = PyCFunction_GET_FUNCTION(func);
    self = PyCFunction_GET_SELF(func);
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    result = cfunc(self, arg);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

/* PyObjectCallOneArg */
#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *result;
    PyObject *args = PyTuple_New(1);
    if (unlikely(!args)) return NULL;
    Py_INCREF(arg);
    PyTuple_SET_ITEM(args, 0, arg);
    result = __Pyx_PyObject_Call(func, args, NULL);
    Py_DECREF(args);
    return result;
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
#if CYTHON_FAST_PYCALL
    if (PyFunction_Check(func)) {
        return __Pyx_PyFunction_FastCall(func, &arg, 1);
    }
#endif
    if (likely(PyCFunction_Check(func))) {
        if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
            return __Pyx_PyObject_CallMethO(func, arg);
#if CYTHON_FAST_PYCCALL
        } else if (__Pyx_PyFastCFunction_Check(func)) {
            return __Pyx_PyCFunction_FastCall(func, &arg, 1);
#endif
        }
    }
    return __Pyx__PyObject_CallOneArg(func, arg);
}
#else
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *result;
    PyObject *args = PyTuple_Pack(1, arg);
    if (unlikely(!args)) return NULL;
    result = __Pyx_PyObject_Call(func, args, NULL);
    Py_DECREF(args);
    return result;
}
#endif

/* GetItemInt */
static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
    PyObject *r;
    if (!j) return NULL;
    r = PyObject_GetItem(o, j);
    Py_DECREF(j);
    return r;
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                                                              CYTHON_NCP_UNUSED int wraparound,
                                                              CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    Py_ssize_t wrapped_i = i;
    if (wraparound & unlikely(i < 0)) {
        wrapped_i += PyList_GET_SIZE(o);
    }
    if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
        PyObject *r = PyList_GET_ITEM(o, wrapped_i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                              CYTHON_NCP_UNUSED int wraparound,
                                                              CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    Py_ssize_t wrapped_i = i;
    if (wraparound & unlikely(i < 0)) {
        wrapped_i += PyTuple_GET_SIZE(o);
    }
    if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
        PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
                                                     CYTHON_NCP_UNUSED int wraparound,
                                                     CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
    if (is_list || PyList_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
        if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
            PyObject *r = PyList_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    }
    else if (PyTuple_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
        if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
            PyObject *r = PyTuple_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    } else {
        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
        if (likely(m && m->sq_item)) {
            if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
                Py_ssize_t l = m->sq_length(o);
                if (likely(l >= 0)) {
                    i += l;
                } else {
                    if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                        return NULL;
                    PyErr_Clear();
                }
            }
            return m->sq_item(o, i);
        }
    }
#else
    if (is_list || PySequence_Check(o)) {
        return PySequence_GetItem(o, i);
    }
#endif
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}

/* ObjectGetItem */
#if CYTHON_USE_TYPE_SLOTS
static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
    PyObject *runerr;
    Py_ssize_t key_value;
    PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
    if (unlikely(!(m && m->sq_item))) {
        PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
        return NULL;
    }
    key_value = __Pyx_PyIndex_AsSsize_t(index);
    if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
        return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
    }
    if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
        PyErr_Clear();
        PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
    }
    return NULL;
}
static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
    PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
    if (likely(m && m->mp_subscript)) {
        return m->mp_subscript(obj, key);
    }
    return __Pyx_PyObject_GetIndex(obj, key);
}
#endif

/* ExtTypeTest */
static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (likely(__Pyx_TypeCheck(obj, type)))
        return 1;
    PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
                 Py_TYPE(obj)->tp_name, type->tp_name);
    return 0;
}

/* PyObjectCallNoArg */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
#if CYTHON_FAST_PYCALL
    if (PyFunction_Check(func)) {
        return __Pyx_PyFunction_FastCall(func, NULL, 0);
    }
#endif
#ifdef __Pyx_CyFunction_USED
    if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
#else
    if (likely(PyCFunction_Check(func)))
#endif
    {
        if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
            return __Pyx_PyObject_CallMethO(func, NULL);
        }
    }
    return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
}
#endif

/* RaiseTooManyValuesToUnpack */
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
    PyErr_Format(PyExc_ValueError,
                 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
}

/* RaiseNeedMoreValuesToUnpack */
static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
    PyErr_Format(PyExc_ValueError,
                 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
                 index, (index == 1) ? "" : "s");
}

/* IterFinish */
static CYTHON_INLINE int __Pyx_IterFinish(void) {
#if CYTHON_FAST_THREAD_STATE
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    PyObject* exc_type = tstate->curexc_type;
    if (unlikely(exc_type)) {
        if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) {
            PyObject *exc_value, *exc_tb;
            exc_value = tstate->curexc_value;
            exc_tb = tstate->curexc_traceback;
            tstate->curexc_type = 0;
            tstate->curexc_value = 0;
            tstate->curexc_traceback = 0;
            Py_DECREF(exc_type);
            Py_XDECREF(exc_value);
            Py_XDECREF(exc_tb);
            return 0;
        } else {
            return -1;
        }
    }
    return 0;
#else
    if (unlikely(PyErr_Occurred())) {
        if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
            PyErr_Clear();
            return 0;
        } else {
            return -1;
        }
    }
    return 0;
#endif
}

/* UnpackItemEndCheck */
static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
    if (unlikely(retval)) {
        Py_DECREF(retval);
        __Pyx_RaiseTooManyValuesError(expected);
        return -1;
    } else {
        return __Pyx_IterFinish();
    }
    return 0;
}

/* set_iter */
static CYTHON_INLINE PyObject* __Pyx_set_iterator(PyObject* iterable, int is_set,
                                                  Py_ssize_t* p_orig_length, int* p_source_is_set) {
#if CYTHON_COMPILING_IN_CPYTHON
    is_set = is_set || likely(PySet_CheckExact(iterable) || PyFrozenSet_CheckExact(iterable));
    *p_source_is_set = is_set;
    if (likely(is_set)) {
        *p_orig_length = PySet_Size(iterable);
        Py_INCREF(iterable);
        return iterable;
    }
#else
    (void)is_set;
    *p_source_is_set = 0;
#endif
    *p_orig_length = 0;
    return PyObject_GetIter(iterable);
}
static CYTHON_INLINE int __Pyx_set_iter_next(
        PyObject* iter_obj, Py_ssize_t orig_length,
        Py_ssize_t* ppos, PyObject **value,
        int source_is_set) {
    if (!CYTHON_COMPILING_IN_CPYTHON || unlikely(!source_is_set)) {
        *value = PyIter_Next(iter_obj);
        if (unlikely(!*value)) {
            return __Pyx_IterFinish();
        }
        (void)orig_length;
        (void)ppos;
        return 1;
    }
#if CYTHON_COMPILING_IN_CPYTHON
    if (unlikely(PySet_GET_SIZE(iter_obj) != orig_length)) {
        PyErr_SetString(
            PyExc_RuntimeError,
            "set changed size during iteration");
        return -1;
    }
    {
        Py_hash_t hash;
        int ret = _PySet_NextEntry(iter_obj, ppos, value, &hash);
        assert (ret != -1);
        if (likely(ret)) {
            Py_INCREF(*value);
            return 1;
        }
    }
#endif
    return 0;
}

/* pyfrozenset_new */
static CYTHON_INLINE PyObject* __Pyx_PyFrozenSet_New(PyObject* it) {
    if (it) {
        PyObject* result;
#if CYTHON_COMPILING_IN_PYPY
        PyObject* args;
        args = PyTuple_Pack(1, it);
        if (unlikely(!args))
            return NULL;
        result = PyObject_Call((PyObject*)&PyFrozenSet_Type, args, NULL);
        Py_DECREF(args);
        return result;
#else
        if (PyFrozenSet_CheckExact(it)) {
            Py_INCREF(it);
            return it;
        }
        result = PyFrozenSet_New(it);
        if (unlikely(!result))
            return NULL;
        if ((PY_VERSION_HEX >= 0x031000A1) || likely(PySet_GET_SIZE(result)))
            return result;
        Py_DECREF(result);
#endif
    }
#if CYTHON_USE_TYPE_SLOTS
    return PyFrozenSet_Type.tp_new(&PyFrozenSet_Type, __pyx_empty_tuple, NULL);
#else
    return PyObject_Call((PyObject*)&PyFrozenSet_Type, __pyx_empty_tuple, NULL);
#endif
}

/* PySetContains */
static int __Pyx_PySet_ContainsUnhashable(PyObject *set, PyObject *key) {
    int result = -1;
    if (PySet_Check(key) && PyErr_ExceptionMatches(PyExc_TypeError)) {
        PyObject *tmpkey;
        PyErr_Clear();
        tmpkey = __Pyx_PyFrozenSet_New(key);
        if (tmpkey != NULL) {
            result = PySet_Contains(set, tmpkey);
            Py_DECREF(tmpkey);
        }
    }
    return result;
}
static CYTHON_INLINE int __Pyx_PySet_ContainsTF(PyObject* key, PyObject* set, int eq) {
    int result = PySet_Contains(set, key);
    if (unlikely(result < 0)) {
        result = __Pyx_PySet_ContainsUnhashable(set, key);
    }
    return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
}

/* PyObjectGetMethod */
static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) {
    PyObject *attr;
#if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP
    PyTypeObject *tp = Py_TYPE(obj);
    PyObject *descr;
    descrgetfunc f = NULL;
    PyObject **dictptr, *dict;
    int meth_found = 0;
    assert (*method == NULL);
    if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) {
        attr = __Pyx_PyObject_GetAttrStr(obj, name);
        goto try_unpack;
    }
    if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) {
        return 0;
    }
    descr = _PyType_Lookup(tp, name);
    if (likely(descr != NULL)) {
        Py_INCREF(descr);
#if PY_MAJOR_VERSION >= 3
        #ifdef __Pyx_CyFunction_USED
        if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr)))
        #else
        if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type)))
        #endif
#else
        #ifdef __Pyx_CyFunction_USED
        if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr)))
        #else
        if (likely(PyFunction_Check(descr)))
        #endif
#endif
        {
            meth_found = 1;
        } else {
            f = Py_TYPE(descr)->tp_descr_get;
            if (f != NULL && PyDescr_IsData(descr)) {
                attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
                Py_DECREF(descr);
                goto try_unpack;
            }
        }
    }
    dictptr = _PyObject_GetDictPtr(obj);
    if (dictptr != NULL && (dict = *dictptr) != NULL) {
        Py_INCREF(dict);
        attr = __Pyx_PyDict_GetItemStr(dict, name);
        if (attr != NULL) {
            Py_INCREF(attr);
            Py_DECREF(dict);
            Py_XDECREF(descr);
            goto try_unpack;
        }
        Py_DECREF(dict);
    }
    if (meth_found) {
        *method = descr;
        return 1;
    }
    if (f != NULL) {
        attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
        Py_DECREF(descr);
        goto try_unpack;
    }
    if (descr != NULL) {
        *method = descr;
        return 0;
    }
    PyErr_Format(PyExc_AttributeError,
#if PY_MAJOR_VERSION >= 3
                 "'%.50s' object has no attribute '%U'",
                 tp->tp_name, name);
#else
                 "'%.50s' object has no attribute '%.400s'",
                 tp->tp_name, PyString_AS_STRING(name));
#endif
    return 0;
#else
    attr = __Pyx_PyObject_GetAttrStr(obj, name);
    goto try_unpack;
#endif
try_unpack:
#if CYTHON_UNPACK_METHODS
    if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) {
        PyObject *function = PyMethod_GET_FUNCTION(attr);
        Py_INCREF(function);
        Py_DECREF(attr);
        *method = function;
        return 1;
    }
#endif
    *method = attr;
    return 0;
}

/* PyObjectCallMethod1 */
static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) {
    PyObject *result = __Pyx_PyObject_CallOneArg(method, arg);
    Py_DECREF(method);
    return result;
}
static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
    PyObject *method = NULL, *result;
    int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
    if (likely(is_method)) {
        result = __Pyx_PyObject_Call2Args(method, obj, arg);
        Py_DECREF(method);
        return result;
    }
    if (unlikely(!method)) return NULL;
    return __Pyx__PyObject_CallMethod1(method, arg);
}

/* append */
static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
    if (likely(PyList_CheckExact(L))) {
        if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1;
    } else {
        PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_append, x);
        if (unlikely(!retval))
            return -1;
        Py_DECREF(retval);
    }
    return 0;
}

/* PyErrFetchRestore */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    tmp_type = tstate->curexc_type;
    tmp_value = tstate->curexc_value;
    tmp_tb = tstate->curexc_traceback;
    tstate->curexc_type = type;
    tstate->curexc_value = value;
    tstate->curexc_traceback = tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
}
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    *type = tstate->curexc_type;
    *value = tstate->curexc_value;
    *tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
}
#endif

/* WriteUnraisableException */
static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
                                  CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
                                  int full_traceback, CYTHON_UNUSED int nogil) {
    PyObject *old_exc, *old_val, *old_tb;
    PyObject *ctx;
    __Pyx_PyThreadState_declare
#ifdef WITH_THREAD
    PyGILState_STATE state;
    if (nogil)
        state = PyGILState_Ensure();
#ifdef _MSC_VER
    else state = (PyGILState_STATE)-1;
#endif
#endif
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
    if (full_traceback) {
        Py_XINCREF(old_exc);
        Py_XINCREF(old_val);
        Py_XINCREF(old_tb);
        __Pyx_ErrRestore(old_exc, old_val, old_tb);
        PyErr_PrintEx(1);
    }
    #if PY_MAJOR_VERSION < 3
    ctx = PyString_FromString(name);
    #else
    ctx = PyUnicode_FromString(name);
    #endif
    __Pyx_ErrRestore(old_exc, old_val, old_tb);
    if (!ctx) {
        PyErr_WriteUnraisable(Py_None);
    } else {
        PyErr_WriteUnraisable(ctx);
        Py_DECREF(ctx);
    }
#ifdef WITH_THREAD
    if (nogil)
        PyGILState_Release(state);
#endif
}

/* PyIntCompare */
static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED long inplace) {
    if (op1 == op2) {
        Py_RETURN_TRUE;
    }
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long a = PyInt_AS_LONG(op1);
        if (a == b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        int unequal;
        unsigned long uintval;
        Py_ssize_t size = Py_SIZE(op1);
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        if (intval == 0) {
            if (size == 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
        } else if (intval < 0) {
            if (size >= 0)
                Py_RETURN_FALSE;
            intval = -intval;
            size = -size;
        } else {
            if (size <= 0)
                Py_RETURN_FALSE;
        }
        uintval = (unsigned long) intval;
#if PyLong_SHIFT * 4 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 4)) {
            unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 3 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 3)) {
            unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 2 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 2)) {
            unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 1 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 1)) {
            unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
            unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK));
        if (unequal == 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
        double a = PyFloat_AS_DOUBLE(op1);
        if ((double)a == (double)b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
    }
    return (
        PyObject_RichCompare(op1, op2, Py_EQ));
}

/* PyIntBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
    (void)inplace;
    (void)zerodivision_check;
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long x;
        long a = PyInt_AS_LONG(op1);
            x = (long)((unsigned long)a + b);
            if (likely((x^a) >= 0 || (x^b) >= 0))
                return PyInt_FromLong(x);
            return PyLong_Type.tp_as_number->nb_add(op1, op2);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a, x;
#ifdef HAVE_LONG_LONG
        const PY_LONG_LONG llb = intval;
        PY_LONG_LONG lla, llx;
#endif
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op1);
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            a = likely(size) ? digits[0] : 0;
            if (size == -1) a = -a;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
            }
        }
                x = a + b;
            return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
        long_long:
                llx = lla + llb;
            return PyLong_FromLongLong(llx);
#endif
        
        
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
        double a = PyFloat_AS_DOUBLE(op1);
            double result;
            PyFPE_START_PROTECT("add", return NULL)
            result = ((double)a) + (double)b;
            PyFPE_END_PROTECT(result)
            return PyFloat_FromDouble(result);
    }
    return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
}
#endif

/* UnpackUnboundCMethod */
static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) {
    PyObject *method;
    method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name);
    if (unlikely(!method))
        return -1;
    target->method = method;
#if CYTHON_COMPILING_IN_CPYTHON
    #if PY_MAJOR_VERSION >= 3
    if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type)))
    #endif
    {
        PyMethodDescrObject *descr = (PyMethodDescrObject*) method;
        target->func = descr->d_method->ml_meth;
        target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS);
    }
#endif
    return 0;
}

/* CallUnboundCMethod1 */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg) {
    if (likely(cfunc->func)) {
        int flag = cfunc->flag;
        if (flag == METH_O) {
            return (*(cfunc->func))(self, arg);
        } else if (PY_VERSION_HEX >= 0x030600B1 && flag == METH_FASTCALL) {
            if (PY_VERSION_HEX >= 0x030700A0) {
                return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, &arg, 1);
            } else {
                return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL);
            }
        } else if (PY_VERSION_HEX >= 0x030700A0 && flag == (METH_FASTCALL | METH_KEYWORDS)) {
            return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL);
        }
    }
    return __Pyx__CallUnboundCMethod1(cfunc, self, arg);
}
#endif
static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg){
    PyObject *args, *result = NULL;
    if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
#if CYTHON_COMPILING_IN_CPYTHON
    if (cfunc->func && (cfunc->flag & METH_VARARGS)) {
        args = PyTuple_New(1);
        if (unlikely(!args)) goto bad;
        Py_INCREF(arg);
        PyTuple_SET_ITEM(args, 0, arg);
        if (cfunc->flag & METH_KEYWORDS)
            result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL);
        else
            result = (*cfunc->func)(self, args);
    } else {
        args = PyTuple_New(2);
        if (unlikely(!args)) goto bad;
        Py_INCREF(self);
        PyTuple_SET_ITEM(args, 0, self);
        Py_INCREF(arg);
        PyTuple_SET_ITEM(args, 1, arg);
        result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
    }
#else
    args = PyTuple_Pack(2, self, arg);
    if (unlikely(!args)) goto bad;
    result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
#endif
bad:
    Py_XDECREF(args);
    return result;
}

/* SetItemInt */
static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
    int r;
    if (!j) return -1;
    r = PyObject_SetItem(o, j, v);
    Py_DECREF(j);
    return r;
}
static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int is_list,
                                               CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
    if (is_list || PyList_CheckExact(o)) {
        Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o));
        if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o)))) {
            PyObject* old = PyList_GET_ITEM(o, n);
            Py_INCREF(v);
            PyList_SET_ITEM(o, n, v);
            Py_DECREF(old);
            return 1;
        }
    } else {
        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
        if (likely(m && m->sq_ass_item)) {
            if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
                Py_ssize_t l = m->sq_length(o);
                if (likely(l >= 0)) {
                    i += l;
                } else {
                    if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                        return -1;
                    PyErr_Clear();
                }
            }
            return m->sq_ass_item(o, i, v);
        }
    }
#else
#if CYTHON_COMPILING_IN_PYPY
    if (is_list || (PySequence_Check(o) && !PyDict_Check(o)))
#else
    if (is_list || PySequence_Check(o))
#endif
    {
        return PySequence_SetItem(o, i, v);
    }
#endif
    return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v);
}

/* PyObjectSetAttrStr */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_setattro))
        return tp->tp_setattro(obj, attr_name, value);
#if PY_MAJOR_VERSION < 3
    if (likely(tp->tp_setattr))
        return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
#endif
    return PyObject_SetAttr(obj, attr_name, value);
}
#endif

/* CallUnboundCMethod2 */
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030600B1
static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) {
    if (likely(cfunc->func)) {
        PyObject *args[2] = {arg1, arg2};
        if (cfunc->flag == METH_FASTCALL) {
            #if PY_VERSION_HEX >= 0x030700A0
            return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, args, 2);
            #else
            return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, 2, NULL);
            #endif
        }
        #if PY_VERSION_HEX >= 0x030700A0
        if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS))
            return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, 2, NULL);
        #endif
    }
    return __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2);
}
#endif
static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){
    PyObject *args, *result = NULL;
    if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
#if CYTHON_COMPILING_IN_CPYTHON
    if (cfunc->func && (cfunc->flag & METH_VARARGS)) {
        args = PyTuple_New(2);
        if (unlikely(!args)) goto bad;
        Py_INCREF(arg1);
        PyTuple_SET_ITEM(args, 0, arg1);
        Py_INCREF(arg2);
        PyTuple_SET_ITEM(args, 1, arg2);
        if (cfunc->flag & METH_KEYWORDS)
            result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL);
        else
            result = (*cfunc->func)(self, args);
    } else {
        args = PyTuple_New(3);
        if (unlikely(!args)) goto bad;
        Py_INCREF(self);
        PyTuple_SET_ITEM(args, 0, self);
        Py_INCREF(arg1);
        PyTuple_SET_ITEM(args, 1, arg1);
        Py_INCREF(arg2);
        PyTuple_SET_ITEM(args, 2, arg2);
        result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
    }
#else
    args = PyTuple_Pack(3, self, arg1, arg2);
    if (unlikely(!args)) goto bad;
    result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
#endif
bad:
    Py_XDECREF(args);
    return result;
}

/* dict_getitem_default */
static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value) {
    PyObject* value;
#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
    value = PyDict_GetItemWithError(d, key);
    if (unlikely(!value)) {
        if (unlikely(PyErr_Occurred()))
            return NULL;
        value = default_value;
    }
    Py_INCREF(value);
    if ((1));
#else
    if (PyString_CheckExact(key) || PyUnicode_CheckExact(key) || PyInt_CheckExact(key)) {
        value = PyDict_GetItem(d, key);
        if (unlikely(!value)) {
            value = default_value;
        }
        Py_INCREF(value);
    }
#endif
    else {
        if (default_value == Py_None)
            value = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyDict_Type_get, d, key);
        else
            value = __Pyx_CallUnboundCMethod2(&__pyx_umethod_PyDict_Type_get, d, key, default_value);
    }
    return value;
}

/* CallUnboundCMethod0 */
static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) {
    PyObject *args, *result = NULL;
    if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
#if CYTHON_ASSUME_SAFE_MACROS
    args = PyTuple_New(1);
    if (unlikely(!args)) goto bad;
    Py_INCREF(self);
    PyTuple_SET_ITEM(args, 0, self);
#else
    args = PyTuple_Pack(1, self);
    if (unlikely(!args)) goto bad;
#endif
    result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
    Py_DECREF(args);
bad:
    return result;
}

/* py_dict_values */
static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d) {
    if (PY_MAJOR_VERSION >= 3)
        return __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyDict_Type_values, d);
    else
        return PyDict_Values(d);
}

/* PyIntBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_SubtractCObj(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
    (void)inplace;
    (void)zerodivision_check;
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op2))) {
        const long a = intval;
        long x;
        long b = PyInt_AS_LONG(op2);
            x = (long)((unsigned long)a - b);
            if (likely((x^a) >= 0 || (x^~b) >= 0))
                return PyInt_FromLong(x);
            return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op2))) {
        const long a = intval;
        long b, x;
#ifdef HAVE_LONG_LONG
        const PY_LONG_LONG lla = intval;
        PY_LONG_LONG llb, llx;
#endif
        const digit* digits = ((PyLongObject*)op2)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op2);
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            b = likely(size) ? digits[0] : 0;
            if (size == -1) b = -b;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        b = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        llb = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        b = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        llb = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        b = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        llb = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        b = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        llb = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        b = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        llb = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        b = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        llb = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                default: return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
            }
        }
                x = a - b;
            return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
        long_long:
                llx = lla - llb;
            return PyLong_FromLongLong(llx);
#endif
        
        
    }
    #endif
    if (PyFloat_CheckExact(op2)) {
        const long a = intval;
        double b = PyFloat_AS_DOUBLE(op2);
            double result;
            PyFPE_START_PROTECT("subtract", return NULL)
            result = ((double)a) - (double)b;
            PyFPE_END_PROTECT(result)
            return PyFloat_FromDouble(result);
    }
    return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2);
}
#endif

/* py_set_discard_unhashable */
static int __Pyx_PySet_DiscardUnhashable(PyObject *set, PyObject *key) {
    PyObject *tmpkey;
    int rv;
    if (likely(!PySet_Check(key) || !PyErr_ExceptionMatches(PyExc_TypeError)))
        return -1;
    PyErr_Clear();
    tmpkey = __Pyx_PyFrozenSet_New(key);
    if (tmpkey == NULL)
        return -1;
    rv = PySet_Discard(set, tmpkey);
    Py_DECREF(tmpkey);
    return rv;
}

/* py_set_discard */
static CYTHON_INLINE int __Pyx_PySet_Discard(PyObject *set, PyObject *key) {
    int found = PySet_Discard(set, key);
    if (unlikely(found < 0)) {
        found = __Pyx_PySet_DiscardUnhashable(set, key);
    }
    return found;
}

/* PyIntBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
    (void)inplace;
    (void)zerodivision_check;
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long x;
        long a = PyInt_AS_LONG(op1);
            x = (long)((unsigned long)a - b);
            if (likely((x^a) >= 0 || (x^~b) >= 0))
                return PyInt_FromLong(x);
            return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a, x;
#ifdef HAVE_LONG_LONG
        const PY_LONG_LONG llb = intval;
        PY_LONG_LONG lla, llx;
#endif
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op1);
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            a = likely(size) ? digits[0] : 0;
            if (size == -1) a = -a;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                default: return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
            }
        }
                x = a - b;
            return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
        long_long:
                llx = lla - llb;
            return PyLong_FromLongLong(llx);
#endif
        
        
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
        double a = PyFloat_AS_DOUBLE(op1);
            double result;
            PyFPE_START_PROTECT("subtract", return NULL)
            result = ((double)a) - (double)b;
            PyFPE_END_PROTECT(result)
            return PyFloat_FromDouble(result);
    }
    return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2);
}
#endif

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

/* PyErrExceptionMatches */
#if CYTHON_FAST_THREAD_STATE
static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
    Py_ssize_t i, n;
    n = PyTuple_GET_SIZE(tuple);
#if PY_MAJOR_VERSION >= 3
    for (i=0; i<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
#endif
    for (i=0; i<n; i++) {
        if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
    }
    return 0;
}
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
    PyObject *exc_type = tstate->curexc_type;
    if (exc_type == err) return 1;
    if (unlikely(!exc_type)) return 0;
    if (unlikely(PyTuple_Check(err)))
        return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
    return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
}
#endif

/* GetAttr */
static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
#if CYTHON_USE_TYPE_SLOTS
#if PY_MAJOR_VERSION >= 3
    if (likely(PyUnicode_Check(n)))
#else
    if (likely(PyString_Check(n)))
#endif
        return __Pyx_PyObject_GetAttrStr(o, n);
#endif
    return PyObject_GetAttr(o, n);
}

/* GetAttr3 */
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;
}
static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
    PyObject *r = __Pyx_GetAttr(o, n);
    return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
}

/* RaiseException */
#if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
                        CYTHON_UNUSED PyObject *cause) {
    __Pyx_PyThreadState_declare
    Py_XINCREF(type);
    if (!value || value == Py_None)
        value = NULL;
    else
        Py_INCREF(value);
    if (!tb || tb == Py_None)
        tb = NULL;
    else {
        Py_INCREF(tb);
        if (!PyTraceBack_Check(tb)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: arg 3 must be a traceback or None");
            goto raise_error;
        }
    }
    if (PyType_Check(type)) {
#if CYTHON_COMPILING_IN_PYPY
        if (!value) {
            Py_INCREF(Py_None);
            value = Py_None;
        }
#endif
        PyErr_NormalizeException(&type, &value, &tb);
    } else {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto raise_error;
        }
        value = type;
        type = (PyObject*) Py_TYPE(type);
        Py_INCREF(type);
        if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: exception class must be a subclass of BaseException");
            goto raise_error;
        }
    }
    __Pyx_PyThreadState_assign
    __Pyx_ErrRestore(type, value, tb);
    return;
raise_error:
    Py_XDECREF(value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
    return;
}
#else
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
    PyObject* owned_instance = NULL;
    if (tb == Py_None) {
        tb = 0;
    } else if (tb && !PyTraceBack_Check(tb)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: arg 3 must be a traceback or None");
        goto bad;
    }
    if (value == Py_None)
        value = 0;
    if (PyExceptionInstance_Check(type)) {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto bad;
        }
        value = type;
        type = (PyObject*) Py_TYPE(value);
    } else if (PyExceptionClass_Check(type)) {
        PyObject *instance_class = NULL;
        if (value && PyExceptionInstance_Check(value)) {
            instance_class = (PyObject*) Py_TYPE(value);
            if (instance_class != type) {
                int is_subclass = PyObject_IsSubclass(instance_class, type);
                if (!is_subclass) {
                    instance_class = NULL;
                } else if (unlikely(is_subclass == -1)) {
                    goto bad;
                } else {
                    type = instance_class;
                }
            }
        }
        if (!instance_class) {
            PyObject *args;
            if (!value)
                args = PyTuple_New(0);
            else if (PyTuple_Check(value)) {
                Py_INCREF(value);
                args = value;
            } else
                args = PyTuple_Pack(1, value);
            if (!args)
                goto bad;
            owned_instance = PyObject_Call(type, args, NULL);
            Py_DECREF(args);
            if (!owned_instance)
                goto bad;
            value = owned_instance;
            if (!PyExceptionInstance_Check(value)) {
                PyErr_Format(PyExc_TypeError,
                             "calling %R should have returned an instance of "
                             "BaseException, not %R",
                             type, Py_TYPE(value));
                goto bad;
            }
        }
    } else {
        PyErr_SetString(PyExc_TypeError,
            "raise: exception class must be a subclass of BaseException");
        goto bad;
    }
    if (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 CYTHON_COMPILING_IN_PYPY
        PyObject *tmp_type, *tmp_value, *tmp_tb;
        PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
        Py_INCREF(tb);
        PyErr_Restore(tmp_type, tmp_value, tb);
        Py_XDECREF(tmp_tb);
#else
        PyThreadState *tstate = __Pyx_PyThreadState_Current;
        PyObject* tmp_tb = tstate->curexc_traceback;
        if (tb != tmp_tb) {
            Py_INCREF(tb);
            tstate->curexc_traceback = tb;
            Py_XDECREF(tmp_tb);
        }
#endif
    }
bad:
    Py_XDECREF(owned_instance);
    return;
}
#endif

/* Import */
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
    PyObject *empty_list = 0;
    PyObject *module = 0;
    PyObject *global_dict = 0;
    PyObject *empty_dict = 0;
    PyObject *list;
    #if PY_MAJOR_VERSION < 3
    PyObject *py_import;
    py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
    if (!py_import)
        goto bad;
    #endif
    if (from_list)
        list = from_list;
    else {
        empty_list = PyList_New(0);
        if (!empty_list)
            goto bad;
        list = empty_list;
    }
    global_dict = PyModule_GetDict(__pyx_m);
    if (!global_dict)
        goto bad;
    empty_dict = PyDict_New();
    if (!empty_dict)
        goto bad;
    {
        #if PY_MAJOR_VERSION >= 3
        if (level == -1) {
            if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) {
                module = PyImport_ImportModuleLevelObject(
                    name, global_dict, empty_dict, list, 1);
                if (!module) {
                    if (!PyErr_ExceptionMatches(PyExc_ImportError))
                        goto bad;
                    PyErr_Clear();
                }
            }
            level = 0;
        }
        #endif
        if (!module) {
            #if PY_MAJOR_VERSION < 3
            PyObject *py_level = PyInt_FromLong(level);
            if (!py_level)
                goto bad;
            module = PyObject_CallFunctionObjArgs(py_import,
                name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
            Py_DECREF(py_level);
            #else
            module = PyImport_ImportModuleLevelObject(
                name, global_dict, empty_dict, list, level);
            #endif
        }
    }
bad:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(py_import);
    #endif
    Py_XDECREF(empty_list);
    Py_XDECREF(empty_dict);
    return module;
}

/* ImportFrom */
static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
    PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
    if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
        PyErr_Format(PyExc_ImportError,
        #if PY_MAJOR_VERSION < 3
            "cannot import name %.230s", PyString_AS_STRING(name));
        #else
            "cannot import name %S", name);
        #endif
    }
    return value;
}

/* HasAttr */
static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
    PyObject *r;
    if (unlikely(!__Pyx_PyBaseString_Check(n))) {
        PyErr_SetString(PyExc_TypeError,
                        "hasattr(): attribute name must be string");
        return -1;
    }
    r = __Pyx_GetAttr(o, n);
    if (unlikely(!r)) {
        PyErr_Clear();
        return 0;
    } else {
        Py_DECREF(r);
        return 1;
    }
}

/* GetTopmostException */
#if CYTHON_USE_EXC_INFO_STACK
static _PyErr_StackItem *
__Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
{
    _PyErr_StackItem *exc_info = tstate->exc_info;
    while ((exc_info->exc_type == NULL || exc_info->exc_type == 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
    _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
    *type = exc_info->exc_type;
    *value = exc_info->exc_value;
    *tb = exc_info->exc_traceback;
    #else
    *type = tstate->exc_type;
    *value = tstate->exc_value;
    *tb = tstate->exc_traceback;
    #endif
    Py_XINCREF(*type);
    Py_XINCREF(*value);
    Py_XINCREF(*tb);
}
static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    #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

/* GetException */
#if CYTHON_FAST_THREAD_STATE
static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
#else
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
#endif
{
    PyObject *local_type, *local_value, *local_tb;
#if CYTHON_FAST_THREAD_STATE
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    local_type = tstate->curexc_type;
    local_value = tstate->curexc_value;
    local_tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
#else
    PyErr_Fetch(&local_type, &local_value, &local_tb);
#endif
    PyErr_NormalizeException(&local_type, &local_value, &local_tb);
#if CYTHON_FAST_THREAD_STATE
    if (unlikely(tstate->curexc_type))
#else
    if (unlikely(PyErr_Occurred()))
#endif
        goto bad;
    #if PY_MAJOR_VERSION >= 3
    if (local_tb) {
        if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
            goto bad;
    }
    #endif
    Py_XINCREF(local_tb);
    Py_XINCREF(local_type);
    Py_XINCREF(local_value);
    *type = local_type;
    *value = local_value;
    *tb = local_tb;
#if CYTHON_FAST_THREAD_STATE
    #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 = local_type;
        exc_info->exc_value = local_value;
        exc_info->exc_traceback = local_tb;
    }
    #else
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = local_type;
    tstate->exc_value = local_value;
    tstate->exc_traceback = local_tb;
    #endif
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#else
    PyErr_SetExcInfo(local_type, local_value, local_tb);
#endif
    return 0;
bad:
    *type = 0;
    *value = 0;
    *tb = 0;
    Py_XDECREF(local_type);
    Py_XDECREF(local_value);
    Py_XDECREF(local_tb);
    return -1;
}

/* PyObject_GenericGetAttrNoDict */
#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
    PyErr_Format(PyExc_AttributeError,
#if PY_MAJOR_VERSION >= 3
                 "'%.50s' object has no attribute '%U'",
                 tp->tp_name, attr_name);
#else
                 "'%.50s' object has no attribute '%.400s'",
                 tp->tp_name, PyString_AS_STRING(attr_name));
#endif
    return NULL;
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
    PyObject *descr;
    PyTypeObject *tp = Py_TYPE(obj);
    if (unlikely(!PyString_Check(attr_name))) {
        return PyObject_GenericGetAttr(obj, attr_name);
    }
    assert(!tp->tp_dictoffset);
    descr = _PyType_Lookup(tp, attr_name);
    if (unlikely(!descr)) {
        return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
    }
    Py_INCREF(descr);
    #if PY_MAJOR_VERSION < 3
    if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
    #endif
    {
        descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
        if (unlikely(f)) {
            PyObject *res = f(descr, obj, (PyObject *)tp);
            Py_DECREF(descr);
            return res;
        }
    }
    return descr;
}
#endif

/* PyObject_GenericGetAttr */
#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
    if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
        return PyObject_GenericGetAttr(obj, attr_name);
    }
    return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
}
#endif

/* SetVTable */
static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
#if PY_VERSION_HEX >= 0x02070000
    PyObject *ob = PyCapsule_New(vtable, 0, 0);
#else
    PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
#endif
    if (!ob)
        goto bad;
    if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
        goto bad;
    Py_DECREF(ob);
    return 0;
bad:
    Py_XDECREF(ob);
    return -1;
}

/* PyObjectGetAttrStrNoError */
static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
        __Pyx_PyErr_Clear();
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
    PyObject *result;
#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
        return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
    }
#endif
    result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
    if (unlikely(!result)) {
        __Pyx_PyObject_GetAttrStr_ClearAttributeError();
    }
    return result;
}

/* SetupReduce */
static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
  int ret;
  PyObject *name_attr;
  name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name);
  if (likely(name_attr)) {
      ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
  } else {
      ret = -1;
  }
  if (unlikely(ret < 0)) {
      PyErr_Clear();
      ret = 0;
  }
  Py_XDECREF(name_attr);
  return ret;
}
static int __Pyx_setup_reduce(PyObject* type_obj) {
    int ret = 0;
    PyObject *object_reduce = NULL;
    PyObject *object_getstate = NULL;
    PyObject *object_reduce_ex = NULL;
    PyObject *reduce = NULL;
    PyObject *reduce_ex = NULL;
    PyObject *reduce_cython = NULL;
    PyObject *setstate = NULL;
    PyObject *setstate_cython = NULL;
    PyObject *getstate = NULL;
#if CYTHON_USE_PYTYPE_LOOKUP
    getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate);
#else
    getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate);
    if (!getstate && PyErr_Occurred()) {
        goto __PYX_BAD;
    }
#endif
    if (getstate) {
#if CYTHON_USE_PYTYPE_LOOKUP
        object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate);
#else
        object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate);
        if (!object_getstate && PyErr_Occurred()) {
            goto __PYX_BAD;
        }
#endif
        if (object_getstate != getstate) {
            goto __PYX_GOOD;
        }
    }
#if CYTHON_USE_PYTYPE_LOOKUP
    object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
#else
    object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
#endif
    reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
    if (reduce_ex == object_reduce_ex) {
#if CYTHON_USE_PYTYPE_LOOKUP
        object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
#else
        object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
#endif
        reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
        if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
            reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
            if (likely(reduce_cython)) {
                ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
                ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
            } else if (reduce == object_reduce || PyErr_Occurred()) {
                goto __PYX_BAD;
            }
            setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
            if (!setstate) PyErr_Clear();
            if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
                setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
                if (likely(setstate_cython)) {
                    ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
                    ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
                } else if (!setstate || PyErr_Occurred()) {
                    goto __PYX_BAD;
                }
            }
            PyType_Modified((PyTypeObject*)type_obj);
        }
    }
    goto __PYX_GOOD;
__PYX_BAD:
    if (!PyErr_Occurred())
        PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
    ret = -1;
__PYX_GOOD:
#if !CYTHON_USE_PYTYPE_LOOKUP
    Py_XDECREF(object_reduce);
    Py_XDECREF(object_reduce_ex);
    Py_XDECREF(object_getstate);
    Py_XDECREF(getstate);
#endif
    Py_XDECREF(reduce);
    Py_XDECREF(reduce_ex);
    Py_XDECREF(reduce_cython);
    Py_XDECREF(setstate);
    Py_XDECREF(setstate_cython);
    return ret;
}

/* TypeImport */
#ifndef __PYX_HAVE_RT_ImportType
#define __PYX_HAVE_RT_ImportType
static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name,
    size_t size, enum __Pyx_ImportType_CheckSize check_size)
{
    PyObject *result = 0;
    char warning[200];
    Py_ssize_t basicsize;
#ifdef Py_LIMITED_API
    PyObject *py_basicsize;
#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;
    }
#ifndef Py_LIMITED_API
    basicsize = ((PyTypeObject *)result)->tp_basicsize;
#else
    py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
    if (!py_basicsize)
        goto bad;
    basicsize = PyLong_AsSsize_t(py_basicsize);
    Py_DECREF(py_basicsize);
    py_basicsize = 0;
    if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
        goto bad;
#endif
    if ((size_t)basicsize < 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);
        goto bad;
    }
    if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != 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);
        goto bad;
    }
    else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) {
        PyOS_snprintf(warning, sizeof(warning),
            "%s.%s size changed, may indicate binary incompatibility. "
            "Expected %zd from C header, got %zd from PyObject",
            module_name, class_name, size, basicsize);
        if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
    }
    return (PyTypeObject *)result;
bad:
    Py_XDECREF(result);
    return NULL;
}
#endif

/* CLineInTraceback */
#ifndef CYTHON_CLINE_IN_TRACEBACK
static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) {
    PyObject *use_cline;
    PyObject *ptype, *pvalue, *ptraceback;
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject **cython_runtime_dict;
#endif
    if (unlikely(!__pyx_cython_runtime)) {
        return c_line;
    }
    __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
#if CYTHON_COMPILING_IN_CPYTHON
    cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
    if (likely(cython_runtime_dict)) {
        __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
            use_cline, *cython_runtime_dict,
            __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
    } else
#endif
    {
      PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
      if (use_cline_obj) {
        use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
        Py_DECREF(use_cline_obj);
      } else {
        PyErr_Clear();
        use_cline = NULL;
      }
    }
    if (!use_cline) {
        c_line = 0;
        (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
    }
    else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
        c_line = 0;
    }
    __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
    return c_line;
}
#endif

/* CodeObjectCache */
static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
    int start = 0, mid = 0, end = count - 1;
    if (end >= 0 && code_line > entries[end].code_line) {
        return count;
    }
    while (start < end) {
        mid = start + (end - start) / 2;
        if (code_line < entries[mid].code_line) {
            end = mid;
        } else if (code_line > entries[mid].code_line) {
             start = mid + 1;
        } else {
            return mid;
        }
    }
    if (code_line <= entries[mid].code_line) {
        return mid;
    } else {
        return mid + 1;
    }
}
static PyCodeObject *__pyx_find_code_object(int code_line) {
    PyCodeObject* code_object;
    int pos;
    if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
        return NULL;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
        return NULL;
    }
    code_object = __pyx_code_cache.entries[pos].code_object;
    Py_INCREF(code_object);
    return code_object;
}
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
    int pos, i;
    __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
    if (unlikely(!code_line)) {
        return;
    }
    if (unlikely(!entries)) {
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
        if (likely(entries)) {
            __pyx_code_cache.entries = entries;
            __pyx_code_cache.max_count = 64;
            __pyx_code_cache.count = 1;
            entries[0].code_line = code_line;
            entries[0].code_object = code_object;
            Py_INCREF(code_object);
        }
        return;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
        PyCodeObject* tmp = entries[pos].code_object;
        entries[pos].code_object = code_object;
        Py_DECREF(tmp);
        return;
    }
    if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
        int new_max = __pyx_code_cache.max_count + 64;
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
            __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
        if (unlikely(!entries)) {
            return;
        }
        __pyx_code_cache.entries = entries;
        __pyx_code_cache.max_count = new_max;
    }
    for (i=__pyx_code_cache.count; i>pos; i--) {
        entries[i] = entries[i-1];
    }
    entries[pos].code_line = code_line;
    entries[pos].code_object = code_object;
    __pyx_code_cache.count++;
    Py_INCREF(code_object);
}

/* AddTraceback */
#include "compile.h"
#include "frameobject.h"
#include "traceback.h"
#if PY_VERSION_HEX >= 0x030b00a6
  #ifndef Py_BUILD_CORE
    #define Py_BUILD_CORE 1
  #endif
  #include "internal/pycore_frame.h"
#endif
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
            const char *funcname, int c_line,
            int py_line, const char *filename) {
    PyCodeObject *py_code = NULL;
    PyObject *py_funcname = NULL;
    #if PY_MAJOR_VERSION < 3
    PyObject *py_srcfile = NULL;
    py_srcfile = PyString_FromString(filename);
    if (!py_srcfile) goto bad;
    #endif
    if (c_line) {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        if (!py_funcname) goto bad;
        #else
        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        if (!py_funcname) goto bad;
        funcname = PyUnicode_AsUTF8(py_funcname);
        if (!funcname) goto bad;
        #endif
    }
    else {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromString(funcname);
        if (!py_funcname) goto bad;
        #endif
    }
    #if PY_MAJOR_VERSION < 3
    py_code = __Pyx_PyCode_New(
        0,
        0,
        0,
        0,
        0,
        __pyx_empty_bytes, /*PyObject *code,*/
        __pyx_empty_tuple, /*PyObject *consts,*/
        __pyx_empty_tuple, /*PyObject *names,*/
        __pyx_empty_tuple, /*PyObject *varnames,*/
        __pyx_empty_tuple, /*PyObject *freevars,*/
        __pyx_empty_tuple, /*PyObject *cellvars,*/
        py_srcfile,   /*PyObject *filename,*/
        py_funcname,  /*PyObject *name,*/
        py_line,
        __pyx_empty_bytes  /*PyObject *lnotab*/
    );
    Py_DECREF(py_srcfile);
    #else
    py_code = PyCode_NewEmpty(filename, funcname, py_line);
    #endif
    Py_XDECREF(py_funcname);  // XDECREF since it's only set on Py3 if cline
    return py_code;
bad:
    Py_XDECREF(py_funcname);
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(py_srcfile);
    #endif
    return NULL;
}
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyFrameObject *py_frame = 0;
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    PyObject *ptype, *pvalue, *ptraceback;
    if (c_line) {
        c_line = __Pyx_CLineForTraceback(tstate, c_line);
    }
    py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
    if (!py_code) {
        __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
        py_code = __Pyx_CreateCodeObjectForTraceback(
            funcname, c_line, py_line, filename);
        if (!py_code) {
            /* If the code object creation fails, then we should clear the
               fetched exception references and propagate the new exception */
            Py_XDECREF(ptype);
            Py_XDECREF(pvalue);
            Py_XDECREF(ptraceback);
            goto bad;
        }
        __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
        __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
    }
    py_frame = PyFrame_New(
        tstate,            /*PyThreadState *tstate,*/
        py_code,           /*PyCodeObject *code,*/
        __pyx_d,    /*PyObject *globals,*/
        0                  /*PyObject *locals*/
    );
    if (!py_frame) goto bad;
    __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
    PyTraceBack_Here(py_frame);
bad:
    Py_XDECREF(py_code);
    Py_XDECREF(py_frame);
}

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

/* FromPyCTupleUtility */
static __pyx_ctuple_int__and_int__and_int __pyx_convert__from_py___pyx_ctuple_int__and_int__and_int(PyObject * o) {
    __pyx_ctuple_int__and_int__and_int result;
    if (!PyTuple_Check(o) || PyTuple_GET_SIZE(o) != 3) {
        PyErr_Format(PyExc_TypeError, "Expected %.16s of size %d, got %.200s", "a tuple", 3, Py_TYPE(o)->tp_name);
        goto bad;
    }
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        result.f0 = __Pyx_PyInt_As_int(PyTuple_GET_ITEM(o, 0));
        if ((result.f0 == (int)-1) && PyErr_Occurred()) goto bad;
        result.f1 = __Pyx_PyInt_As_int(PyTuple_GET_ITEM(o, 1));
        if ((result.f1 == (int)-1) && PyErr_Occurred()) goto bad;
        result.f2 = __Pyx_PyInt_As_int(PyTuple_GET_ITEM(o, 2));
        if ((result.f2 == (int)-1) && PyErr_Occurred()) goto bad;
#else
    {
        PyObject *item;
        item = PySequence_ITEM(o, 0);  if (unlikely(!item)) goto bad;
        result.f0 = __Pyx_PyInt_As_int(item);
        Py_DECREF(item);
        if ((result.f0 == (int)-1) && PyErr_Occurred()) goto bad;
        item = PySequence_ITEM(o, 1);  if (unlikely(!item)) goto bad;
        result.f1 = __Pyx_PyInt_As_int(item);
        Py_DECREF(item);
        if ((result.f1 == (int)-1) && PyErr_Occurred()) goto bad;
        item = PySequence_ITEM(o, 2);  if (unlikely(!item)) goto bad;
        result.f2 = __Pyx_PyInt_As_int(item);
        Py_DECREF(item);
        if ((result.f2 == (int)-1) && PyErr_Occurred()) goto bad;
    }
#endif
    return result;
bad:
    return result;
}

/* FromPyCTupleUtility */
static __pyx_ctuple_int__and_int __pyx_convert__from_py___pyx_ctuple_int__and_int(PyObject * o) {
    __pyx_ctuple_int__and_int result;
    if (!PyTuple_Check(o) || PyTuple_GET_SIZE(o) != 2) {
        PyErr_Format(PyExc_TypeError, "Expected %.16s of size %d, got %.200s", "a tuple", 2, Py_TYPE(o)->tp_name);
        goto bad;
    }
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        result.f0 = __Pyx_PyInt_As_int(PyTuple_GET_ITEM(o, 0));
        if ((result.f0 == (int)-1) && PyErr_Occurred()) goto bad;
        result.f1 = __Pyx_PyInt_As_int(PyTuple_GET_ITEM(o, 1));
        if ((result.f1 == (int)-1) && PyErr_Occurred()) goto bad;
#else
    {
        PyObject *item;
        item = PySequence_ITEM(o, 0);  if (unlikely(!item)) goto bad;
        result.f0 = __Pyx_PyInt_As_int(item);
        Py_DECREF(item);
        if ((result.f0 == (int)-1) && PyErr_Occurred()) goto bad;
        item = PySequence_ITEM(o, 1);  if (unlikely(!item)) goto bad;
        result.f1 = __Pyx_PyInt_As_int(item);
        Py_DECREF(item);
        if ((result.f1 == (int)-1) && PyErr_Occurred()) goto bad;
    }
#endif
    return result;
bad:
    return result;
}

/* Declarations */
#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
      return ::std::complex< float >(x, y);
    }
  #else
    static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
      return x + y*(__pyx_t_float_complex)_Complex_I;
    }
  #endif
#else
    static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
      __pyx_t_float_complex z;
      z.real = x;
      z.imag = y;
      return z;
    }
#endif

/* Arithmetic */
#if CYTHON_CCOMPLEX
#else
    static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
       return (a.real == b.real) && (a.imag == b.imag);
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
        __pyx_t_float_complex z;
        z.real = a.real + b.real;
        z.imag = a.imag + b.imag;
        return z;
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
        __pyx_t_float_complex z;
        z.real = a.real - b.real;
        z.imag = a.imag - b.imag;
        return z;
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
        __pyx_t_float_complex z;
        z.real = a.real * b.real - a.imag * b.imag;
        z.imag = a.real * b.imag + a.imag * b.real;
        return z;
    }
    #if 1
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
        if (b.imag == 0) {
            return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
        } else if (fabsf(b.real) >= fabsf(b.imag)) {
            if (b.real == 0 && b.imag == 0) {
                return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
            } else {
                float r = b.imag / b.real;
                float s = (float)(1.0) / (b.real + b.imag * r);
                return __pyx_t_float_complex_from_parts(
                    (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
            }
        } else {
            float r = b.real / b.imag;
            float s = (float)(1.0) / (b.imag + b.real * r);
            return __pyx_t_float_complex_from_parts(
                (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
        }
    }
    #else
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
        if (b.imag == 0) {
            return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
        } else {
            float denom = b.real * b.real + b.imag * b.imag;
            return __pyx_t_float_complex_from_parts(
                (a.real * b.real + a.imag * b.imag) / denom,
                (a.imag * b.real - a.real * b.imag) / denom);
        }
    }
    #endif
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
        __pyx_t_float_complex z;
        z.real = -a.real;
        z.imag = -a.imag;
        return z;
    }
    static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
       return (a.real == 0) && (a.imag == 0);
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
        __pyx_t_float_complex z;
        z.real =  a.real;
        z.imag = -a.imag;
        return z;
    }
    #if 1
        static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
          #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
            return sqrtf(z.real*z.real + z.imag*z.imag);
          #else
            return hypotf(z.real, z.imag);
          #endif
        }
        static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
            __pyx_t_float_complex z;
            float r, lnr, theta, z_r, z_theta;
            if (b.imag == 0 && b.real == (int)b.real) {
                if (b.real < 0) {
                    float denom = a.real * a.real + a.imag * a.imag;
                    a.real = a.real / denom;
                    a.imag = -a.imag / denom;
                    b.real = -b.real;
                }
                switch ((int)b.real) {
                    case 0:
                        z.real = 1;
                        z.imag = 0;
                        return z;
                    case 1:
                        return a;
                    case 2:
                        return __Pyx_c_prod_float(a, a);
                    case 3:
                        z = __Pyx_c_prod_float(a, a);
                        return __Pyx_c_prod_float(z, a);
                    case 4:
                        z = __Pyx_c_prod_float(a, a);
                        return __Pyx_c_prod_float(z, z);
                }
            }
            if (a.imag == 0) {
                if (a.real == 0) {
                    return a;
                } else if (b.imag == 0) {
                    z.real = powf(a.real, b.real);
                    z.imag = 0;
                    return z;
                } else if (a.real > 0) {
                    r = a.real;
                    theta = 0;
                } else {
                    r = -a.real;
                    theta = atan2f(0.0, -1.0);
                }
            } else {
                r = __Pyx_c_abs_float(a);
                theta = atan2f(a.imag, a.real);
            }
            lnr = logf(r);
            z_r = expf(lnr * b.real - theta * b.imag);
            z_theta = theta * b.real + lnr * b.imag;
            z.real = z_r * cosf(z_theta);
            z.imag = z_r * sinf(z_theta);
            return z;
        }
    #endif
#endif

/* Declarations */
#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
      return ::std::complex< double >(x, y);
    }
  #else
    static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
      return x + y*(__pyx_t_double_complex)_Complex_I;
    }
  #endif
#else
    static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
      __pyx_t_double_complex z;
      z.real = x;
      z.imag = y;
      return z;
    }
#endif

/* Arithmetic */
#if CYTHON_CCOMPLEX
#else
    static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
       return (a.real == b.real) && (a.imag == b.imag);
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        __pyx_t_double_complex z;
        z.real = a.real + b.real;
        z.imag = a.imag + b.imag;
        return z;
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        __pyx_t_double_complex z;
        z.real = a.real - b.real;
        z.imag = a.imag - b.imag;
        return z;
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        __pyx_t_double_complex z;
        z.real = a.real * b.real - a.imag * b.imag;
        z.imag = a.real * b.imag + a.imag * b.real;
        return z;
    }
    #if 1
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        if (b.imag == 0) {
            return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
        } else if (fabs(b.real) >= fabs(b.imag)) {
            if (b.real == 0 && b.imag == 0) {
                return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
            } else {
                double r = b.imag / b.real;
                double s = (double)(1.0) / (b.real + b.imag * r);
                return __pyx_t_double_complex_from_parts(
                    (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
            }
        } else {
            double r = b.real / b.imag;
            double s = (double)(1.0) / (b.imag + b.real * r);
            return __pyx_t_double_complex_from_parts(
                (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
        }
    }
    #else
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        if (b.imag == 0) {
            return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
        } else {
            double denom = b.real * b.real + b.imag * b.imag;
            return __pyx_t_double_complex_from_parts(
                (a.real * b.real + a.imag * b.imag) / denom,
                (a.imag * b.real - a.real * b.imag) / denom);
        }
    }
    #endif
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
        __pyx_t_double_complex z;
        z.real = -a.real;
        z.imag = -a.imag;
        return z;
    }
    static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
       return (a.real == 0) && (a.imag == 0);
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
        __pyx_t_double_complex z;
        z.real =  a.real;
        z.imag = -a.imag;
        return z;
    }
    #if 1
        static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
          #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
            return sqrt(z.real*z.real + z.imag*z.imag);
          #else
            return hypot(z.real, z.imag);
          #endif
        }
        static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
            __pyx_t_double_complex z;
            double r, lnr, theta, z_r, z_theta;
            if (b.imag == 0 && b.real == (int)b.real) {
                if (b.real < 0) {
                    double denom = a.real * a.real + a.imag * a.imag;
                    a.real = a.real / denom;
                    a.imag = -a.imag / denom;
                    b.real = -b.real;
                }
                switch ((int)b.real) {
                    case 0:
                        z.real = 1;
                        z.imag = 0;
                        return z;
                    case 1:
                        return a;
                    case 2:
                        return __Pyx_c_prod_double(a, a);
                    case 3:
                        z = __Pyx_c_prod_double(a, a);
                        return __Pyx_c_prod_double(z, a);
                    case 4:
                        z = __Pyx_c_prod_double(a, a);
                        return __Pyx_c_prod_double(z, z);
                }
            }
            if (a.imag == 0) {
                if (a.real == 0) {
                    return a;
                } else if (b.imag == 0) {
                    z.real = pow(a.real, b.real);
                    z.imag = 0;
                    return z;
                } else if (a.real > 0) {
                    r = a.real;
                    theta = 0;
                } else {
                    r = -a.real;
                    theta = atan2(0.0, -1.0);
                }
            } else {
                r = __Pyx_c_abs_double(a);
                theta = atan2(a.imag, a.real);
            }
            lnr = log(r);
            z_r = exp(lnr * b.real - theta * b.imag);
            z_theta = theta * b.real + lnr * b.imag;
            z.real = z_r * cos(z_theta);
            z.imag = z_r * sin(z_theta);
            return z;
        }
    #endif
#endif

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const int neg_one = (int) -1, const_zero = (int) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(int) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(int) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(int) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(int),
                                     little, !is_unsigned);
    }
}

/* CIntFromPy */
static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const int neg_one = (int) -1, const_zero = (int) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(int) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (int) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int) 0;
                case  1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
                case 2:
                    if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
                            return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
                            return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
                            return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (int) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(int) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int) 0;
                case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(int,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                            return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                            return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
                            return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(int) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            int val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (int) -1;
        }
    } else {
        int val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (int) -1;
        val = __Pyx_PyInt_As_int(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to int");
    return (int) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to int");
    return (int) -1;
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_char(char value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const char neg_one = (char) -1, const_zero = (char) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(char) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(char) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(char) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(char),
                                     little, !is_unsigned);
    }
}

/* CIntFromPy */
static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const char neg_one = (char) -1, const_zero = (char) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(char) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (char) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (char) 0;
                case  1: __PYX_VERIFY_RETURN_INT(char, digit, digits[0])
                case 2:
                    if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(char) >= 2 * PyLong_SHIFT) {
                            return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(char) >= 3 * PyLong_SHIFT) {
                            return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(char) >= 4 * PyLong_SHIFT) {
                            return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (char) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(char) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (char) 0;
                case -1: __PYX_VERIFY_RETURN_INT(char, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(char,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(char) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
                            return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
                            return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
                            return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
                            return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
                            return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
                            return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(char) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            char val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (char) -1;
        }
    } else {
        char val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (char) -1;
        val = __Pyx_PyInt_As_char(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to char");
    return (char) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to char");
    return (char) -1;
}

/* CIntFromPy */
static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const long neg_one = (long) -1, const_zero = (long) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(long) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (long) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (long) 0;
                case  1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
                case 2:
                    if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
                            return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
                            return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
                            return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (long) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(long) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (long) 0;
                case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(long,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                            return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                            return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                            return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(long) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            long val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (long) -1;
        }
    } else {
        long val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (long) -1;
        val = __Pyx_PyInt_As_long(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to long");
    return (long) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to long");
    return (long) -1;
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const long neg_one = (long) -1, const_zero = (long) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(long) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(long) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(long),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const Py_intptr_t neg_one = (Py_intptr_t) -1, const_zero = (Py_intptr_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(Py_intptr_t) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(Py_intptr_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(Py_intptr_t) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(Py_intptr_t) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(Py_intptr_t) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(Py_intptr_t),
                                     little, !is_unsigned);
    }
}

/* FastTypeChecks */
#if CYTHON_COMPILING_IN_CPYTHON
static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
    while (a) {
        a = a->tp_base;
        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);
}
#if PY_MAJOR_VERSION == 2
static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
    PyObject *exception, *value, *tb;
    int res;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&exception, &value, &tb);
    res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
    if (unlikely(res == -1)) {
        PyErr_WriteUnraisable(err);
        res = 0;
    }
    if (!res) {
        res = PyObject_IsSubclass(err, exc_type2);
        if (unlikely(res == -1)) {
            PyErr_WriteUnraisable(err);
            res = 0;
        }
    }
    __Pyx_ErrRestore(exception, value, tb);
    return res;
}
#else
static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
    int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
    if (!res) {
        res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
    }
    return res;
}
#endif
static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
    Py_ssize_t i, n;
    assert(PyExceptionClass_Check(exc_type));
    n = PyTuple_GET_SIZE(tuple);
#if PY_MAJOR_VERSION >= 3
    for (i=0; i<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
#endif
    for (i=0; i<n; i++) {
        PyObject *t = PyTuple_GET_ITEM(tuple, i);
        #if PY_MAJOR_VERSION < 3
        if (likely(exc_type == t)) return 1;
        #endif
        if (likely(PyExceptionClass_Check(t))) {
            if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
        } else {
        }
    }
    return 0;
}
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
    if (likely(err == exc_type)) return 1;
    if (likely(PyExceptionClass_Check(err))) {
        if (likely(PyExceptionClass_Check(exc_type))) {
            return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
        } else if (likely(PyTuple_Check(exc_type))) {
            return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
        } else {
        }
    }
    return PyErr_GivenExceptionMatches(err, exc_type);
}
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
    assert(PyExceptionClass_Check(exc_type1));
    assert(PyExceptionClass_Check(exc_type2));
    if (likely(err == exc_type1 || err == exc_type2)) return 1;
    if (likely(PyExceptionClass_Check(err))) {
        return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
    }
    return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
}
#endif

/* CheckBinaryVersion */
static int __Pyx_check_binary_version(void) {
    char ctversion[5];
    int same=1, i, found_dot;
    const char* rt_from_call = Py_GetVersion();
    PyOS_snprintf(ctversion, 5, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
    found_dot = 0;
    for (i = 0; i < 4; i++) {
        if (!ctversion[i]) {
            same = (rt_from_call[i] < '0' || rt_from_call[i] > '9');
            break;
        }
        if (rt_from_call[i] != ctversion[i]) {
            same = 0;
            break;
        }
    }
    if (!same) {
        char rtversion[5] = {'\0'};
        char message[200];
        for (i=0; i<4; ++i) {
            if (rt_from_call[i] == '.') {
                if (found_dot) break;
                found_dot = 1;
            } else if (rt_from_call[i] < '0' || rt_from_call[i] > '9') {
                break;
            }
            rtversion[i] = rt_from_call[i];
        }
        PyOS_snprintf(message, sizeof(message),
                      "compiletime version %s of module '%.100s' "
                      "does not match runtime version %s",
                      ctversion, __Pyx_MODULE_NAME, rtversion);
        return PyErr_WarnEx(NULL, message, 1);
    }
    return 0;
}

/* InitStrings */
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
    while (t->p) {
        #if PY_MAJOR_VERSION < 3
        if (t->is_unicode) {
            *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
        } else if (t->intern) {
            *t->p = PyString_InternFromString(t->s);
        } else {
            *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
        }
        #else
        if (t->is_unicode | t->is_str) {
            if (t->intern) {
                *t->p = PyUnicode_InternFromString(t->s);
            } else if (t->encoding) {
                *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
            } else {
                *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
            }
        } else {
            *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
        }
        #endif
        if (!*t->p)
            return -1;
        if (PyObject_Hash(*t->p) == -1)
            return -1;
        ++t;
    }
    return 0;
}

static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
    return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
}
static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
    Py_ssize_t ignore;
    return __Pyx_PyObject_AsStringAndSize(o, &ignore);
}
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
#if !CYTHON_PEP393_ENABLED
static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
    char* defenc_c;
    PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
    if (!defenc) return NULL;
    defenc_c = PyBytes_AS_STRING(defenc);
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
    {
        char* end = defenc_c + PyBytes_GET_SIZE(defenc);
        char* c;
        for (c = defenc_c; c < end; c++) {
            if ((unsigned char) (*c) >= 128) {
                PyUnicode_AsASCIIString(o);
                return NULL;
            }
        }
    }
#endif
    *length = PyBytes_GET_SIZE(defenc);
    return defenc_c;
}
#else
static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
    if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
    if (likely(PyUnicode_IS_ASCII(o))) {
        *length = PyUnicode_GET_LENGTH(o);
        return PyUnicode_AsUTF8(o);
    } else {
        PyUnicode_AsASCIIString(o);
        return NULL;
    }
#else
    return PyUnicode_AsUTF8AndSize(o, length);
#endif
}
#endif
#endif
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
    if (
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
            __Pyx_sys_getdefaultencoding_not_ascii &&
#endif
            PyUnicode_Check(o)) {
        return __Pyx_PyUnicode_AsStringAndSize(o, length);
    } else
#endif
#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
    if (PyByteArray_Check(o)) {
        *length = PyByteArray_GET_SIZE(o);
        return PyByteArray_AS_STRING(o);
    } else
#endif
    {
        char* result;
        int r = PyBytes_AsStringAndSize(o, &result, length);
        if (unlikely(r < 0)) {
            return NULL;
        } else {
            return result;
        }
    }
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
   int is_true = x == Py_True;
   if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
   else return PyObject_IsTrue(x);
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
    int retval;
    if (unlikely(!x)) return -1;
    retval = __Pyx_PyObject_IsTrue(x);
    Py_DECREF(x);
    return retval;
}
static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
#if PY_MAJOR_VERSION >= 3
    if (PyLong_Check(result)) {
        if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
                "__int__ returned non-int (type %.200s).  "
                "The ability to return an instance of a strict subclass of int "
                "is deprecated, and may be removed in a future version of Python.",
                Py_TYPE(result)->tp_name)) {
            Py_DECREF(result);
            return NULL;
        }
        return result;
    }
#endif
    PyErr_Format(PyExc_TypeError,
                 "__%.4s__ returned non-%.4s (type %.200s)",
                 type_name, type_name, Py_TYPE(result)->tp_name);
    Py_DECREF(result);
    return NULL;
}
static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
#if CYTHON_USE_TYPE_SLOTS
  PyNumberMethods *m;
#endif
  const char *name = NULL;
  PyObject *res = NULL;
#if PY_MAJOR_VERSION < 3
  if (likely(PyInt_Check(x) || PyLong_Check(x)))
#else
  if (likely(PyLong_Check(x)))
#endif
    return __Pyx_NewRef(x);
#if CYTHON_USE_TYPE_SLOTS
  m = Py_TYPE(x)->tp_as_number;
  #if PY_MAJOR_VERSION < 3
  if (m && m->nb_int) {
    name = "int";
    res = m->nb_int(x);
  }
  else if (m && m->nb_long) {
    name = "long";
    res = m->nb_long(x);
  }
  #else
  if (likely(m && m->nb_int)) {
    name = "int";
    res = m->nb_int(x);
  }
  #endif
#else
  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
    res = PyNumber_Int(x);
  }
#endif
  if (likely(res)) {
#if PY_MAJOR_VERSION < 3
    if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
#else
    if (unlikely(!PyLong_CheckExact(res))) {
#endif
        return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
    }
  }
  else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_TypeError,
                    "an integer is required");
  }
  return res;
}
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  Py_ssize_t ival;
  PyObject *x;
#if PY_MAJOR_VERSION < 3
  if (likely(PyInt_CheckExact(b))) {
    if (sizeof(Py_ssize_t) >= sizeof(long))
        return PyInt_AS_LONG(b);
    else
        return PyInt_AsSsize_t(b);
  }
#endif
  if (likely(PyLong_CheckExact(b))) {
    #if CYTHON_USE_PYLONG_INTERNALS
    const digit* digits = ((PyLongObject*)b)->ob_digit;
    const Py_ssize_t size = Py_SIZE(b);
    if (likely(__Pyx_sst_abs(size) <= 1)) {
        ival = likely(size) ? digits[0] : 0;
        if (size == -1) ival = -ival;
        return ival;
    } else {
      switch (size) {
         case 2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
      }
    }
    #endif
    return PyLong_AsSsize_t(b);
  }
  x = PyNumber_Index(b);
  if (!x) return -1;
  ival = PyInt_AsSsize_t(x);
  Py_DECREF(x);
  return ival;
}
static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
  if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) {
    return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
#if PY_MAJOR_VERSION < 3
  } else if (likely(PyInt_CheckExact(o))) {
    return PyInt_AS_LONG(o);
#endif
  } else {
    Py_ssize_t ival;
    PyObject *x;
    x = PyNumber_Index(o);
    if (!x) return -1;
    ival = PyInt_AsLong(x);
    Py_DECREF(x);
    return ival;
  }
}
static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
  return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
}
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
    return PyInt_FromSize_t(ival);
}


#endif /* Py_PYTHON_H */
