/* Generated by Cython 3.0.12 */

/* BEGIN: Cython Metadata
{
    "distutils": {
        "extra_compile_args": [
            "-O3"
        ],
        "name": "ete4.core.tree",
        "sources": [
            "ete4/core/tree.pyx"
        ]
    },
    "module_name": "ete4.core.tree"
}
END: Cython Metadata */

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

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

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

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

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

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

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

#define __PYX_HAVE__ete4__core__tree
#define __PYX_HAVE_API__ete4__core__tree
/* Early includes */
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */

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

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

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


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

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

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

static const char *__pyx_f[] = {
  "ete4/core/tree.pyx",
  "<stringsource>",
};
/* #### Code section: utility_code_proto_before_types ### */
/* ForceInitThreads.proto */
#ifndef __PYX_FORCE_INIT_THREADS
  #define __PYX_FORCE_INIT_THREADS 0
#endif

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

/*--- Type declarations ---*/
struct __pyx_obj_4ete4_4core_4tree_Tree;
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct__genexpr;
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_1___getitem__;
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_2_genexpr;
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_3___contains__;
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_4_genexpr;
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_5___iter__;
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_6_remove_child;
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_7_genexpr;
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_8_prune;
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_9_leaves;
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_10_leaf_names;
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_11_descendants;
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_12_traverse;
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_13_iter_prepostorder;
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_14_ancestors;
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_15_lineage;
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_16_search_nodes;
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_17_genexpr;
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_18_search_descendants;
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_19_search_ancestors;
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_20_genexpr;
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_21_get_distance;
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_22_genexpr;
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_23_genexpr;
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_24_sort_descendants;
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_25_get_cached_content;
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds;
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_27_genexpr;
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_28_genexpr;
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_29_genexpr;
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_30_genexpr;
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_31_from_common;
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_32_genexpr;
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_33_genexpr;
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_34_genexpr;
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_35_genexpr;
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_36_genexpr;
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_37_genexpr;
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_38_compare;
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_39_edges;
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_40_get_topology_id;
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_41_genexpr;
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_42_genexpr;
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_43_is_monophyletic;
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_44_genexpr;
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_45_check_monophyly;
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_46_genexpr;
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_47_genexpr;
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_48_get_monophyletic;
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_49_expand_polytomies;
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_50_add_leaf;
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_51_enum_unordered;
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_52_genexpr;
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_53_from_parent_child_table;
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_54_from_skbio;
struct __pyx_ctuple_double__and_double;
typedef struct __pyx_ctuple_double__and_double __pyx_ctuple_double__and_double;

/* "ete4/core/tree.pyx":39
 *     cdef public dict props
 *     cdef public list _children
 *     cdef public (double, double) size  # sum of lengths, number of leaves             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, data=None, children=None, parser=None):
 */
struct __pyx_ctuple_double__and_double {
  double f0;
  double f1;
};

/* "ete4/core/tree.pyx":30
 * 
 * 
 * cdef class Tree:             # <<<<<<<<<<<<<<
 *     """
 *     A Tree has a collection of Tree instances connected in a hierarchical way.
 */
struct __pyx_obj_4ete4_4core_4tree_Tree {
  PyObject_HEAD
  struct __pyx_obj_4ete4_4core_4tree_Tree *up;
  PyObject *props;
  PyObject *_children;
  __pyx_ctuple_double__and_double size;
};


/* "ete4/core/tree.pyx":192
 *     def __len__(self):
 *         """Return the number of leaves."""
 *         return sum(1 for _ in self.leaves())             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, node_id):
 */
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct__genexpr {
  PyObject_HEAD
  PyObject *__pyx_genexpr_arg_0;
  PyObject *__pyx_v__;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "ete4/core/tree.pyx":194
 *         return sum(1 for _ in self.leaves())
 * 
 *     def __getitem__(self, node_id):             # <<<<<<<<<<<<<<
 *         """Return the node that matches the given node_id."""
 *         try:
 */
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_1___getitem__ {
  PyObject_HEAD
  PyObject *__pyx_v_node_id;
};


/* "ete4/core/tree.pyx":198
 *         try:
 *             if type(node_id) == str:    # node_id can be the name of a node
 *                 return next(n for n in self.traverse() if n.name == node_id)             # <<<<<<<<<<<<<<
 *             elif type(node_id) == int:  # or the index of a child
 *                 return self.children[node_id]
 */
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_2_genexpr {
  PyObject_HEAD
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_1___getitem__ *__pyx_outer_scope;
  PyObject *__pyx_genexpr_arg_0;
  PyObject *__pyx_v_n;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "ete4/core/tree.pyx":244
 *                                px, py, px0, cascade)
 * 
 *     def __contains__(self, node):             # <<<<<<<<<<<<<<
 *         """Return True if the tree contains the given node.
 * 
 */
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_3___contains__ {
  PyObject_HEAD
  PyObject *__pyx_v_node;
};


/* "ete4/core/tree.pyx":252
 *             return node in self.traverse()
 *         elif type(node) == str:
 *             return any(n.name == node for n in self.traverse())             # <<<<<<<<<<<<<<
 *         else:
 *             raise TreeError('Can only check nodes or names in a Tree')
 */
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_4_genexpr {
  PyObject_HEAD
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_3___contains__ *__pyx_outer_scope;
  PyObject *__pyx_genexpr_arg_0;
  PyObject *__pyx_v_n;
};


/* "ete4/core/tree.pyx":256
 *             raise TreeError('Can only check nodes or names in a Tree')
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         """Yield all the terminal nodes (leaves)."""
 *         yield from self.leaves()
 */
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_5___iter__ {
  PyObject_HEAD
  struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self;
};


/* "ete4/core/tree.pyx":319
 *             raise TreeError(f'Cannot pop child: not found ({e})')
 * 
 *     def remove_child(self, child):             # <<<<<<<<<<<<<<
 *         """Remove child from this node and return it.
 * 
 */
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_6_remove_child {
  PyObject_HEAD
  PyObject *__pyx_v_child;
};


/* "ete4/core/tree.pyx":327
 *         try:
 *             if type(child) == str:  # translate into a node
 *                 child = next(n for n in self.children if n.name == child)             # <<<<<<<<<<<<<<
 * 
 *             self.children.remove(child)  # parent removes child
 */
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_7_genexpr {
  PyObject_HEAD
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_6_remove_child *__pyx_outer_scope;
  PyObject *__pyx_genexpr_arg_0;
  PyObject *__pyx_v_n;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "ete4/core/tree.pyx":429
 *         return self
 * 
 *     def prune(self, nodes, preserve_branch_length=False):             # <<<<<<<<<<<<<<
 *         """Prune the topology conserving only the given nodes.
 * 
 */
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_8_prune {
  PyObject_HEAD
  PyObject *__pyx_v_n2depth;
};


/* "ete4/core/tree.pyx":563
 *                 if not self.is_root else [])
 * 
 *     def leaves(self, is_leaf_fn=None):             # <<<<<<<<<<<<<<
 *         """Yield the terminal nodes (leaves) under this node."""
 *         is_leaf = is_leaf_fn or (lambda n: n.is_leaf)
 */
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_9_leaves {
  PyObject_HEAD
  PyObject *__pyx_v_is_leaf;
  PyObject *__pyx_v_is_leaf_fn;
  PyObject *__pyx_v_node;
  struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "ete4/core/tree.pyx":570
 *                 yield node
 * 
 *     def leaf_names(self, is_leaf_fn=None):             # <<<<<<<<<<<<<<
 *         """Yield the leaf names under this node."""
 *         for leaf in self.leaves(is_leaf_fn):
 */
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_10_leaf_names {
  PyObject_HEAD
  PyObject *__pyx_v_is_leaf_fn;
  PyObject *__pyx_v_leaf;
  struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "ete4/core/tree.pyx":575
 *             yield leaf.name
 * 
 *     def descendants(self, strategy='levelorder', is_leaf_fn=None):             # <<<<<<<<<<<<<<
 *         """Yield all descendant nodes."""
 *         for node in self.traverse(strategy, is_leaf_fn):
 */
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_11_descendants {
  PyObject_HEAD
  PyObject *__pyx_v_is_leaf_fn;
  PyObject *__pyx_v_node;
  struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self;
  PyObject *__pyx_v_strategy;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "ete4/core/tree.pyx":581
 *                 yield node
 * 
 *     def traverse(self, strategy='levelorder', is_leaf_fn=None):             # <<<<<<<<<<<<<<
 *         """Traverse the tree structure under this node and yield the nodes.
 * 
 */
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_12_traverse {
  PyObject_HEAD
  PyObject *__pyx_v_is_leaf_fn;
  struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self;
  PyObject *__pyx_v_strategy;
};


/* "ete4/core/tree.pyx":606
 *             raise TreeError(f'Unknown strategy: {strategy}')
 * 
 *     def iter_prepostorder(self, is_leaf_fn=None):             # <<<<<<<<<<<<<<
 *         """Yield all nodes in a tree in both pre and post order.
 * 
 */
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_13_iter_prepostorder {
  PyObject_HEAD
  PyObject *__pyx_v_is_leaf_fn;
  PyObject *__pyx_v_node;
  PyObject *__pyx_v_path;
  PyObject *__pyx_v_seen;
  struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "ete4/core/tree.pyx":621
 *                 path.append(node)
 * 
 *     def ancestors(self, root=None, include_root=True):             # <<<<<<<<<<<<<<
 *         """Yield all ancestor nodes of this node (up to the root if given)."""
 *         # root === n1 === n2 === .. === nN === node  ->  [nN, .., n2, n1, root]
 */
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_14_ancestors {
  PyObject_HEAD
  PyObject *__pyx_v_include_root;
  struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_node;
  PyObject *__pyx_v_root;
  struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self;
};


/* "ete4/core/tree.pyx":636
 *             yield root
 * 
 *     def lineage(self, root=None, include_root=True):             # <<<<<<<<<<<<<<
 *         """Yield all nodes in the lineage of this node (up to root if given)."""
 *         if not include_root and self is root:
 */
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_15_lineage {
  PyObject_HEAD
  PyObject *__pyx_v_include_root;
  PyObject *__pyx_v_root;
  struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self;
};


/* "ete4/core/tree.pyx":728
 *         return root
 * 
 *     def search_nodes(self, **conditions):             # <<<<<<<<<<<<<<
 *         """Yield nodes matching the given conditions.
 * 
 */
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_16_search_nodes {
  PyObject_HEAD
  PyObject *__pyx_v_conditions;
  PyObject *__pyx_v_genexpr;
  PyObject *__pyx_v_node;
  struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "ete4/core/tree.pyx":737
 *         """
 *         for node in self.traverse():
 *             if all(node.get_prop(k) == v for k, v in conditions.items()):             # <<<<<<<<<<<<<<
 *                 yield node
 * 
 */
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_17_genexpr {
  PyObject_HEAD
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_16_search_nodes *__pyx_outer_scope;
  PyObject *__pyx_genexpr_arg_0;
  PyObject *__pyx_v_k;
  PyObject *__pyx_v_v;
};


/* "ete4/core/tree.pyx":740
 *                 yield node
 * 
 *     def search_descendants(self, **conditions):             # <<<<<<<<<<<<<<
 *         """Yield descendant nodes matching the given conditions."""
 *         for node in self.search_nodes(**conditions):
 */
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_18_search_descendants {
  PyObject_HEAD
  PyObject *__pyx_v_conditions;
  PyObject *__pyx_v_node;
  struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "ete4/core/tree.pyx":746
 *                 yield node
 * 
 *     def search_ancestors(self, **conditions):             # <<<<<<<<<<<<<<
 *         """Yield ancestor nodes matching the given conditions."""
 *         for node in self.ancestors():
 */
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_19_search_ancestors {
  PyObject_HEAD
  PyObject *__pyx_v_conditions;
  PyObject *__pyx_v_genexpr;
  PyObject *__pyx_v_node;
  struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "ete4/core/tree.pyx":749
 *         """Yield ancestor nodes matching the given conditions."""
 *         for node in self.ancestors():
 *             if all(node.get_prop(k) == v for k, v in conditions.items()):             # <<<<<<<<<<<<<<
 *                 yield node
 * 
 */
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_20_genexpr {
  PyObject_HEAD
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_19_search_ancestors *__pyx_outer_scope;
  PyObject *__pyx_genexpr_arg_0;
  PyObject *__pyx_v_k;
  PyObject *__pyx_v_v;
};


/* "ete4/core/tree.pyx":760
 *     # ###########################
 * 
 *     def get_distance(self, node1, node2, topological=False):             # <<<<<<<<<<<<<<
 *         """Return the distance between the given nodes.
 * 
 */
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_21_get_distance {
  PyObject_HEAD
  PyObject *__pyx_v_d;
};


/* "ete4/core/tree.pyx":774
 *         root = self.root.common_ancestor([node1, node2])  # common root
 * 
 *         return (sum(d(n) for n in node1.lineage(root, include_root=False)) +             # <<<<<<<<<<<<<<
 *                 sum(d(n) for n in node2.lineage(root, include_root=False)))
 * 
 */
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_22_genexpr {
  PyObject_HEAD
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_21_get_distance *__pyx_outer_scope;
  PyObject *__pyx_genexpr_arg_0;
  PyObject *__pyx_v_n;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "ete4/core/tree.pyx":775
 * 
 *         return (sum(d(n) for n in node1.lineage(root, include_root=False)) +
 *                 sum(d(n) for n in node2.lineage(root, include_root=False)))             # <<<<<<<<<<<<<<
 * 
 *     def get_farthest_node(self, topological=False):
 */
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_23_genexpr {
  PyObject_HEAD
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_21_get_distance *__pyx_outer_scope;
  PyObject *__pyx_genexpr_arg_0;
  PyObject *__pyx_v_n;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "ete4/core/tree.pyx":1114
 *         ops.ladderize(self, topological, reverse)
 * 
 *     def sort_descendants(self, prop='name'):             # <<<<<<<<<<<<<<
 *         """Sort branches by leaf node values (names or any other given prop)."""
 *         leaf_values = self.get_cached_content(prop, container_type=list)
 */
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_24_sort_descendants {
  PyObject_HEAD
  PyObject *__pyx_v_leaf_values;
};


/* "ete4/core/tree.pyx":1119
 *         ops.sort(self, key=lambda node: tuple(sorted(leaf_values[node])))
 * 
 *     def get_cached_content(self, prop=None, container_type=set,             # <<<<<<<<<<<<<<
 *                            leaves_only=True):
 *         """Return dict that assigns to each node a set of its leaves.
 */
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_25_get_cached_content {
  PyObject_HEAD
  PyObject *__pyx_v_prop;
  struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self;
};


/* "ete4/core/tree.pyx":1158
 *         return leaves
 * 
 *     def robinson_foulds(self, t2, prop_t1='name', prop_t2='name',             # <<<<<<<<<<<<<<
 *                         unrooted_trees=False, expand_polytomies=False,
 *                         polytomy_size_limit=5, skip_large_polytomies=False,
 */
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds {
  PyObject_HEAD
  PyObject *__pyx_v_common;
  PyObject *__pyx_v_discard_t1;
  PyObject *__pyx_v_discard_t2;
  PyObject *__pyx_v_edges1;
  PyObject *__pyx_v_edges2;
  PyObject *__pyx_v_from_common;
  PyObject *__pyx_v_has_prop;
  PyObject *__pyx_9genexpr23__pyx_v_leaves;
  PyObject *__pyx_9genexpr27__pyx_v_leaves;
  PyObject *__pyx_v_prop_t1;
  PyObject *__pyx_v_prop_t2;
};


/* "ete4/core/tree.pyx":1207
 * 
 *         # Check for duplicated items (is it necessary? can we optimize? what's the impact in performance?')
 *         size1 = sum(1 for n in origin_t if n.get_prop(prop_t1) in common)             # <<<<<<<<<<<<<<
 *         size2 = sum(1 for n in target_t if n.get_prop(prop_t2) in common)
 * 
 */
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_27_genexpr {
  PyObject_HEAD
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds *__pyx_outer_scope;
  struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_genexpr_arg_0;
  PyObject *__pyx_v_n;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "ete4/core/tree.pyx":1208
 *         # Check for duplicated items (is it necessary? can we optimize? what's the impact in performance?')
 *         size1 = sum(1 for n in origin_t if n.get_prop(prop_t1) in common)
 *         size2 = sum(1 for n in target_t if n.get_prop(prop_t2) in common)             # <<<<<<<<<<<<<<
 * 
 *         if size1 > len(common):
 */
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_28_genexpr {
  PyObject_HEAD
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds *__pyx_outer_scope;
  PyObject *__pyx_genexpr_arg_0;
  PyObject *__pyx_v_n;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "ete4/core/tree.pyx":1231
 *         polytomy_correction = 0
 *         if correct_by_polytomy_size:
 *             corr1 = sum(len(n.children) - 2 for n in origin_t.traverse() if len(n.children) > 2)             # <<<<<<<<<<<<<<
 *             corr2 = sum(len(n.children) - 2 for n in target_t.traverse() if len(n.children) > 2)
 * 
 */
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_29_genexpr {
  PyObject_HEAD
  PyObject *__pyx_genexpr_arg_0;
  PyObject *__pyx_v_n;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "ete4/core/tree.pyx":1232
 *         if correct_by_polytomy_size:
 *             corr1 = sum(len(n.children) - 2 for n in origin_t.traverse() if len(n.children) > 2)
 *             corr2 = sum(len(n.children) - 2 for n in target_t.traverse() if len(n.children) > 2)             # <<<<<<<<<<<<<<
 * 
 *             if corr1 > 0 and corr2 > 0:
 */
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_30_genexpr {
  PyObject_HEAD
  PyObject *__pyx_genexpr_arg_0;
  PyObject *__pyx_v_n;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "ete4/core/tree.pyx":1239
 *             polytomy_correction = max(corr1, corr2)
 * 
 *         def from_common(nodes, prop):  # helper function             # <<<<<<<<<<<<<<
 *             """Yield values (if existing in both trees) for property prop."""
 *             for node in nodes:
 */
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_31_from_common {
  PyObject_HEAD
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds *__pyx_outer_scope;
  PyObject *__pyx_v_node;
  PyObject *__pyx_v_nodes;
  PyObject *__pyx_v_prop;
  PyObject *__pyx_v_value;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "ete4/core/tree.pyx":1265
 * 
 *             if min_support_t1:
 *                 support_t1 = {tuple(sorted(from_common(leaves, prop_t1) for n in leaves)): branch.support or 0             # <<<<<<<<<<<<<<
 *                               for branch, leaves in t1_leaves.items()}
 * 
 */
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_32_genexpr {
  PyObject_HEAD
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds *__pyx_outer_scope;
  PyObject *__pyx_genexpr_arg_0;
  PyObject *__pyx_v_n;
};


/* "ete4/core/tree.pyx":1285
 * 
 *                 if min_support_t2:
 *                     support_t2 = {tuple(sorted(from_common(leaves, prop_t2) for n in leaves)): branch.support or 0             # <<<<<<<<<<<<<<
 *                                   for branch, leaves in t2_leaves.items()}
 * 
 */
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_33_genexpr {
  PyObject_HEAD
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds *__pyx_outer_scope;
  PyObject *__pyx_genexpr_arg_0;
  PyObject *__pyx_v_n;
};


/* "ete4/core/tree.pyx":1306
 *                 if unrooted_trees:
 *                     max_parts = (
 *                         sum(1 for p in edges1 - discard_t1 if len(p[0]) > 1 and len(p[1]) > 1) +             # <<<<<<<<<<<<<<
 *                         sum(1 for p in edges2 - discard_t2 if len(p[0]) > 1 and len(p[1]) > 1))
 *                 else:
 */
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_34_genexpr {
  PyObject_HEAD
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds *__pyx_outer_scope;
  PyObject *__pyx_genexpr_arg_0;
  PyObject *__pyx_v_p;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "ete4/core/tree.pyx":1307
 *                     max_parts = (
 *                         sum(1 for p in edges1 - discard_t1 if len(p[0]) > 1 and len(p[1]) > 1) +
 *                         sum(1 for p in edges2 - discard_t2 if len(p[0]) > 1 and len(p[1]) > 1))             # <<<<<<<<<<<<<<
 *                 else:
 *                     # Otherwise we need to count the actual number of valid
 */
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_35_genexpr {
  PyObject_HEAD
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds *__pyx_outer_scope;
  PyObject *__pyx_genexpr_arg_0;
  PyObject *__pyx_v_p;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "ete4/core/tree.pyx":1313
 *                     # partition of the two trees (only needed in rooted trees)
 *                     max_parts = (
 *                         sum(1 for p in edges1 - discard_t1 if len(p) > 1) +             # <<<<<<<<<<<<<<
 *                         sum(1 for p in edges2 - discard_t2 if len(p) > 1)) - 2
 * 
 */
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_36_genexpr {
  PyObject_HEAD
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds *__pyx_outer_scope;
  PyObject *__pyx_genexpr_arg_0;
  PyObject *__pyx_v_p;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "ete4/core/tree.pyx":1314
 *                     max_parts = (
 *                         sum(1 for p in edges1 - discard_t1 if len(p) > 1) +
 *                         sum(1 for p in edges2 - discard_t2 if len(p) > 1)) - 2             # <<<<<<<<<<<<<<
 * 
 *                 if not min_comparison or (min_comparison[0] is not None and min_comparison[0] > rf):
 */
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_37_genexpr {
  PyObject_HEAD
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds *__pyx_outer_scope;
  PyObject *__pyx_genexpr_arg_0;
  PyObject *__pyx_v_p;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "ete4/core/tree.pyx":1321
 *         return min_comparison
 * 
 *     def compare(self, ref_tree, use_collateral=False, min_support_source=0.0, min_support_ref=0.0,             # <<<<<<<<<<<<<<
 *                 has_duplications=False, expand_polytomies=False, unrooted=False,
 *                 max_treeko_splits_to_be_artifact=1000, ref_tree_attr='name', source_tree_attr='name'):
 */
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_38_compare {
  PyObject_HEAD
  PyObject *__pyx_v_expand_polytomies;
  PyObject *__pyx_v_min_support_ref;
  PyObject *__pyx_v_min_support_source;
  PyObject *__pyx_v_ref_tree_attr;
  PyObject *__pyx_v_source_tree_attr;
  PyObject *__pyx_v_unrooted;
};


/* "ete4/core/tree.pyx":1506
 *             raise TreeError(f'Unknown output for diff: {output}')
 * 
 *     def edges(self, cached_content=None):             # <<<<<<<<<<<<<<
 *         """Yield a pair of sets of leafs for every partition of the tree.
 * 
 */
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_39_edges {
  PyObject_HEAD
  PyObject *__pyx_v_all_leaves;
  PyObject *__pyx_v_cached_content;
  PyObject *__pyx_v_leaves_descendant;
  struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
};


/* "ete4/core/tree.pyx":1538
 *                          preserve_branch_length=preserve_branch_length)
 * 
 *     def get_topology_id(self, prop='name'):             # <<<<<<<<<<<<<<
 *         """Return a unique ID representing the topology of the tree.
 * 
 */
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_40_get_topology_id {
  PyObject_HEAD
  PyObject *__pyx_v_prop;
};


/* "ete4/core/tree.pyx":1554
 *         edge_keys = []
 *         for s1, s2 in self.edges():
 *             k1 = sorted(e.props.get(prop, getattr(e, prop)) for e in s1)             # <<<<<<<<<<<<<<
 *             k2 = sorted(e.props.get(prop, getattr(e, prop)) for e in s2)
 * 
 */
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_41_genexpr {
  PyObject_HEAD
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_40_get_topology_id *__pyx_outer_scope;
  PyObject *__pyx_genexpr_arg_0;
  PyObject *__pyx_v_e;
};


/* "ete4/core/tree.pyx":1555
 *         for s1, s2 in self.edges():
 *             k1 = sorted(e.props.get(prop, getattr(e, prop)) for e in s1)
 *             k2 = sorted(e.props.get(prop, getattr(e, prop)) for e in s2)             # <<<<<<<<<<<<<<
 * 
 *             edge_keys.append(sorted([k1, k2]))
 */
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_42_genexpr {
  PyObject_HEAD
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_40_get_topology_id *__pyx_outer_scope;
  PyObject *__pyx_genexpr_arg_0;
  PyObject *__pyx_v_e;
};


/* "ete4/core/tree.pyx":1565
 *         ops.to_ultrametric(self, topological)
 * 
 *     def is_monophyletic(self, nodes):             # <<<<<<<<<<<<<<
 *         """Return True if the nodes form a monophyletic group."""
 *         nodes = set(nodes)  # in case it is not a set already
 */
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_43_is_monophyletic {
  PyObject_HEAD
  PyObject *__pyx_v_nodes;
};


/* "ete4/core/tree.pyx":1568
 *         """Return True if the nodes form a monophyletic group."""
 *         nodes = set(nodes)  # in case it is not a set already
 *         return all(n in nodes for n in self.common_ancestor(nodes).leaves())             # <<<<<<<<<<<<<<
 * 
 *     def check_monophyly(self, values, prop='name', unrooted=False):
 */
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_44_genexpr {
  PyObject_HEAD
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_43_is_monophyletic *__pyx_outer_scope;
  PyObject *__pyx_genexpr_arg_0;
  PyObject *__pyx_v_n;
};


/* "ete4/core/tree.pyx":1570
 *         return all(n in nodes for n in self.common_ancestor(nodes).leaves())
 * 
 *     def check_monophyly(self, values, prop='name', unrooted=False):             # <<<<<<<<<<<<<<
 *         """Return tuple (is_monophyletic, clade_type, leaves_extra).
 * 
 */
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_45_check_monophyly {
  PyObject_HEAD
  PyObject *__pyx_v_prop;
  PyObject *__pyx_v_values;
};


/* "ete4/core/tree.pyx":1580
 *         values = set(values)  # in case it is not a set (so we check faster)
 * 
 *         nodes = set(n for n in self.leaves()             # <<<<<<<<<<<<<<
 *                         if n.props.get(prop, getattr(n, prop)) in values)
 * 
 */
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_46_genexpr {
  PyObject_HEAD
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_45_check_monophyly *__pyx_outer_scope;
  PyObject *__pyx_genexpr_arg_0;
  PyObject *__pyx_v_n;
};


/* "ete4/core/tree.pyx":1584
 * 
 *         if not unrooted:
 *             leaves_from_ancestor = set(n for n in self.common_ancestor(nodes).leaves())             # <<<<<<<<<<<<<<
 * 
 *             leaves_extra = leaves_from_ancestor - nodes
 */
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_47_genexpr {
  PyObject_HEAD
  PyObject *__pyx_genexpr_arg_0;
  PyObject *__pyx_v_n;
};


/* "ete4/core/tree.pyx":1607
 *             return False, 'polyphyletic', leaves_extra
 * 
 *     def get_monophyletic(self, values, prop='name'):             # <<<<<<<<<<<<<<
 *         """Yield nodes matching the provided monophyly criteria.
 * 
 */
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_48_get_monophyletic {
  PyObject_HEAD
  PyObject *__pyx_v_is_monophyletic;
  PyObject *__pyx_v_n2values;
  PyObject *__pyx_v_prop;
  struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self;
  PyObject *__pyx_v_values;
};


/* "ete4/core/tree.pyx":1625
 *         yield from self.leaves(is_leaf_fn=is_monophyletic)
 * 
 *     def expand_polytomies(self, map_prop="name", polytomy_size_limit=5,             # <<<<<<<<<<<<<<
 *                           skip_large_polytomies=False):
 *         """Return all combinations of solutions of the multifurcated nodes.
 */
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_49_expand_polytomies {
  PyObject_HEAD
  PyObject *__pyx_v_TipTuple;
  PyObject *__pyx_v_add_leaf;
  PyObject *__pyx_v_enum_unordered;
};


/* "ete4/core/tree.pyx":1648
 *             pass
 * 
 *         def add_leaf(tree, label):             # <<<<<<<<<<<<<<
 *           yield (label, tree)
 *           if not isinstance(tree, TipTuple) and isinstance(tree, tuple):
 */
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_50_add_leaf {
  PyObject_HEAD
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_49_expand_polytomies *__pyx_outer_scope;
  PyObject *__pyx_v_label;
  PyObject *__pyx_v_left;
  PyObject *__pyx_v_right;
  PyObject *__pyx_v_tree;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "ete4/core/tree.pyx":1656
 *               yield (tree[0], right)
 * 
 *         def enum_unordered(labels):             # <<<<<<<<<<<<<<
 *           if len(labels) == 1:
 *             yield labels[0]
 */
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_51_enum_unordered {
  PyObject_HEAD
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_49_expand_polytomies *__pyx_outer_scope;
  PyObject *__pyx_v_labels;
  PyObject *__pyx_v_new_tree;
  PyObject *__pyx_v_tree;
  Py_ssize_t __pyx_t_0;
  PyObject *__pyx_t_1;
  PyObject *__pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
};


/* "ete4/core/tree.pyx":1779
 *             # figure out the unique nodes in the path
 *             uniquenodes = paths[leaf1] ^ paths[leaf2]
 *             distance = sum(x.dist for x in uniquenodes)             # <<<<<<<<<<<<<<
 *             leaf_distances[leaf1.name][leaf2.name] = leaf_distances[leaf2.name][leaf1.name] = distance
 * 
 */
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_52_genexpr {
  PyObject_HEAD
  PyObject *__pyx_genexpr_arg_0;
  PyObject *__pyx_v_x;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "ete4/core/tree.pyx":1797
 *     # TODO: The next two functions should really be parsers (which may
 *     # be also used when calling __init__().
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_parent_child_table(parent_child_table):
 *         """Convert a parent-child table into an ETE Tree instance.
 */
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_53_from_parent_child_table {
  PyObject_HEAD
  PyObject *__pyx_v_nodes_by_name;
};


/* "ete4/core/tree.pyx":1845
 *         return root
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_skbio(skbio_tree, map_attributes=None):
 *         """Convert a scikit-bio TreeNode object into ETE Tree object.
 */
struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_54_from_skbio {
  PyObject_HEAD
  PyObject *__pyx_v_all_nodes;
  PyObject *__pyx_v_map_attributes;
};

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/* AssertionsEnabled.proto */
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
  #define __Pyx_init_assertions_enabled()  (0)
  #define __pyx_assertions_enabled()  (1)
#elif CYTHON_COMPILING_IN_LIMITED_API  ||  (CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030C0000)
  static int __pyx_assertions_enabled_flag;
  #define __pyx_assertions_enabled() (__pyx_assertions_enabled_flag)
  static int __Pyx_init_assertions_enabled(void) {
    PyObject *builtins, *debug, *debug_str;
    int flag;
    builtins = PyEval_GetBuiltins();
    if (!builtins) goto bad;
    debug_str = PyUnicode_FromStringAndSize("__debug__", 9);
    if (!debug_str) goto bad;
    debug = PyObject_GetItem(builtins, debug_str);
    Py_DECREF(debug_str);
    if (!debug) goto bad;
    flag = PyObject_IsTrue(debug);
    Py_DECREF(debug);
    if (flag == -1) goto bad;
    __pyx_assertions_enabled_flag = flag;
    return 0;
  bad:
    __pyx_assertions_enabled_flag = 1;
    return -1;
  }
#else
  #define __Pyx_init_assertions_enabled()  (0)
  #define __pyx_assertions_enabled()  (!Py_OptimizeFlag)
#endif

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/* PyObject_Unicode.proto */
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyObject_Unicode(obj)\
    (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Str(obj))
#else
#define __Pyx_PyObject_Unicode(obj)\
    (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Unicode(obj))
#endif

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

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

/* 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_pop.proto */
static CYTHON_INLINE PyObject *__Pyx_PyDict_Pop(PyObject *d, PyObject *key, PyObject *default_value);

/* pybytes_as_double.proto */
static double __Pyx_SlowPyString_AsDouble(PyObject *obj);
static double __Pyx__PyBytes_AsDouble(PyObject *obj, const char* start, Py_ssize_t length);
static CYTHON_INLINE double __Pyx_PyBytes_AsDouble(PyObject *obj) {
    char* as_c_string;
    Py_ssize_t size;
#if CYTHON_ASSUME_SAFE_MACROS
    as_c_string = PyBytes_AS_STRING(obj);
    size = PyBytes_GET_SIZE(obj);
#else
    if (PyBytes_AsStringAndSize(obj, &as_c_string, &size) < 0) {
        return (double)-1;
    }
#endif
    return __Pyx__PyBytes_AsDouble(obj, as_c_string, size);
}
static CYTHON_INLINE double __Pyx_PyByteArray_AsDouble(PyObject *obj) {
    char* as_c_string;
    Py_ssize_t size;
#if CYTHON_ASSUME_SAFE_MACROS
    as_c_string = PyByteArray_AS_STRING(obj);
    size = PyByteArray_GET_SIZE(obj);
#else
    as_c_string = PyByteArray_AsString(obj);
    if (as_c_string == NULL) {
        return (double)-1;
    }
    size = PyByteArray_Size(obj);
#endif
    return __Pyx__PyBytes_AsDouble(obj, as_c_string, size);
}

/* pyunicode_as_double.proto */
#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY && CYTHON_ASSUME_SAFE_MACROS
static const char* __Pyx__PyUnicode_AsDouble_Copy(const void* data, const int kind, char* buffer, Py_ssize_t start, Py_ssize_t end) {
    int last_was_punctuation;
    Py_ssize_t i;
    last_was_punctuation = 1;
    for (i=start; i <= end; i++) {
        Py_UCS4 chr = PyUnicode_READ(kind, data, i);
        int is_punctuation = (chr == '_') | (chr == '.');
        *buffer = (char)chr;
        buffer += (chr != '_');
        if (unlikely(chr > 127)) goto parse_failure;
        if (unlikely(last_was_punctuation & is_punctuation)) goto parse_failure;
        last_was_punctuation = is_punctuation;
    }
    if (unlikely(last_was_punctuation)) goto parse_failure;
    *buffer = '\0';
    return buffer;
parse_failure:
    return NULL;
}
static double __Pyx__PyUnicode_AsDouble_inf_nan(const void* data, int kind, Py_ssize_t start, Py_ssize_t length) {
    int matches = 1;
    Py_UCS4 chr;
    Py_UCS4 sign = PyUnicode_READ(kind, data, start);
    int is_signed = (sign == '-') | (sign == '+');
    start += is_signed;
    length -= is_signed;
    switch (PyUnicode_READ(kind, data, start)) {
        #ifdef Py_NAN
        case 'n':
        case 'N':
            if (unlikely(length != 3)) goto parse_failure;
            chr = PyUnicode_READ(kind, data, start+1);
            matches &= (chr == 'a') | (chr == 'A');
            chr = PyUnicode_READ(kind, data, start+2);
            matches &= (chr == 'n') | (chr == 'N');
            if (unlikely(!matches)) goto parse_failure;
            return (sign == '-') ? -Py_NAN : Py_NAN;
        #endif
        case 'i':
        case 'I':
            if (unlikely(length < 3)) goto parse_failure;
            chr = PyUnicode_READ(kind, data, start+1);
            matches &= (chr == 'n') | (chr == 'N');
            chr = PyUnicode_READ(kind, data, start+2);
            matches &= (chr == 'f') | (chr == 'F');
            if (likely(length == 3 && matches))
                return (sign == '-') ? -Py_HUGE_VAL : Py_HUGE_VAL;
            if (unlikely(length != 8)) goto parse_failure;
            chr = PyUnicode_READ(kind, data, start+3);
            matches &= (chr == 'i') | (chr == 'I');
            chr = PyUnicode_READ(kind, data, start+4);
            matches &= (chr == 'n') | (chr == 'N');
            chr = PyUnicode_READ(kind, data, start+5);
            matches &= (chr == 'i') | (chr == 'I');
            chr = PyUnicode_READ(kind, data, start+6);
            matches &= (chr == 't') | (chr == 'T');
            chr = PyUnicode_READ(kind, data, start+7);
            matches &= (chr == 'y') | (chr == 'Y');
            if (unlikely(!matches)) goto parse_failure;
            return (sign == '-') ? -Py_HUGE_VAL : Py_HUGE_VAL;
        case '.': case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9':
            break;
        default:
            goto parse_failure;
    }
    return 0.0;
parse_failure:
    return -1.0;
}
static double __Pyx_PyUnicode_AsDouble_WithSpaces(PyObject *obj) {
    double value;
    const char *last;
    char *end;
    Py_ssize_t start, length = PyUnicode_GET_LENGTH(obj);
    const int kind = PyUnicode_KIND(obj);
    const void* data = PyUnicode_DATA(obj);
    start = 0;
    while (Py_UNICODE_ISSPACE(PyUnicode_READ(kind, data, start)))
        start++;
    while (start < length - 1 && Py_UNICODE_ISSPACE(PyUnicode_READ(kind, data, length - 1)))
        length--;
    length -= start;
    if (unlikely(length <= 0)) goto fallback;
    value = __Pyx__PyUnicode_AsDouble_inf_nan(data, kind, start, length);
    if (unlikely(value == -1.0)) goto fallback;
    if (value != 0.0) return value;
    if (length < 40) {
        char number[40];
        last = __Pyx__PyUnicode_AsDouble_Copy(data, kind, number, start, start + length);
        if (unlikely(!last)) goto fallback;
        value = PyOS_string_to_double(number, &end, NULL);
    } else {
        char *number = (char*) PyMem_Malloc((length + 1) * sizeof(char));
        if (unlikely(!number)) goto fallback;
        last = __Pyx__PyUnicode_AsDouble_Copy(data, kind, number, start, start + length);
        if (unlikely(!last)) {
            PyMem_Free(number);
            goto fallback;
        }
        value = PyOS_string_to_double(number, &end, NULL);
        PyMem_Free(number);
    }
    if (likely(end == last) || (value == (double)-1 && PyErr_Occurred())) {
        return value;
    }
fallback:
    return __Pyx_SlowPyString_AsDouble(obj);
}
#endif
static CYTHON_INLINE double __Pyx_PyUnicode_AsDouble(PyObject *obj) {
#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY && CYTHON_ASSUME_SAFE_MACROS
    if (unlikely(__Pyx_PyUnicode_READY(obj) == -1))
        return (double)-1;
    if (likely(PyUnicode_IS_ASCII(obj))) {
        const char *s;
        Py_ssize_t length;
        s = PyUnicode_AsUTF8AndSize(obj, &length);
        return __Pyx__PyBytes_AsDouble(obj, s, length);
    }
    return __Pyx_PyUnicode_AsDouble_WithSpaces(obj);
#else
    return __Pyx_SlowPyString_AsDouble(obj);
#endif
}

/* pynumber_float.proto */
static CYTHON_INLINE PyObject* __Pyx__PyNumber_Float(PyObject* obj);
#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : __Pyx__PyNumber_Float(x))

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/* GeneratorYieldFrom.proto */
static CYTHON_INLINE PyObject* __Pyx_Generator_Yield_From(__pyx_CoroutineObject *gen, PyObject *source);

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/* PyFloatBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyFloat_AddObjC(PyObject *op1, PyObject *op2, double floatval, int inplace, int zerodivision_check);
#else
#define __Pyx_PyFloat_AddObjC(op1, op2, floatval, inplace, zerodivision_check)\
    (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
#endif

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

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

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

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

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

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

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

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

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

/* SliceObject.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
        PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
        PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
        int has_cstart, int has_cstop, int wraparound);

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

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

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

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

/* py_dict_keys.proto */
static CYTHON_INLINE PyObject* __Pyx_PyDict_Keys(PyObject* d);

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

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

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

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

/* SetupReduce.proto */
#if !CYTHON_COMPILING_IN_LIMITED_API
static int __Pyx_setup_reduce(PyObject* type_obj);
#endif

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

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

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

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

/* ToPyCTupleUtility.proto */
static PyObject* __pyx_convert__to_py___pyx_ctuple_double__and_double(__pyx_ctuple_double__and_double);

/* FromPyCTupleUtility.proto */
static CYTHON_INLINE __pyx_ctuple_double__and_double __pyx_convert__from_py___pyx_ctuple_double__and_double(PyObject *);

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

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

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

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

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

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

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

/* Module declarations from "ete4.core.tree" */
static PyObject *__pyx_f_4ete4_4core_4tree___pyx_unpickle_Tree__set_state(struct __pyx_obj_4ete4_4core_4tree_Tree *, PyObject *); /*proto*/
/* #### Code section: typeinfo ### */
/* #### Code section: before_global_var ### */
#define __Pyx_MODULE_NAME "ete4.core.tree"
extern int __pyx_module_is_main_ete4__core__tree;
int __pyx_module_is_main_ete4__core__tree = 0;

/* Implementation of "ete4.core.tree" */
/* #### Code section: global_var ### */
static PyObject *__pyx_builtin_staticmethod;
static PyObject *__pyx_builtin_AssertionError;
static PyObject *__pyx_builtin_ValueError;
static PyObject *__pyx_builtin_sum;
static PyObject *__pyx_builtin_StopIteration;
static PyObject *__pyx_builtin_IndexError;
static PyObject *__pyx_builtin_TypeError;
static PyObject *__pyx_builtin_hex;
static PyObject *__pyx_builtin_sorted;
static PyObject *__pyx_builtin_open;
static PyObject *__pyx_builtin_print;
static PyObject *__pyx_builtin_max;
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_enumerate;
/* #### Code section: string_decls ### */
static const char __pyx_k_a[] = "a";
static const char __pyx_k_b[] = "b";
static const char __pyx_k_d[] = "d";
static const char __pyx_k_e[] = "e";
static const char __pyx_k_h[] = "h";
static const char __pyx_k_i[] = "i";
static const char __pyx_k_m[] = "m";
static const char __pyx_k_n[] = "n";
static const char __pyx_k_p[] = "p";
static const char __pyx_k_s[] = "%s;";
static const char __pyx_k_w[] = "w";
static const char __pyx_k_x[] = "x";
static const char __pyx_k_y[] = "y";
static const char __pyx_k_NA[] = "NA";
static const char __pyx_k_No[] = "No";
static const char __pyx_k__2[] = " ";
static const char __pyx_k__3[] = "";
static const char __pyx_k__4[] = ">";
static const char __pyx_k__5[] = ")";
static const char __pyx_k_at[] = " at ";
static const char __pyx_k_ch[] = "ch";
static const char __pyx_k_fp[] = "fp";
static const char __pyx_k_gc[] = "gc";
static const char __pyx_k_id[] = "id";
static const char __pyx_k_k1[] = "k1";
static const char __pyx_k_k2[] = "k2";
static const char __pyx_k_nw[] = "nw";
static const char __pyx_k_px[] = "px";
static const char __pyx_k_py[] = "py";
static const char __pyx_k_rf[] = "rf";
static const char __pyx_k_s1[] = "s1";
static const char __pyx_k_s2[] = "s2";
static const char __pyx_k_t1[] = "t1";
static const char __pyx_k_t2[] = "t2";
static const char __pyx_k_up[] = "up";
static const char __pyx_k_ETE[] = "ETE";
static const char __pyx_k_Yes[] = "Yes";
static const char __pyx_k__15[] = "\n";
static const char __pyx_k__20[] = ".";
static const char __pyx_k__21[] = "*";
static const char __pyx_k__22[] = ",";
static const char __pyx_k__23[] = ":";
static const char __pyx_k_add[] = "add";
static const char __pyx_k_doc[] = "__doc__";
static const char __pyx_k_dpi[] = "dpi";
static const char __pyx_k_ete[] = "ete";
static const char __pyx_k_get[] = "get";
static const char __pyx_k_hex[] = "hex";
static const char __pyx_k_inf[] = "inf";
static const char __pyx_k_key[] = "key";
static const char __pyx_k_max[] = "max";
static const char __pyx_k_md5[] = "md5";
static const char __pyx_k_new[] = "__new__";
static const char __pyx_k_ops[] = "ops";
static const char __pyx_k_pop[] = "pop";
static const char __pyx_k_px0[] = "px0";
static const char __pyx_k_raw[] = "raw";
static const char __pyx_k_sum[] = "sum";
static const char __pyx_k_Face[] = "Face";
static const char __pyx_k_Tree[] = "<Tree";
static const char __pyx_k__121[] = "_";
static const char __pyx_k__203[] = "?";
static const char __pyx_k_alld[] = "alld";
static const char __pyx_k_args[] = "args";
static const char __pyx_k_attr[] = "attr";
static const char __pyx_k_copy[] = "copy";
static const char __pyx_k_data[] = "data";
static const char __pyx_k_dict[] = "__dict__";
static const char __pyx_k_diff[] = "_diff";
static const char __pyx_k_dist[] = "dist";
static const char __pyx_k_dump[] = "dump";
static const char __pyx_k_exit[] = "__exit__";
static const char __pyx_k_face[] = "face";
static const char __pyx_k_hash[] = "__hash__";
static const char __pyx_k_host[] = "host";
static const char __pyx_k_http[] = "http://";
static const char __pyx_k_iter[] = "__iter__";
static const char __pyx_k_join[] = "join";
static const char __pyx_k_keys[] = "keys";
static const char __pyx_k_leaf[] = "leaf";
static const char __pyx_k_left[] = "left";
static const char __pyx_k_main[] = "__main__";
static const char __pyx_k_math[] = "math";
static const char __pyx_k_mean[] = "mean";
static const char __pyx_k_name[] = "name";
static const char __pyx_k_node[] = "node";
static const char __pyx_k_open[] = "open";
static const char __pyx_k_path[] = "path";
static const char __pyx_k_port[] = "port";
static const char __pyx_k_post[] = "post";
static const char __pyx_k_prev[] = "prev";
static const char __pyx_k_prop[] = "prop";
static const char __pyx_k_quit[] = "quit";
static const char __pyx_k_root[] = "root";
static const char __pyx_k_seed[] = "seed";
static const char __pyx_k_seen[] = "seen";
static const char __pyx_k_self[] = "self";
static const char __pyx_k_send[] = "send";
static const char __pyx_k_show[] = "show";
static const char __pyx_k_size[] = "size";
static const char __pyx_k_sort[] = "sort";
static const char __pyx_k_spec[] = "__spec__";
static const char __pyx_k_test[] = "__test__";
static const char __pyx_k_time[] = "time";
static const char __pyx_k_tree[] = "tree";
static const char __pyx_k_warn[] = "warn";
static const char __pyx_k_yule[] = "yule";
static const char __pyx_k_cdist[] = "cdist";
static const char __pyx_k_child[] = "child";
static const char __pyx_k_class[] = "__class__";
static const char __pyx_k_close[] = "close";
static const char __pyx_k_color[] = "color";
static const char __pyx_k_corr1[] = "corr1";
static const char __pyx_k_corr2[] = "corr2";
static const char __pyx_k_depth[] = "depth";
static const char __pyx_k_diffs[] = "diffs";
static const char __pyx_k_dumps[] = "dumps";
static const char __pyx_k_edges[] = "edges";
static const char __pyx_k_enter[] = "__enter__";
static const char __pyx_k_faces[] = "_faces";
static const char __pyx_k_fdist[] = "fdist";
static const char __pyx_k_fnode[] = "fnode";
static const char __pyx_k_index[] = "index";
static const char __pyx_k_items[] = "items";
static const char __pyx_k_label[] = "label";
static const char __pyx_k_leaf1[] = "leaf1";
static const char __pyx_k_leaf2[] = "leaf2";
static const char __pyx_k_loads[] = "loads";
static const char __pyx_k_lower[] = "lower";
static const char __pyx_k_maxrf[] = "maxrf";
static const char __pyx_k_model[] = "model";
static const char __pyx_k_names[] = "names";
static const char __pyx_k_ndups[] = "ndups";
static const char __pyx_k_nexus[] = "nexus";
static const char __pyx_k_node1[] = "node1";
static const char __pyx_k_node2[] = "node2";
static const char __pyx_k_nodes[] = "nodes";
static const char __pyx_k_order[] = "order";
static const char __pyx_k_paths[] = "paths";
static const char __pyx_k_print[] = "print";
static const char __pyx_k_prop1[] = "prop1";
static const char __pyx_k_prop2[] = "prop2";
static const char __pyx_k_props[] = "props";
static const char __pyx_k_prune[] = "prune";
static const char __pyx_k_range[] = "range";
static const char __pyx_k_ref_p[] = "ref_p";
static const char __pyx_k_right[] = "right";
static const char __pyx_k_side1[] = "side1";
static const char __pyx_k_side2[] = "side2";
static const char __pyx_k_size1[] = "size1";
static const char __pyx_k_size2[] = "size2";
static const char __pyx_k_skbio[] = "skbio";
static const char __pyx_k_sleep[] = "sleep";
static const char __pyx_k_src_p[] = "src_p";
static const char __pyx_k_start[] = "start";
static const char __pyx_k_state[] = "state";
static const char __pyx_k_super[] = "super";
static const char __pyx_k_table[] = "table";
static const char __pyx_k_throw[] = "throw";
static const char __pyx_k_tools[] = "tools";
static const char __pyx_k_units[] = "units";
static const char __pyx_k_utils[] = "utils";
static const char __pyx_k_value[] = "value";
static const char __pyx_k_write[] = "write";
static const char __pyx_k_Chrome[] = "Chrome";
static const char __pyx_k_Tree_2[] = "Tree";
static const char __pyx_k_all_rf[] = "all_rf";
static const char __pyx_k_append[] = "append";
static const char __pyx_k_bprops[] = "bprops";
static const char __pyx_k_branch[] = "branch";
static const char __pyx_k_column[] = "column";
static const char __pyx_k_common[] = "common";
static const char __pyx_k_delete[] = "delete";
static const char __pyx_k_detach[] = "detach";
static const char __pyx_k_dict_2[] = "_dict";
static const char __pyx_k_drawer[] = "drawer";
static const char __pyx_k_driver[] = "driver";
static const char __pyx_k_edges1[] = "edges1";
static const char __pyx_k_edges2[] = "edges2";
static const char __pyx_k_enable[] = "enable";
static const char __pyx_k_ete_ch[] = "ete_ch";
static const char __pyx_k_face_2[] = "face ";
static const char __pyx_k_import[] = "__import__";
static const char __pyx_k_indent[] = "indent";
static const char __pyx_k_inline[] = "%%inline";
static const char __pyx_k_kwargs[] = "kwargs";
static const char __pyx_k_labels[] = "labels";
static const char __pyx_k_layout[] = "layout";
static const char __pyx_k_leaves[] = "leaves";
static const char __pyx_k_length[] = "length";
static const char __pyx_k_max_rf[] = "max_rf";
static const char __pyx_k_method[] = "method";
static const char __pyx_k_module[] = "__module__";
static const char __pyx_k_name_2[] = "__name__";
static const char __pyx_k_newick[] = "newick";
static const char __pyx_k_not_in[] = " not in ";
static const char __pyx_k_ntrees[] = "ntrees";
static const char __pyx_k_output[] = "output";
static const char __pyx_k_parent[] = "parent";
static const char __pyx_k_parser[] = "parser";
static const char __pyx_k_pickle[] = "pickle";
static const char __pyx_k_reduce[] = "__reduce__";
static const char __pyx_k_remove[] = "remove";
static const char __pyx_k_render[] = "render";
static const char __pyx_k_result[] = "result";
static const char __pyx_k_return[] = "%%return";
static const char __pyx_k_rf_max[] = "rf_max";
static const char __pyx_k_server[] = "server";
static const char __pyx_k_sister[] = "sister";
static const char __pyx_k_sorted[] = "sorted";
static const char __pyx_k_thread[] = "thread";
static const char __pyx_k_to_str[] = "to_str";
static const char __pyx_k_unroot[] = "unroot";
static const char __pyx_k_update[] = "update";
static const char __pyx_k_values[] = "values";
static const char __pyx_k_Options[] = "Options";
static const char __pyx_k_PARSERS[] = "PARSERS";
static const char __pyx_k_cascade[] = "cascade";
static const char __pyx_k_columns[] = "columns";
static const char __pyx_k_compact[] = "compact";
static const char __pyx_k_compare[] = "_compare";
static const char __pyx_k_cpickle[] = "cpickle";
static const char __pyx_k_current[] = "current";
static const char __pyx_k_default[] = "default";
static const char __pyx_k_disable[] = "disable";
static const char __pyx_k_dist_fn[] = "dist_fn";
static const char __pyx_k_explore[] = "explore";
static const char __pyx_k_genexpr[] = "genexpr";
static const char __pyx_k_get_img[] = "get_img";
static const char __pyx_k_hashlib[] = "hashlib";
static const char __pyx_k_is_leaf[] = "is_leaf";
static const char __pyx_k_is_root[] = "is_root";
static const char __pyx_k_layouts[] = "layouts";
static const char __pyx_k_lineage[] = "lineage";
static const char __pyx_k_n2count[] = "n2count";
static const char __pyx_k_n2depth[] = "n2depth";
static const char __pyx_k_ncommon[] = "ncommon";
static const char __pyx_k_norm_rf[] = "norm_rf";
static const char __pyx_k_options[] = "options";
static const char __pyx_k_outfile[] = "outfile";
static const char __pyx_k_popitem[] = "popitem";
static const char __pyx_k_prepare[] = "__prepare__";
static const char __pyx_k_product[] = "product";
static const char __pyx_k_prop_t1[] = "prop_t1";
static const char __pyx_k_prop_t2[] = "prop_t2";
static const char __pyx_k_reverse[] = "reverse";
static const char __pyx_k_rooting[] = "rooting";
static const char __pyx_k_sisters[] = "sisters";
static const char __pyx_k_subtree[] = "subtree";
static const char __pyx_k_support[] = "support";
static const char __pyx_k_to_keep[] = "to_keep";
static const char __pyx_k_total_d[] = "total_d";
static const char __pyx_k_verbose[] = "verbose";
static const char __pyx_k_Node_has[] = "Node has ";
static const char __pyx_k_Rooted_s[] = "Rooted: %s";
static const char __pyx_k_TipTuple[] = "TipTuple";
static const char __pyx_k_TreeNode[] = "TreeNode";
static const char __pyx_k_add_face[] = "add_face";
static const char __pyx_k_add_leaf[] = "add_leaf";
static const char __pyx_k_add_prop[] = "add_prop";
static const char __pyx_k_add_tree[] = "add_tree";
static const char __pyx_k_children[] = "children";
static const char __pyx_k_compress[] = "compress";
static const char __pyx_k_deepcopy[] = "deepcopy";
static const char __pyx_k_del_prop[] = "del_prop";
static const char __pyx_k_describe[] = "describe";
static const char __pyx_k_diameter[] = "diameter";
static const char __pyx_k_distance[] = "distance";
static const char __pyx_k_ete_diff[] = "ete_diff";
static const char __pyx_k_ete_node[] = "ete_node";
static const char __pyx_k_explorer[] = "explorer";
static const char __pyx_k_get_node[] = "get_node";
static const char __pyx_k_get_prop[] = "get_prop";
static const char __pyx_k_getstate[] = "__getstate__";
static const char __pyx_k_has_prop[] = "has_prop";
static const char __pyx_k_headless[] = "--headless";
static const char __pyx_k_issubset[] = "issubset";
static const char __pyx_k_map_prop[] = "map_prop";
static const char __pyx_k_max_dist[] = "max_dist";
static const char __pyx_k_max_node[] = "max_node";
static const char __pyx_k_min_dist[] = "min_dist";
static const char __pyx_k_min_node[] = "min_node";
static const char __pyx_k_n2values[] = "n2values";
static const char __pyx_k_new_node[] = "new_node";
static const char __pyx_k_new_tree[] = "new_tree";
static const char __pyx_k_nodename[] = "nodename";
static const char __pyx_k_origin_t[] = "origin_t";
static const char __pyx_k_populate[] = "populate";
static const char __pyx_k_position[] = "position";
static const char __pyx_k_preorder[] = "preorder";
static const char __pyx_k_pyx_type[] = "__pyx_type";
static const char __pyx_k_qualname[] = "__qualname__";
static const char __pyx_k_ref_disc[] = "ref_disc";
static const char __pyx_k_ref_tree[] = "ref_tree";
static const char __pyx_k_safe_div[] = "_safe_div";
static const char __pyx_k_selenium[] = "selenium";
static const char __pyx_k_set_name[] = "__set_name__";
static const char __pyx_k_setstate[] = "__setstate__";
static const char __pyx_k_shutdown[] = "shutdown";
static const char __pyx_k_smallest[] = "smallest";
static const char __pyx_k_sp_trees[] = "sp_trees";
static const char __pyx_k_src_disc[] = "src_disc";
static const char __pyx_k_src_tree[] = "src_tree";
static const char __pyx_k_strategy[] = "strategy";
static const char __pyx_k_subtrees[] = "subtrees";
static const char __pyx_k_target_t[] = "target_t";
static const char __pyx_k_text_viz[] = "text_viz";
static const char __pyx_k_topology[] = "topology";
static const char __pyx_k_total_rf[] = "total_rf";
static const char __pyx_k_traverse[] = "traverse";
static const char __pyx_k_treediff[] = "treediff";
static const char __pyx_k_treeko_d[] = "treeko_d";
static const char __pyx_k_treeview[] = "treeview";
static const char __pyx_k_unrooted[] = "unrooted";
static const char __pyx_k_usecolor[] = "usecolor";
static const char __pyx_k_visitors[] = "visitors";
static const char __pyx_k_warnings[] = "warnings";
static const char __pyx_k_win_name[] = "win_name";
static const char __pyx_k_127_0_0_1[] = "127.0.0.1";
static const char __pyx_k_FaceAreas[] = "_FaceAreas";
static const char __pyx_k_NodeStyle[] = "NodeStyle";
static const char __pyx_k_TreeError[] = "TreeError";
static const char __pyx_k_Tree_copy[] = "Tree.copy";
static const char __pyx_k_Tree_show[] = "Tree.show";
static const char __pyx_k_TypeError[] = "TypeError";
static const char __pyx_k_add_child[] = "add_child";
static const char __pyx_k_add_props[] = "add_props";
static const char __pyx_k_all_nodes[] = "all_nodes";
static const char __pyx_k_allleaves[] = "allleaves";
static const char __pyx_k_ancestors[] = "ancestors";
static const char __pyx_k_child_idx[] = "child_idx";
static const char __pyx_k_cmp_nodes[] = "cmp_nodes";
static const char __pyx_k_compare_2[] = "compare";
static const char __pyx_k_diffs_tab[] = "diffs_tab";
static const char __pyx_k_difftable[] = "difftable";
static const char __pyx_k_edge_keys[] = "edge_keys";
static const char __pyx_k_enumerate[] = "enumerate";
static const char __pyx_k_face_area[] = "face_area";
static const char __pyx_k_file_name[] = "file_name";
static const char __pyx_k_functools[] = "functools";
static const char __pyx_k_hexdigest[] = "hexdigest";
static const char __pyx_k_img_style[] = "_img_style";
static const char __pyx_k_isenabled[] = "isenabled";
static const char __pyx_k_itertools[] = "itertools";
static const char __pyx_k_ladderize[] = "ladderize";
static const char __pyx_k_max_parts[] = "max_parts";
static const char __pyx_k_metaclass[] = "__metaclass__";
static const char __pyx_k_name2node[] = "name2node";
static const char __pyx_k_node2path[] = "node2path";
static const char __pyx_k_pop_child[] = "pop_child";
static const char __pyx_k_postorder[] = "postorder";
static const char __pyx_k_pyx_state[] = "__pyx_state";
static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
static const char __pyx_k_ref_edges[] = "ref_edges";
static const char __pyx_k_ref_found[] = "ref_found";
static const char __pyx_k_render_sm[] = "render_sm";
static const char __pyx_k_set_style[] = "set_style";
static const char __pyx_k_show_tree[] = "show_tree";
static const char __pyx_k_smartview[] = "smartview";
static const char __pyx_k_src_found[] = "src_found";
static const char __pyx_k_t1_leaves[] = "t1_leaves";
static const char __pyx_k_t2_leaves[] = "t2_leaves";
static const char __pyx_k_webdriver[] = "webdriver";
static const char __pyx_k_weight_fn[] = "weight_fn";
static const char __pyx_k_IndexError[] = "IndexError";
static const char __pyx_k_Tree__diff[] = "Tree._diff";
static const char __pyx_k_Tree_edges[] = "Tree.edges";
static const char __pyx_k_Tree_prune[] = "Tree.prune";
static const char __pyx_k_Tree_write[] = "Tree.write";
static const char __pyx_k_ValueError[] = "ValueError";
static const char __pyx_k_Wrote_file[] = "Wrote file:";
static const char __pyx_k_add_sister[] = "add_sister";
static const char __pyx_k_all_leaves[] = "all_leaves";
static const char __pyx_k_all_max_rf[] = "all_max_rf";
static const char __pyx_k_bad_parser[] = "bad parser: ";
static const char __pyx_k_child_name[] = "child_name";
static const char __pyx_k_childtrees[] = "childtrees";
static const char __pyx_k_cmp_to_key[] = "cmp_to_key";
static const char __pyx_k_conditions[] = "conditions";
static const char __pyx_k_discard_t1[] = "discard_t1";
static const char __pyx_k_discard_t2[] = "discard_t2";
static const char __pyx_k_ete_format[] = "ete_format";
static const char __pyx_k_from_skbio[] = "from_skbio";
static const char __pyx_k_is_leaf_fn[] = "is_leaf_fn";
static const char __pyx_k_leaf_names[] = "leaf_names";
static const char __pyx_k_levelorder[] = "levelorder";
static const char __pyx_k_movingnode[] = "movingnode";
static const char __pyx_k_n2subtrees[] = "n2subtrees";
static const char __pyx_k_operations[] = "operations";
static const char __pyx_k_position_2[] = "position ";
static const char __pyx_k_pyx_result[] = "__pyx_result";
static const char __pyx_k_setdefault[] = "setdefault";
static const char __pyx_k_skbio_node[] = "skbio_node";
static const char __pyx_k_skbio_tree[] = "skbio_tree";
static const char __pyx_k_startswith[] = "startswith";
static const char __pyx_k_subtree_nw[] = "subtree_nw";
static const char __pyx_k_support_fn[] = "support_fn";
static const char __pyx_k_support_t1[] = "support_t1";
static const char __pyx_k_support_t2[] = "support_t2";
static const char __pyx_k_tree_sizes[] = "tree_sizes";
static const char __pyx_k_tree_style[] = "tree_style";
static const char __pyx_k_No_children[] = "No children";
static const char __pyx_k_PickleError[] = "PickleError";
static const char __pyx_k_Tree___iter[] = "Tree.__iter__";
static const char __pyx_k_Tree_delete[] = "Tree.delete";
static const char __pyx_k_Tree_detach[] = "Tree.detach";
static const char __pyx_k_Tree_leaves[] = "Tree.leaves";
static const char __pyx_k_Tree_render[] = "Tree.render";
static const char __pyx_k_Tree_to_str[] = "Tree.to_str";
static const char __pyx_k_Tree_unroot[] = "Tree.unroot";
static const char __pyx_k_descendants[] = "descendants";
static const char __pyx_k_from_common[] = "from_common";
static const char __pyx_k_get_content[] = "get_content";
static const char __pyx_k_get_sisters[] = "get_sisters";
static const char __pyx_k_keep_server[] = "keep_server";
static const char __pyx_k_leaf_values[] = "leaf_values";
static const char __pyx_k_leaves_only[] = "leaves_only";
static const char __pyx_k_mro_entries[] = "__mro_entries__";
static const char __pyx_k_newick_only[] = "newick_only";
static const char __pyx_k_node_leaves[] = "node_leaves";
static const char __pyx_k_parent_name[] = "parent_name";
static const char __pyx_k_remove_tree[] = "remove_tree";
static const char __pyx_k_render_tree[] = "render_tree";
static const char __pyx_k_source_tree[] = "source_tree";
static const char __pyx_k_standardize[] = "standardize";
static const char __pyx_k_topological[] = "topological";
static const char __pyx_k_treeko_dist[] = "treeko_dist";
static const char __pyx_k_uniquenodes[] = "uniquenodes";
static const char __pyx_k_visitor_key[] = "visitor_key";
static const char __pyx_k_window_size[] = "--window-size=";
static const char __pyx_k_Tree_compare[] = "Tree.compare";
static const char __pyx_k_Tree_explore[] = "Tree.explore";
static const char __pyx_k_Tree_lineage[] = "Tree.lineage";
static const char __pyx_k_add_argument[] = "add_argument";
static const char __pyx_k_add_children[] = "add_children";
static const char __pyx_k_branch_right[] = "branch-right";
static const char __pyx_k_combinations[] = "combinations";
static const char __pyx_k_common_edges[] = "common_edges";
static const char __pyx_k_common_names[] = "common_names";
static const char __pyx_k_get_children[] = "get_children";
static const char __pyx_k_get_distance[] = "get_distance";
static const char __pyx_k_get_ete_node[] = "get_ete_node";
static const char __pyx_k_include_root[] = "include_root";
static const char __pyx_k_include_self[] = "include_self";
static const char __pyx_k_initializing[] = "_initializing";
static const char __pyx_k_is_coroutine[] = "_is_coroutine";
static const char __pyx_k_leaves_extra[] = "leaves_extra";
static const char __pyx_k_monophyletic[] = "monophyletic";
static const char __pyx_k_open_browser[] = "open_browser";
static const char __pyx_k_origin_trees[] = "origin_trees";
static const char __pyx_k_paraphyletic[] = "paraphyletic";
static const char __pyx_k_polyphyletic[] = "polyphyletic";
static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
static const char __pyx_k_remove_child[] = "remove_child";
static const char __pyx_k_search_nodes[] = "search_nodes";
static const char __pyx_k_server_close[] = "server_close";
static const char __pyx_k_set_outgroup[] = "set_outgroup";
static const char __pyx_k_sorted_nodes[] = "sorted_nodes";
static const char __pyx_k_source_edges[] = "source_edges";
static const char __pyx_k_start_server[] = "start_server";
static const char __pyx_k_staticmethod[] = "staticmethod";
static const char __pyx_k_stringsource[] = "<stringsource>";
static const char __pyx_k_target_trees[] = "target_trees";
static const char __pyx_k_traverse_bfs[] = "traverse_bfs";
static const char __pyx_k_use_setstate[] = "use_setstate";
static const char __pyx_k_visited_node[] = "visited_node";
static const char __pyx_k_FaceContainer[] = "FaceContainer";
static const char __pyx_k_StopIteration[] = "StopIteration";
static const char __pyx_k_Tree_add_face[] = "Tree.add_face";
static const char __pyx_k_Tree_add_prop[] = "Tree.add_prop";
static const char __pyx_k_Tree_del_prop[] = "Tree.del_prop";
static const char __pyx_k_Tree_describe[] = "Tree.describe";
static const char __pyx_k_Tree_get_prop[] = "Tree.get_prop";
static const char __pyx_k_Tree_populate[] = "Tree.populate";
static const char __pyx_k_Tree_traverse[] = "Tree.traverse";
static const char __pyx_k_class_getitem[] = "__class_getitem__";
static const char __pyx_k_delete_orphan[] = "delete_orphan";
static const char __pyx_k_farthest_dist[] = "farthest_dist";
static const char __pyx_k_farthest_node[] = "farthest_node";
static const char __pyx_k_init_subclass[] = "__init_subclass__";
static const char __pyx_k_mean_distance[] = "mean_distance";
static const char __pyx_k_nodes_by_name[] = "nodes_by_name";
static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
static const char __pyx_k_ref_tree_attr[] = "ref_tree_attr";
static const char __pyx_k_remove_sister[] = "remove_sister";
static const char __pyx_k_return_format[] = "return_format";
static const char __pyx_k_show_internal[] = "show_internal";
static const char __pyx_k_skbioTreeNode[] = "skbioTreeNode";
static const char __pyx_k_swap_children[] = "swap_children";
static const char __pyx_k_t1_leaves_all[] = "t1_leaves_all";
static const char __pyx_k_t2_leaves_all[] = "t2_leaves_all";
static const char __pyx_k_treeview_main[] = "treeview.main";
static const char __pyx_k_AssertionError[] = "AssertionError";
static const char __pyx_k_FACE_POSITIONS[] = "FACE_POSITIONS";
static const char __pyx_k_Max_distance_g[] = "Max. distance: %g";
static const char __pyx_k_Tree_add_child[] = "Tree.add_child";
static const char __pyx_k_Tree_add_props[] = "Tree.add_props";
static const char __pyx_k_Tree_ancestors[] = "Tree.ancestors";
static const char __pyx_k_Tree_ladderize[] = "Tree.ladderize";
static const char __pyx_k_Tree_pop_child[] = "Tree.pop_child";
static const char __pyx_k_Tree_render_sm[] = "Tree.render_sm";
static const char __pyx_k_Tree_set_style[] = "Tree.set_style";
static const char __pyx_k_cached_content[] = "cached_content";
static const char __pyx_k_container_type[] = "container_type";
static const char __pyx_k_enum_unordered[] = "enum_unordered";
static const char __pyx_k_ete4_core_tree[] = "ete4.core.tree";
static const char __pyx_k_leaf_distances[] = "leaf_distances";
static const char __pyx_k_map_attributes[] = "map_attributes";
static const char __pyx_k_map_properties[] = "map_properties";
static const char __pyx_k_min_comparison[] = "min_comparison";
static const char __pyx_k_min_support_t1[] = "min_support_t1";
static const char __pyx_k_min_support_t2[] = "min_support_t2";
static const char __pyx_k_parser_extract[] = "parser.extract";
static const char __pyx_k_server_address[] = "server_address";
static const char __pyx_k_show_difftable[] = "show_difftable";
static const char __pyx_k_to_ultrametric[] = "to_ultrametric";
static const char __pyx_k_unrooted_trees[] = "unrooted_trees";
static const char __pyx_k_use_collateral[] = "use_collateral";
static const char __pyx_k_visitors2nodes[] = "visitors2nodes";
static const char __pyx_k_Invalid_node_id[] = "Invalid node_id: ";
static const char __pyx_k_Tree_add_sister[] = "Tree.add_sister";
static const char __pyx_k_Tree_from_skbio[] = "Tree.from_skbio";
static const char __pyx_k_Tree_leaf_names[] = "Tree.leaf_names";
static const char __pyx_k_check_monophyly[] = "check_monophyly";
static const char __pyx_k_common_ancestor[] = "common_ancestor";
static const char __pyx_k_disable_logging[] = "--disable-logging";
static const char __pyx_k_get_distance_fn[] = "get_distance_fn";
static const char __pyx_k_get_topology_id[] = "get_topology_id";
static const char __pyx_k_is_monophyletic[] = "is_monophyletic";
static const char __pyx_k_min_support_ref[] = "min_support_ref";
static const char __pyx_k_newick_extended[] = "newick-extended";
static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
static const char __pyx_k_remove_children[] = "remove_children";
static const char __pyx_k_robinson_foulds[] = "robinson_foulds";
static const char __pyx_k_save_screenshot[] = "save_screenshot";
static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
static const char __pyx_k_source_subtrees[] = "source_subtrees";
static const char __pyx_k_speciesFunction[] = "_speciesFunction";
static const char __pyx_k_subtree_content[] = "subtree_content";
static const char __pyx_k_translate_nodes[] = "_translate_nodes";
static const char __pyx_k_valid_ref_edges[] = "valid_ref_edges";
static const char __pyx_k_valid_src_edges[] = "valid_src_edges";
static const char __pyx_k_Tree_descendants[] = "Tree.descendants";
static const char __pyx_k_Tree_get_sisters[] = "Tree.get_sisters";
static const char __pyx_k_Tree_standardize[] = "Tree.standardize";
static const char __pyx_k_Unknown_strategy[] = "Unknown strategy: ";
static const char __pyx_k_disable_breakpad[] = "--disable-breakpad";
static const char __pyx_k_format_root_node[] = "format_root_node";
static const char __pyx_k_get_closest_leaf[] = "get_closest_leaf";
static const char __pyx_k_get_monophyletic[] = "get_monophyletic";
static const char __pyx_k_has_duplications[] = "has_duplications";
static const char __pyx_k_orig_target_size[] = "orig_target_size";
static const char __pyx_k_ref_found_in_src[] = "ref_found_in_src";
static const char __pyx_k_resolve_polytomy[] = "resolve_polytomy";
static const char __pyx_k_reverse_children[] = "reverse_children";
static const char __pyx_k_search_ancestors[] = "search_ancestors";
static const char __pyx_k_sort_descendants[] = "sort_descendants";
static const char __pyx_k_source_tree_attr[] = "source_tree_attr";
static const char __pyx_k_src_found_in_ref[] = "src_found_in_ref";
static const char __pyx_k_Invalid_node_type[] = "Invalid node type";
static const char __pyx_k_Tree_add_children[] = "Tree.add_children";
static const char __pyx_k_Tree_get_children[] = "Tree.get_children";
static const char __pyx_k_Tree_get_distance[] = "Tree.get_distance";
static const char __pyx_k_Tree_remove_child[] = "Tree.remove_child";
static const char __pyx_k_Tree_search_nodes[] = "Tree.search_nodes";
static const char __pyx_k_Tree_set_outgroup[] = "Tree.set_outgroup";
static const char __pyx_k_cophenetic_matrix[] = "cophenetic_matrix";
static const char __pyx_k_expand_polytomies[] = "expand_polytomies";
static const char __pyx_k_get_farthest_leaf[] = "get_farthest_leaf";
static const char __pyx_k_get_farthest_node[] = "get_farthest_node";
static const char __pyx_k_iter_prepostorder[] = "iter_prepostorder";
static const char __pyx_k_leaves_descendant[] = "leaves_descendant";
static const char __pyx_k_pyx_unpickle_Tree[] = "__pyx_unpickle_Tree";
static const char __pyx_k_Tree_mean_distance[] = "Tree.mean_distance";
static const char __pyx_k_Tree_remove_sister[] = "Tree.remove_sister";
static const char __pyx_k_Tree_swap_children[] = "Tree.swap_children";
static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines";
static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
static const char __pyx_k_ete4_core_tree_pyx[] = "ete4/core/tree.pyx";
static const char __pyx_k_get_cached_content[] = "get_cached_content";
static const char __pyx_k_min_support_source[] = "min_support_source";
static const char __pyx_k_parent_child_table[] = "parent_child_table";
static const char __pyx_k_search_descendants[] = "search_descendants";
static const char __pyx_k_show_difftable_tab[] = "show_difftable_tab";
static const char __pyx_k_sp_naming_function[] = "sp_naming_function";
static const char __pyx_k_Ambiguous_node_name[] = "Ambiguous node name: ";
static const char __pyx_k_Invalid_copy_method[] = "Invalid copy method";
static const char __pyx_k_ModuleNotFoundError[] = "ModuleNotFoundError";
static const char __pyx_k_Most_distant_node_s[] = "Most distant node: %s";
static const char __pyx_k_Tree_to_ultrametric[] = "Tree.to_ultrametric";
static const char __pyx_k_effective_tree_size[] = "effective_tree_size";
static const char __pyx_k_extract_data_parser[] = "extract_data_parser";
static const char __pyx_k_polytomy_correction[] = "polytomy_correction";
static const char __pyx_k_polytomy_size_limit[] = "polytomy_size_limit";
static const char __pyx_k_ref_edges_in_source[] = "ref_edges_in_source";
static const char __pyx_k_show_difftable_topo[] = "show_difftable_topo";
static const char __pyx_k_source_edges_in_ref[] = "source_edges_in_ref";
static const char __pyx_k_Incorrect_child_type[] = "Incorrect child type: ";
static const char __pyx_k_Tree___reduce_cython[] = "Tree.__reduce_cython__";
static const char __pyx_k_Tree_check_monophyly[] = "Tree.check_monophyly";
static const char __pyx_k_Tree_common_ancestor[] = "Tree.common_ancestor";
static const char __pyx_k_Tree_get_topology_id[] = "Tree.get_topology_id";
static const char __pyx_k_Tree_is_monophyletic[] = "Tree.is_monophyletic";
static const char __pyx_k_Tree_remove_children[] = "Tree.remove_children";
static const char __pyx_k_Tree_robinson_foulds[] = "Tree.robinson_foulds";
static const char __pyx_k_get_speciation_trees[] = "get_speciation_trees";
static const char __pyx_k_leaves_from_ancestor[] = "leaves_from_ancestor";
static const char __pyx_k_leaves_locals_lambda[] = "leaves.<locals>.<lambda>";
static const char __pyx_k_len___locals_genexpr[] = "__len__.<locals>.genexpr";
static const char __pyx_k_prevent_nondicotomic[] = "prevent_nondicotomic";
static const char __pyx_k_static_gui_html_tree[] = "/static/gui.html?tree=";
static const char __pyx_k_Tree__translate_nodes[] = "Tree._translate_nodes";
static const char __pyx_k_Tree_get_closest_leaf[] = "Tree.get_closest_leaf";
static const char __pyx_k_Tree_get_monophyletic[] = "Tree.get_monophyletic";
static const char __pyx_k_Tree_resolve_polytomy[] = "Tree.resolve_polytomy";
static const char __pyx_k_Tree_reverse_children[] = "Tree.reverse_children";
static const char __pyx_k_Tree_search_ancestors[] = "Tree.search_ancestors";
static const char __pyx_k_Tree_sort_descendants[] = "Tree.sort_descendants";
static const char __pyx_k_get_midpoint_outgroup[] = "get_midpoint_outgroup";
static const char __pyx_k_search_leaves_by_name[] = "search_leaves_by_name";
static const char __pyx_k_skip_large_polytomies[] = "skip_large_polytomies";
static const char __pyx_k_total_valid_ref_edges[] = "total_valid_ref_edges";
static const char __pyx_k_Number_of_leaf_nodes_d[] = "Number of leaf nodes: %d";
static const char __pyx_k_Tree___setstate_cython[] = "Tree.__setstate_cython__";
static const char __pyx_k_Tree_cophenetic_matrix[] = "Tree.cophenetic_matrix";
static const char __pyx_k_Tree_expand_polytomies[] = "Tree.expand_polytomies";
static const char __pyx_k_Tree_get_farthest_leaf[] = "Tree.get_farthest_leaf";
static const char __pyx_k_Tree_get_farthest_node[] = "Tree.get_farthest_node";
static const char __pyx_k_Tree_iter_prepostorder[] = "Tree.iter_prepostorder";
static const char __pyx_k_is_not_a_Face_instance[] = " is not a Face instance";
static const char __pyx_k_metrics_recording_only[] = "--metrics-recording-only";
static const char __pyx_k_preserve_branch_length[] = "preserve_branch_length";
static const char __pyx_k_prune_locals_cmp_nodes[] = "prune.<locals>.cmp_nodes";
static const char __pyx_k_show_difftable_summary[] = "show_difftable_summary";
static const char __pyx_k_No_node_found_with_name[] = "No node found with name: ";
static const char __pyx_k_Total_number_of_nodes_d[] = "Total number of nodes: %d";
static const char __pyx_k_Tree_get_cached_content[] = "Tree.get_cached_content";
static const char __pyx_k_Tree_search_descendants[] = "Tree.search_descendants";
static const char __pyx_k_Unknown_output_for_diff[] = "Unknown output for diff: ";
static const char __pyx_k_autodetect_duplications[] = "autodetect_duplications";
static const char __pyx_k_compare_locals__compare[] = "compare.<locals>._compare";
static const char __pyx_k_from_parent_child_table[] = "from_parent_child_table";
static const char __pyx_k_compare_locals__safe_div[] = "compare.<locals>._safe_div";
static const char __pyx_k_correct_by_polytomy_size[] = "correct_by_polytomy_size";
static const char __pyx_k_getitem___locals_genexpr[] = "__getitem__.<locals>.genexpr";
static const char __pyx_k_contains___locals_genexpr[] = "__contains__.<locals>.genexpr";
static const char __pyx_k_Cannot_pop_child_not_found[] = "Cannot pop child: not found (";
static const char __pyx_k_Tree_get_midpoint_outgroup[] = "Tree.get_midpoint_outgroup";
static const char __pyx_k_Tree_search_leaves_by_name[] = "Tree.search_leaves_by_name";
static const char __pyx_k_get_distance_locals_genexpr[] = "get_distance.<locals>.genexpr";
static const char __pyx_k_remove_child_locals_genexpr[] = "remove_child.<locals>.genexpr";
static const char __pyx_k_search_nodes_locals_genexpr[] = "search_nodes.<locals>.genexpr";
static const char __pyx_k_No_common_ancestor_for_nodes[] = "No common ancestor for nodes: ";
static const char __pyx_k_Tree_from_parent_child_table[] = "Tree.from_parent_child_table";
static const char __pyx_k_Cannot_remove_child_not_found[] = "Cannot remove child: not found (";
static const char __pyx_k_This_module_provides_the_class[] = "\nThis module provides the class Tree, which is the main one used in ete.\n\nThe most common way to use it is::\n\n  t = Tree(open(file_with_newick), parser=parser_id)\n\nwhere ``parser_id`` is one of the values that can be seen in the\n:mod:`newick parser module <ete4.parser.newick>`.\n";
static const char __pyx_k_check_monophyly_locals_genexpr[] = "check_monophyly.<locals>.genexpr";
static const char __pyx_k_from_skbio_locals_get_ete_node[] = "from_skbio.<locals>.get_ete_node";
static const char __pyx_k_get_monophyletic_locals_lambda[] = "get_monophyletic.<locals>.<lambda>";
static const char __pyx_k_get_topology_id_locals_genexpr[] = "get_topology_id.<locals>.genexpr";
static const char __pyx_k_is_monophyletic_locals_genexpr[] = "is_monophyletic.<locals>.genexpr";
static const char __pyx_k_robinson_foulds_locals_genexpr[] = "robinson_foulds.<locals>.genexpr";
static const char __pyx_k_sort_descendants_locals_lambda[] = "sort_descendants.<locals>.<lambda>";
static const char __pyx_k_children_Use_reverse_children_i[] = " children. Use reverse_children() instead?";
static const char __pyx_k_get_farthest_and_closest_leaves[] = "_get_farthest_and_closest_leaves.<locals>.<lambda>";
static const char __pyx_k_get_farthest_node_locals_lambda[] = "get_farthest_node.<locals>.<lambda>";
static const char __pyx_k_init_from_empty_data_should_not[] = "init from empty data should not use parser";
static const char __pyx_k_init_from_parsed_content_cannot[] = "init from parsed content cannot have children";
static const char __pyx_k_robinson_foulds_locals_has_prop[] = "robinson_foulds.<locals>.has_prop";
static const char __pyx_k_search_ancestors_locals_genexpr[] = "search_ancestors.<locals>.genexpr";
static const char __pyx_k_A_parent_node_is_required_to_add[] = "A parent node is required to add a sister";
static const char __pyx_k_Both_trees_contain_polytomies_Tr[] = "Both trees contain polytomies! Try expand_polytomies=True instead.";
static const char __pyx_k_Can_only_check_nodes_or_names_in[] = "Can only check nodes or names in a Tree";
static const char __pyx_k_Cannot_remove_sister_because_the[] = "Cannot remove sister because there are no sisters";
static const char __pyx_k_Cannot_render_image_missing_modu[] = "Cannot render image - missing module \"selenium\"";
static const char __pyx_k_Duplicated_items_found_in_refere[] = "Duplicated items found in reference tree.";
static const char __pyx_k_Duplicated_items_found_in_target[] = "Duplicated items found in target tree.";
static const char __pyx_k_Found_polytomy_larger_than_curre[] = "Found polytomy larger than current limit: %s";
static const char __pyx_k_Incompatible_checksums_0x_x_vs_0[] = "Incompatible checksums (0x%x vs (0x9050475, 0x1a93b81, 0x290a31e) = (_children, props, size, up))";
static const char __pyx_k_Tree__get_farthest_and_closest_l[] = "Tree._get_farthest_and_closest_leaves";
static const char __pyx_k_Unrooted_tree_found_You_may_want[] = "Unrooted tree found! You may want to set unrooted_trees=True.";
static const char __pyx_k_cophenetic_matrix_locals_genexpr[] = "cophenetic_matrix.<locals>.genexpr";
static const char __pyx_k_expand_polytomies_and_correct_by[] = "expand_polytomies and correct_by_polytomy_size are mutually exclusive.";
static const char __pyx_k_expand_polytomies_and_unrooted_t[] = "expand_polytomies and unrooted_trees are mutually exclusive.";
static const char __pyx_k_expand_polytomies_locals_TipTupl[] = "expand_polytomies.<locals>.TipTuple";
static const char __pyx_k_expand_polytomies_locals_add_lea[] = "expand_polytomies.<locals>.add_leaf";
static const char __pyx_k_expand_polytomies_locals_enum_un[] = "expand_polytomies.<locals>.enum_unordered";
static const char __pyx_k_from_parent_child_table_locals_g[] = "from_parent_child_table.<locals>.get_node";
static const char __pyx_k_get_cached_content_locals_get_co[] = "get_cached_content.<locals>.get_content";
static const char __pyx_k_init_from_dict_data_should_not_u[] = "init from dict data should not use parser";
static const char __pyx_k_max_treeko_splits_to_be_artifact[] = "max_treeko_splits_to_be_artifact";
static const char __pyx_k_multiple_trees_use_nexus_load_in[] = "multiple trees - use nexus.load() instead?";
static const char __pyx_k_robinson_foulds_locals_from_comm[] = "robinson_foulds.<locals>.from_common";
static const char __pyx_k_selenium_webdriver_chrome_option[] = "selenium.webdriver.chrome.options";
static const char __pyx_k_get_farthest_and_closest_leaves_2[] = "_get_farthest_and_closest_leaves";
/* #### Code section: decls ### */
static int __pyx_pf_4ete4_4core_4tree_4Tree___init__(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_data, PyObject *__pyx_v_children, PyObject *__pyx_v_parser); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_4name___get__(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self); /* proto */
static int __pyx_pf_4ete4_4core_4tree_4Tree_4name_2__set__(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_4dist___get__(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self); /* proto */
static int __pyx_pf_4ete4_4core_4tree_4Tree_4dist_2__set__(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_7support___get__(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self); /* proto */
static int __pyx_pf_4ete4_4core_4tree_4Tree_7support_2__set__(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_8children___get__(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self); /* proto */
static int __pyx_pf_4ete4_4core_4tree_4Tree_8children_2__set__(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_children); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_7is_leaf___get__(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_7is_root___get__(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_4root___get__(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_2id___get__(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_5level___get__(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_2get_prop(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_prop, PyObject *__pyx_v_default); /* proto */
static int __pyx_pf_4ete4_4core_4tree_4Tree_4__bool__(CYTHON_UNUSED struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_7__len___genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */
static Py_ssize_t __pyx_pf_4ete4_4core_4tree_4Tree_6__len__(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_11__getitem___genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_8__getitem__(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_node_id); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_10__add__(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_12__repr__(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_14__str__(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_16to_str(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_show_internal, PyObject *__pyx_v_compact, PyObject *__pyx_v_props, PyObject *__pyx_v_px, PyObject *__pyx_v_py, PyObject *__pyx_v_px0, PyObject *__pyx_v_cascade); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_12__contains___genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */
static int __pyx_pf_4ete4_4core_4tree_4Tree_18__contains__(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_node); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_20__iter__(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_23add_prop(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_25add_props(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_props); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_27del_prop(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_29add_child(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_child, PyObject *__pyx_v_name, PyObject *__pyx_v_dist, PyObject *__pyx_v_support); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_31add_children(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_nodes); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_33pop_child(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_child_idx); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_12remove_child_genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_35remove_child(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_child); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_37remove_children(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_39add_sister(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_sister, PyObject *__pyx_v_name, PyObject *__pyx_v_dist); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_41remove_sister(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_sister); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_43delete(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_prevent_nondicotomic, PyObject *__pyx_v_preserve_branch_length); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_45detach(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_5prune_cmp_nodes(PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_47prune(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_nodes, PyObject *__pyx_v_preserve_branch_length); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_49reverse_children(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_51swap_children(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_53get_children(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_55get_sisters(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda4(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_n); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_57leaves(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_is_leaf_fn); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_60leaf_names(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_is_leaf_fn); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_63descendants(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_strategy, PyObject *__pyx_v_is_leaf_fn); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_66traverse(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_strategy, PyObject *__pyx_v_is_leaf_fn); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_69iter_prepostorder(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_is_leaf_fn); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_72ancestors(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_root, PyObject *__pyx_v_include_root); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_75lineage(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_root, PyObject *__pyx_v_include_root); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_78_translate_nodes(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_nodes); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_80describe(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_82write(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_outfile, PyObject *__pyx_v_props, PyObject *__pyx_v_parser, PyObject *__pyx_v_format_root_node, PyObject *__pyx_v_is_leaf_fn); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_84common_ancestor(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_nodes); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_12search_nodes_genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_86search_nodes(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_conditions); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_89search_descendants(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_conditions); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_16search_ancestors_genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_92search_ancestors(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_conditions); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_95search_leaves_by_name(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_12get_distance_genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_12get_distance_3genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_97get_distance(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_node1, PyObject *__pyx_v_node2, PyObject *__pyx_v_topological); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda9(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_node); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_99get_farthest_node(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_topological); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda10(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_node); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_101_get_farthest_and_closest_leaves(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_topological, PyObject *__pyx_v_is_leaf_fn); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_103get_farthest_leaf(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_topological, PyObject *__pyx_v_is_leaf_fn); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_105get_closest_leaf(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_topological, PyObject *__pyx_v_is_leaf_fn); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_107get_midpoint_outgroup(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_topological); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_109mean_distance(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_weight_fn, PyObject *__pyx_v_leaf, PyObject *__pyx_v_topological); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_111populate(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_names, PyObject *__pyx_v_model, PyObject *__pyx_v_dist_fn, PyObject *__pyx_v_support_fn); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_113set_outgroup(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_node, PyObject *__pyx_v_bprops, PyObject *__pyx_v_dist); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_115unroot(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_bprops); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_117show(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_layout, PyObject *__pyx_v_tree_style, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_119render(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_file_name, PyObject *__pyx_v_layout, PyObject *__pyx_v_w, PyObject *__pyx_v_h, PyObject *__pyx_v_tree_style, PyObject *__pyx_v_units, PyObject *__pyx_v_dpi); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_121explore(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_layouts, PyObject *__pyx_v_host, PyObject *__pyx_v_port, PyObject *__pyx_v_verbose, PyObject *__pyx_v_compress, PyObject *__pyx_v_keep_server, PyObject *__pyx_v_open_browser, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_123render_sm(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_file_name, PyObject *__pyx_v_layouts, PyObject *__pyx_v_w, PyObject *__pyx_v_h); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_125copy(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_method); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_127ladderize(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_topological, PyObject *__pyx_v_reverse); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda11(PyObject *__pyx_self, PyObject *__pyx_v_node); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_129sort_descendants(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_prop); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_18get_cached_content_get_content(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_131get_cached_content(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_prop, PyObject *__pyx_v_container_type, PyObject *__pyx_v_leaves_only); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_15robinson_foulds_has_prop(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_node, PyObject *__pyx_v_prop); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_15robinson_foulds_2from_common(PyObject *__pyx_self, PyObject *__pyx_v_nodes, PyObject *__pyx_v_prop); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_15robinson_foulds_5genexpr(PyObject *__pyx_self, struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_genexpr_arg_0); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_15robinson_foulds_8genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_15robinson_foulds_11genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_15robinson_foulds_14genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_15robinson_foulds_9genexpr23_genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_15robinson_foulds_9genexpr27_genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_15robinson_foulds_17genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_15robinson_foulds_20genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_15robinson_foulds_23genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_15robinson_foulds_26genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_133robinson_foulds(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_t2, PyObject *__pyx_v_prop_t1, PyObject *__pyx_v_prop_t2, PyObject *__pyx_v_unrooted_trees, PyObject *__pyx_v_expand_polytomies, PyObject *__pyx_v_polytomy_size_limit, PyObject *__pyx_v_skip_large_polytomies, PyObject *__pyx_v_correct_by_polytomy_size, PyObject *__pyx_v_min_support_t1, PyObject *__pyx_v_min_support_t2); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_7compare__safe_div(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_a, PyObject *__pyx_v_b); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_7compare_2_compare(PyObject *__pyx_self, PyObject *__pyx_v_src_tree, PyObject *__pyx_v_ref_tree); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_135compare(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_ref_tree, CYTHON_UNUSED PyObject *__pyx_v_use_collateral, PyObject *__pyx_v_min_support_source, PyObject *__pyx_v_min_support_ref, PyObject *__pyx_v_has_duplications, PyObject *__pyx_v_expand_polytomies, PyObject *__pyx_v_unrooted, PyObject *__pyx_v_max_treeko_splits_to_be_artifact, PyObject *__pyx_v_ref_tree_attr, PyObject *__pyx_v_source_tree_attr); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_137_diff(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_t2, PyObject *__pyx_v_output, PyObject *__pyx_v_prop_t1, PyObject *__pyx_v_prop_t2, PyObject *__pyx_v_color); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_139edges(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_cached_content); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_142standardize(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_delete_orphan, PyObject *__pyx_v_preserve_branch_length); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_15get_topology_id_genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_15get_topology_id_3genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_144get_topology_id(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_prop); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_146to_ultrametric(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_topological); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_15is_monophyletic_genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_148is_monophyletic(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_nodes); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_15check_monophyly_genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_15check_monophyly_3genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_150check_monophyly(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_values, PyObject *__pyx_v_prop, PyObject *__pyx_v_unrooted); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda27(PyObject *__pyx_self, PyObject *__pyx_v_node); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_152get_monophyletic(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_values, PyObject *__pyx_v_prop); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_17expand_polytomies_add_leaf(PyObject *__pyx_self, PyObject *__pyx_v_tree, PyObject *__pyx_v_label); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_17expand_polytomies_3enum_unordered(PyObject *__pyx_self, PyObject *__pyx_v_labels); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_155expand_polytomies(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_map_prop, PyObject *__pyx_v_polytomy_size_limit, PyObject *__pyx_v_skip_large_polytomies); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_157resolve_polytomy(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_descendants); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_17cophenetic_matrix_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_159cophenetic_matrix(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_23from_parent_child_table_get_node(PyObject *__pyx_self, PyObject *__pyx_v_nodename, PyObject *__pyx_v_dist); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_161from_parent_child_table(PyObject *__pyx_v_parent_child_table); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_10from_skbio_get_ete_node(PyObject *__pyx_self, PyObject *__pyx_v_skbio_node); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_163from_skbio(PyObject *__pyx_v_skbio_tree, PyObject *__pyx_v_map_attributes); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_165add_face(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_face, PyObject *__pyx_v_column, PyObject *__pyx_v_position); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_9img_style___get__(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self); /* proto */
static int __pyx_pf_4ete4_4core_4tree_4Tree_9img_style_2__set__(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_167set_style(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_2up___get__(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self); /* proto */
static int __pyx_pf_4ete4_4core_4tree_4Tree_2up_2__set__(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_4ete4_4core_4tree_4Tree_2up_4__del__(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_5props___get__(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self); /* proto */
static int __pyx_pf_4ete4_4core_4tree_4Tree_5props_2__set__(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_4ete4_4core_4tree_4Tree_5props_4__del__(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_9_children___get__(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self); /* proto */
static int __pyx_pf_4ete4_4core_4tree_4Tree_9_children_2__set__(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_4ete4_4core_4tree_4Tree_9_children_4__del__(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_4size___get__(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self); /* proto */
static int __pyx_pf_4ete4_4core_4tree_4Tree_4size_2__set__(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_169__reduce_cython__(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_171__setstate_cython__(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_4ete4_4core_4tree___pyx_unpickle_Tree(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_4ete4_4core_4tree_Tree(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct__genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_1___getitem__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_2_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_3___contains__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_4_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_5___iter__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_6_remove_child(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_7_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_8_prune(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_9_leaves(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_10_leaf_names(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_11_descendants(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_12_traverse(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_13_iter_prepostorder(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_14_ancestors(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_15_lineage(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_16_search_nodes(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_17_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_18_search_descendants(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_19_search_ancestors(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_20_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_21_get_distance(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_22_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_23_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_24_sort_descendants(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_25_get_cached_content(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_27_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_28_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_29_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_30_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_31_from_common(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_32_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_33_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_34_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_35_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_36_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_37_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_38_compare(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_39_edges(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_40_get_topology_id(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_41_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_42_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_43_is_monophyletic(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_44_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_45_check_monophyly(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_46_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_47_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_48_get_monophyletic(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_49_expand_polytomies(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_50_add_leaf(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_51_enum_unordered(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_52_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_53_from_parent_child_table(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_54_from_skbio(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_get = {0, 0, 0, 0, 0};
static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_keys = {0, 0, 0, 0, 0};
static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop = {0, 0, 0, 0, 0};
static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_setdefault = {0, 0, 0, 0, 0};
static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_update = {0, 0, 0, 0, 0};
static __Pyx_CachedCFunction __pyx_umethod_PyList_Type_pop = {0, 0, 0, 0, 0};
static __Pyx_CachedCFunction __pyx_umethod_PySet_Type_issubset = {0, 0, 0, 0, 0};
/* #### Code section: late_includes ### */
/* #### Code section: module_state ### */
typedef struct {
  PyObject *__pyx_d;
  PyObject *__pyx_b;
  PyObject *__pyx_cython_runtime;
  PyObject *__pyx_empty_tuple;
  PyObject *__pyx_empty_bytes;
  PyObject *__pyx_empty_unicode;
  #ifdef __Pyx_CyFunction_USED
  PyTypeObject *__pyx_CyFunctionType;
  #endif
  #ifdef __Pyx_FusedFunction_USED
  PyTypeObject *__pyx_FusedFunctionType;
  #endif
  #ifdef __Pyx_Generator_USED
  PyTypeObject *__pyx_GeneratorType;
  #endif
  #ifdef __Pyx_IterableCoroutine_USED
  PyTypeObject *__pyx_IterableCoroutineType;
  #endif
  #ifdef __Pyx_Coroutine_USED
  PyTypeObject *__pyx_CoroutineAwaitType;
  #endif
  #ifdef __Pyx_Coroutine_USED
  PyTypeObject *__pyx_CoroutineType;
  #endif
  #if CYTHON_USE_MODULE_STATE
  PyObject *__pyx_type_4ete4_4core_4tree_Tree;
  PyObject *__pyx_type_4ete4_4core_4tree___pyx_scope_struct__genexpr;
  PyObject *__pyx_type_4ete4_4core_4tree___pyx_scope_struct_1___getitem__;
  PyObject *__pyx_type_4ete4_4core_4tree___pyx_scope_struct_2_genexpr;
  PyObject *__pyx_type_4ete4_4core_4tree___pyx_scope_struct_3___contains__;
  PyObject *__pyx_type_4ete4_4core_4tree___pyx_scope_struct_4_genexpr;
  PyObject *__pyx_type_4ete4_4core_4tree___pyx_scope_struct_5___iter__;
  PyObject *__pyx_type_4ete4_4core_4tree___pyx_scope_struct_6_remove_child;
  PyObject *__pyx_type_4ete4_4core_4tree___pyx_scope_struct_7_genexpr;
  PyObject *__pyx_type_4ete4_4core_4tree___pyx_scope_struct_8_prune;
  PyObject *__pyx_type_4ete4_4core_4tree___pyx_scope_struct_9_leaves;
  PyObject *__pyx_type_4ete4_4core_4tree___pyx_scope_struct_10_leaf_names;
  PyObject *__pyx_type_4ete4_4core_4tree___pyx_scope_struct_11_descendants;
  PyObject *__pyx_type_4ete4_4core_4tree___pyx_scope_struct_12_traverse;
  PyObject *__pyx_type_4ete4_4core_4tree___pyx_scope_struct_13_iter_prepostorder;
  PyObject *__pyx_type_4ete4_4core_4tree___pyx_scope_struct_14_ancestors;
  PyObject *__pyx_type_4ete4_4core_4tree___pyx_scope_struct_15_lineage;
  PyObject *__pyx_type_4ete4_4core_4tree___pyx_scope_struct_16_search_nodes;
  PyObject *__pyx_type_4ete4_4core_4tree___pyx_scope_struct_17_genexpr;
  PyObject *__pyx_type_4ete4_4core_4tree___pyx_scope_struct_18_search_descendants;
  PyObject *__pyx_type_4ete4_4core_4tree___pyx_scope_struct_19_search_ancestors;
  PyObject *__pyx_type_4ete4_4core_4tree___pyx_scope_struct_20_genexpr;
  PyObject *__pyx_type_4ete4_4core_4tree___pyx_scope_struct_21_get_distance;
  PyObject *__pyx_type_4ete4_4core_4tree___pyx_scope_struct_22_genexpr;
  PyObject *__pyx_type_4ete4_4core_4tree___pyx_scope_struct_23_genexpr;
  PyObject *__pyx_type_4ete4_4core_4tree___pyx_scope_struct_24_sort_descendants;
  PyObject *__pyx_type_4ete4_4core_4tree___pyx_scope_struct_25_get_cached_content;
  PyObject *__pyx_type_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds;
  PyObject *__pyx_type_4ete4_4core_4tree___pyx_scope_struct_27_genexpr;
  PyObject *__pyx_type_4ete4_4core_4tree___pyx_scope_struct_28_genexpr;
  PyObject *__pyx_type_4ete4_4core_4tree___pyx_scope_struct_29_genexpr;
  PyObject *__pyx_type_4ete4_4core_4tree___pyx_scope_struct_30_genexpr;
  PyObject *__pyx_type_4ete4_4core_4tree___pyx_scope_struct_31_from_common;
  PyObject *__pyx_type_4ete4_4core_4tree___pyx_scope_struct_32_genexpr;
  PyObject *__pyx_type_4ete4_4core_4tree___pyx_scope_struct_33_genexpr;
  PyObject *__pyx_type_4ete4_4core_4tree___pyx_scope_struct_34_genexpr;
  PyObject *__pyx_type_4ete4_4core_4tree___pyx_scope_struct_35_genexpr;
  PyObject *__pyx_type_4ete4_4core_4tree___pyx_scope_struct_36_genexpr;
  PyObject *__pyx_type_4ete4_4core_4tree___pyx_scope_struct_37_genexpr;
  PyObject *__pyx_type_4ete4_4core_4tree___pyx_scope_struct_38_compare;
  PyObject *__pyx_type_4ete4_4core_4tree___pyx_scope_struct_39_edges;
  PyObject *__pyx_type_4ete4_4core_4tree___pyx_scope_struct_40_get_topology_id;
  PyObject *__pyx_type_4ete4_4core_4tree___pyx_scope_struct_41_genexpr;
  PyObject *__pyx_type_4ete4_4core_4tree___pyx_scope_struct_42_genexpr;
  PyObject *__pyx_type_4ete4_4core_4tree___pyx_scope_struct_43_is_monophyletic;
  PyObject *__pyx_type_4ete4_4core_4tree___pyx_scope_struct_44_genexpr;
  PyObject *__pyx_type_4ete4_4core_4tree___pyx_scope_struct_45_check_monophyly;
  PyObject *__pyx_type_4ete4_4core_4tree___pyx_scope_struct_46_genexpr;
  PyObject *__pyx_type_4ete4_4core_4tree___pyx_scope_struct_47_genexpr;
  PyObject *__pyx_type_4ete4_4core_4tree___pyx_scope_struct_48_get_monophyletic;
  PyObject *__pyx_type_4ete4_4core_4tree___pyx_scope_struct_49_expand_polytomies;
  PyObject *__pyx_type_4ete4_4core_4tree___pyx_scope_struct_50_add_leaf;
  PyObject *__pyx_type_4ete4_4core_4tree___pyx_scope_struct_51_enum_unordered;
  PyObject *__pyx_type_4ete4_4core_4tree___pyx_scope_struct_52_genexpr;
  PyObject *__pyx_type_4ete4_4core_4tree___pyx_scope_struct_53_from_parent_child_table;
  PyObject *__pyx_type_4ete4_4core_4tree___pyx_scope_struct_54_from_skbio;
  #endif
  PyTypeObject *__pyx_ptype_4ete4_4core_4tree_Tree;
  PyTypeObject *__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct__genexpr;
  PyTypeObject *__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_1___getitem__;
  PyTypeObject *__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_2_genexpr;
  PyTypeObject *__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_3___contains__;
  PyTypeObject *__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_4_genexpr;
  PyTypeObject *__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_5___iter__;
  PyTypeObject *__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_6_remove_child;
  PyTypeObject *__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_7_genexpr;
  PyTypeObject *__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_8_prune;
  PyTypeObject *__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_9_leaves;
  PyTypeObject *__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_10_leaf_names;
  PyTypeObject *__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_11_descendants;
  PyTypeObject *__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_12_traverse;
  PyTypeObject *__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_13_iter_prepostorder;
  PyTypeObject *__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_14_ancestors;
  PyTypeObject *__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_15_lineage;
  PyTypeObject *__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_16_search_nodes;
  PyTypeObject *__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_17_genexpr;
  PyTypeObject *__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_18_search_descendants;
  PyTypeObject *__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_19_search_ancestors;
  PyTypeObject *__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_20_genexpr;
  PyTypeObject *__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_21_get_distance;
  PyTypeObject *__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_22_genexpr;
  PyTypeObject *__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_23_genexpr;
  PyTypeObject *__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_24_sort_descendants;
  PyTypeObject *__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_25_get_cached_content;
  PyTypeObject *__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds;
  PyTypeObject *__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_27_genexpr;
  PyTypeObject *__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_28_genexpr;
  PyTypeObject *__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_29_genexpr;
  PyTypeObject *__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_30_genexpr;
  PyTypeObject *__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_31_from_common;
  PyTypeObject *__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_32_genexpr;
  PyTypeObject *__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_33_genexpr;
  PyTypeObject *__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_34_genexpr;
  PyTypeObject *__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_35_genexpr;
  PyTypeObject *__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_36_genexpr;
  PyTypeObject *__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_37_genexpr;
  PyTypeObject *__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_38_compare;
  PyTypeObject *__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_39_edges;
  PyTypeObject *__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_40_get_topology_id;
  PyTypeObject *__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_41_genexpr;
  PyTypeObject *__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_42_genexpr;
  PyTypeObject *__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_43_is_monophyletic;
  PyTypeObject *__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_44_genexpr;
  PyTypeObject *__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_45_check_monophyly;
  PyTypeObject *__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_46_genexpr;
  PyTypeObject *__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_47_genexpr;
  PyTypeObject *__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_48_get_monophyletic;
  PyTypeObject *__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_49_expand_polytomies;
  PyTypeObject *__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_50_add_leaf;
  PyTypeObject *__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_51_enum_unordered;
  PyTypeObject *__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_52_genexpr;
  PyTypeObject *__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_53_from_parent_child_table;
  PyTypeObject *__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_54_from_skbio;
  PyObject *__pyx_kp_u_127_0_0_1;
  PyObject *__pyx_kp_u_A_parent_node_is_required_to_add;
  PyObject *__pyx_kp_u_Ambiguous_node_name;
  PyObject *__pyx_n_s_AssertionError;
  PyObject *__pyx_kp_u_Both_trees_contain_polytomies_Tr;
  PyObject *__pyx_kp_u_Can_only_check_nodes_or_names_in;
  PyObject *__pyx_kp_u_Cannot_pop_child_not_found;
  PyObject *__pyx_kp_u_Cannot_remove_child_not_found;
  PyObject *__pyx_kp_u_Cannot_remove_sister_because_the;
  PyObject *__pyx_kp_u_Cannot_render_image_missing_modu;
  PyObject *__pyx_n_s_Chrome;
  PyObject *__pyx_kp_u_Duplicated_items_found_in_refere;
  PyObject *__pyx_kp_u_Duplicated_items_found_in_target;
  PyObject *__pyx_n_u_ETE;
  PyObject *__pyx_n_s_FACE_POSITIONS;
  PyObject *__pyx_n_s_Face;
  PyObject *__pyx_n_s_FaceAreas;
  PyObject *__pyx_n_s_FaceContainer;
  PyObject *__pyx_kp_u_Found_polytomy_larger_than_curre;
  PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0;
  PyObject *__pyx_kp_u_Incorrect_child_type;
  PyObject *__pyx_n_s_IndexError;
  PyObject *__pyx_kp_u_Invalid_copy_method;
  PyObject *__pyx_kp_u_Invalid_node_id;
  PyObject *__pyx_kp_u_Invalid_node_type;
  PyObject *__pyx_kp_u_Max_distance_g;
  PyObject *__pyx_n_s_ModuleNotFoundError;
  PyObject *__pyx_kp_u_Most_distant_node_s;
  PyObject *__pyx_n_u_NA;
  PyObject *__pyx_n_u_No;
  PyObject *__pyx_kp_u_No_children;
  PyObject *__pyx_kp_u_No_common_ancestor_for_nodes;
  PyObject *__pyx_kp_u_No_node_found_with_name;
  PyObject *__pyx_n_s_NodeStyle;
  PyObject *__pyx_kp_u_Node_has;
  PyObject *__pyx_kp_u_Number_of_leaf_nodes_d;
  PyObject *__pyx_n_s_Options;
  PyObject *__pyx_n_s_PARSERS;
  PyObject *__pyx_n_s_PickleError;
  PyObject *__pyx_kp_u_Rooted_s;
  PyObject *__pyx_n_s_StopIteration;
  PyObject *__pyx_n_s_TipTuple;
  PyObject *__pyx_kp_u_Total_number_of_nodes_d;
  PyObject *__pyx_kp_u_Tree;
  PyObject *__pyx_n_s_TreeError;
  PyObject *__pyx_n_s_TreeNode;
  PyObject *__pyx_n_s_Tree_2;
  PyObject *__pyx_n_s_Tree___iter;
  PyObject *__pyx_n_s_Tree___reduce_cython;
  PyObject *__pyx_n_s_Tree___setstate_cython;
  PyObject *__pyx_n_s_Tree__diff;
  PyObject *__pyx_n_s_Tree__get_farthest_and_closest_l;
  PyObject *__pyx_n_s_Tree__translate_nodes;
  PyObject *__pyx_n_s_Tree_add_child;
  PyObject *__pyx_n_s_Tree_add_children;
  PyObject *__pyx_n_s_Tree_add_face;
  PyObject *__pyx_n_s_Tree_add_prop;
  PyObject *__pyx_n_s_Tree_add_props;
  PyObject *__pyx_n_s_Tree_add_sister;
  PyObject *__pyx_n_s_Tree_ancestors;
  PyObject *__pyx_n_s_Tree_check_monophyly;
  PyObject *__pyx_n_s_Tree_common_ancestor;
  PyObject *__pyx_n_s_Tree_compare;
  PyObject *__pyx_n_s_Tree_cophenetic_matrix;
  PyObject *__pyx_n_s_Tree_copy;
  PyObject *__pyx_n_s_Tree_del_prop;
  PyObject *__pyx_n_s_Tree_delete;
  PyObject *__pyx_n_s_Tree_descendants;
  PyObject *__pyx_n_s_Tree_describe;
  PyObject *__pyx_n_s_Tree_detach;
  PyObject *__pyx_n_s_Tree_edges;
  PyObject *__pyx_n_s_Tree_expand_polytomies;
  PyObject *__pyx_n_s_Tree_explore;
  PyObject *__pyx_n_s_Tree_from_parent_child_table;
  PyObject *__pyx_n_s_Tree_from_skbio;
  PyObject *__pyx_n_s_Tree_get_cached_content;
  PyObject *__pyx_n_s_Tree_get_children;
  PyObject *__pyx_n_s_Tree_get_closest_leaf;
  PyObject *__pyx_n_s_Tree_get_distance;
  PyObject *__pyx_n_s_Tree_get_farthest_leaf;
  PyObject *__pyx_n_s_Tree_get_farthest_node;
  PyObject *__pyx_n_s_Tree_get_midpoint_outgroup;
  PyObject *__pyx_n_s_Tree_get_monophyletic;
  PyObject *__pyx_n_s_Tree_get_prop;
  PyObject *__pyx_n_s_Tree_get_sisters;
  PyObject *__pyx_n_s_Tree_get_topology_id;
  PyObject *__pyx_n_s_Tree_is_monophyletic;
  PyObject *__pyx_n_s_Tree_iter_prepostorder;
  PyObject *__pyx_n_s_Tree_ladderize;
  PyObject *__pyx_n_s_Tree_leaf_names;
  PyObject *__pyx_n_s_Tree_leaves;
  PyObject *__pyx_n_s_Tree_lineage;
  PyObject *__pyx_n_s_Tree_mean_distance;
  PyObject *__pyx_n_s_Tree_pop_child;
  PyObject *__pyx_n_s_Tree_populate;
  PyObject *__pyx_n_s_Tree_prune;
  PyObject *__pyx_n_s_Tree_remove_child;
  PyObject *__pyx_n_s_Tree_remove_children;
  PyObject *__pyx_n_s_Tree_remove_sister;
  PyObject *__pyx_n_s_Tree_render;
  PyObject *__pyx_n_s_Tree_render_sm;
  PyObject *__pyx_n_s_Tree_resolve_polytomy;
  PyObject *__pyx_n_s_Tree_reverse_children;
  PyObject *__pyx_n_s_Tree_robinson_foulds;
  PyObject *__pyx_n_s_Tree_search_ancestors;
  PyObject *__pyx_n_s_Tree_search_descendants;
  PyObject *__pyx_n_s_Tree_search_leaves_by_name;
  PyObject *__pyx_n_s_Tree_search_nodes;
  PyObject *__pyx_n_s_Tree_set_outgroup;
  PyObject *__pyx_n_s_Tree_set_style;
  PyObject *__pyx_n_s_Tree_show;
  PyObject *__pyx_n_s_Tree_sort_descendants;
  PyObject *__pyx_n_s_Tree_standardize;
  PyObject *__pyx_n_s_Tree_swap_children;
  PyObject *__pyx_n_s_Tree_to_str;
  PyObject *__pyx_n_s_Tree_to_ultrametric;
  PyObject *__pyx_n_s_Tree_traverse;
  PyObject *__pyx_n_s_Tree_unroot;
  PyObject *__pyx_n_s_Tree_write;
  PyObject *__pyx_n_s_TypeError;
  PyObject *__pyx_kp_u_Unknown_output_for_diff;
  PyObject *__pyx_kp_u_Unknown_strategy;
  PyObject *__pyx_kp_u_Unrooted_tree_found_You_may_want;
  PyObject *__pyx_n_s_ValueError;
  PyObject *__pyx_kp_u_Wrote_file;
  PyObject *__pyx_n_u_Yes;
  PyObject *__pyx_n_s__121;
  PyObject *__pyx_kp_u__15;
  PyObject *__pyx_kp_u__2;
  PyObject *__pyx_kp_u__20;
  PyObject *__pyx_n_s__203;
  PyObject *__pyx_n_s__21;
  PyObject *__pyx_kp_u__22;
  PyObject *__pyx_kp_u__23;
  PyObject *__pyx_n_s__3;
  PyObject *__pyx_kp_u__3;
  PyObject *__pyx_kp_u__4;
  PyObject *__pyx_kp_u__5;
  PyObject *__pyx_n_s_a;
  PyObject *__pyx_n_s_add;
  PyObject *__pyx_n_s_add_argument;
  PyObject *__pyx_n_s_add_child;
  PyObject *__pyx_n_s_add_children;
  PyObject *__pyx_n_s_add_face;
  PyObject *__pyx_n_s_add_leaf;
  PyObject *__pyx_n_s_add_prop;
  PyObject *__pyx_n_s_add_props;
  PyObject *__pyx_n_s_add_sister;
  PyObject *__pyx_n_s_add_tree;
  PyObject *__pyx_n_s_all_leaves;
  PyObject *__pyx_n_s_all_max_rf;
  PyObject *__pyx_n_s_all_nodes;
  PyObject *__pyx_n_s_all_rf;
  PyObject *__pyx_n_s_alld;
  PyObject *__pyx_n_s_allleaves;
  PyObject *__pyx_n_s_ancestors;
  PyObject *__pyx_n_s_append;
  PyObject *__pyx_n_s_args;
  PyObject *__pyx_n_s_asyncio_coroutines;
  PyObject *__pyx_kp_u_at;
  PyObject *__pyx_n_s_attr;
  PyObject *__pyx_n_s_autodetect_duplications;
  PyObject *__pyx_n_s_b;
  PyObject *__pyx_kp_u_bad_parser;
  PyObject *__pyx_n_s_bprops;
  PyObject *__pyx_n_s_branch;
  PyObject *__pyx_kp_u_branch_right;
  PyObject *__pyx_n_s_cached_content;
  PyObject *__pyx_n_s_cascade;
  PyObject *__pyx_n_s_cdist;
  PyObject *__pyx_n_s_ch;
  PyObject *__pyx_n_s_check_monophyly;
  PyObject *__pyx_n_s_check_monophyly_locals_genexpr;
  PyObject *__pyx_n_s_child;
  PyObject *__pyx_n_s_child_idx;
  PyObject *__pyx_n_s_child_name;
  PyObject *__pyx_n_s_children;
  PyObject *__pyx_kp_u_children_Use_reverse_children_i;
  PyObject *__pyx_n_s_childtrees;
  PyObject *__pyx_n_s_class;
  PyObject *__pyx_n_s_class_getitem;
  PyObject *__pyx_n_s_cline_in_traceback;
  PyObject *__pyx_n_s_close;
  PyObject *__pyx_n_s_cmp_nodes;
  PyObject *__pyx_n_s_cmp_to_key;
  PyObject *__pyx_n_s_color;
  PyObject *__pyx_n_s_column;
  PyObject *__pyx_n_s_columns;
  PyObject *__pyx_n_s_combinations;
  PyObject *__pyx_n_s_common;
  PyObject *__pyx_n_s_common_ancestor;
  PyObject *__pyx_n_s_common_edges;
  PyObject *__pyx_n_u_common_edges;
  PyObject *__pyx_n_s_common_names;
  PyObject *__pyx_n_s_compact;
  PyObject *__pyx_n_s_compare;
  PyObject *__pyx_n_s_compare_2;
  PyObject *__pyx_n_s_compare_locals__compare;
  PyObject *__pyx_n_s_compare_locals__safe_div;
  PyObject *__pyx_n_s_compress;
  PyObject *__pyx_n_s_conditions;
  PyObject *__pyx_n_s_container_type;
  PyObject *__pyx_n_s_contains___locals_genexpr;
  PyObject *__pyx_n_s_cophenetic_matrix;
  PyObject *__pyx_n_s_cophenetic_matrix_locals_genexpr;
  PyObject *__pyx_n_s_copy;
  PyObject *__pyx_n_s_corr1;
  PyObject *__pyx_n_s_corr2;
  PyObject *__pyx_n_s_correct_by_polytomy_size;
  PyObject *__pyx_n_u_cpickle;
  PyObject *__pyx_n_s_current;
  PyObject *__pyx_n_s_d;
  PyObject *__pyx_n_s_data;
  PyObject *__pyx_n_s_deepcopy;
  PyObject *__pyx_n_u_deepcopy;
  PyObject *__pyx_n_s_default;
  PyObject *__pyx_n_s_del_prop;
  PyObject *__pyx_n_s_delete;
  PyObject *__pyx_n_s_delete_orphan;
  PyObject *__pyx_n_s_depth;
  PyObject *__pyx_n_s_descendants;
  PyObject *__pyx_n_s_describe;
  PyObject *__pyx_n_s_detach;
  PyObject *__pyx_n_s_diameter;
  PyObject *__pyx_n_s_dict;
  PyObject *__pyx_n_s_dict_2;
  PyObject *__pyx_n_s_diff;
  PyObject *__pyx_n_u_diffs;
  PyObject *__pyx_n_u_diffs_tab;
  PyObject *__pyx_n_s_difftable;
  PyObject *__pyx_kp_u_disable;
  PyObject *__pyx_kp_u_disable_breakpad;
  PyObject *__pyx_kp_u_disable_logging;
  PyObject *__pyx_n_s_discard_t1;
  PyObject *__pyx_n_s_discard_t2;
  PyObject *__pyx_n_s_dist;
  PyObject *__pyx_n_u_dist;
  PyObject *__pyx_n_s_dist_fn;
  PyObject *__pyx_n_s_distance;
  PyObject *__pyx_n_s_doc;
  PyObject *__pyx_n_s_dpi;
  PyObject *__pyx_n_s_drawer;
  PyObject *__pyx_n_s_driver;
  PyObject *__pyx_n_s_dump;
  PyObject *__pyx_n_s_dumps;
  PyObject *__pyx_n_s_e;
  PyObject *__pyx_n_s_edge_keys;
  PyObject *__pyx_n_s_edges;
  PyObject *__pyx_n_s_edges1;
  PyObject *__pyx_n_s_edges2;
  PyObject *__pyx_n_u_effective_tree_size;
  PyObject *__pyx_kp_u_enable;
  PyObject *__pyx_n_s_enter;
  PyObject *__pyx_n_s_enum_unordered;
  PyObject *__pyx_n_s_enumerate;
  PyObject *__pyx_n_u_ete;
  PyObject *__pyx_n_s_ete4_core_tree;
  PyObject *__pyx_kp_s_ete4_core_tree_pyx;
  PyObject *__pyx_n_s_ete_ch;
  PyObject *__pyx_n_s_ete_diff;
  PyObject *__pyx_n_s_ete_format;
  PyObject *__pyx_n_s_ete_node;
  PyObject *__pyx_n_s_exit;
  PyObject *__pyx_n_s_expand_polytomies;
  PyObject *__pyx_kp_u_expand_polytomies_and_correct_by;
  PyObject *__pyx_kp_u_expand_polytomies_and_unrooted_t;
  PyObject *__pyx_n_s_expand_polytomies_locals_TipTupl;
  PyObject *__pyx_n_s_expand_polytomies_locals_add_lea;
  PyObject *__pyx_n_s_expand_polytomies_locals_enum_un;
  PyObject *__pyx_n_s_explore;
  PyObject *__pyx_n_s_explorer;
  PyObject *__pyx_n_s_extract_data_parser;
  PyObject *__pyx_n_s_face;
  PyObject *__pyx_kp_u_face_2;
  PyObject *__pyx_n_s_face_area;
  PyObject *__pyx_n_u_faces;
  PyObject *__pyx_n_s_farthest_dist;
  PyObject *__pyx_n_s_farthest_node;
  PyObject *__pyx_n_s_fdist;
  PyObject *__pyx_n_s_file_name;
  PyObject *__pyx_n_s_fnode;
  PyObject *__pyx_n_s_format_root_node;
  PyObject *__pyx_n_s_fp;
  PyObject *__pyx_n_s_from_common;
  PyObject *__pyx_n_s_from_parent_child_table;
  PyObject *__pyx_n_s_from_parent_child_table_locals_g;
  PyObject *__pyx_n_s_from_skbio;
  PyObject *__pyx_n_s_from_skbio_locals_get_ete_node;
  PyObject *__pyx_n_s_functools;
  PyObject *__pyx_kp_u_gc;
  PyObject *__pyx_n_s_genexpr;
  PyObject *__pyx_n_s_get;
  PyObject *__pyx_n_s_get_cached_content;
  PyObject *__pyx_n_s_get_cached_content_locals_get_co;
  PyObject *__pyx_n_s_get_children;
  PyObject *__pyx_n_s_get_closest_leaf;
  PyObject *__pyx_n_s_get_content;
  PyObject *__pyx_n_s_get_distance;
  PyObject *__pyx_n_s_get_distance_fn;
  PyObject *__pyx_n_s_get_distance_locals_genexpr;
  PyObject *__pyx_n_s_get_ete_node;
  PyObject *__pyx_n_s_get_farthest_and_closest_leaves;
  PyObject *__pyx_n_s_get_farthest_and_closest_leaves_2;
  PyObject *__pyx_n_s_get_farthest_leaf;
  PyObject *__pyx_n_s_get_farthest_node;
  PyObject *__pyx_n_s_get_farthest_node_locals_lambda;
  PyObject *__pyx_n_s_get_img;
  PyObject *__pyx_n_s_get_midpoint_outgroup;
  PyObject *__pyx_n_s_get_monophyletic;
  PyObject *__pyx_n_s_get_monophyletic_locals_lambda;
  PyObject *__pyx_n_s_get_node;
  PyObject *__pyx_n_s_get_prop;
  PyObject *__pyx_n_s_get_sisters;
  PyObject *__pyx_n_s_get_speciation_trees;
  PyObject *__pyx_n_s_get_topology_id;
  PyObject *__pyx_n_s_get_topology_id_locals_genexpr;
  PyObject *__pyx_n_s_getitem___locals_genexpr;
  PyObject *__pyx_n_s_getstate;
  PyObject *__pyx_n_s_h;
  PyObject *__pyx_n_s_has_duplications;
  PyObject *__pyx_n_s_has_prop;
  PyObject *__pyx_n_s_hash;
  PyObject *__pyx_n_s_hashlib;
  PyObject *__pyx_kp_u_headless;
  PyObject *__pyx_n_s_hex;
  PyObject *__pyx_n_s_hexdigest;
  PyObject *__pyx_n_s_host;
  PyObject *__pyx_kp_u_http;
  PyObject *__pyx_n_s_i;
  PyObject *__pyx_n_s_id;
  PyObject *__pyx_n_u_id;
  PyObject *__pyx_n_u_img_style;
  PyObject *__pyx_n_s_import;
  PyObject *__pyx_n_s_include_root;
  PyObject *__pyx_n_s_include_self;
  PyObject *__pyx_n_s_indent;
  PyObject *__pyx_n_u_indent;
  PyObject *__pyx_n_s_index;
  PyObject *__pyx_n_s_inf;
  PyObject *__pyx_kp_u_init_from_dict_data_should_not_u;
  PyObject *__pyx_kp_u_init_from_empty_data_should_not;
  PyObject *__pyx_kp_u_init_from_parsed_content_cannot;
  PyObject *__pyx_n_s_init_subclass;
  PyObject *__pyx_n_s_initializing;
  PyObject *__pyx_kp_u_inline;
  PyObject *__pyx_n_s_is_coroutine;
  PyObject *__pyx_n_s_is_leaf;
  PyObject *__pyx_n_s_is_leaf_fn;
  PyObject *__pyx_n_s_is_monophyletic;
  PyObject *__pyx_n_s_is_monophyletic_locals_genexpr;
  PyObject *__pyx_kp_u_is_not_a_Face_instance;
  PyObject *__pyx_n_s_is_root;
  PyObject *__pyx_kp_u_isenabled;
  PyObject *__pyx_n_s_issubset;
  PyObject *__pyx_n_s_items;
  PyObject *__pyx_n_s_iter;
  PyObject *__pyx_n_s_iter_prepostorder;
  PyObject *__pyx_n_s_itertools;
  PyObject *__pyx_n_s_join;
  PyObject *__pyx_n_s_k1;
  PyObject *__pyx_n_s_k2;
  PyObject *__pyx_n_s_keep_server;
  PyObject *__pyx_n_s_key;
  PyObject *__pyx_n_s_keys;
  PyObject *__pyx_n_s_kwargs;
  PyObject *__pyx_n_s_label;
  PyObject *__pyx_n_s_labels;
  PyObject *__pyx_n_s_ladderize;
  PyObject *__pyx_n_s_layout;
  PyObject *__pyx_n_s_layouts;
  PyObject *__pyx_n_s_leaf;
  PyObject *__pyx_n_s_leaf1;
  PyObject *__pyx_n_s_leaf2;
  PyObject *__pyx_n_s_leaf_distances;
  PyObject *__pyx_n_s_leaf_names;
  PyObject *__pyx_n_s_leaf_values;
  PyObject *__pyx_n_s_leaves;
  PyObject *__pyx_n_s_leaves_descendant;
  PyObject *__pyx_n_s_leaves_extra;
  PyObject *__pyx_n_s_leaves_from_ancestor;
  PyObject *__pyx_n_s_leaves_locals_lambda;
  PyObject *__pyx_n_s_leaves_only;
  PyObject *__pyx_n_s_left;
  PyObject *__pyx_n_s_len___locals_genexpr;
  PyObject *__pyx_n_u_length;
  PyObject *__pyx_n_u_levelorder;
  PyObject *__pyx_n_s_lineage;
  PyObject *__pyx_n_s_loads;
  PyObject *__pyx_n_s_lower;
  PyObject *__pyx_n_s_m;
  PyObject *__pyx_n_s_main;
  PyObject *__pyx_n_s_map_attributes;
  PyObject *__pyx_n_s_map_prop;
  PyObject *__pyx_n_s_map_properties;
  PyObject *__pyx_n_s_math;
  PyObject *__pyx_n_s_max;
  PyObject *__pyx_n_s_max_dist;
  PyObject *__pyx_n_s_max_node;
  PyObject *__pyx_n_s_max_parts;
  PyObject *__pyx_n_s_max_rf;
  PyObject *__pyx_n_u_max_rf;
  PyObject *__pyx_n_s_max_treeko_splits_to_be_artifact;
  PyObject *__pyx_n_s_maxrf;
  PyObject *__pyx_n_s_md5;
  PyObject *__pyx_n_s_mean;
  PyObject *__pyx_n_s_mean_distance;
  PyObject *__pyx_n_s_metaclass;
  PyObject *__pyx_n_s_method;
  PyObject *__pyx_kp_u_metrics_recording_only;
  PyObject *__pyx_n_s_min_comparison;
  PyObject *__pyx_n_s_min_dist;
  PyObject *__pyx_n_s_min_node;
  PyObject *__pyx_n_s_min_support_ref;
  PyObject *__pyx_n_s_min_support_source;
  PyObject *__pyx_n_s_min_support_t1;
  PyObject *__pyx_n_s_min_support_t2;
  PyObject *__pyx_n_s_model;
  PyObject *__pyx_n_s_module;
  PyObject *__pyx_n_u_monophyletic;
  PyObject *__pyx_n_s_movingnode;
  PyObject *__pyx_n_s_mro_entries;
  PyObject *__pyx_kp_u_multiple_trees_use_nexus_load_in;
  PyObject *__pyx_n_s_n;
  PyObject *__pyx_n_s_n2count;
  PyObject *__pyx_n_s_n2depth;
  PyObject *__pyx_n_s_n2subtrees;
  PyObject *__pyx_n_s_n2values;
  PyObject *__pyx_n_s_name;
  PyObject *__pyx_n_u_name;
  PyObject *__pyx_n_s_name2node;
  PyObject *__pyx_n_s_name_2;
  PyObject *__pyx_n_s_names;
  PyObject *__pyx_n_s_ncommon;
  PyObject *__pyx_n_s_ndups;
  PyObject *__pyx_n_s_new;
  PyObject *__pyx_n_s_new_node;
  PyObject *__pyx_n_s_new_tree;
  PyObject *__pyx_n_s_newick;
  PyObject *__pyx_n_u_newick;
  PyObject *__pyx_kp_u_newick_extended;
  PyObject *__pyx_n_s_newick_only;
  PyObject *__pyx_n_s_nexus;
  PyObject *__pyx_n_u_nexus;
  PyObject *__pyx_n_s_node;
  PyObject *__pyx_n_s_node1;
  PyObject *__pyx_n_s_node2;
  PyObject *__pyx_n_s_node2path;
  PyObject *__pyx_n_s_node_leaves;
  PyObject *__pyx_n_s_nodename;
  PyObject *__pyx_n_s_nodes;
  PyObject *__pyx_n_s_nodes_by_name;
  PyObject *__pyx_n_u_norm_rf;
  PyObject *__pyx_kp_u_not_in;
  PyObject *__pyx_n_s_ntrees;
  PyObject *__pyx_n_s_nw;
  PyObject *__pyx_n_s_open;
  PyObject *__pyx_n_s_open_browser;
  PyObject *__pyx_n_s_operations;
  PyObject *__pyx_n_s_ops;
  PyObject *__pyx_n_s_options;
  PyObject *__pyx_n_s_order;
  PyObject *__pyx_n_s_orig_target_size;
  PyObject *__pyx_n_s_origin_t;
  PyObject *__pyx_n_s_origin_trees;
  PyObject *__pyx_n_s_outfile;
  PyObject *__pyx_n_s_output;
  PyObject *__pyx_n_s_p;
  PyObject *__pyx_n_u_paraphyletic;
  PyObject *__pyx_n_s_parent;
  PyObject *__pyx_n_s_parent_child_table;
  PyObject *__pyx_n_s_parent_name;
  PyObject *__pyx_n_s_parser;
  PyObject *__pyx_n_s_parser_extract;
  PyObject *__pyx_n_s_path;
  PyObject *__pyx_n_s_paths;
  PyObject *__pyx_n_s_pickle;
  PyObject *__pyx_n_u_polyphyletic;
  PyObject *__pyx_n_s_polytomy_correction;
  PyObject *__pyx_n_s_polytomy_size_limit;
  PyObject *__pyx_n_s_pop;
  PyObject *__pyx_n_s_pop_child;
  PyObject *__pyx_n_s_popitem;
  PyObject *__pyx_n_s_populate;
  PyObject *__pyx_n_s_port;
  PyObject *__pyx_n_s_position;
  PyObject *__pyx_kp_u_position_2;
  PyObject *__pyx_n_s_post;
  PyObject *__pyx_n_u_postorder;
  PyObject *__pyx_n_s_preorder;
  PyObject *__pyx_n_u_preorder;
  PyObject *__pyx_n_s_prepare;
  PyObject *__pyx_n_s_preserve_branch_length;
  PyObject *__pyx_n_s_prev;
  PyObject *__pyx_n_s_prevent_nondicotomic;
  PyObject *__pyx_n_s_print;
  PyObject *__pyx_n_s_product;
  PyObject *__pyx_n_s_prop;
  PyObject *__pyx_n_s_prop1;
  PyObject *__pyx_n_s_prop2;
  PyObject *__pyx_n_s_prop_t1;
  PyObject *__pyx_n_s_prop_t2;
  PyObject *__pyx_n_s_props;
  PyObject *__pyx_n_s_prune;
  PyObject *__pyx_n_s_prune_locals_cmp_nodes;
  PyObject *__pyx_n_s_px;
  PyObject *__pyx_n_u_px;
  PyObject *__pyx_n_s_px0;
  PyObject *__pyx_n_s_py;
  PyObject *__pyx_n_s_pyx_PickleError;
  PyObject *__pyx_n_s_pyx_checksum;
  PyObject *__pyx_n_s_pyx_result;
  PyObject *__pyx_n_s_pyx_state;
  PyObject *__pyx_n_s_pyx_type;
  PyObject *__pyx_n_s_pyx_unpickle_Tree;
  PyObject *__pyx_n_s_qualname;
  PyObject *__pyx_n_s_quit;
  PyObject *__pyx_n_s_range;
  PyObject *__pyx_n_u_raw;
  PyObject *__pyx_n_s_reduce;
  PyObject *__pyx_n_s_reduce_cython;
  PyObject *__pyx_n_s_reduce_ex;
  PyObject *__pyx_n_s_ref_disc;
  PyObject *__pyx_n_u_ref_edges;
  PyObject *__pyx_n_u_ref_edges_in_source;
  PyObject *__pyx_n_s_ref_found;
  PyObject *__pyx_n_s_ref_found_in_src;
  PyObject *__pyx_n_s_ref_p;
  PyObject *__pyx_n_s_ref_tree;
  PyObject *__pyx_n_s_ref_tree_attr;
  PyObject *__pyx_n_s_remove;
  PyObject *__pyx_n_s_remove_child;
  PyObject *__pyx_n_s_remove_child_locals_genexpr;
  PyObject *__pyx_n_s_remove_children;
  PyObject *__pyx_n_s_remove_sister;
  PyObject *__pyx_n_s_remove_tree;
  PyObject *__pyx_n_s_render;
  PyObject *__pyx_n_s_render_sm;
  PyObject *__pyx_n_s_render_tree;
  PyObject *__pyx_n_s_resolve_polytomy;
  PyObject *__pyx_n_s_result;
  PyObject *__pyx_kp_u_return;
  PyObject *__pyx_n_s_return_format;
  PyObject *__pyx_n_s_reverse;
  PyObject *__pyx_n_s_reverse_children;
  PyObject *__pyx_n_s_rf;
  PyObject *__pyx_n_u_rf;
  PyObject *__pyx_n_s_rf_max;
  PyObject *__pyx_n_s_right;
  PyObject *__pyx_n_s_robinson_foulds;
  PyObject *__pyx_n_s_robinson_foulds_locals_from_comm;
  PyObject *__pyx_n_s_robinson_foulds_locals_genexpr;
  PyObject *__pyx_n_s_robinson_foulds_locals_has_prop;
  PyObject *__pyx_n_s_root;
  PyObject *__pyx_n_s_rooting;
  PyObject *__pyx_kp_u_s;
  PyObject *__pyx_n_s_s1;
  PyObject *__pyx_n_s_s2;
  PyObject *__pyx_n_s_safe_div;
  PyObject *__pyx_n_s_save_screenshot;
  PyObject *__pyx_n_s_search_ancestors;
  PyObject *__pyx_n_s_search_ancestors_locals_genexpr;
  PyObject *__pyx_n_s_search_descendants;
  PyObject *__pyx_n_s_search_leaves_by_name;
  PyObject *__pyx_n_s_search_nodes;
  PyObject *__pyx_n_s_search_nodes_locals_genexpr;
  PyObject *__pyx_n_s_seed;
  PyObject *__pyx_n_s_seen;
  PyObject *__pyx_n_s_selenium;
  PyObject *__pyx_n_s_selenium_webdriver_chrome_option;
  PyObject *__pyx_n_s_self;
  PyObject *__pyx_n_s_send;
  PyObject *__pyx_n_s_server;
  PyObject *__pyx_n_s_server_address;
  PyObject *__pyx_n_s_server_close;
  PyObject *__pyx_n_s_set_name;
  PyObject *__pyx_n_s_set_outgroup;
  PyObject *__pyx_n_s_set_style;
  PyObject *__pyx_n_s_setdefault;
  PyObject *__pyx_n_s_setstate;
  PyObject *__pyx_n_s_setstate_cython;
  PyObject *__pyx_n_s_show;
  PyObject *__pyx_n_s_show_difftable;
  PyObject *__pyx_n_s_show_difftable_summary;
  PyObject *__pyx_n_s_show_difftable_tab;
  PyObject *__pyx_n_s_show_difftable_topo;
  PyObject *__pyx_n_s_show_internal;
  PyObject *__pyx_n_s_show_tree;
  PyObject *__pyx_n_s_shutdown;
  PyObject *__pyx_n_s_side1;
  PyObject *__pyx_n_s_side2;
  PyObject *__pyx_n_s_sister;
  PyObject *__pyx_n_s_sisters;
  PyObject *__pyx_n_s_size;
  PyObject *__pyx_n_s_size1;
  PyObject *__pyx_n_s_size2;
  PyObject *__pyx_n_s_skbio;
  PyObject *__pyx_n_s_skbioTreeNode;
  PyObject *__pyx_n_s_skbio_node;
  PyObject *__pyx_n_s_skbio_tree;
  PyObject *__pyx_n_s_skip_large_polytomies;
  PyObject *__pyx_n_s_sleep;
  PyObject *__pyx_n_s_smallest;
  PyObject *__pyx_n_s_smartview;
  PyObject *__pyx_n_s_sort;
  PyObject *__pyx_n_s_sort_descendants;
  PyObject *__pyx_n_s_sort_descendants_locals_lambda;
  PyObject *__pyx_n_s_sorted;
  PyObject *__pyx_n_s_sorted_nodes;
  PyObject *__pyx_n_u_source_edges;
  PyObject *__pyx_n_u_source_edges_in_ref;
  PyObject *__pyx_n_u_source_subtrees;
  PyObject *__pyx_n_s_source_tree;
  PyObject *__pyx_n_s_source_tree_attr;
  PyObject *__pyx_n_s_sp_naming_function;
  PyObject *__pyx_n_s_sp_trees;
  PyObject *__pyx_n_s_spec;
  PyObject *__pyx_n_u_speciesFunction;
  PyObject *__pyx_n_s_src_disc;
  PyObject *__pyx_n_s_src_found;
  PyObject *__pyx_n_s_src_found_in_ref;
  PyObject *__pyx_n_s_src_p;
  PyObject *__pyx_n_s_src_tree;
  PyObject *__pyx_n_s_standardize;
  PyObject *__pyx_n_s_start;
  PyObject *__pyx_n_s_start_server;
  PyObject *__pyx_n_s_startswith;
  PyObject *__pyx_n_s_state;
  PyObject *__pyx_kp_u_static_gui_html_tree;
  PyObject *__pyx_n_s_staticmethod;
  PyObject *__pyx_n_s_strategy;
  PyObject *__pyx_kp_s_stringsource;
  PyObject *__pyx_n_s_subtree;
  PyObject *__pyx_n_s_subtree_content;
  PyObject *__pyx_n_s_subtree_nw;
  PyObject *__pyx_n_s_subtrees;
  PyObject *__pyx_n_s_sum;
  PyObject *__pyx_n_s_super;
  PyObject *__pyx_n_s_support;
  PyObject *__pyx_n_u_support;
  PyObject *__pyx_n_s_support_fn;
  PyObject *__pyx_n_s_support_t1;
  PyObject *__pyx_n_s_support_t2;
  PyObject *__pyx_n_s_swap_children;
  PyObject *__pyx_n_s_t1;
  PyObject *__pyx_n_s_t1_leaves;
  PyObject *__pyx_n_s_t1_leaves_all;
  PyObject *__pyx_n_s_t2;
  PyObject *__pyx_n_s_t2_leaves;
  PyObject *__pyx_n_s_t2_leaves_all;
  PyObject *__pyx_n_u_table;
  PyObject *__pyx_n_s_target_t;
  PyObject *__pyx_n_s_target_trees;
  PyObject *__pyx_n_s_test;
  PyObject *__pyx_n_s_text_viz;
  PyObject *__pyx_n_s_thread;
  PyObject *__pyx_n_s_throw;
  PyObject *__pyx_n_s_time;
  PyObject *__pyx_n_s_to_keep;
  PyObject *__pyx_n_s_to_str;
  PyObject *__pyx_n_s_to_ultrametric;
  PyObject *__pyx_n_s_tools;
  PyObject *__pyx_n_s_topological;
  PyObject *__pyx_n_u_topology;
  PyObject *__pyx_n_s_total_d;
  PyObject *__pyx_n_s_total_rf;
  PyObject *__pyx_n_s_total_valid_ref_edges;
  PyObject *__pyx_n_s_translate_nodes;
  PyObject *__pyx_n_s_traverse;
  PyObject *__pyx_n_s_traverse_bfs;
  PyObject *__pyx_n_s_tree;
  PyObject *__pyx_n_s_tree_sizes;
  PyObject *__pyx_n_s_tree_style;
  PyObject *__pyx_n_s_treediff;
  PyObject *__pyx_n_s_treeko_d;
  PyObject *__pyx_n_u_treeko_dist;
  PyObject *__pyx_n_s_treeview;
  PyObject *__pyx_n_s_treeview_main;
  PyObject *__pyx_n_s_uniquenodes;
  PyObject *__pyx_n_s_units;
  PyObject *__pyx_n_s_unroot;
  PyObject *__pyx_n_s_unrooted;
  PyObject *__pyx_n_s_unrooted_trees;
  PyObject *__pyx_n_s_up;
  PyObject *__pyx_n_s_update;
  PyObject *__pyx_n_s_use_collateral;
  PyObject *__pyx_n_s_use_setstate;
  PyObject *__pyx_n_s_usecolor;
  PyObject *__pyx_n_s_utils;
  PyObject *__pyx_n_s_valid_ref_edges;
  PyObject *__pyx_n_s_valid_src_edges;
  PyObject *__pyx_n_s_value;
  PyObject *__pyx_n_s_values;
  PyObject *__pyx_n_s_verbose;
  PyObject *__pyx_n_s_visited_node;
  PyObject *__pyx_n_s_visitor_key;
  PyObject *__pyx_n_s_visitors;
  PyObject *__pyx_n_s_visitors2nodes;
  PyObject *__pyx_n_s_w;
  PyObject *__pyx_n_u_w;
  PyObject *__pyx_n_s_warn;
  PyObject *__pyx_n_s_warnings;
  PyObject *__pyx_n_s_webdriver;
  PyObject *__pyx_n_s_weight_fn;
  PyObject *__pyx_n_s_win_name;
  PyObject *__pyx_kp_u_window_size;
  PyObject *__pyx_n_s_write;
  PyObject *__pyx_n_s_x;
  PyObject *__pyx_n_s_y;
  PyObject *__pyx_n_u_yule;
  PyObject *__pyx_float_0_0;
  PyObject *__pyx_float_1_0;
  PyObject *__pyx_int_0;
  PyObject *__pyx_int_1;
  PyObject *__pyx_int_2;
  PyObject *__pyx_int_5;
  PyObject *__pyx_int_90;
  PyObject *__pyx_int_1000;
  PyObject *__pyx_int_27868033;
  PyObject *__pyx_int_43033374;
  PyObject *__pyx_int_151323765;
  PyObject *__pyx_int_neg_1;
  PyObject *__pyx_k__24;
  PyObject *__pyx_slice_;
  PyObject *__pyx_tuple__6;
  PyObject *__pyx_slice__35;
  PyObject *__pyx_slice__38;
  PyObject *__pyx_tuple__16;
  PyObject *__pyx_tuple__26;
  PyObject *__pyx_tuple__28;
  PyObject *__pyx_tuple__30;
  PyObject *__pyx_tuple__31;
  PyObject *__pyx_tuple__33;
  PyObject *__pyx_tuple__39;
  PyObject *__pyx_tuple__41;
  PyObject *__pyx_tuple__43;
  PyObject *__pyx_tuple__45;
  PyObject *__pyx_tuple__46;
  PyObject *__pyx_tuple__48;
  PyObject *__pyx_tuple__49;
  PyObject *__pyx_tuple__51;
  PyObject *__pyx_tuple__53;
  PyObject *__pyx_tuple__54;
  PyObject *__pyx_tuple__56;
  PyObject *__pyx_tuple__58;
  PyObject *__pyx_tuple__60;
  PyObject *__pyx_tuple__62;
  PyObject *__pyx_tuple__63;
  PyObject *__pyx_tuple__65;
  PyObject *__pyx_tuple__67;
  PyObject *__pyx_tuple__68;
  PyObject *__pyx_tuple__70;
  PyObject *__pyx_tuple__72;
  PyObject *__pyx_tuple__74;
  PyObject *__pyx_tuple__76;
  PyObject *__pyx_tuple__78;
  PyObject *__pyx_tuple__79;
  PyObject *__pyx_tuple__81;
  PyObject *__pyx_tuple__83;
  PyObject *__pyx_tuple__85;
  PyObject *__pyx_tuple__88;
  PyObject *__pyx_tuple__90;
  PyObject *__pyx_tuple__91;
  PyObject *__pyx_tuple__92;
  PyObject *__pyx_tuple__93;
  PyObject *__pyx_tuple__94;
  PyObject *__pyx_tuple__95;
  PyObject *__pyx_tuple__96;
  PyObject *__pyx_tuple__97;
  PyObject *__pyx_tuple__98;
  PyObject *__pyx_tuple__99;
  PyObject *__pyx_codeobj__7;
  PyObject *__pyx_codeobj__8;
  PyObject *__pyx_codeobj__9;
  PyObject *__pyx_tuple__101;
  PyObject *__pyx_tuple__103;
  PyObject *__pyx_tuple__105;
  PyObject *__pyx_tuple__106;
  PyObject *__pyx_tuple__108;
  PyObject *__pyx_tuple__109;
  PyObject *__pyx_tuple__111;
  PyObject *__pyx_tuple__113;
  PyObject *__pyx_tuple__115;
  PyObject *__pyx_tuple__117;
  PyObject *__pyx_tuple__118;
  PyObject *__pyx_tuple__122;
  PyObject *__pyx_tuple__124;
  PyObject *__pyx_tuple__126;
  PyObject *__pyx_tuple__127;
  PyObject *__pyx_tuple__129;
  PyObject *__pyx_tuple__130;
  PyObject *__pyx_tuple__132;
  PyObject *__pyx_tuple__133;
  PyObject *__pyx_tuple__135;
  PyObject *__pyx_tuple__137;
  PyObject *__pyx_tuple__138;
  PyObject *__pyx_tuple__140;
  PyObject *__pyx_tuple__141;
  PyObject *__pyx_tuple__143;
  PyObject *__pyx_tuple__144;
  PyObject *__pyx_tuple__146;
  PyObject *__pyx_tuple__148;
  PyObject *__pyx_tuple__149;
  PyObject *__pyx_tuple__151;
  PyObject *__pyx_tuple__152;
  PyObject *__pyx_tuple__154;
  PyObject *__pyx_tuple__155;
  PyObject *__pyx_tuple__157;
  PyObject *__pyx_tuple__159;
  PyObject *__pyx_tuple__160;
  PyObject *__pyx_tuple__162;
  PyObject *__pyx_tuple__163;
  PyObject *__pyx_tuple__165;
  PyObject *__pyx_tuple__166;
  PyObject *__pyx_tuple__167;
  PyObject *__pyx_tuple__169;
  PyObject *__pyx_tuple__170;
  PyObject *__pyx_tuple__172;
  PyObject *__pyx_tuple__174;
  PyObject *__pyx_tuple__176;
  PyObject *__pyx_tuple__178;
  PyObject *__pyx_tuple__179;
  PyObject *__pyx_tuple__180;
  PyObject *__pyx_tuple__182;
  PyObject *__pyx_tuple__183;
  PyObject *__pyx_tuple__185;
  PyObject *__pyx_tuple__186;
  PyObject *__pyx_tuple__188;
  PyObject *__pyx_tuple__190;
  PyObject *__pyx_tuple__192;
  PyObject *__pyx_tuple__194;
  PyObject *__pyx_tuple__195;
  PyObject *__pyx_tuple__197;
  PyObject *__pyx_tuple__199;
  PyObject *__pyx_tuple__201;
  PyObject *__pyx_codeobj__10;
  PyObject *__pyx_codeobj__11;
  PyObject *__pyx_codeobj__12;
  PyObject *__pyx_codeobj__13;
  PyObject *__pyx_codeobj__14;
  PyObject *__pyx_codeobj__17;
  PyObject *__pyx_codeobj__18;
  PyObject *__pyx_codeobj__19;
  PyObject *__pyx_codeobj__25;
  PyObject *__pyx_codeobj__27;
  PyObject *__pyx_codeobj__29;
  PyObject *__pyx_codeobj__32;
  PyObject *__pyx_codeobj__34;
  PyObject *__pyx_codeobj__36;
  PyObject *__pyx_codeobj__37;
  PyObject *__pyx_codeobj__40;
  PyObject *__pyx_codeobj__42;
  PyObject *__pyx_codeobj__44;
  PyObject *__pyx_codeobj__47;
  PyObject *__pyx_codeobj__50;
  PyObject *__pyx_codeobj__52;
  PyObject *__pyx_codeobj__55;
  PyObject *__pyx_codeobj__57;
  PyObject *__pyx_codeobj__59;
  PyObject *__pyx_codeobj__61;
  PyObject *__pyx_codeobj__64;
  PyObject *__pyx_codeobj__66;
  PyObject *__pyx_codeobj__69;
  PyObject *__pyx_codeobj__71;
  PyObject *__pyx_codeobj__73;
  PyObject *__pyx_codeobj__75;
  PyObject *__pyx_codeobj__77;
  PyObject *__pyx_codeobj__80;
  PyObject *__pyx_codeobj__82;
  PyObject *__pyx_codeobj__84;
  PyObject *__pyx_codeobj__86;
  PyObject *__pyx_codeobj__87;
  PyObject *__pyx_codeobj__89;
  PyObject *__pyx_codeobj__100;
  PyObject *__pyx_codeobj__102;
  PyObject *__pyx_codeobj__104;
  PyObject *__pyx_codeobj__107;
  PyObject *__pyx_codeobj__110;
  PyObject *__pyx_codeobj__112;
  PyObject *__pyx_codeobj__114;
  PyObject *__pyx_codeobj__116;
  PyObject *__pyx_codeobj__119;
  PyObject *__pyx_codeobj__120;
  PyObject *__pyx_codeobj__123;
  PyObject *__pyx_codeobj__125;
  PyObject *__pyx_codeobj__128;
  PyObject *__pyx_codeobj__131;
  PyObject *__pyx_codeobj__134;
  PyObject *__pyx_codeobj__136;
  PyObject *__pyx_codeobj__139;
  PyObject *__pyx_codeobj__142;
  PyObject *__pyx_codeobj__145;
  PyObject *__pyx_codeobj__147;
  PyObject *__pyx_codeobj__150;
  PyObject *__pyx_codeobj__153;
  PyObject *__pyx_codeobj__156;
  PyObject *__pyx_codeobj__158;
  PyObject *__pyx_codeobj__161;
  PyObject *__pyx_codeobj__164;
  PyObject *__pyx_codeobj__168;
  PyObject *__pyx_codeobj__171;
  PyObject *__pyx_codeobj__173;
  PyObject *__pyx_codeobj__175;
  PyObject *__pyx_codeobj__177;
  PyObject *__pyx_codeobj__181;
  PyObject *__pyx_codeobj__184;
  PyObject *__pyx_codeobj__187;
  PyObject *__pyx_codeobj__189;
  PyObject *__pyx_codeobj__191;
  PyObject *__pyx_codeobj__193;
  PyObject *__pyx_codeobj__196;
  PyObject *__pyx_codeobj__198;
  PyObject *__pyx_codeobj__200;
  PyObject *__pyx_codeobj__202;
} __pyx_mstate;

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

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

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

#define __pyx_m (PyState_FindModule(&__pyx_moduledef))
#else
static __pyx_mstate __pyx_mstate_global_static =
#ifdef __cplusplus
    {};
#else
    {0};
#endif
static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static;
#endif
/* #### Code section: module_state_clear ### */
#if CYTHON_USE_MODULE_STATE
static int __pyx_m_clear(PyObject *m) {
  __pyx_mstate *clear_module_state = __pyx_mstate(m);
  if (!clear_module_state) return 0;
  Py_CLEAR(clear_module_state->__pyx_d);
  Py_CLEAR(clear_module_state->__pyx_b);
  Py_CLEAR(clear_module_state->__pyx_cython_runtime);
  Py_CLEAR(clear_module_state->__pyx_empty_tuple);
  Py_CLEAR(clear_module_state->__pyx_empty_bytes);
  Py_CLEAR(clear_module_state->__pyx_empty_unicode);
  #ifdef __Pyx_CyFunction_USED
  Py_CLEAR(clear_module_state->__pyx_CyFunctionType);
  #endif
  #ifdef __Pyx_FusedFunction_USED
  Py_CLEAR(clear_module_state->__pyx_FusedFunctionType);
  #endif
  Py_CLEAR(clear_module_state->__pyx_ptype_4ete4_4core_4tree_Tree);
  Py_CLEAR(clear_module_state->__pyx_type_4ete4_4core_4tree_Tree);
  Py_CLEAR(clear_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct__genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct__genexpr);
  Py_CLEAR(clear_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_1___getitem__);
  Py_CLEAR(clear_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_1___getitem__);
  Py_CLEAR(clear_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_2_genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_2_genexpr);
  Py_CLEAR(clear_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_3___contains__);
  Py_CLEAR(clear_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_3___contains__);
  Py_CLEAR(clear_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_4_genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_4_genexpr);
  Py_CLEAR(clear_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_5___iter__);
  Py_CLEAR(clear_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_5___iter__);
  Py_CLEAR(clear_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_6_remove_child);
  Py_CLEAR(clear_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_6_remove_child);
  Py_CLEAR(clear_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_7_genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_7_genexpr);
  Py_CLEAR(clear_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_8_prune);
  Py_CLEAR(clear_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_8_prune);
  Py_CLEAR(clear_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_9_leaves);
  Py_CLEAR(clear_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_9_leaves);
  Py_CLEAR(clear_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_10_leaf_names);
  Py_CLEAR(clear_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_10_leaf_names);
  Py_CLEAR(clear_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_11_descendants);
  Py_CLEAR(clear_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_11_descendants);
  Py_CLEAR(clear_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_12_traverse);
  Py_CLEAR(clear_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_12_traverse);
  Py_CLEAR(clear_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_13_iter_prepostorder);
  Py_CLEAR(clear_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_13_iter_prepostorder);
  Py_CLEAR(clear_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_14_ancestors);
  Py_CLEAR(clear_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_14_ancestors);
  Py_CLEAR(clear_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_15_lineage);
  Py_CLEAR(clear_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_15_lineage);
  Py_CLEAR(clear_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_16_search_nodes);
  Py_CLEAR(clear_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_16_search_nodes);
  Py_CLEAR(clear_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_17_genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_17_genexpr);
  Py_CLEAR(clear_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_18_search_descendants);
  Py_CLEAR(clear_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_18_search_descendants);
  Py_CLEAR(clear_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_19_search_ancestors);
  Py_CLEAR(clear_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_19_search_ancestors);
  Py_CLEAR(clear_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_20_genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_20_genexpr);
  Py_CLEAR(clear_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_21_get_distance);
  Py_CLEAR(clear_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_21_get_distance);
  Py_CLEAR(clear_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_22_genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_22_genexpr);
  Py_CLEAR(clear_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_23_genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_23_genexpr);
  Py_CLEAR(clear_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_24_sort_descendants);
  Py_CLEAR(clear_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_24_sort_descendants);
  Py_CLEAR(clear_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_25_get_cached_content);
  Py_CLEAR(clear_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_25_get_cached_content);
  Py_CLEAR(clear_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds);
  Py_CLEAR(clear_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds);
  Py_CLEAR(clear_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_27_genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_27_genexpr);
  Py_CLEAR(clear_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_28_genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_28_genexpr);
  Py_CLEAR(clear_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_29_genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_29_genexpr);
  Py_CLEAR(clear_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_30_genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_30_genexpr);
  Py_CLEAR(clear_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_31_from_common);
  Py_CLEAR(clear_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_31_from_common);
  Py_CLEAR(clear_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_32_genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_32_genexpr);
  Py_CLEAR(clear_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_33_genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_33_genexpr);
  Py_CLEAR(clear_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_34_genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_34_genexpr);
  Py_CLEAR(clear_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_35_genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_35_genexpr);
  Py_CLEAR(clear_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_36_genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_36_genexpr);
  Py_CLEAR(clear_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_37_genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_37_genexpr);
  Py_CLEAR(clear_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_38_compare);
  Py_CLEAR(clear_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_38_compare);
  Py_CLEAR(clear_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_39_edges);
  Py_CLEAR(clear_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_39_edges);
  Py_CLEAR(clear_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_40_get_topology_id);
  Py_CLEAR(clear_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_40_get_topology_id);
  Py_CLEAR(clear_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_41_genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_41_genexpr);
  Py_CLEAR(clear_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_42_genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_42_genexpr);
  Py_CLEAR(clear_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_43_is_monophyletic);
  Py_CLEAR(clear_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_43_is_monophyletic);
  Py_CLEAR(clear_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_44_genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_44_genexpr);
  Py_CLEAR(clear_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_45_check_monophyly);
  Py_CLEAR(clear_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_45_check_monophyly);
  Py_CLEAR(clear_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_46_genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_46_genexpr);
  Py_CLEAR(clear_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_47_genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_47_genexpr);
  Py_CLEAR(clear_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_48_get_monophyletic);
  Py_CLEAR(clear_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_48_get_monophyletic);
  Py_CLEAR(clear_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_49_expand_polytomies);
  Py_CLEAR(clear_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_49_expand_polytomies);
  Py_CLEAR(clear_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_50_add_leaf);
  Py_CLEAR(clear_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_50_add_leaf);
  Py_CLEAR(clear_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_51_enum_unordered);
  Py_CLEAR(clear_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_51_enum_unordered);
  Py_CLEAR(clear_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_52_genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_52_genexpr);
  Py_CLEAR(clear_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_53_from_parent_child_table);
  Py_CLEAR(clear_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_53_from_parent_child_table);
  Py_CLEAR(clear_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_54_from_skbio);
  Py_CLEAR(clear_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_54_from_skbio);
  Py_CLEAR(clear_module_state->__pyx_kp_u_127_0_0_1);
  Py_CLEAR(clear_module_state->__pyx_kp_u_A_parent_node_is_required_to_add);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Ambiguous_node_name);
  Py_CLEAR(clear_module_state->__pyx_n_s_AssertionError);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Both_trees_contain_polytomies_Tr);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Can_only_check_nodes_or_names_in);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Cannot_pop_child_not_found);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Cannot_remove_child_not_found);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Cannot_remove_sister_because_the);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Cannot_render_image_missing_modu);
  Py_CLEAR(clear_module_state->__pyx_n_s_Chrome);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Duplicated_items_found_in_refere);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Duplicated_items_found_in_target);
  Py_CLEAR(clear_module_state->__pyx_n_u_ETE);
  Py_CLEAR(clear_module_state->__pyx_n_s_FACE_POSITIONS);
  Py_CLEAR(clear_module_state->__pyx_n_s_Face);
  Py_CLEAR(clear_module_state->__pyx_n_s_FaceAreas);
  Py_CLEAR(clear_module_state->__pyx_n_s_FaceContainer);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Found_polytomy_larger_than_curre);
  Py_CLEAR(clear_module_state->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Incorrect_child_type);
  Py_CLEAR(clear_module_state->__pyx_n_s_IndexError);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Invalid_copy_method);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Invalid_node_id);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Invalid_node_type);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Max_distance_g);
  Py_CLEAR(clear_module_state->__pyx_n_s_ModuleNotFoundError);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Most_distant_node_s);
  Py_CLEAR(clear_module_state->__pyx_n_u_NA);
  Py_CLEAR(clear_module_state->__pyx_n_u_No);
  Py_CLEAR(clear_module_state->__pyx_kp_u_No_children);
  Py_CLEAR(clear_module_state->__pyx_kp_u_No_common_ancestor_for_nodes);
  Py_CLEAR(clear_module_state->__pyx_kp_u_No_node_found_with_name);
  Py_CLEAR(clear_module_state->__pyx_n_s_NodeStyle);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Node_has);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Number_of_leaf_nodes_d);
  Py_CLEAR(clear_module_state->__pyx_n_s_Options);
  Py_CLEAR(clear_module_state->__pyx_n_s_PARSERS);
  Py_CLEAR(clear_module_state->__pyx_n_s_PickleError);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Rooted_s);
  Py_CLEAR(clear_module_state->__pyx_n_s_StopIteration);
  Py_CLEAR(clear_module_state->__pyx_n_s_TipTuple);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Total_number_of_nodes_d);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Tree);
  Py_CLEAR(clear_module_state->__pyx_n_s_TreeError);
  Py_CLEAR(clear_module_state->__pyx_n_s_TreeNode);
  Py_CLEAR(clear_module_state->__pyx_n_s_Tree_2);
  Py_CLEAR(clear_module_state->__pyx_n_s_Tree___iter);
  Py_CLEAR(clear_module_state->__pyx_n_s_Tree___reduce_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_Tree___setstate_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_Tree__diff);
  Py_CLEAR(clear_module_state->__pyx_n_s_Tree__get_farthest_and_closest_l);
  Py_CLEAR(clear_module_state->__pyx_n_s_Tree__translate_nodes);
  Py_CLEAR(clear_module_state->__pyx_n_s_Tree_add_child);
  Py_CLEAR(clear_module_state->__pyx_n_s_Tree_add_children);
  Py_CLEAR(clear_module_state->__pyx_n_s_Tree_add_face);
  Py_CLEAR(clear_module_state->__pyx_n_s_Tree_add_prop);
  Py_CLEAR(clear_module_state->__pyx_n_s_Tree_add_props);
  Py_CLEAR(clear_module_state->__pyx_n_s_Tree_add_sister);
  Py_CLEAR(clear_module_state->__pyx_n_s_Tree_ancestors);
  Py_CLEAR(clear_module_state->__pyx_n_s_Tree_check_monophyly);
  Py_CLEAR(clear_module_state->__pyx_n_s_Tree_common_ancestor);
  Py_CLEAR(clear_module_state->__pyx_n_s_Tree_compare);
  Py_CLEAR(clear_module_state->__pyx_n_s_Tree_cophenetic_matrix);
  Py_CLEAR(clear_module_state->__pyx_n_s_Tree_copy);
  Py_CLEAR(clear_module_state->__pyx_n_s_Tree_del_prop);
  Py_CLEAR(clear_module_state->__pyx_n_s_Tree_delete);
  Py_CLEAR(clear_module_state->__pyx_n_s_Tree_descendants);
  Py_CLEAR(clear_module_state->__pyx_n_s_Tree_describe);
  Py_CLEAR(clear_module_state->__pyx_n_s_Tree_detach);
  Py_CLEAR(clear_module_state->__pyx_n_s_Tree_edges);
  Py_CLEAR(clear_module_state->__pyx_n_s_Tree_expand_polytomies);
  Py_CLEAR(clear_module_state->__pyx_n_s_Tree_explore);
  Py_CLEAR(clear_module_state->__pyx_n_s_Tree_from_parent_child_table);
  Py_CLEAR(clear_module_state->__pyx_n_s_Tree_from_skbio);
  Py_CLEAR(clear_module_state->__pyx_n_s_Tree_get_cached_content);
  Py_CLEAR(clear_module_state->__pyx_n_s_Tree_get_children);
  Py_CLEAR(clear_module_state->__pyx_n_s_Tree_get_closest_leaf);
  Py_CLEAR(clear_module_state->__pyx_n_s_Tree_get_distance);
  Py_CLEAR(clear_module_state->__pyx_n_s_Tree_get_farthest_leaf);
  Py_CLEAR(clear_module_state->__pyx_n_s_Tree_get_farthest_node);
  Py_CLEAR(clear_module_state->__pyx_n_s_Tree_get_midpoint_outgroup);
  Py_CLEAR(clear_module_state->__pyx_n_s_Tree_get_monophyletic);
  Py_CLEAR(clear_module_state->__pyx_n_s_Tree_get_prop);
  Py_CLEAR(clear_module_state->__pyx_n_s_Tree_get_sisters);
  Py_CLEAR(clear_module_state->__pyx_n_s_Tree_get_topology_id);
  Py_CLEAR(clear_module_state->__pyx_n_s_Tree_is_monophyletic);
  Py_CLEAR(clear_module_state->__pyx_n_s_Tree_iter_prepostorder);
  Py_CLEAR(clear_module_state->__pyx_n_s_Tree_ladderize);
  Py_CLEAR(clear_module_state->__pyx_n_s_Tree_leaf_names);
  Py_CLEAR(clear_module_state->__pyx_n_s_Tree_leaves);
  Py_CLEAR(clear_module_state->__pyx_n_s_Tree_lineage);
  Py_CLEAR(clear_module_state->__pyx_n_s_Tree_mean_distance);
  Py_CLEAR(clear_module_state->__pyx_n_s_Tree_pop_child);
  Py_CLEAR(clear_module_state->__pyx_n_s_Tree_populate);
  Py_CLEAR(clear_module_state->__pyx_n_s_Tree_prune);
  Py_CLEAR(clear_module_state->__pyx_n_s_Tree_remove_child);
  Py_CLEAR(clear_module_state->__pyx_n_s_Tree_remove_children);
  Py_CLEAR(clear_module_state->__pyx_n_s_Tree_remove_sister);
  Py_CLEAR(clear_module_state->__pyx_n_s_Tree_render);
  Py_CLEAR(clear_module_state->__pyx_n_s_Tree_render_sm);
  Py_CLEAR(clear_module_state->__pyx_n_s_Tree_resolve_polytomy);
  Py_CLEAR(clear_module_state->__pyx_n_s_Tree_reverse_children);
  Py_CLEAR(clear_module_state->__pyx_n_s_Tree_robinson_foulds);
  Py_CLEAR(clear_module_state->__pyx_n_s_Tree_search_ancestors);
  Py_CLEAR(clear_module_state->__pyx_n_s_Tree_search_descendants);
  Py_CLEAR(clear_module_state->__pyx_n_s_Tree_search_leaves_by_name);
  Py_CLEAR(clear_module_state->__pyx_n_s_Tree_search_nodes);
  Py_CLEAR(clear_module_state->__pyx_n_s_Tree_set_outgroup);
  Py_CLEAR(clear_module_state->__pyx_n_s_Tree_set_style);
  Py_CLEAR(clear_module_state->__pyx_n_s_Tree_show);
  Py_CLEAR(clear_module_state->__pyx_n_s_Tree_sort_descendants);
  Py_CLEAR(clear_module_state->__pyx_n_s_Tree_standardize);
  Py_CLEAR(clear_module_state->__pyx_n_s_Tree_swap_children);
  Py_CLEAR(clear_module_state->__pyx_n_s_Tree_to_str);
  Py_CLEAR(clear_module_state->__pyx_n_s_Tree_to_ultrametric);
  Py_CLEAR(clear_module_state->__pyx_n_s_Tree_traverse);
  Py_CLEAR(clear_module_state->__pyx_n_s_Tree_unroot);
  Py_CLEAR(clear_module_state->__pyx_n_s_Tree_write);
  Py_CLEAR(clear_module_state->__pyx_n_s_TypeError);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Unknown_output_for_diff);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Unknown_strategy);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Unrooted_tree_found_You_may_want);
  Py_CLEAR(clear_module_state->__pyx_n_s_ValueError);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Wrote_file);
  Py_CLEAR(clear_module_state->__pyx_n_u_Yes);
  Py_CLEAR(clear_module_state->__pyx_n_s__121);
  Py_CLEAR(clear_module_state->__pyx_kp_u__15);
  Py_CLEAR(clear_module_state->__pyx_kp_u__2);
  Py_CLEAR(clear_module_state->__pyx_kp_u__20);
  Py_CLEAR(clear_module_state->__pyx_n_s__203);
  Py_CLEAR(clear_module_state->__pyx_n_s__21);
  Py_CLEAR(clear_module_state->__pyx_kp_u__22);
  Py_CLEAR(clear_module_state->__pyx_kp_u__23);
  Py_CLEAR(clear_module_state->__pyx_n_s__3);
  Py_CLEAR(clear_module_state->__pyx_kp_u__3);
  Py_CLEAR(clear_module_state->__pyx_kp_u__4);
  Py_CLEAR(clear_module_state->__pyx_kp_u__5);
  Py_CLEAR(clear_module_state->__pyx_n_s_a);
  Py_CLEAR(clear_module_state->__pyx_n_s_add);
  Py_CLEAR(clear_module_state->__pyx_n_s_add_argument);
  Py_CLEAR(clear_module_state->__pyx_n_s_add_child);
  Py_CLEAR(clear_module_state->__pyx_n_s_add_children);
  Py_CLEAR(clear_module_state->__pyx_n_s_add_face);
  Py_CLEAR(clear_module_state->__pyx_n_s_add_leaf);
  Py_CLEAR(clear_module_state->__pyx_n_s_add_prop);
  Py_CLEAR(clear_module_state->__pyx_n_s_add_props);
  Py_CLEAR(clear_module_state->__pyx_n_s_add_sister);
  Py_CLEAR(clear_module_state->__pyx_n_s_add_tree);
  Py_CLEAR(clear_module_state->__pyx_n_s_all_leaves);
  Py_CLEAR(clear_module_state->__pyx_n_s_all_max_rf);
  Py_CLEAR(clear_module_state->__pyx_n_s_all_nodes);
  Py_CLEAR(clear_module_state->__pyx_n_s_all_rf);
  Py_CLEAR(clear_module_state->__pyx_n_s_alld);
  Py_CLEAR(clear_module_state->__pyx_n_s_allleaves);
  Py_CLEAR(clear_module_state->__pyx_n_s_ancestors);
  Py_CLEAR(clear_module_state->__pyx_n_s_append);
  Py_CLEAR(clear_module_state->__pyx_n_s_args);
  Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines);
  Py_CLEAR(clear_module_state->__pyx_kp_u_at);
  Py_CLEAR(clear_module_state->__pyx_n_s_attr);
  Py_CLEAR(clear_module_state->__pyx_n_s_autodetect_duplications);
  Py_CLEAR(clear_module_state->__pyx_n_s_b);
  Py_CLEAR(clear_module_state->__pyx_kp_u_bad_parser);
  Py_CLEAR(clear_module_state->__pyx_n_s_bprops);
  Py_CLEAR(clear_module_state->__pyx_n_s_branch);
  Py_CLEAR(clear_module_state->__pyx_kp_u_branch_right);
  Py_CLEAR(clear_module_state->__pyx_n_s_cached_content);
  Py_CLEAR(clear_module_state->__pyx_n_s_cascade);
  Py_CLEAR(clear_module_state->__pyx_n_s_cdist);
  Py_CLEAR(clear_module_state->__pyx_n_s_ch);
  Py_CLEAR(clear_module_state->__pyx_n_s_check_monophyly);
  Py_CLEAR(clear_module_state->__pyx_n_s_check_monophyly_locals_genexpr);
  Py_CLEAR(clear_module_state->__pyx_n_s_child);
  Py_CLEAR(clear_module_state->__pyx_n_s_child_idx);
  Py_CLEAR(clear_module_state->__pyx_n_s_child_name);
  Py_CLEAR(clear_module_state->__pyx_n_s_children);
  Py_CLEAR(clear_module_state->__pyx_kp_u_children_Use_reverse_children_i);
  Py_CLEAR(clear_module_state->__pyx_n_s_childtrees);
  Py_CLEAR(clear_module_state->__pyx_n_s_class);
  Py_CLEAR(clear_module_state->__pyx_n_s_class_getitem);
  Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback);
  Py_CLEAR(clear_module_state->__pyx_n_s_close);
  Py_CLEAR(clear_module_state->__pyx_n_s_cmp_nodes);
  Py_CLEAR(clear_module_state->__pyx_n_s_cmp_to_key);
  Py_CLEAR(clear_module_state->__pyx_n_s_color);
  Py_CLEAR(clear_module_state->__pyx_n_s_column);
  Py_CLEAR(clear_module_state->__pyx_n_s_columns);
  Py_CLEAR(clear_module_state->__pyx_n_s_combinations);
  Py_CLEAR(clear_module_state->__pyx_n_s_common);
  Py_CLEAR(clear_module_state->__pyx_n_s_common_ancestor);
  Py_CLEAR(clear_module_state->__pyx_n_s_common_edges);
  Py_CLEAR(clear_module_state->__pyx_n_u_common_edges);
  Py_CLEAR(clear_module_state->__pyx_n_s_common_names);
  Py_CLEAR(clear_module_state->__pyx_n_s_compact);
  Py_CLEAR(clear_module_state->__pyx_n_s_compare);
  Py_CLEAR(clear_module_state->__pyx_n_s_compare_2);
  Py_CLEAR(clear_module_state->__pyx_n_s_compare_locals__compare);
  Py_CLEAR(clear_module_state->__pyx_n_s_compare_locals__safe_div);
  Py_CLEAR(clear_module_state->__pyx_n_s_compress);
  Py_CLEAR(clear_module_state->__pyx_n_s_conditions);
  Py_CLEAR(clear_module_state->__pyx_n_s_container_type);
  Py_CLEAR(clear_module_state->__pyx_n_s_contains___locals_genexpr);
  Py_CLEAR(clear_module_state->__pyx_n_s_cophenetic_matrix);
  Py_CLEAR(clear_module_state->__pyx_n_s_cophenetic_matrix_locals_genexpr);
  Py_CLEAR(clear_module_state->__pyx_n_s_copy);
  Py_CLEAR(clear_module_state->__pyx_n_s_corr1);
  Py_CLEAR(clear_module_state->__pyx_n_s_corr2);
  Py_CLEAR(clear_module_state->__pyx_n_s_correct_by_polytomy_size);
  Py_CLEAR(clear_module_state->__pyx_n_u_cpickle);
  Py_CLEAR(clear_module_state->__pyx_n_s_current);
  Py_CLEAR(clear_module_state->__pyx_n_s_d);
  Py_CLEAR(clear_module_state->__pyx_n_s_data);
  Py_CLEAR(clear_module_state->__pyx_n_s_deepcopy);
  Py_CLEAR(clear_module_state->__pyx_n_u_deepcopy);
  Py_CLEAR(clear_module_state->__pyx_n_s_default);
  Py_CLEAR(clear_module_state->__pyx_n_s_del_prop);
  Py_CLEAR(clear_module_state->__pyx_n_s_delete);
  Py_CLEAR(clear_module_state->__pyx_n_s_delete_orphan);
  Py_CLEAR(clear_module_state->__pyx_n_s_depth);
  Py_CLEAR(clear_module_state->__pyx_n_s_descendants);
  Py_CLEAR(clear_module_state->__pyx_n_s_describe);
  Py_CLEAR(clear_module_state->__pyx_n_s_detach);
  Py_CLEAR(clear_module_state->__pyx_n_s_diameter);
  Py_CLEAR(clear_module_state->__pyx_n_s_dict);
  Py_CLEAR(clear_module_state->__pyx_n_s_dict_2);
  Py_CLEAR(clear_module_state->__pyx_n_s_diff);
  Py_CLEAR(clear_module_state->__pyx_n_u_diffs);
  Py_CLEAR(clear_module_state->__pyx_n_u_diffs_tab);
  Py_CLEAR(clear_module_state->__pyx_n_s_difftable);
  Py_CLEAR(clear_module_state->__pyx_kp_u_disable);
  Py_CLEAR(clear_module_state->__pyx_kp_u_disable_breakpad);
  Py_CLEAR(clear_module_state->__pyx_kp_u_disable_logging);
  Py_CLEAR(clear_module_state->__pyx_n_s_discard_t1);
  Py_CLEAR(clear_module_state->__pyx_n_s_discard_t2);
  Py_CLEAR(clear_module_state->__pyx_n_s_dist);
  Py_CLEAR(clear_module_state->__pyx_n_u_dist);
  Py_CLEAR(clear_module_state->__pyx_n_s_dist_fn);
  Py_CLEAR(clear_module_state->__pyx_n_s_distance);
  Py_CLEAR(clear_module_state->__pyx_n_s_doc);
  Py_CLEAR(clear_module_state->__pyx_n_s_dpi);
  Py_CLEAR(clear_module_state->__pyx_n_s_drawer);
  Py_CLEAR(clear_module_state->__pyx_n_s_driver);
  Py_CLEAR(clear_module_state->__pyx_n_s_dump);
  Py_CLEAR(clear_module_state->__pyx_n_s_dumps);
  Py_CLEAR(clear_module_state->__pyx_n_s_e);
  Py_CLEAR(clear_module_state->__pyx_n_s_edge_keys);
  Py_CLEAR(clear_module_state->__pyx_n_s_edges);
  Py_CLEAR(clear_module_state->__pyx_n_s_edges1);
  Py_CLEAR(clear_module_state->__pyx_n_s_edges2);
  Py_CLEAR(clear_module_state->__pyx_n_u_effective_tree_size);
  Py_CLEAR(clear_module_state->__pyx_kp_u_enable);
  Py_CLEAR(clear_module_state->__pyx_n_s_enter);
  Py_CLEAR(clear_module_state->__pyx_n_s_enum_unordered);
  Py_CLEAR(clear_module_state->__pyx_n_s_enumerate);
  Py_CLEAR(clear_module_state->__pyx_n_u_ete);
  Py_CLEAR(clear_module_state->__pyx_n_s_ete4_core_tree);
  Py_CLEAR(clear_module_state->__pyx_kp_s_ete4_core_tree_pyx);
  Py_CLEAR(clear_module_state->__pyx_n_s_ete_ch);
  Py_CLEAR(clear_module_state->__pyx_n_s_ete_diff);
  Py_CLEAR(clear_module_state->__pyx_n_s_ete_format);
  Py_CLEAR(clear_module_state->__pyx_n_s_ete_node);
  Py_CLEAR(clear_module_state->__pyx_n_s_exit);
  Py_CLEAR(clear_module_state->__pyx_n_s_expand_polytomies);
  Py_CLEAR(clear_module_state->__pyx_kp_u_expand_polytomies_and_correct_by);
  Py_CLEAR(clear_module_state->__pyx_kp_u_expand_polytomies_and_unrooted_t);
  Py_CLEAR(clear_module_state->__pyx_n_s_expand_polytomies_locals_TipTupl);
  Py_CLEAR(clear_module_state->__pyx_n_s_expand_polytomies_locals_add_lea);
  Py_CLEAR(clear_module_state->__pyx_n_s_expand_polytomies_locals_enum_un);
  Py_CLEAR(clear_module_state->__pyx_n_s_explore);
  Py_CLEAR(clear_module_state->__pyx_n_s_explorer);
  Py_CLEAR(clear_module_state->__pyx_n_s_extract_data_parser);
  Py_CLEAR(clear_module_state->__pyx_n_s_face);
  Py_CLEAR(clear_module_state->__pyx_kp_u_face_2);
  Py_CLEAR(clear_module_state->__pyx_n_s_face_area);
  Py_CLEAR(clear_module_state->__pyx_n_u_faces);
  Py_CLEAR(clear_module_state->__pyx_n_s_farthest_dist);
  Py_CLEAR(clear_module_state->__pyx_n_s_farthest_node);
  Py_CLEAR(clear_module_state->__pyx_n_s_fdist);
  Py_CLEAR(clear_module_state->__pyx_n_s_file_name);
  Py_CLEAR(clear_module_state->__pyx_n_s_fnode);
  Py_CLEAR(clear_module_state->__pyx_n_s_format_root_node);
  Py_CLEAR(clear_module_state->__pyx_n_s_fp);
  Py_CLEAR(clear_module_state->__pyx_n_s_from_common);
  Py_CLEAR(clear_module_state->__pyx_n_s_from_parent_child_table);
  Py_CLEAR(clear_module_state->__pyx_n_s_from_parent_child_table_locals_g);
  Py_CLEAR(clear_module_state->__pyx_n_s_from_skbio);
  Py_CLEAR(clear_module_state->__pyx_n_s_from_skbio_locals_get_ete_node);
  Py_CLEAR(clear_module_state->__pyx_n_s_functools);
  Py_CLEAR(clear_module_state->__pyx_kp_u_gc);
  Py_CLEAR(clear_module_state->__pyx_n_s_genexpr);
  Py_CLEAR(clear_module_state->__pyx_n_s_get);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_cached_content);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_cached_content_locals_get_co);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_children);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_closest_leaf);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_content);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_distance);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_distance_fn);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_distance_locals_genexpr);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_ete_node);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_farthest_and_closest_leaves);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_farthest_and_closest_leaves_2);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_farthest_leaf);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_farthest_node);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_farthest_node_locals_lambda);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_img);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_midpoint_outgroup);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_monophyletic);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_monophyletic_locals_lambda);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_node);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_prop);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_sisters);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_speciation_trees);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_topology_id);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_topology_id_locals_genexpr);
  Py_CLEAR(clear_module_state->__pyx_n_s_getitem___locals_genexpr);
  Py_CLEAR(clear_module_state->__pyx_n_s_getstate);
  Py_CLEAR(clear_module_state->__pyx_n_s_h);
  Py_CLEAR(clear_module_state->__pyx_n_s_has_duplications);
  Py_CLEAR(clear_module_state->__pyx_n_s_has_prop);
  Py_CLEAR(clear_module_state->__pyx_n_s_hash);
  Py_CLEAR(clear_module_state->__pyx_n_s_hashlib);
  Py_CLEAR(clear_module_state->__pyx_kp_u_headless);
  Py_CLEAR(clear_module_state->__pyx_n_s_hex);
  Py_CLEAR(clear_module_state->__pyx_n_s_hexdigest);
  Py_CLEAR(clear_module_state->__pyx_n_s_host);
  Py_CLEAR(clear_module_state->__pyx_kp_u_http);
  Py_CLEAR(clear_module_state->__pyx_n_s_i);
  Py_CLEAR(clear_module_state->__pyx_n_s_id);
  Py_CLEAR(clear_module_state->__pyx_n_u_id);
  Py_CLEAR(clear_module_state->__pyx_n_u_img_style);
  Py_CLEAR(clear_module_state->__pyx_n_s_import);
  Py_CLEAR(clear_module_state->__pyx_n_s_include_root);
  Py_CLEAR(clear_module_state->__pyx_n_s_include_self);
  Py_CLEAR(clear_module_state->__pyx_n_s_indent);
  Py_CLEAR(clear_module_state->__pyx_n_u_indent);
  Py_CLEAR(clear_module_state->__pyx_n_s_index);
  Py_CLEAR(clear_module_state->__pyx_n_s_inf);
  Py_CLEAR(clear_module_state->__pyx_kp_u_init_from_dict_data_should_not_u);
  Py_CLEAR(clear_module_state->__pyx_kp_u_init_from_empty_data_should_not);
  Py_CLEAR(clear_module_state->__pyx_kp_u_init_from_parsed_content_cannot);
  Py_CLEAR(clear_module_state->__pyx_n_s_init_subclass);
  Py_CLEAR(clear_module_state->__pyx_n_s_initializing);
  Py_CLEAR(clear_module_state->__pyx_kp_u_inline);
  Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine);
  Py_CLEAR(clear_module_state->__pyx_n_s_is_leaf);
  Py_CLEAR(clear_module_state->__pyx_n_s_is_leaf_fn);
  Py_CLEAR(clear_module_state->__pyx_n_s_is_monophyletic);
  Py_CLEAR(clear_module_state->__pyx_n_s_is_monophyletic_locals_genexpr);
  Py_CLEAR(clear_module_state->__pyx_kp_u_is_not_a_Face_instance);
  Py_CLEAR(clear_module_state->__pyx_n_s_is_root);
  Py_CLEAR(clear_module_state->__pyx_kp_u_isenabled);
  Py_CLEAR(clear_module_state->__pyx_n_s_issubset);
  Py_CLEAR(clear_module_state->__pyx_n_s_items);
  Py_CLEAR(clear_module_state->__pyx_n_s_iter);
  Py_CLEAR(clear_module_state->__pyx_n_s_iter_prepostorder);
  Py_CLEAR(clear_module_state->__pyx_n_s_itertools);
  Py_CLEAR(clear_module_state->__pyx_n_s_join);
  Py_CLEAR(clear_module_state->__pyx_n_s_k1);
  Py_CLEAR(clear_module_state->__pyx_n_s_k2);
  Py_CLEAR(clear_module_state->__pyx_n_s_keep_server);
  Py_CLEAR(clear_module_state->__pyx_n_s_key);
  Py_CLEAR(clear_module_state->__pyx_n_s_keys);
  Py_CLEAR(clear_module_state->__pyx_n_s_kwargs);
  Py_CLEAR(clear_module_state->__pyx_n_s_label);
  Py_CLEAR(clear_module_state->__pyx_n_s_labels);
  Py_CLEAR(clear_module_state->__pyx_n_s_ladderize);
  Py_CLEAR(clear_module_state->__pyx_n_s_layout);
  Py_CLEAR(clear_module_state->__pyx_n_s_layouts);
  Py_CLEAR(clear_module_state->__pyx_n_s_leaf);
  Py_CLEAR(clear_module_state->__pyx_n_s_leaf1);
  Py_CLEAR(clear_module_state->__pyx_n_s_leaf2);
  Py_CLEAR(clear_module_state->__pyx_n_s_leaf_distances);
  Py_CLEAR(clear_module_state->__pyx_n_s_leaf_names);
  Py_CLEAR(clear_module_state->__pyx_n_s_leaf_values);
  Py_CLEAR(clear_module_state->__pyx_n_s_leaves);
  Py_CLEAR(clear_module_state->__pyx_n_s_leaves_descendant);
  Py_CLEAR(clear_module_state->__pyx_n_s_leaves_extra);
  Py_CLEAR(clear_module_state->__pyx_n_s_leaves_from_ancestor);
  Py_CLEAR(clear_module_state->__pyx_n_s_leaves_locals_lambda);
  Py_CLEAR(clear_module_state->__pyx_n_s_leaves_only);
  Py_CLEAR(clear_module_state->__pyx_n_s_left);
  Py_CLEAR(clear_module_state->__pyx_n_s_len___locals_genexpr);
  Py_CLEAR(clear_module_state->__pyx_n_u_length);
  Py_CLEAR(clear_module_state->__pyx_n_u_levelorder);
  Py_CLEAR(clear_module_state->__pyx_n_s_lineage);
  Py_CLEAR(clear_module_state->__pyx_n_s_loads);
  Py_CLEAR(clear_module_state->__pyx_n_s_lower);
  Py_CLEAR(clear_module_state->__pyx_n_s_m);
  Py_CLEAR(clear_module_state->__pyx_n_s_main);
  Py_CLEAR(clear_module_state->__pyx_n_s_map_attributes);
  Py_CLEAR(clear_module_state->__pyx_n_s_map_prop);
  Py_CLEAR(clear_module_state->__pyx_n_s_map_properties);
  Py_CLEAR(clear_module_state->__pyx_n_s_math);
  Py_CLEAR(clear_module_state->__pyx_n_s_max);
  Py_CLEAR(clear_module_state->__pyx_n_s_max_dist);
  Py_CLEAR(clear_module_state->__pyx_n_s_max_node);
  Py_CLEAR(clear_module_state->__pyx_n_s_max_parts);
  Py_CLEAR(clear_module_state->__pyx_n_s_max_rf);
  Py_CLEAR(clear_module_state->__pyx_n_u_max_rf);
  Py_CLEAR(clear_module_state->__pyx_n_s_max_treeko_splits_to_be_artifact);
  Py_CLEAR(clear_module_state->__pyx_n_s_maxrf);
  Py_CLEAR(clear_module_state->__pyx_n_s_md5);
  Py_CLEAR(clear_module_state->__pyx_n_s_mean);
  Py_CLEAR(clear_module_state->__pyx_n_s_mean_distance);
  Py_CLEAR(clear_module_state->__pyx_n_s_metaclass);
  Py_CLEAR(clear_module_state->__pyx_n_s_method);
  Py_CLEAR(clear_module_state->__pyx_kp_u_metrics_recording_only);
  Py_CLEAR(clear_module_state->__pyx_n_s_min_comparison);
  Py_CLEAR(clear_module_state->__pyx_n_s_min_dist);
  Py_CLEAR(clear_module_state->__pyx_n_s_min_node);
  Py_CLEAR(clear_module_state->__pyx_n_s_min_support_ref);
  Py_CLEAR(clear_module_state->__pyx_n_s_min_support_source);
  Py_CLEAR(clear_module_state->__pyx_n_s_min_support_t1);
  Py_CLEAR(clear_module_state->__pyx_n_s_min_support_t2);
  Py_CLEAR(clear_module_state->__pyx_n_s_model);
  Py_CLEAR(clear_module_state->__pyx_n_s_module);
  Py_CLEAR(clear_module_state->__pyx_n_u_monophyletic);
  Py_CLEAR(clear_module_state->__pyx_n_s_movingnode);
  Py_CLEAR(clear_module_state->__pyx_n_s_mro_entries);
  Py_CLEAR(clear_module_state->__pyx_kp_u_multiple_trees_use_nexus_load_in);
  Py_CLEAR(clear_module_state->__pyx_n_s_n);
  Py_CLEAR(clear_module_state->__pyx_n_s_n2count);
  Py_CLEAR(clear_module_state->__pyx_n_s_n2depth);
  Py_CLEAR(clear_module_state->__pyx_n_s_n2subtrees);
  Py_CLEAR(clear_module_state->__pyx_n_s_n2values);
  Py_CLEAR(clear_module_state->__pyx_n_s_name);
  Py_CLEAR(clear_module_state->__pyx_n_u_name);
  Py_CLEAR(clear_module_state->__pyx_n_s_name2node);
  Py_CLEAR(clear_module_state->__pyx_n_s_name_2);
  Py_CLEAR(clear_module_state->__pyx_n_s_names);
  Py_CLEAR(clear_module_state->__pyx_n_s_ncommon);
  Py_CLEAR(clear_module_state->__pyx_n_s_ndups);
  Py_CLEAR(clear_module_state->__pyx_n_s_new);
  Py_CLEAR(clear_module_state->__pyx_n_s_new_node);
  Py_CLEAR(clear_module_state->__pyx_n_s_new_tree);
  Py_CLEAR(clear_module_state->__pyx_n_s_newick);
  Py_CLEAR(clear_module_state->__pyx_n_u_newick);
  Py_CLEAR(clear_module_state->__pyx_kp_u_newick_extended);
  Py_CLEAR(clear_module_state->__pyx_n_s_newick_only);
  Py_CLEAR(clear_module_state->__pyx_n_s_nexus);
  Py_CLEAR(clear_module_state->__pyx_n_u_nexus);
  Py_CLEAR(clear_module_state->__pyx_n_s_node);
  Py_CLEAR(clear_module_state->__pyx_n_s_node1);
  Py_CLEAR(clear_module_state->__pyx_n_s_node2);
  Py_CLEAR(clear_module_state->__pyx_n_s_node2path);
  Py_CLEAR(clear_module_state->__pyx_n_s_node_leaves);
  Py_CLEAR(clear_module_state->__pyx_n_s_nodename);
  Py_CLEAR(clear_module_state->__pyx_n_s_nodes);
  Py_CLEAR(clear_module_state->__pyx_n_s_nodes_by_name);
  Py_CLEAR(clear_module_state->__pyx_n_u_norm_rf);
  Py_CLEAR(clear_module_state->__pyx_kp_u_not_in);
  Py_CLEAR(clear_module_state->__pyx_n_s_ntrees);
  Py_CLEAR(clear_module_state->__pyx_n_s_nw);
  Py_CLEAR(clear_module_state->__pyx_n_s_open);
  Py_CLEAR(clear_module_state->__pyx_n_s_open_browser);
  Py_CLEAR(clear_module_state->__pyx_n_s_operations);
  Py_CLEAR(clear_module_state->__pyx_n_s_ops);
  Py_CLEAR(clear_module_state->__pyx_n_s_options);
  Py_CLEAR(clear_module_state->__pyx_n_s_order);
  Py_CLEAR(clear_module_state->__pyx_n_s_orig_target_size);
  Py_CLEAR(clear_module_state->__pyx_n_s_origin_t);
  Py_CLEAR(clear_module_state->__pyx_n_s_origin_trees);
  Py_CLEAR(clear_module_state->__pyx_n_s_outfile);
  Py_CLEAR(clear_module_state->__pyx_n_s_output);
  Py_CLEAR(clear_module_state->__pyx_n_s_p);
  Py_CLEAR(clear_module_state->__pyx_n_u_paraphyletic);
  Py_CLEAR(clear_module_state->__pyx_n_s_parent);
  Py_CLEAR(clear_module_state->__pyx_n_s_parent_child_table);
  Py_CLEAR(clear_module_state->__pyx_n_s_parent_name);
  Py_CLEAR(clear_module_state->__pyx_n_s_parser);
  Py_CLEAR(clear_module_state->__pyx_n_s_parser_extract);
  Py_CLEAR(clear_module_state->__pyx_n_s_path);
  Py_CLEAR(clear_module_state->__pyx_n_s_paths);
  Py_CLEAR(clear_module_state->__pyx_n_s_pickle);
  Py_CLEAR(clear_module_state->__pyx_n_u_polyphyletic);
  Py_CLEAR(clear_module_state->__pyx_n_s_polytomy_correction);
  Py_CLEAR(clear_module_state->__pyx_n_s_polytomy_size_limit);
  Py_CLEAR(clear_module_state->__pyx_n_s_pop);
  Py_CLEAR(clear_module_state->__pyx_n_s_pop_child);
  Py_CLEAR(clear_module_state->__pyx_n_s_popitem);
  Py_CLEAR(clear_module_state->__pyx_n_s_populate);
  Py_CLEAR(clear_module_state->__pyx_n_s_port);
  Py_CLEAR(clear_module_state->__pyx_n_s_position);
  Py_CLEAR(clear_module_state->__pyx_kp_u_position_2);
  Py_CLEAR(clear_module_state->__pyx_n_s_post);
  Py_CLEAR(clear_module_state->__pyx_n_u_postorder);
  Py_CLEAR(clear_module_state->__pyx_n_s_preorder);
  Py_CLEAR(clear_module_state->__pyx_n_u_preorder);
  Py_CLEAR(clear_module_state->__pyx_n_s_prepare);
  Py_CLEAR(clear_module_state->__pyx_n_s_preserve_branch_length);
  Py_CLEAR(clear_module_state->__pyx_n_s_prev);
  Py_CLEAR(clear_module_state->__pyx_n_s_prevent_nondicotomic);
  Py_CLEAR(clear_module_state->__pyx_n_s_print);
  Py_CLEAR(clear_module_state->__pyx_n_s_product);
  Py_CLEAR(clear_module_state->__pyx_n_s_prop);
  Py_CLEAR(clear_module_state->__pyx_n_s_prop1);
  Py_CLEAR(clear_module_state->__pyx_n_s_prop2);
  Py_CLEAR(clear_module_state->__pyx_n_s_prop_t1);
  Py_CLEAR(clear_module_state->__pyx_n_s_prop_t2);
  Py_CLEAR(clear_module_state->__pyx_n_s_props);
  Py_CLEAR(clear_module_state->__pyx_n_s_prune);
  Py_CLEAR(clear_module_state->__pyx_n_s_prune_locals_cmp_nodes);
  Py_CLEAR(clear_module_state->__pyx_n_s_px);
  Py_CLEAR(clear_module_state->__pyx_n_u_px);
  Py_CLEAR(clear_module_state->__pyx_n_s_px0);
  Py_CLEAR(clear_module_state->__pyx_n_s_py);
  Py_CLEAR(clear_module_state->__pyx_n_s_pyx_PickleError);
  Py_CLEAR(clear_module_state->__pyx_n_s_pyx_checksum);
  Py_CLEAR(clear_module_state->__pyx_n_s_pyx_result);
  Py_CLEAR(clear_module_state->__pyx_n_s_pyx_state);
  Py_CLEAR(clear_module_state->__pyx_n_s_pyx_type);
  Py_CLEAR(clear_module_state->__pyx_n_s_pyx_unpickle_Tree);
  Py_CLEAR(clear_module_state->__pyx_n_s_qualname);
  Py_CLEAR(clear_module_state->__pyx_n_s_quit);
  Py_CLEAR(clear_module_state->__pyx_n_s_range);
  Py_CLEAR(clear_module_state->__pyx_n_u_raw);
  Py_CLEAR(clear_module_state->__pyx_n_s_reduce);
  Py_CLEAR(clear_module_state->__pyx_n_s_reduce_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_reduce_ex);
  Py_CLEAR(clear_module_state->__pyx_n_s_ref_disc);
  Py_CLEAR(clear_module_state->__pyx_n_u_ref_edges);
  Py_CLEAR(clear_module_state->__pyx_n_u_ref_edges_in_source);
  Py_CLEAR(clear_module_state->__pyx_n_s_ref_found);
  Py_CLEAR(clear_module_state->__pyx_n_s_ref_found_in_src);
  Py_CLEAR(clear_module_state->__pyx_n_s_ref_p);
  Py_CLEAR(clear_module_state->__pyx_n_s_ref_tree);
  Py_CLEAR(clear_module_state->__pyx_n_s_ref_tree_attr);
  Py_CLEAR(clear_module_state->__pyx_n_s_remove);
  Py_CLEAR(clear_module_state->__pyx_n_s_remove_child);
  Py_CLEAR(clear_module_state->__pyx_n_s_remove_child_locals_genexpr);
  Py_CLEAR(clear_module_state->__pyx_n_s_remove_children);
  Py_CLEAR(clear_module_state->__pyx_n_s_remove_sister);
  Py_CLEAR(clear_module_state->__pyx_n_s_remove_tree);
  Py_CLEAR(clear_module_state->__pyx_n_s_render);
  Py_CLEAR(clear_module_state->__pyx_n_s_render_sm);
  Py_CLEAR(clear_module_state->__pyx_n_s_render_tree);
  Py_CLEAR(clear_module_state->__pyx_n_s_resolve_polytomy);
  Py_CLEAR(clear_module_state->__pyx_n_s_result);
  Py_CLEAR(clear_module_state->__pyx_kp_u_return);
  Py_CLEAR(clear_module_state->__pyx_n_s_return_format);
  Py_CLEAR(clear_module_state->__pyx_n_s_reverse);
  Py_CLEAR(clear_module_state->__pyx_n_s_reverse_children);
  Py_CLEAR(clear_module_state->__pyx_n_s_rf);
  Py_CLEAR(clear_module_state->__pyx_n_u_rf);
  Py_CLEAR(clear_module_state->__pyx_n_s_rf_max);
  Py_CLEAR(clear_module_state->__pyx_n_s_right);
  Py_CLEAR(clear_module_state->__pyx_n_s_robinson_foulds);
  Py_CLEAR(clear_module_state->__pyx_n_s_robinson_foulds_locals_from_comm);
  Py_CLEAR(clear_module_state->__pyx_n_s_robinson_foulds_locals_genexpr);
  Py_CLEAR(clear_module_state->__pyx_n_s_robinson_foulds_locals_has_prop);
  Py_CLEAR(clear_module_state->__pyx_n_s_root);
  Py_CLEAR(clear_module_state->__pyx_n_s_rooting);
  Py_CLEAR(clear_module_state->__pyx_kp_u_s);
  Py_CLEAR(clear_module_state->__pyx_n_s_s1);
  Py_CLEAR(clear_module_state->__pyx_n_s_s2);
  Py_CLEAR(clear_module_state->__pyx_n_s_safe_div);
  Py_CLEAR(clear_module_state->__pyx_n_s_save_screenshot);
  Py_CLEAR(clear_module_state->__pyx_n_s_search_ancestors);
  Py_CLEAR(clear_module_state->__pyx_n_s_search_ancestors_locals_genexpr);
  Py_CLEAR(clear_module_state->__pyx_n_s_search_descendants);
  Py_CLEAR(clear_module_state->__pyx_n_s_search_leaves_by_name);
  Py_CLEAR(clear_module_state->__pyx_n_s_search_nodes);
  Py_CLEAR(clear_module_state->__pyx_n_s_search_nodes_locals_genexpr);
  Py_CLEAR(clear_module_state->__pyx_n_s_seed);
  Py_CLEAR(clear_module_state->__pyx_n_s_seen);
  Py_CLEAR(clear_module_state->__pyx_n_s_selenium);
  Py_CLEAR(clear_module_state->__pyx_n_s_selenium_webdriver_chrome_option);
  Py_CLEAR(clear_module_state->__pyx_n_s_self);
  Py_CLEAR(clear_module_state->__pyx_n_s_send);
  Py_CLEAR(clear_module_state->__pyx_n_s_server);
  Py_CLEAR(clear_module_state->__pyx_n_s_server_address);
  Py_CLEAR(clear_module_state->__pyx_n_s_server_close);
  Py_CLEAR(clear_module_state->__pyx_n_s_set_name);
  Py_CLEAR(clear_module_state->__pyx_n_s_set_outgroup);
  Py_CLEAR(clear_module_state->__pyx_n_s_set_style);
  Py_CLEAR(clear_module_state->__pyx_n_s_setdefault);
  Py_CLEAR(clear_module_state->__pyx_n_s_setstate);
  Py_CLEAR(clear_module_state->__pyx_n_s_setstate_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_show);
  Py_CLEAR(clear_module_state->__pyx_n_s_show_difftable);
  Py_CLEAR(clear_module_state->__pyx_n_s_show_difftable_summary);
  Py_CLEAR(clear_module_state->__pyx_n_s_show_difftable_tab);
  Py_CLEAR(clear_module_state->__pyx_n_s_show_difftable_topo);
  Py_CLEAR(clear_module_state->__pyx_n_s_show_internal);
  Py_CLEAR(clear_module_state->__pyx_n_s_show_tree);
  Py_CLEAR(clear_module_state->__pyx_n_s_shutdown);
  Py_CLEAR(clear_module_state->__pyx_n_s_side1);
  Py_CLEAR(clear_module_state->__pyx_n_s_side2);
  Py_CLEAR(clear_module_state->__pyx_n_s_sister);
  Py_CLEAR(clear_module_state->__pyx_n_s_sisters);
  Py_CLEAR(clear_module_state->__pyx_n_s_size);
  Py_CLEAR(clear_module_state->__pyx_n_s_size1);
  Py_CLEAR(clear_module_state->__pyx_n_s_size2);
  Py_CLEAR(clear_module_state->__pyx_n_s_skbio);
  Py_CLEAR(clear_module_state->__pyx_n_s_skbioTreeNode);
  Py_CLEAR(clear_module_state->__pyx_n_s_skbio_node);
  Py_CLEAR(clear_module_state->__pyx_n_s_skbio_tree);
  Py_CLEAR(clear_module_state->__pyx_n_s_skip_large_polytomies);
  Py_CLEAR(clear_module_state->__pyx_n_s_sleep);
  Py_CLEAR(clear_module_state->__pyx_n_s_smallest);
  Py_CLEAR(clear_module_state->__pyx_n_s_smartview);
  Py_CLEAR(clear_module_state->__pyx_n_s_sort);
  Py_CLEAR(clear_module_state->__pyx_n_s_sort_descendants);
  Py_CLEAR(clear_module_state->__pyx_n_s_sort_descendants_locals_lambda);
  Py_CLEAR(clear_module_state->__pyx_n_s_sorted);
  Py_CLEAR(clear_module_state->__pyx_n_s_sorted_nodes);
  Py_CLEAR(clear_module_state->__pyx_n_u_source_edges);
  Py_CLEAR(clear_module_state->__pyx_n_u_source_edges_in_ref);
  Py_CLEAR(clear_module_state->__pyx_n_u_source_subtrees);
  Py_CLEAR(clear_module_state->__pyx_n_s_source_tree);
  Py_CLEAR(clear_module_state->__pyx_n_s_source_tree_attr);
  Py_CLEAR(clear_module_state->__pyx_n_s_sp_naming_function);
  Py_CLEAR(clear_module_state->__pyx_n_s_sp_trees);
  Py_CLEAR(clear_module_state->__pyx_n_s_spec);
  Py_CLEAR(clear_module_state->__pyx_n_u_speciesFunction);
  Py_CLEAR(clear_module_state->__pyx_n_s_src_disc);
  Py_CLEAR(clear_module_state->__pyx_n_s_src_found);
  Py_CLEAR(clear_module_state->__pyx_n_s_src_found_in_ref);
  Py_CLEAR(clear_module_state->__pyx_n_s_src_p);
  Py_CLEAR(clear_module_state->__pyx_n_s_src_tree);
  Py_CLEAR(clear_module_state->__pyx_n_s_standardize);
  Py_CLEAR(clear_module_state->__pyx_n_s_start);
  Py_CLEAR(clear_module_state->__pyx_n_s_start_server);
  Py_CLEAR(clear_module_state->__pyx_n_s_startswith);
  Py_CLEAR(clear_module_state->__pyx_n_s_state);
  Py_CLEAR(clear_module_state->__pyx_kp_u_static_gui_html_tree);
  Py_CLEAR(clear_module_state->__pyx_n_s_staticmethod);
  Py_CLEAR(clear_module_state->__pyx_n_s_strategy);
  Py_CLEAR(clear_module_state->__pyx_kp_s_stringsource);
  Py_CLEAR(clear_module_state->__pyx_n_s_subtree);
  Py_CLEAR(clear_module_state->__pyx_n_s_subtree_content);
  Py_CLEAR(clear_module_state->__pyx_n_s_subtree_nw);
  Py_CLEAR(clear_module_state->__pyx_n_s_subtrees);
  Py_CLEAR(clear_module_state->__pyx_n_s_sum);
  Py_CLEAR(clear_module_state->__pyx_n_s_super);
  Py_CLEAR(clear_module_state->__pyx_n_s_support);
  Py_CLEAR(clear_module_state->__pyx_n_u_support);
  Py_CLEAR(clear_module_state->__pyx_n_s_support_fn);
  Py_CLEAR(clear_module_state->__pyx_n_s_support_t1);
  Py_CLEAR(clear_module_state->__pyx_n_s_support_t2);
  Py_CLEAR(clear_module_state->__pyx_n_s_swap_children);
  Py_CLEAR(clear_module_state->__pyx_n_s_t1);
  Py_CLEAR(clear_module_state->__pyx_n_s_t1_leaves);
  Py_CLEAR(clear_module_state->__pyx_n_s_t1_leaves_all);
  Py_CLEAR(clear_module_state->__pyx_n_s_t2);
  Py_CLEAR(clear_module_state->__pyx_n_s_t2_leaves);
  Py_CLEAR(clear_module_state->__pyx_n_s_t2_leaves_all);
  Py_CLEAR(clear_module_state->__pyx_n_u_table);
  Py_CLEAR(clear_module_state->__pyx_n_s_target_t);
  Py_CLEAR(clear_module_state->__pyx_n_s_target_trees);
  Py_CLEAR(clear_module_state->__pyx_n_s_test);
  Py_CLEAR(clear_module_state->__pyx_n_s_text_viz);
  Py_CLEAR(clear_module_state->__pyx_n_s_thread);
  Py_CLEAR(clear_module_state->__pyx_n_s_throw);
  Py_CLEAR(clear_module_state->__pyx_n_s_time);
  Py_CLEAR(clear_module_state->__pyx_n_s_to_keep);
  Py_CLEAR(clear_module_state->__pyx_n_s_to_str);
  Py_CLEAR(clear_module_state->__pyx_n_s_to_ultrametric);
  Py_CLEAR(clear_module_state->__pyx_n_s_tools);
  Py_CLEAR(clear_module_state->__pyx_n_s_topological);
  Py_CLEAR(clear_module_state->__pyx_n_u_topology);
  Py_CLEAR(clear_module_state->__pyx_n_s_total_d);
  Py_CLEAR(clear_module_state->__pyx_n_s_total_rf);
  Py_CLEAR(clear_module_state->__pyx_n_s_total_valid_ref_edges);
  Py_CLEAR(clear_module_state->__pyx_n_s_translate_nodes);
  Py_CLEAR(clear_module_state->__pyx_n_s_traverse);
  Py_CLEAR(clear_module_state->__pyx_n_s_traverse_bfs);
  Py_CLEAR(clear_module_state->__pyx_n_s_tree);
  Py_CLEAR(clear_module_state->__pyx_n_s_tree_sizes);
  Py_CLEAR(clear_module_state->__pyx_n_s_tree_style);
  Py_CLEAR(clear_module_state->__pyx_n_s_treediff);
  Py_CLEAR(clear_module_state->__pyx_n_s_treeko_d);
  Py_CLEAR(clear_module_state->__pyx_n_u_treeko_dist);
  Py_CLEAR(clear_module_state->__pyx_n_s_treeview);
  Py_CLEAR(clear_module_state->__pyx_n_s_treeview_main);
  Py_CLEAR(clear_module_state->__pyx_n_s_uniquenodes);
  Py_CLEAR(clear_module_state->__pyx_n_s_units);
  Py_CLEAR(clear_module_state->__pyx_n_s_unroot);
  Py_CLEAR(clear_module_state->__pyx_n_s_unrooted);
  Py_CLEAR(clear_module_state->__pyx_n_s_unrooted_trees);
  Py_CLEAR(clear_module_state->__pyx_n_s_up);
  Py_CLEAR(clear_module_state->__pyx_n_s_update);
  Py_CLEAR(clear_module_state->__pyx_n_s_use_collateral);
  Py_CLEAR(clear_module_state->__pyx_n_s_use_setstate);
  Py_CLEAR(clear_module_state->__pyx_n_s_usecolor);
  Py_CLEAR(clear_module_state->__pyx_n_s_utils);
  Py_CLEAR(clear_module_state->__pyx_n_s_valid_ref_edges);
  Py_CLEAR(clear_module_state->__pyx_n_s_valid_src_edges);
  Py_CLEAR(clear_module_state->__pyx_n_s_value);
  Py_CLEAR(clear_module_state->__pyx_n_s_values);
  Py_CLEAR(clear_module_state->__pyx_n_s_verbose);
  Py_CLEAR(clear_module_state->__pyx_n_s_visited_node);
  Py_CLEAR(clear_module_state->__pyx_n_s_visitor_key);
  Py_CLEAR(clear_module_state->__pyx_n_s_visitors);
  Py_CLEAR(clear_module_state->__pyx_n_s_visitors2nodes);
  Py_CLEAR(clear_module_state->__pyx_n_s_w);
  Py_CLEAR(clear_module_state->__pyx_n_u_w);
  Py_CLEAR(clear_module_state->__pyx_n_s_warn);
  Py_CLEAR(clear_module_state->__pyx_n_s_warnings);
  Py_CLEAR(clear_module_state->__pyx_n_s_webdriver);
  Py_CLEAR(clear_module_state->__pyx_n_s_weight_fn);
  Py_CLEAR(clear_module_state->__pyx_n_s_win_name);
  Py_CLEAR(clear_module_state->__pyx_kp_u_window_size);
  Py_CLEAR(clear_module_state->__pyx_n_s_write);
  Py_CLEAR(clear_module_state->__pyx_n_s_x);
  Py_CLEAR(clear_module_state->__pyx_n_s_y);
  Py_CLEAR(clear_module_state->__pyx_n_u_yule);
  Py_CLEAR(clear_module_state->__pyx_float_0_0);
  Py_CLEAR(clear_module_state->__pyx_float_1_0);
  Py_CLEAR(clear_module_state->__pyx_int_0);
  Py_CLEAR(clear_module_state->__pyx_int_1);
  Py_CLEAR(clear_module_state->__pyx_int_2);
  Py_CLEAR(clear_module_state->__pyx_int_5);
  Py_CLEAR(clear_module_state->__pyx_int_90);
  Py_CLEAR(clear_module_state->__pyx_int_1000);
  Py_CLEAR(clear_module_state->__pyx_int_27868033);
  Py_CLEAR(clear_module_state->__pyx_int_43033374);
  Py_CLEAR(clear_module_state->__pyx_int_151323765);
  Py_CLEAR(clear_module_state->__pyx_int_neg_1);
  Py_CLEAR(clear_module_state->__pyx_k__24);
  Py_CLEAR(clear_module_state->__pyx_slice_);
  Py_CLEAR(clear_module_state->__pyx_tuple__6);
  Py_CLEAR(clear_module_state->__pyx_slice__35);
  Py_CLEAR(clear_module_state->__pyx_slice__38);
  Py_CLEAR(clear_module_state->__pyx_tuple__16);
  Py_CLEAR(clear_module_state->__pyx_tuple__26);
  Py_CLEAR(clear_module_state->__pyx_tuple__28);
  Py_CLEAR(clear_module_state->__pyx_tuple__30);
  Py_CLEAR(clear_module_state->__pyx_tuple__31);
  Py_CLEAR(clear_module_state->__pyx_tuple__33);
  Py_CLEAR(clear_module_state->__pyx_tuple__39);
  Py_CLEAR(clear_module_state->__pyx_tuple__41);
  Py_CLEAR(clear_module_state->__pyx_tuple__43);
  Py_CLEAR(clear_module_state->__pyx_tuple__45);
  Py_CLEAR(clear_module_state->__pyx_tuple__46);
  Py_CLEAR(clear_module_state->__pyx_tuple__48);
  Py_CLEAR(clear_module_state->__pyx_tuple__49);
  Py_CLEAR(clear_module_state->__pyx_tuple__51);
  Py_CLEAR(clear_module_state->__pyx_tuple__53);
  Py_CLEAR(clear_module_state->__pyx_tuple__54);
  Py_CLEAR(clear_module_state->__pyx_tuple__56);
  Py_CLEAR(clear_module_state->__pyx_tuple__58);
  Py_CLEAR(clear_module_state->__pyx_tuple__60);
  Py_CLEAR(clear_module_state->__pyx_tuple__62);
  Py_CLEAR(clear_module_state->__pyx_tuple__63);
  Py_CLEAR(clear_module_state->__pyx_tuple__65);
  Py_CLEAR(clear_module_state->__pyx_tuple__67);
  Py_CLEAR(clear_module_state->__pyx_tuple__68);
  Py_CLEAR(clear_module_state->__pyx_tuple__70);
  Py_CLEAR(clear_module_state->__pyx_tuple__72);
  Py_CLEAR(clear_module_state->__pyx_tuple__74);
  Py_CLEAR(clear_module_state->__pyx_tuple__76);
  Py_CLEAR(clear_module_state->__pyx_tuple__78);
  Py_CLEAR(clear_module_state->__pyx_tuple__79);
  Py_CLEAR(clear_module_state->__pyx_tuple__81);
  Py_CLEAR(clear_module_state->__pyx_tuple__83);
  Py_CLEAR(clear_module_state->__pyx_tuple__85);
  Py_CLEAR(clear_module_state->__pyx_tuple__88);
  Py_CLEAR(clear_module_state->__pyx_tuple__90);
  Py_CLEAR(clear_module_state->__pyx_tuple__91);
  Py_CLEAR(clear_module_state->__pyx_tuple__92);
  Py_CLEAR(clear_module_state->__pyx_tuple__93);
  Py_CLEAR(clear_module_state->__pyx_tuple__94);
  Py_CLEAR(clear_module_state->__pyx_tuple__95);
  Py_CLEAR(clear_module_state->__pyx_tuple__96);
  Py_CLEAR(clear_module_state->__pyx_tuple__97);
  Py_CLEAR(clear_module_state->__pyx_tuple__98);
  Py_CLEAR(clear_module_state->__pyx_tuple__99);
  Py_CLEAR(clear_module_state->__pyx_codeobj__7);
  Py_CLEAR(clear_module_state->__pyx_codeobj__8);
  Py_CLEAR(clear_module_state->__pyx_codeobj__9);
  Py_CLEAR(clear_module_state->__pyx_tuple__101);
  Py_CLEAR(clear_module_state->__pyx_tuple__103);
  Py_CLEAR(clear_module_state->__pyx_tuple__105);
  Py_CLEAR(clear_module_state->__pyx_tuple__106);
  Py_CLEAR(clear_module_state->__pyx_tuple__108);
  Py_CLEAR(clear_module_state->__pyx_tuple__109);
  Py_CLEAR(clear_module_state->__pyx_tuple__111);
  Py_CLEAR(clear_module_state->__pyx_tuple__113);
  Py_CLEAR(clear_module_state->__pyx_tuple__115);
  Py_CLEAR(clear_module_state->__pyx_tuple__117);
  Py_CLEAR(clear_module_state->__pyx_tuple__118);
  Py_CLEAR(clear_module_state->__pyx_tuple__122);
  Py_CLEAR(clear_module_state->__pyx_tuple__124);
  Py_CLEAR(clear_module_state->__pyx_tuple__126);
  Py_CLEAR(clear_module_state->__pyx_tuple__127);
  Py_CLEAR(clear_module_state->__pyx_tuple__129);
  Py_CLEAR(clear_module_state->__pyx_tuple__130);
  Py_CLEAR(clear_module_state->__pyx_tuple__132);
  Py_CLEAR(clear_module_state->__pyx_tuple__133);
  Py_CLEAR(clear_module_state->__pyx_tuple__135);
  Py_CLEAR(clear_module_state->__pyx_tuple__137);
  Py_CLEAR(clear_module_state->__pyx_tuple__138);
  Py_CLEAR(clear_module_state->__pyx_tuple__140);
  Py_CLEAR(clear_module_state->__pyx_tuple__141);
  Py_CLEAR(clear_module_state->__pyx_tuple__143);
  Py_CLEAR(clear_module_state->__pyx_tuple__144);
  Py_CLEAR(clear_module_state->__pyx_tuple__146);
  Py_CLEAR(clear_module_state->__pyx_tuple__148);
  Py_CLEAR(clear_module_state->__pyx_tuple__149);
  Py_CLEAR(clear_module_state->__pyx_tuple__151);
  Py_CLEAR(clear_module_state->__pyx_tuple__152);
  Py_CLEAR(clear_module_state->__pyx_tuple__154);
  Py_CLEAR(clear_module_state->__pyx_tuple__155);
  Py_CLEAR(clear_module_state->__pyx_tuple__157);
  Py_CLEAR(clear_module_state->__pyx_tuple__159);
  Py_CLEAR(clear_module_state->__pyx_tuple__160);
  Py_CLEAR(clear_module_state->__pyx_tuple__162);
  Py_CLEAR(clear_module_state->__pyx_tuple__163);
  Py_CLEAR(clear_module_state->__pyx_tuple__165);
  Py_CLEAR(clear_module_state->__pyx_tuple__166);
  Py_CLEAR(clear_module_state->__pyx_tuple__167);
  Py_CLEAR(clear_module_state->__pyx_tuple__169);
  Py_CLEAR(clear_module_state->__pyx_tuple__170);
  Py_CLEAR(clear_module_state->__pyx_tuple__172);
  Py_CLEAR(clear_module_state->__pyx_tuple__174);
  Py_CLEAR(clear_module_state->__pyx_tuple__176);
  Py_CLEAR(clear_module_state->__pyx_tuple__178);
  Py_CLEAR(clear_module_state->__pyx_tuple__179);
  Py_CLEAR(clear_module_state->__pyx_tuple__180);
  Py_CLEAR(clear_module_state->__pyx_tuple__182);
  Py_CLEAR(clear_module_state->__pyx_tuple__183);
  Py_CLEAR(clear_module_state->__pyx_tuple__185);
  Py_CLEAR(clear_module_state->__pyx_tuple__186);
  Py_CLEAR(clear_module_state->__pyx_tuple__188);
  Py_CLEAR(clear_module_state->__pyx_tuple__190);
  Py_CLEAR(clear_module_state->__pyx_tuple__192);
  Py_CLEAR(clear_module_state->__pyx_tuple__194);
  Py_CLEAR(clear_module_state->__pyx_tuple__195);
  Py_CLEAR(clear_module_state->__pyx_tuple__197);
  Py_CLEAR(clear_module_state->__pyx_tuple__199);
  Py_CLEAR(clear_module_state->__pyx_tuple__201);
  Py_CLEAR(clear_module_state->__pyx_codeobj__10);
  Py_CLEAR(clear_module_state->__pyx_codeobj__11);
  Py_CLEAR(clear_module_state->__pyx_codeobj__12);
  Py_CLEAR(clear_module_state->__pyx_codeobj__13);
  Py_CLEAR(clear_module_state->__pyx_codeobj__14);
  Py_CLEAR(clear_module_state->__pyx_codeobj__17);
  Py_CLEAR(clear_module_state->__pyx_codeobj__18);
  Py_CLEAR(clear_module_state->__pyx_codeobj__19);
  Py_CLEAR(clear_module_state->__pyx_codeobj__25);
  Py_CLEAR(clear_module_state->__pyx_codeobj__27);
  Py_CLEAR(clear_module_state->__pyx_codeobj__29);
  Py_CLEAR(clear_module_state->__pyx_codeobj__32);
  Py_CLEAR(clear_module_state->__pyx_codeobj__34);
  Py_CLEAR(clear_module_state->__pyx_codeobj__36);
  Py_CLEAR(clear_module_state->__pyx_codeobj__37);
  Py_CLEAR(clear_module_state->__pyx_codeobj__40);
  Py_CLEAR(clear_module_state->__pyx_codeobj__42);
  Py_CLEAR(clear_module_state->__pyx_codeobj__44);
  Py_CLEAR(clear_module_state->__pyx_codeobj__47);
  Py_CLEAR(clear_module_state->__pyx_codeobj__50);
  Py_CLEAR(clear_module_state->__pyx_codeobj__52);
  Py_CLEAR(clear_module_state->__pyx_codeobj__55);
  Py_CLEAR(clear_module_state->__pyx_codeobj__57);
  Py_CLEAR(clear_module_state->__pyx_codeobj__59);
  Py_CLEAR(clear_module_state->__pyx_codeobj__61);
  Py_CLEAR(clear_module_state->__pyx_codeobj__64);
  Py_CLEAR(clear_module_state->__pyx_codeobj__66);
  Py_CLEAR(clear_module_state->__pyx_codeobj__69);
  Py_CLEAR(clear_module_state->__pyx_codeobj__71);
  Py_CLEAR(clear_module_state->__pyx_codeobj__73);
  Py_CLEAR(clear_module_state->__pyx_codeobj__75);
  Py_CLEAR(clear_module_state->__pyx_codeobj__77);
  Py_CLEAR(clear_module_state->__pyx_codeobj__80);
  Py_CLEAR(clear_module_state->__pyx_codeobj__82);
  Py_CLEAR(clear_module_state->__pyx_codeobj__84);
  Py_CLEAR(clear_module_state->__pyx_codeobj__86);
  Py_CLEAR(clear_module_state->__pyx_codeobj__87);
  Py_CLEAR(clear_module_state->__pyx_codeobj__89);
  Py_CLEAR(clear_module_state->__pyx_codeobj__100);
  Py_CLEAR(clear_module_state->__pyx_codeobj__102);
  Py_CLEAR(clear_module_state->__pyx_codeobj__104);
  Py_CLEAR(clear_module_state->__pyx_codeobj__107);
  Py_CLEAR(clear_module_state->__pyx_codeobj__110);
  Py_CLEAR(clear_module_state->__pyx_codeobj__112);
  Py_CLEAR(clear_module_state->__pyx_codeobj__114);
  Py_CLEAR(clear_module_state->__pyx_codeobj__116);
  Py_CLEAR(clear_module_state->__pyx_codeobj__119);
  Py_CLEAR(clear_module_state->__pyx_codeobj__120);
  Py_CLEAR(clear_module_state->__pyx_codeobj__123);
  Py_CLEAR(clear_module_state->__pyx_codeobj__125);
  Py_CLEAR(clear_module_state->__pyx_codeobj__128);
  Py_CLEAR(clear_module_state->__pyx_codeobj__131);
  Py_CLEAR(clear_module_state->__pyx_codeobj__134);
  Py_CLEAR(clear_module_state->__pyx_codeobj__136);
  Py_CLEAR(clear_module_state->__pyx_codeobj__139);
  Py_CLEAR(clear_module_state->__pyx_codeobj__142);
  Py_CLEAR(clear_module_state->__pyx_codeobj__145);
  Py_CLEAR(clear_module_state->__pyx_codeobj__147);
  Py_CLEAR(clear_module_state->__pyx_codeobj__150);
  Py_CLEAR(clear_module_state->__pyx_codeobj__153);
  Py_CLEAR(clear_module_state->__pyx_codeobj__156);
  Py_CLEAR(clear_module_state->__pyx_codeobj__158);
  Py_CLEAR(clear_module_state->__pyx_codeobj__161);
  Py_CLEAR(clear_module_state->__pyx_codeobj__164);
  Py_CLEAR(clear_module_state->__pyx_codeobj__168);
  Py_CLEAR(clear_module_state->__pyx_codeobj__171);
  Py_CLEAR(clear_module_state->__pyx_codeobj__173);
  Py_CLEAR(clear_module_state->__pyx_codeobj__175);
  Py_CLEAR(clear_module_state->__pyx_codeobj__177);
  Py_CLEAR(clear_module_state->__pyx_codeobj__181);
  Py_CLEAR(clear_module_state->__pyx_codeobj__184);
  Py_CLEAR(clear_module_state->__pyx_codeobj__187);
  Py_CLEAR(clear_module_state->__pyx_codeobj__189);
  Py_CLEAR(clear_module_state->__pyx_codeobj__191);
  Py_CLEAR(clear_module_state->__pyx_codeobj__193);
  Py_CLEAR(clear_module_state->__pyx_codeobj__196);
  Py_CLEAR(clear_module_state->__pyx_codeobj__198);
  Py_CLEAR(clear_module_state->__pyx_codeobj__200);
  Py_CLEAR(clear_module_state->__pyx_codeobj__202);
  return 0;
}
#endif
/* #### Code section: module_state_traverse ### */
#if CYTHON_USE_MODULE_STATE
static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
  __pyx_mstate *traverse_module_state = __pyx_mstate(m);
  if (!traverse_module_state) return 0;
  Py_VISIT(traverse_module_state->__pyx_d);
  Py_VISIT(traverse_module_state->__pyx_b);
  Py_VISIT(traverse_module_state->__pyx_cython_runtime);
  Py_VISIT(traverse_module_state->__pyx_empty_tuple);
  Py_VISIT(traverse_module_state->__pyx_empty_bytes);
  Py_VISIT(traverse_module_state->__pyx_empty_unicode);
  #ifdef __Pyx_CyFunction_USED
  Py_VISIT(traverse_module_state->__pyx_CyFunctionType);
  #endif
  #ifdef __Pyx_FusedFunction_USED
  Py_VISIT(traverse_module_state->__pyx_FusedFunctionType);
  #endif
  Py_VISIT(traverse_module_state->__pyx_ptype_4ete4_4core_4tree_Tree);
  Py_VISIT(traverse_module_state->__pyx_type_4ete4_4core_4tree_Tree);
  Py_VISIT(traverse_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct__genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct__genexpr);
  Py_VISIT(traverse_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_1___getitem__);
  Py_VISIT(traverse_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_1___getitem__);
  Py_VISIT(traverse_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_2_genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_2_genexpr);
  Py_VISIT(traverse_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_3___contains__);
  Py_VISIT(traverse_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_3___contains__);
  Py_VISIT(traverse_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_4_genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_4_genexpr);
  Py_VISIT(traverse_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_5___iter__);
  Py_VISIT(traverse_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_5___iter__);
  Py_VISIT(traverse_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_6_remove_child);
  Py_VISIT(traverse_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_6_remove_child);
  Py_VISIT(traverse_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_7_genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_7_genexpr);
  Py_VISIT(traverse_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_8_prune);
  Py_VISIT(traverse_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_8_prune);
  Py_VISIT(traverse_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_9_leaves);
  Py_VISIT(traverse_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_9_leaves);
  Py_VISIT(traverse_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_10_leaf_names);
  Py_VISIT(traverse_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_10_leaf_names);
  Py_VISIT(traverse_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_11_descendants);
  Py_VISIT(traverse_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_11_descendants);
  Py_VISIT(traverse_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_12_traverse);
  Py_VISIT(traverse_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_12_traverse);
  Py_VISIT(traverse_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_13_iter_prepostorder);
  Py_VISIT(traverse_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_13_iter_prepostorder);
  Py_VISIT(traverse_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_14_ancestors);
  Py_VISIT(traverse_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_14_ancestors);
  Py_VISIT(traverse_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_15_lineage);
  Py_VISIT(traverse_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_15_lineage);
  Py_VISIT(traverse_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_16_search_nodes);
  Py_VISIT(traverse_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_16_search_nodes);
  Py_VISIT(traverse_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_17_genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_17_genexpr);
  Py_VISIT(traverse_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_18_search_descendants);
  Py_VISIT(traverse_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_18_search_descendants);
  Py_VISIT(traverse_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_19_search_ancestors);
  Py_VISIT(traverse_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_19_search_ancestors);
  Py_VISIT(traverse_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_20_genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_20_genexpr);
  Py_VISIT(traverse_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_21_get_distance);
  Py_VISIT(traverse_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_21_get_distance);
  Py_VISIT(traverse_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_22_genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_22_genexpr);
  Py_VISIT(traverse_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_23_genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_23_genexpr);
  Py_VISIT(traverse_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_24_sort_descendants);
  Py_VISIT(traverse_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_24_sort_descendants);
  Py_VISIT(traverse_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_25_get_cached_content);
  Py_VISIT(traverse_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_25_get_cached_content);
  Py_VISIT(traverse_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds);
  Py_VISIT(traverse_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds);
  Py_VISIT(traverse_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_27_genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_27_genexpr);
  Py_VISIT(traverse_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_28_genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_28_genexpr);
  Py_VISIT(traverse_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_29_genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_29_genexpr);
  Py_VISIT(traverse_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_30_genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_30_genexpr);
  Py_VISIT(traverse_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_31_from_common);
  Py_VISIT(traverse_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_31_from_common);
  Py_VISIT(traverse_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_32_genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_32_genexpr);
  Py_VISIT(traverse_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_33_genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_33_genexpr);
  Py_VISIT(traverse_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_34_genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_34_genexpr);
  Py_VISIT(traverse_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_35_genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_35_genexpr);
  Py_VISIT(traverse_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_36_genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_36_genexpr);
  Py_VISIT(traverse_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_37_genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_37_genexpr);
  Py_VISIT(traverse_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_38_compare);
  Py_VISIT(traverse_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_38_compare);
  Py_VISIT(traverse_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_39_edges);
  Py_VISIT(traverse_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_39_edges);
  Py_VISIT(traverse_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_40_get_topology_id);
  Py_VISIT(traverse_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_40_get_topology_id);
  Py_VISIT(traverse_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_41_genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_41_genexpr);
  Py_VISIT(traverse_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_42_genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_42_genexpr);
  Py_VISIT(traverse_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_43_is_monophyletic);
  Py_VISIT(traverse_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_43_is_monophyletic);
  Py_VISIT(traverse_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_44_genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_44_genexpr);
  Py_VISIT(traverse_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_45_check_monophyly);
  Py_VISIT(traverse_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_45_check_monophyly);
  Py_VISIT(traverse_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_46_genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_46_genexpr);
  Py_VISIT(traverse_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_47_genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_47_genexpr);
  Py_VISIT(traverse_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_48_get_monophyletic);
  Py_VISIT(traverse_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_48_get_monophyletic);
  Py_VISIT(traverse_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_49_expand_polytomies);
  Py_VISIT(traverse_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_49_expand_polytomies);
  Py_VISIT(traverse_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_50_add_leaf);
  Py_VISIT(traverse_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_50_add_leaf);
  Py_VISIT(traverse_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_51_enum_unordered);
  Py_VISIT(traverse_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_51_enum_unordered);
  Py_VISIT(traverse_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_52_genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_52_genexpr);
  Py_VISIT(traverse_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_53_from_parent_child_table);
  Py_VISIT(traverse_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_53_from_parent_child_table);
  Py_VISIT(traverse_module_state->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_54_from_skbio);
  Py_VISIT(traverse_module_state->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_54_from_skbio);
  Py_VISIT(traverse_module_state->__pyx_kp_u_127_0_0_1);
  Py_VISIT(traverse_module_state->__pyx_kp_u_A_parent_node_is_required_to_add);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Ambiguous_node_name);
  Py_VISIT(traverse_module_state->__pyx_n_s_AssertionError);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Both_trees_contain_polytomies_Tr);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Can_only_check_nodes_or_names_in);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Cannot_pop_child_not_found);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Cannot_remove_child_not_found);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Cannot_remove_sister_because_the);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Cannot_render_image_missing_modu);
  Py_VISIT(traverse_module_state->__pyx_n_s_Chrome);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Duplicated_items_found_in_refere);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Duplicated_items_found_in_target);
  Py_VISIT(traverse_module_state->__pyx_n_u_ETE);
  Py_VISIT(traverse_module_state->__pyx_n_s_FACE_POSITIONS);
  Py_VISIT(traverse_module_state->__pyx_n_s_Face);
  Py_VISIT(traverse_module_state->__pyx_n_s_FaceAreas);
  Py_VISIT(traverse_module_state->__pyx_n_s_FaceContainer);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Found_polytomy_larger_than_curre);
  Py_VISIT(traverse_module_state->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Incorrect_child_type);
  Py_VISIT(traverse_module_state->__pyx_n_s_IndexError);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Invalid_copy_method);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Invalid_node_id);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Invalid_node_type);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Max_distance_g);
  Py_VISIT(traverse_module_state->__pyx_n_s_ModuleNotFoundError);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Most_distant_node_s);
  Py_VISIT(traverse_module_state->__pyx_n_u_NA);
  Py_VISIT(traverse_module_state->__pyx_n_u_No);
  Py_VISIT(traverse_module_state->__pyx_kp_u_No_children);
  Py_VISIT(traverse_module_state->__pyx_kp_u_No_common_ancestor_for_nodes);
  Py_VISIT(traverse_module_state->__pyx_kp_u_No_node_found_with_name);
  Py_VISIT(traverse_module_state->__pyx_n_s_NodeStyle);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Node_has);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Number_of_leaf_nodes_d);
  Py_VISIT(traverse_module_state->__pyx_n_s_Options);
  Py_VISIT(traverse_module_state->__pyx_n_s_PARSERS);
  Py_VISIT(traverse_module_state->__pyx_n_s_PickleError);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Rooted_s);
  Py_VISIT(traverse_module_state->__pyx_n_s_StopIteration);
  Py_VISIT(traverse_module_state->__pyx_n_s_TipTuple);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Total_number_of_nodes_d);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Tree);
  Py_VISIT(traverse_module_state->__pyx_n_s_TreeError);
  Py_VISIT(traverse_module_state->__pyx_n_s_TreeNode);
  Py_VISIT(traverse_module_state->__pyx_n_s_Tree_2);
  Py_VISIT(traverse_module_state->__pyx_n_s_Tree___iter);
  Py_VISIT(traverse_module_state->__pyx_n_s_Tree___reduce_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_Tree___setstate_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_Tree__diff);
  Py_VISIT(traverse_module_state->__pyx_n_s_Tree__get_farthest_and_closest_l);
  Py_VISIT(traverse_module_state->__pyx_n_s_Tree__translate_nodes);
  Py_VISIT(traverse_module_state->__pyx_n_s_Tree_add_child);
  Py_VISIT(traverse_module_state->__pyx_n_s_Tree_add_children);
  Py_VISIT(traverse_module_state->__pyx_n_s_Tree_add_face);
  Py_VISIT(traverse_module_state->__pyx_n_s_Tree_add_prop);
  Py_VISIT(traverse_module_state->__pyx_n_s_Tree_add_props);
  Py_VISIT(traverse_module_state->__pyx_n_s_Tree_add_sister);
  Py_VISIT(traverse_module_state->__pyx_n_s_Tree_ancestors);
  Py_VISIT(traverse_module_state->__pyx_n_s_Tree_check_monophyly);
  Py_VISIT(traverse_module_state->__pyx_n_s_Tree_common_ancestor);
  Py_VISIT(traverse_module_state->__pyx_n_s_Tree_compare);
  Py_VISIT(traverse_module_state->__pyx_n_s_Tree_cophenetic_matrix);
  Py_VISIT(traverse_module_state->__pyx_n_s_Tree_copy);
  Py_VISIT(traverse_module_state->__pyx_n_s_Tree_del_prop);
  Py_VISIT(traverse_module_state->__pyx_n_s_Tree_delete);
  Py_VISIT(traverse_module_state->__pyx_n_s_Tree_descendants);
  Py_VISIT(traverse_module_state->__pyx_n_s_Tree_describe);
  Py_VISIT(traverse_module_state->__pyx_n_s_Tree_detach);
  Py_VISIT(traverse_module_state->__pyx_n_s_Tree_edges);
  Py_VISIT(traverse_module_state->__pyx_n_s_Tree_expand_polytomies);
  Py_VISIT(traverse_module_state->__pyx_n_s_Tree_explore);
  Py_VISIT(traverse_module_state->__pyx_n_s_Tree_from_parent_child_table);
  Py_VISIT(traverse_module_state->__pyx_n_s_Tree_from_skbio);
  Py_VISIT(traverse_module_state->__pyx_n_s_Tree_get_cached_content);
  Py_VISIT(traverse_module_state->__pyx_n_s_Tree_get_children);
  Py_VISIT(traverse_module_state->__pyx_n_s_Tree_get_closest_leaf);
  Py_VISIT(traverse_module_state->__pyx_n_s_Tree_get_distance);
  Py_VISIT(traverse_module_state->__pyx_n_s_Tree_get_farthest_leaf);
  Py_VISIT(traverse_module_state->__pyx_n_s_Tree_get_farthest_node);
  Py_VISIT(traverse_module_state->__pyx_n_s_Tree_get_midpoint_outgroup);
  Py_VISIT(traverse_module_state->__pyx_n_s_Tree_get_monophyletic);
  Py_VISIT(traverse_module_state->__pyx_n_s_Tree_get_prop);
  Py_VISIT(traverse_module_state->__pyx_n_s_Tree_get_sisters);
  Py_VISIT(traverse_module_state->__pyx_n_s_Tree_get_topology_id);
  Py_VISIT(traverse_module_state->__pyx_n_s_Tree_is_monophyletic);
  Py_VISIT(traverse_module_state->__pyx_n_s_Tree_iter_prepostorder);
  Py_VISIT(traverse_module_state->__pyx_n_s_Tree_ladderize);
  Py_VISIT(traverse_module_state->__pyx_n_s_Tree_leaf_names);
  Py_VISIT(traverse_module_state->__pyx_n_s_Tree_leaves);
  Py_VISIT(traverse_module_state->__pyx_n_s_Tree_lineage);
  Py_VISIT(traverse_module_state->__pyx_n_s_Tree_mean_distance);
  Py_VISIT(traverse_module_state->__pyx_n_s_Tree_pop_child);
  Py_VISIT(traverse_module_state->__pyx_n_s_Tree_populate);
  Py_VISIT(traverse_module_state->__pyx_n_s_Tree_prune);
  Py_VISIT(traverse_module_state->__pyx_n_s_Tree_remove_child);
  Py_VISIT(traverse_module_state->__pyx_n_s_Tree_remove_children);
  Py_VISIT(traverse_module_state->__pyx_n_s_Tree_remove_sister);
  Py_VISIT(traverse_module_state->__pyx_n_s_Tree_render);
  Py_VISIT(traverse_module_state->__pyx_n_s_Tree_render_sm);
  Py_VISIT(traverse_module_state->__pyx_n_s_Tree_resolve_polytomy);
  Py_VISIT(traverse_module_state->__pyx_n_s_Tree_reverse_children);
  Py_VISIT(traverse_module_state->__pyx_n_s_Tree_robinson_foulds);
  Py_VISIT(traverse_module_state->__pyx_n_s_Tree_search_ancestors);
  Py_VISIT(traverse_module_state->__pyx_n_s_Tree_search_descendants);
  Py_VISIT(traverse_module_state->__pyx_n_s_Tree_search_leaves_by_name);
  Py_VISIT(traverse_module_state->__pyx_n_s_Tree_search_nodes);
  Py_VISIT(traverse_module_state->__pyx_n_s_Tree_set_outgroup);
  Py_VISIT(traverse_module_state->__pyx_n_s_Tree_set_style);
  Py_VISIT(traverse_module_state->__pyx_n_s_Tree_show);
  Py_VISIT(traverse_module_state->__pyx_n_s_Tree_sort_descendants);
  Py_VISIT(traverse_module_state->__pyx_n_s_Tree_standardize);
  Py_VISIT(traverse_module_state->__pyx_n_s_Tree_swap_children);
  Py_VISIT(traverse_module_state->__pyx_n_s_Tree_to_str);
  Py_VISIT(traverse_module_state->__pyx_n_s_Tree_to_ultrametric);
  Py_VISIT(traverse_module_state->__pyx_n_s_Tree_traverse);
  Py_VISIT(traverse_module_state->__pyx_n_s_Tree_unroot);
  Py_VISIT(traverse_module_state->__pyx_n_s_Tree_write);
  Py_VISIT(traverse_module_state->__pyx_n_s_TypeError);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Unknown_output_for_diff);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Unknown_strategy);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Unrooted_tree_found_You_may_want);
  Py_VISIT(traverse_module_state->__pyx_n_s_ValueError);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Wrote_file);
  Py_VISIT(traverse_module_state->__pyx_n_u_Yes);
  Py_VISIT(traverse_module_state->__pyx_n_s__121);
  Py_VISIT(traverse_module_state->__pyx_kp_u__15);
  Py_VISIT(traverse_module_state->__pyx_kp_u__2);
  Py_VISIT(traverse_module_state->__pyx_kp_u__20);
  Py_VISIT(traverse_module_state->__pyx_n_s__203);
  Py_VISIT(traverse_module_state->__pyx_n_s__21);
  Py_VISIT(traverse_module_state->__pyx_kp_u__22);
  Py_VISIT(traverse_module_state->__pyx_kp_u__23);
  Py_VISIT(traverse_module_state->__pyx_n_s__3);
  Py_VISIT(traverse_module_state->__pyx_kp_u__3);
  Py_VISIT(traverse_module_state->__pyx_kp_u__4);
  Py_VISIT(traverse_module_state->__pyx_kp_u__5);
  Py_VISIT(traverse_module_state->__pyx_n_s_a);
  Py_VISIT(traverse_module_state->__pyx_n_s_add);
  Py_VISIT(traverse_module_state->__pyx_n_s_add_argument);
  Py_VISIT(traverse_module_state->__pyx_n_s_add_child);
  Py_VISIT(traverse_module_state->__pyx_n_s_add_children);
  Py_VISIT(traverse_module_state->__pyx_n_s_add_face);
  Py_VISIT(traverse_module_state->__pyx_n_s_add_leaf);
  Py_VISIT(traverse_module_state->__pyx_n_s_add_prop);
  Py_VISIT(traverse_module_state->__pyx_n_s_add_props);
  Py_VISIT(traverse_module_state->__pyx_n_s_add_sister);
  Py_VISIT(traverse_module_state->__pyx_n_s_add_tree);
  Py_VISIT(traverse_module_state->__pyx_n_s_all_leaves);
  Py_VISIT(traverse_module_state->__pyx_n_s_all_max_rf);
  Py_VISIT(traverse_module_state->__pyx_n_s_all_nodes);
  Py_VISIT(traverse_module_state->__pyx_n_s_all_rf);
  Py_VISIT(traverse_module_state->__pyx_n_s_alld);
  Py_VISIT(traverse_module_state->__pyx_n_s_allleaves);
  Py_VISIT(traverse_module_state->__pyx_n_s_ancestors);
  Py_VISIT(traverse_module_state->__pyx_n_s_append);
  Py_VISIT(traverse_module_state->__pyx_n_s_args);
  Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines);
  Py_VISIT(traverse_module_state->__pyx_kp_u_at);
  Py_VISIT(traverse_module_state->__pyx_n_s_attr);
  Py_VISIT(traverse_module_state->__pyx_n_s_autodetect_duplications);
  Py_VISIT(traverse_module_state->__pyx_n_s_b);
  Py_VISIT(traverse_module_state->__pyx_kp_u_bad_parser);
  Py_VISIT(traverse_module_state->__pyx_n_s_bprops);
  Py_VISIT(traverse_module_state->__pyx_n_s_branch);
  Py_VISIT(traverse_module_state->__pyx_kp_u_branch_right);
  Py_VISIT(traverse_module_state->__pyx_n_s_cached_content);
  Py_VISIT(traverse_module_state->__pyx_n_s_cascade);
  Py_VISIT(traverse_module_state->__pyx_n_s_cdist);
  Py_VISIT(traverse_module_state->__pyx_n_s_ch);
  Py_VISIT(traverse_module_state->__pyx_n_s_check_monophyly);
  Py_VISIT(traverse_module_state->__pyx_n_s_check_monophyly_locals_genexpr);
  Py_VISIT(traverse_module_state->__pyx_n_s_child);
  Py_VISIT(traverse_module_state->__pyx_n_s_child_idx);
  Py_VISIT(traverse_module_state->__pyx_n_s_child_name);
  Py_VISIT(traverse_module_state->__pyx_n_s_children);
  Py_VISIT(traverse_module_state->__pyx_kp_u_children_Use_reverse_children_i);
  Py_VISIT(traverse_module_state->__pyx_n_s_childtrees);
  Py_VISIT(traverse_module_state->__pyx_n_s_class);
  Py_VISIT(traverse_module_state->__pyx_n_s_class_getitem);
  Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback);
  Py_VISIT(traverse_module_state->__pyx_n_s_close);
  Py_VISIT(traverse_module_state->__pyx_n_s_cmp_nodes);
  Py_VISIT(traverse_module_state->__pyx_n_s_cmp_to_key);
  Py_VISIT(traverse_module_state->__pyx_n_s_color);
  Py_VISIT(traverse_module_state->__pyx_n_s_column);
  Py_VISIT(traverse_module_state->__pyx_n_s_columns);
  Py_VISIT(traverse_module_state->__pyx_n_s_combinations);
  Py_VISIT(traverse_module_state->__pyx_n_s_common);
  Py_VISIT(traverse_module_state->__pyx_n_s_common_ancestor);
  Py_VISIT(traverse_module_state->__pyx_n_s_common_edges);
  Py_VISIT(traverse_module_state->__pyx_n_u_common_edges);
  Py_VISIT(traverse_module_state->__pyx_n_s_common_names);
  Py_VISIT(traverse_module_state->__pyx_n_s_compact);
  Py_VISIT(traverse_module_state->__pyx_n_s_compare);
  Py_VISIT(traverse_module_state->__pyx_n_s_compare_2);
  Py_VISIT(traverse_module_state->__pyx_n_s_compare_locals__compare);
  Py_VISIT(traverse_module_state->__pyx_n_s_compare_locals__safe_div);
  Py_VISIT(traverse_module_state->__pyx_n_s_compress);
  Py_VISIT(traverse_module_state->__pyx_n_s_conditions);
  Py_VISIT(traverse_module_state->__pyx_n_s_container_type);
  Py_VISIT(traverse_module_state->__pyx_n_s_contains___locals_genexpr);
  Py_VISIT(traverse_module_state->__pyx_n_s_cophenetic_matrix);
  Py_VISIT(traverse_module_state->__pyx_n_s_cophenetic_matrix_locals_genexpr);
  Py_VISIT(traverse_module_state->__pyx_n_s_copy);
  Py_VISIT(traverse_module_state->__pyx_n_s_corr1);
  Py_VISIT(traverse_module_state->__pyx_n_s_corr2);
  Py_VISIT(traverse_module_state->__pyx_n_s_correct_by_polytomy_size);
  Py_VISIT(traverse_module_state->__pyx_n_u_cpickle);
  Py_VISIT(traverse_module_state->__pyx_n_s_current);
  Py_VISIT(traverse_module_state->__pyx_n_s_d);
  Py_VISIT(traverse_module_state->__pyx_n_s_data);
  Py_VISIT(traverse_module_state->__pyx_n_s_deepcopy);
  Py_VISIT(traverse_module_state->__pyx_n_u_deepcopy);
  Py_VISIT(traverse_module_state->__pyx_n_s_default);
  Py_VISIT(traverse_module_state->__pyx_n_s_del_prop);
  Py_VISIT(traverse_module_state->__pyx_n_s_delete);
  Py_VISIT(traverse_module_state->__pyx_n_s_delete_orphan);
  Py_VISIT(traverse_module_state->__pyx_n_s_depth);
  Py_VISIT(traverse_module_state->__pyx_n_s_descendants);
  Py_VISIT(traverse_module_state->__pyx_n_s_describe);
  Py_VISIT(traverse_module_state->__pyx_n_s_detach);
  Py_VISIT(traverse_module_state->__pyx_n_s_diameter);
  Py_VISIT(traverse_module_state->__pyx_n_s_dict);
  Py_VISIT(traverse_module_state->__pyx_n_s_dict_2);
  Py_VISIT(traverse_module_state->__pyx_n_s_diff);
  Py_VISIT(traverse_module_state->__pyx_n_u_diffs);
  Py_VISIT(traverse_module_state->__pyx_n_u_diffs_tab);
  Py_VISIT(traverse_module_state->__pyx_n_s_difftable);
  Py_VISIT(traverse_module_state->__pyx_kp_u_disable);
  Py_VISIT(traverse_module_state->__pyx_kp_u_disable_breakpad);
  Py_VISIT(traverse_module_state->__pyx_kp_u_disable_logging);
  Py_VISIT(traverse_module_state->__pyx_n_s_discard_t1);
  Py_VISIT(traverse_module_state->__pyx_n_s_discard_t2);
  Py_VISIT(traverse_module_state->__pyx_n_s_dist);
  Py_VISIT(traverse_module_state->__pyx_n_u_dist);
  Py_VISIT(traverse_module_state->__pyx_n_s_dist_fn);
  Py_VISIT(traverse_module_state->__pyx_n_s_distance);
  Py_VISIT(traverse_module_state->__pyx_n_s_doc);
  Py_VISIT(traverse_module_state->__pyx_n_s_dpi);
  Py_VISIT(traverse_module_state->__pyx_n_s_drawer);
  Py_VISIT(traverse_module_state->__pyx_n_s_driver);
  Py_VISIT(traverse_module_state->__pyx_n_s_dump);
  Py_VISIT(traverse_module_state->__pyx_n_s_dumps);
  Py_VISIT(traverse_module_state->__pyx_n_s_e);
  Py_VISIT(traverse_module_state->__pyx_n_s_edge_keys);
  Py_VISIT(traverse_module_state->__pyx_n_s_edges);
  Py_VISIT(traverse_module_state->__pyx_n_s_edges1);
  Py_VISIT(traverse_module_state->__pyx_n_s_edges2);
  Py_VISIT(traverse_module_state->__pyx_n_u_effective_tree_size);
  Py_VISIT(traverse_module_state->__pyx_kp_u_enable);
  Py_VISIT(traverse_module_state->__pyx_n_s_enter);
  Py_VISIT(traverse_module_state->__pyx_n_s_enum_unordered);
  Py_VISIT(traverse_module_state->__pyx_n_s_enumerate);
  Py_VISIT(traverse_module_state->__pyx_n_u_ete);
  Py_VISIT(traverse_module_state->__pyx_n_s_ete4_core_tree);
  Py_VISIT(traverse_module_state->__pyx_kp_s_ete4_core_tree_pyx);
  Py_VISIT(traverse_module_state->__pyx_n_s_ete_ch);
  Py_VISIT(traverse_module_state->__pyx_n_s_ete_diff);
  Py_VISIT(traverse_module_state->__pyx_n_s_ete_format);
  Py_VISIT(traverse_module_state->__pyx_n_s_ete_node);
  Py_VISIT(traverse_module_state->__pyx_n_s_exit);
  Py_VISIT(traverse_module_state->__pyx_n_s_expand_polytomies);
  Py_VISIT(traverse_module_state->__pyx_kp_u_expand_polytomies_and_correct_by);
  Py_VISIT(traverse_module_state->__pyx_kp_u_expand_polytomies_and_unrooted_t);
  Py_VISIT(traverse_module_state->__pyx_n_s_expand_polytomies_locals_TipTupl);
  Py_VISIT(traverse_module_state->__pyx_n_s_expand_polytomies_locals_add_lea);
  Py_VISIT(traverse_module_state->__pyx_n_s_expand_polytomies_locals_enum_un);
  Py_VISIT(traverse_module_state->__pyx_n_s_explore);
  Py_VISIT(traverse_module_state->__pyx_n_s_explorer);
  Py_VISIT(traverse_module_state->__pyx_n_s_extract_data_parser);
  Py_VISIT(traverse_module_state->__pyx_n_s_face);
  Py_VISIT(traverse_module_state->__pyx_kp_u_face_2);
  Py_VISIT(traverse_module_state->__pyx_n_s_face_area);
  Py_VISIT(traverse_module_state->__pyx_n_u_faces);
  Py_VISIT(traverse_module_state->__pyx_n_s_farthest_dist);
  Py_VISIT(traverse_module_state->__pyx_n_s_farthest_node);
  Py_VISIT(traverse_module_state->__pyx_n_s_fdist);
  Py_VISIT(traverse_module_state->__pyx_n_s_file_name);
  Py_VISIT(traverse_module_state->__pyx_n_s_fnode);
  Py_VISIT(traverse_module_state->__pyx_n_s_format_root_node);
  Py_VISIT(traverse_module_state->__pyx_n_s_fp);
  Py_VISIT(traverse_module_state->__pyx_n_s_from_common);
  Py_VISIT(traverse_module_state->__pyx_n_s_from_parent_child_table);
  Py_VISIT(traverse_module_state->__pyx_n_s_from_parent_child_table_locals_g);
  Py_VISIT(traverse_module_state->__pyx_n_s_from_skbio);
  Py_VISIT(traverse_module_state->__pyx_n_s_from_skbio_locals_get_ete_node);
  Py_VISIT(traverse_module_state->__pyx_n_s_functools);
  Py_VISIT(traverse_module_state->__pyx_kp_u_gc);
  Py_VISIT(traverse_module_state->__pyx_n_s_genexpr);
  Py_VISIT(traverse_module_state->__pyx_n_s_get);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_cached_content);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_cached_content_locals_get_co);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_children);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_closest_leaf);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_content);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_distance);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_distance_fn);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_distance_locals_genexpr);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_ete_node);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_farthest_and_closest_leaves);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_farthest_and_closest_leaves_2);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_farthest_leaf);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_farthest_node);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_farthest_node_locals_lambda);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_img);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_midpoint_outgroup);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_monophyletic);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_monophyletic_locals_lambda);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_node);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_prop);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_sisters);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_speciation_trees);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_topology_id);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_topology_id_locals_genexpr);
  Py_VISIT(traverse_module_state->__pyx_n_s_getitem___locals_genexpr);
  Py_VISIT(traverse_module_state->__pyx_n_s_getstate);
  Py_VISIT(traverse_module_state->__pyx_n_s_h);
  Py_VISIT(traverse_module_state->__pyx_n_s_has_duplications);
  Py_VISIT(traverse_module_state->__pyx_n_s_has_prop);
  Py_VISIT(traverse_module_state->__pyx_n_s_hash);
  Py_VISIT(traverse_module_state->__pyx_n_s_hashlib);
  Py_VISIT(traverse_module_state->__pyx_kp_u_headless);
  Py_VISIT(traverse_module_state->__pyx_n_s_hex);
  Py_VISIT(traverse_module_state->__pyx_n_s_hexdigest);
  Py_VISIT(traverse_module_state->__pyx_n_s_host);
  Py_VISIT(traverse_module_state->__pyx_kp_u_http);
  Py_VISIT(traverse_module_state->__pyx_n_s_i);
  Py_VISIT(traverse_module_state->__pyx_n_s_id);
  Py_VISIT(traverse_module_state->__pyx_n_u_id);
  Py_VISIT(traverse_module_state->__pyx_n_u_img_style);
  Py_VISIT(traverse_module_state->__pyx_n_s_import);
  Py_VISIT(traverse_module_state->__pyx_n_s_include_root);
  Py_VISIT(traverse_module_state->__pyx_n_s_include_self);
  Py_VISIT(traverse_module_state->__pyx_n_s_indent);
  Py_VISIT(traverse_module_state->__pyx_n_u_indent);
  Py_VISIT(traverse_module_state->__pyx_n_s_index);
  Py_VISIT(traverse_module_state->__pyx_n_s_inf);
  Py_VISIT(traverse_module_state->__pyx_kp_u_init_from_dict_data_should_not_u);
  Py_VISIT(traverse_module_state->__pyx_kp_u_init_from_empty_data_should_not);
  Py_VISIT(traverse_module_state->__pyx_kp_u_init_from_parsed_content_cannot);
  Py_VISIT(traverse_module_state->__pyx_n_s_init_subclass);
  Py_VISIT(traverse_module_state->__pyx_n_s_initializing);
  Py_VISIT(traverse_module_state->__pyx_kp_u_inline);
  Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine);
  Py_VISIT(traverse_module_state->__pyx_n_s_is_leaf);
  Py_VISIT(traverse_module_state->__pyx_n_s_is_leaf_fn);
  Py_VISIT(traverse_module_state->__pyx_n_s_is_monophyletic);
  Py_VISIT(traverse_module_state->__pyx_n_s_is_monophyletic_locals_genexpr);
  Py_VISIT(traverse_module_state->__pyx_kp_u_is_not_a_Face_instance);
  Py_VISIT(traverse_module_state->__pyx_n_s_is_root);
  Py_VISIT(traverse_module_state->__pyx_kp_u_isenabled);
  Py_VISIT(traverse_module_state->__pyx_n_s_issubset);
  Py_VISIT(traverse_module_state->__pyx_n_s_items);
  Py_VISIT(traverse_module_state->__pyx_n_s_iter);
  Py_VISIT(traverse_module_state->__pyx_n_s_iter_prepostorder);
  Py_VISIT(traverse_module_state->__pyx_n_s_itertools);
  Py_VISIT(traverse_module_state->__pyx_n_s_join);
  Py_VISIT(traverse_module_state->__pyx_n_s_k1);
  Py_VISIT(traverse_module_state->__pyx_n_s_k2);
  Py_VISIT(traverse_module_state->__pyx_n_s_keep_server);
  Py_VISIT(traverse_module_state->__pyx_n_s_key);
  Py_VISIT(traverse_module_state->__pyx_n_s_keys);
  Py_VISIT(traverse_module_state->__pyx_n_s_kwargs);
  Py_VISIT(traverse_module_state->__pyx_n_s_label);
  Py_VISIT(traverse_module_state->__pyx_n_s_labels);
  Py_VISIT(traverse_module_state->__pyx_n_s_ladderize);
  Py_VISIT(traverse_module_state->__pyx_n_s_layout);
  Py_VISIT(traverse_module_state->__pyx_n_s_layouts);
  Py_VISIT(traverse_module_state->__pyx_n_s_leaf);
  Py_VISIT(traverse_module_state->__pyx_n_s_leaf1);
  Py_VISIT(traverse_module_state->__pyx_n_s_leaf2);
  Py_VISIT(traverse_module_state->__pyx_n_s_leaf_distances);
  Py_VISIT(traverse_module_state->__pyx_n_s_leaf_names);
  Py_VISIT(traverse_module_state->__pyx_n_s_leaf_values);
  Py_VISIT(traverse_module_state->__pyx_n_s_leaves);
  Py_VISIT(traverse_module_state->__pyx_n_s_leaves_descendant);
  Py_VISIT(traverse_module_state->__pyx_n_s_leaves_extra);
  Py_VISIT(traverse_module_state->__pyx_n_s_leaves_from_ancestor);
  Py_VISIT(traverse_module_state->__pyx_n_s_leaves_locals_lambda);
  Py_VISIT(traverse_module_state->__pyx_n_s_leaves_only);
  Py_VISIT(traverse_module_state->__pyx_n_s_left);
  Py_VISIT(traverse_module_state->__pyx_n_s_len___locals_genexpr);
  Py_VISIT(traverse_module_state->__pyx_n_u_length);
  Py_VISIT(traverse_module_state->__pyx_n_u_levelorder);
  Py_VISIT(traverse_module_state->__pyx_n_s_lineage);
  Py_VISIT(traverse_module_state->__pyx_n_s_loads);
  Py_VISIT(traverse_module_state->__pyx_n_s_lower);
  Py_VISIT(traverse_module_state->__pyx_n_s_m);
  Py_VISIT(traverse_module_state->__pyx_n_s_main);
  Py_VISIT(traverse_module_state->__pyx_n_s_map_attributes);
  Py_VISIT(traverse_module_state->__pyx_n_s_map_prop);
  Py_VISIT(traverse_module_state->__pyx_n_s_map_properties);
  Py_VISIT(traverse_module_state->__pyx_n_s_math);
  Py_VISIT(traverse_module_state->__pyx_n_s_max);
  Py_VISIT(traverse_module_state->__pyx_n_s_max_dist);
  Py_VISIT(traverse_module_state->__pyx_n_s_max_node);
  Py_VISIT(traverse_module_state->__pyx_n_s_max_parts);
  Py_VISIT(traverse_module_state->__pyx_n_s_max_rf);
  Py_VISIT(traverse_module_state->__pyx_n_u_max_rf);
  Py_VISIT(traverse_module_state->__pyx_n_s_max_treeko_splits_to_be_artifact);
  Py_VISIT(traverse_module_state->__pyx_n_s_maxrf);
  Py_VISIT(traverse_module_state->__pyx_n_s_md5);
  Py_VISIT(traverse_module_state->__pyx_n_s_mean);
  Py_VISIT(traverse_module_state->__pyx_n_s_mean_distance);
  Py_VISIT(traverse_module_state->__pyx_n_s_metaclass);
  Py_VISIT(traverse_module_state->__pyx_n_s_method);
  Py_VISIT(traverse_module_state->__pyx_kp_u_metrics_recording_only);
  Py_VISIT(traverse_module_state->__pyx_n_s_min_comparison);
  Py_VISIT(traverse_module_state->__pyx_n_s_min_dist);
  Py_VISIT(traverse_module_state->__pyx_n_s_min_node);
  Py_VISIT(traverse_module_state->__pyx_n_s_min_support_ref);
  Py_VISIT(traverse_module_state->__pyx_n_s_min_support_source);
  Py_VISIT(traverse_module_state->__pyx_n_s_min_support_t1);
  Py_VISIT(traverse_module_state->__pyx_n_s_min_support_t2);
  Py_VISIT(traverse_module_state->__pyx_n_s_model);
  Py_VISIT(traverse_module_state->__pyx_n_s_module);
  Py_VISIT(traverse_module_state->__pyx_n_u_monophyletic);
  Py_VISIT(traverse_module_state->__pyx_n_s_movingnode);
  Py_VISIT(traverse_module_state->__pyx_n_s_mro_entries);
  Py_VISIT(traverse_module_state->__pyx_kp_u_multiple_trees_use_nexus_load_in);
  Py_VISIT(traverse_module_state->__pyx_n_s_n);
  Py_VISIT(traverse_module_state->__pyx_n_s_n2count);
  Py_VISIT(traverse_module_state->__pyx_n_s_n2depth);
  Py_VISIT(traverse_module_state->__pyx_n_s_n2subtrees);
  Py_VISIT(traverse_module_state->__pyx_n_s_n2values);
  Py_VISIT(traverse_module_state->__pyx_n_s_name);
  Py_VISIT(traverse_module_state->__pyx_n_u_name);
  Py_VISIT(traverse_module_state->__pyx_n_s_name2node);
  Py_VISIT(traverse_module_state->__pyx_n_s_name_2);
  Py_VISIT(traverse_module_state->__pyx_n_s_names);
  Py_VISIT(traverse_module_state->__pyx_n_s_ncommon);
  Py_VISIT(traverse_module_state->__pyx_n_s_ndups);
  Py_VISIT(traverse_module_state->__pyx_n_s_new);
  Py_VISIT(traverse_module_state->__pyx_n_s_new_node);
  Py_VISIT(traverse_module_state->__pyx_n_s_new_tree);
  Py_VISIT(traverse_module_state->__pyx_n_s_newick);
  Py_VISIT(traverse_module_state->__pyx_n_u_newick);
  Py_VISIT(traverse_module_state->__pyx_kp_u_newick_extended);
  Py_VISIT(traverse_module_state->__pyx_n_s_newick_only);
  Py_VISIT(traverse_module_state->__pyx_n_s_nexus);
  Py_VISIT(traverse_module_state->__pyx_n_u_nexus);
  Py_VISIT(traverse_module_state->__pyx_n_s_node);
  Py_VISIT(traverse_module_state->__pyx_n_s_node1);
  Py_VISIT(traverse_module_state->__pyx_n_s_node2);
  Py_VISIT(traverse_module_state->__pyx_n_s_node2path);
  Py_VISIT(traverse_module_state->__pyx_n_s_node_leaves);
  Py_VISIT(traverse_module_state->__pyx_n_s_nodename);
  Py_VISIT(traverse_module_state->__pyx_n_s_nodes);
  Py_VISIT(traverse_module_state->__pyx_n_s_nodes_by_name);
  Py_VISIT(traverse_module_state->__pyx_n_u_norm_rf);
  Py_VISIT(traverse_module_state->__pyx_kp_u_not_in);
  Py_VISIT(traverse_module_state->__pyx_n_s_ntrees);
  Py_VISIT(traverse_module_state->__pyx_n_s_nw);
  Py_VISIT(traverse_module_state->__pyx_n_s_open);
  Py_VISIT(traverse_module_state->__pyx_n_s_open_browser);
  Py_VISIT(traverse_module_state->__pyx_n_s_operations);
  Py_VISIT(traverse_module_state->__pyx_n_s_ops);
  Py_VISIT(traverse_module_state->__pyx_n_s_options);
  Py_VISIT(traverse_module_state->__pyx_n_s_order);
  Py_VISIT(traverse_module_state->__pyx_n_s_orig_target_size);
  Py_VISIT(traverse_module_state->__pyx_n_s_origin_t);
  Py_VISIT(traverse_module_state->__pyx_n_s_origin_trees);
  Py_VISIT(traverse_module_state->__pyx_n_s_outfile);
  Py_VISIT(traverse_module_state->__pyx_n_s_output);
  Py_VISIT(traverse_module_state->__pyx_n_s_p);
  Py_VISIT(traverse_module_state->__pyx_n_u_paraphyletic);
  Py_VISIT(traverse_module_state->__pyx_n_s_parent);
  Py_VISIT(traverse_module_state->__pyx_n_s_parent_child_table);
  Py_VISIT(traverse_module_state->__pyx_n_s_parent_name);
  Py_VISIT(traverse_module_state->__pyx_n_s_parser);
  Py_VISIT(traverse_module_state->__pyx_n_s_parser_extract);
  Py_VISIT(traverse_module_state->__pyx_n_s_path);
  Py_VISIT(traverse_module_state->__pyx_n_s_paths);
  Py_VISIT(traverse_module_state->__pyx_n_s_pickle);
  Py_VISIT(traverse_module_state->__pyx_n_u_polyphyletic);
  Py_VISIT(traverse_module_state->__pyx_n_s_polytomy_correction);
  Py_VISIT(traverse_module_state->__pyx_n_s_polytomy_size_limit);
  Py_VISIT(traverse_module_state->__pyx_n_s_pop);
  Py_VISIT(traverse_module_state->__pyx_n_s_pop_child);
  Py_VISIT(traverse_module_state->__pyx_n_s_popitem);
  Py_VISIT(traverse_module_state->__pyx_n_s_populate);
  Py_VISIT(traverse_module_state->__pyx_n_s_port);
  Py_VISIT(traverse_module_state->__pyx_n_s_position);
  Py_VISIT(traverse_module_state->__pyx_kp_u_position_2);
  Py_VISIT(traverse_module_state->__pyx_n_s_post);
  Py_VISIT(traverse_module_state->__pyx_n_u_postorder);
  Py_VISIT(traverse_module_state->__pyx_n_s_preorder);
  Py_VISIT(traverse_module_state->__pyx_n_u_preorder);
  Py_VISIT(traverse_module_state->__pyx_n_s_prepare);
  Py_VISIT(traverse_module_state->__pyx_n_s_preserve_branch_length);
  Py_VISIT(traverse_module_state->__pyx_n_s_prev);
  Py_VISIT(traverse_module_state->__pyx_n_s_prevent_nondicotomic);
  Py_VISIT(traverse_module_state->__pyx_n_s_print);
  Py_VISIT(traverse_module_state->__pyx_n_s_product);
  Py_VISIT(traverse_module_state->__pyx_n_s_prop);
  Py_VISIT(traverse_module_state->__pyx_n_s_prop1);
  Py_VISIT(traverse_module_state->__pyx_n_s_prop2);
  Py_VISIT(traverse_module_state->__pyx_n_s_prop_t1);
  Py_VISIT(traverse_module_state->__pyx_n_s_prop_t2);
  Py_VISIT(traverse_module_state->__pyx_n_s_props);
  Py_VISIT(traverse_module_state->__pyx_n_s_prune);
  Py_VISIT(traverse_module_state->__pyx_n_s_prune_locals_cmp_nodes);
  Py_VISIT(traverse_module_state->__pyx_n_s_px);
  Py_VISIT(traverse_module_state->__pyx_n_u_px);
  Py_VISIT(traverse_module_state->__pyx_n_s_px0);
  Py_VISIT(traverse_module_state->__pyx_n_s_py);
  Py_VISIT(traverse_module_state->__pyx_n_s_pyx_PickleError);
  Py_VISIT(traverse_module_state->__pyx_n_s_pyx_checksum);
  Py_VISIT(traverse_module_state->__pyx_n_s_pyx_result);
  Py_VISIT(traverse_module_state->__pyx_n_s_pyx_state);
  Py_VISIT(traverse_module_state->__pyx_n_s_pyx_type);
  Py_VISIT(traverse_module_state->__pyx_n_s_pyx_unpickle_Tree);
  Py_VISIT(traverse_module_state->__pyx_n_s_qualname);
  Py_VISIT(traverse_module_state->__pyx_n_s_quit);
  Py_VISIT(traverse_module_state->__pyx_n_s_range);
  Py_VISIT(traverse_module_state->__pyx_n_u_raw);
  Py_VISIT(traverse_module_state->__pyx_n_s_reduce);
  Py_VISIT(traverse_module_state->__pyx_n_s_reduce_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_reduce_ex);
  Py_VISIT(traverse_module_state->__pyx_n_s_ref_disc);
  Py_VISIT(traverse_module_state->__pyx_n_u_ref_edges);
  Py_VISIT(traverse_module_state->__pyx_n_u_ref_edges_in_source);
  Py_VISIT(traverse_module_state->__pyx_n_s_ref_found);
  Py_VISIT(traverse_module_state->__pyx_n_s_ref_found_in_src);
  Py_VISIT(traverse_module_state->__pyx_n_s_ref_p);
  Py_VISIT(traverse_module_state->__pyx_n_s_ref_tree);
  Py_VISIT(traverse_module_state->__pyx_n_s_ref_tree_attr);
  Py_VISIT(traverse_module_state->__pyx_n_s_remove);
  Py_VISIT(traverse_module_state->__pyx_n_s_remove_child);
  Py_VISIT(traverse_module_state->__pyx_n_s_remove_child_locals_genexpr);
  Py_VISIT(traverse_module_state->__pyx_n_s_remove_children);
  Py_VISIT(traverse_module_state->__pyx_n_s_remove_sister);
  Py_VISIT(traverse_module_state->__pyx_n_s_remove_tree);
  Py_VISIT(traverse_module_state->__pyx_n_s_render);
  Py_VISIT(traverse_module_state->__pyx_n_s_render_sm);
  Py_VISIT(traverse_module_state->__pyx_n_s_render_tree);
  Py_VISIT(traverse_module_state->__pyx_n_s_resolve_polytomy);
  Py_VISIT(traverse_module_state->__pyx_n_s_result);
  Py_VISIT(traverse_module_state->__pyx_kp_u_return);
  Py_VISIT(traverse_module_state->__pyx_n_s_return_format);
  Py_VISIT(traverse_module_state->__pyx_n_s_reverse);
  Py_VISIT(traverse_module_state->__pyx_n_s_reverse_children);
  Py_VISIT(traverse_module_state->__pyx_n_s_rf);
  Py_VISIT(traverse_module_state->__pyx_n_u_rf);
  Py_VISIT(traverse_module_state->__pyx_n_s_rf_max);
  Py_VISIT(traverse_module_state->__pyx_n_s_right);
  Py_VISIT(traverse_module_state->__pyx_n_s_robinson_foulds);
  Py_VISIT(traverse_module_state->__pyx_n_s_robinson_foulds_locals_from_comm);
  Py_VISIT(traverse_module_state->__pyx_n_s_robinson_foulds_locals_genexpr);
  Py_VISIT(traverse_module_state->__pyx_n_s_robinson_foulds_locals_has_prop);
  Py_VISIT(traverse_module_state->__pyx_n_s_root);
  Py_VISIT(traverse_module_state->__pyx_n_s_rooting);
  Py_VISIT(traverse_module_state->__pyx_kp_u_s);
  Py_VISIT(traverse_module_state->__pyx_n_s_s1);
  Py_VISIT(traverse_module_state->__pyx_n_s_s2);
  Py_VISIT(traverse_module_state->__pyx_n_s_safe_div);
  Py_VISIT(traverse_module_state->__pyx_n_s_save_screenshot);
  Py_VISIT(traverse_module_state->__pyx_n_s_search_ancestors);
  Py_VISIT(traverse_module_state->__pyx_n_s_search_ancestors_locals_genexpr);
  Py_VISIT(traverse_module_state->__pyx_n_s_search_descendants);
  Py_VISIT(traverse_module_state->__pyx_n_s_search_leaves_by_name);
  Py_VISIT(traverse_module_state->__pyx_n_s_search_nodes);
  Py_VISIT(traverse_module_state->__pyx_n_s_search_nodes_locals_genexpr);
  Py_VISIT(traverse_module_state->__pyx_n_s_seed);
  Py_VISIT(traverse_module_state->__pyx_n_s_seen);
  Py_VISIT(traverse_module_state->__pyx_n_s_selenium);
  Py_VISIT(traverse_module_state->__pyx_n_s_selenium_webdriver_chrome_option);
  Py_VISIT(traverse_module_state->__pyx_n_s_self);
  Py_VISIT(traverse_module_state->__pyx_n_s_send);
  Py_VISIT(traverse_module_state->__pyx_n_s_server);
  Py_VISIT(traverse_module_state->__pyx_n_s_server_address);
  Py_VISIT(traverse_module_state->__pyx_n_s_server_close);
  Py_VISIT(traverse_module_state->__pyx_n_s_set_name);
  Py_VISIT(traverse_module_state->__pyx_n_s_set_outgroup);
  Py_VISIT(traverse_module_state->__pyx_n_s_set_style);
  Py_VISIT(traverse_module_state->__pyx_n_s_setdefault);
  Py_VISIT(traverse_module_state->__pyx_n_s_setstate);
  Py_VISIT(traverse_module_state->__pyx_n_s_setstate_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_show);
  Py_VISIT(traverse_module_state->__pyx_n_s_show_difftable);
  Py_VISIT(traverse_module_state->__pyx_n_s_show_difftable_summary);
  Py_VISIT(traverse_module_state->__pyx_n_s_show_difftable_tab);
  Py_VISIT(traverse_module_state->__pyx_n_s_show_difftable_topo);
  Py_VISIT(traverse_module_state->__pyx_n_s_show_internal);
  Py_VISIT(traverse_module_state->__pyx_n_s_show_tree);
  Py_VISIT(traverse_module_state->__pyx_n_s_shutdown);
  Py_VISIT(traverse_module_state->__pyx_n_s_side1);
  Py_VISIT(traverse_module_state->__pyx_n_s_side2);
  Py_VISIT(traverse_module_state->__pyx_n_s_sister);
  Py_VISIT(traverse_module_state->__pyx_n_s_sisters);
  Py_VISIT(traverse_module_state->__pyx_n_s_size);
  Py_VISIT(traverse_module_state->__pyx_n_s_size1);
  Py_VISIT(traverse_module_state->__pyx_n_s_size2);
  Py_VISIT(traverse_module_state->__pyx_n_s_skbio);
  Py_VISIT(traverse_module_state->__pyx_n_s_skbioTreeNode);
  Py_VISIT(traverse_module_state->__pyx_n_s_skbio_node);
  Py_VISIT(traverse_module_state->__pyx_n_s_skbio_tree);
  Py_VISIT(traverse_module_state->__pyx_n_s_skip_large_polytomies);
  Py_VISIT(traverse_module_state->__pyx_n_s_sleep);
  Py_VISIT(traverse_module_state->__pyx_n_s_smallest);
  Py_VISIT(traverse_module_state->__pyx_n_s_smartview);
  Py_VISIT(traverse_module_state->__pyx_n_s_sort);
  Py_VISIT(traverse_module_state->__pyx_n_s_sort_descendants);
  Py_VISIT(traverse_module_state->__pyx_n_s_sort_descendants_locals_lambda);
  Py_VISIT(traverse_module_state->__pyx_n_s_sorted);
  Py_VISIT(traverse_module_state->__pyx_n_s_sorted_nodes);
  Py_VISIT(traverse_module_state->__pyx_n_u_source_edges);
  Py_VISIT(traverse_module_state->__pyx_n_u_source_edges_in_ref);
  Py_VISIT(traverse_module_state->__pyx_n_u_source_subtrees);
  Py_VISIT(traverse_module_state->__pyx_n_s_source_tree);
  Py_VISIT(traverse_module_state->__pyx_n_s_source_tree_attr);
  Py_VISIT(traverse_module_state->__pyx_n_s_sp_naming_function);
  Py_VISIT(traverse_module_state->__pyx_n_s_sp_trees);
  Py_VISIT(traverse_module_state->__pyx_n_s_spec);
  Py_VISIT(traverse_module_state->__pyx_n_u_speciesFunction);
  Py_VISIT(traverse_module_state->__pyx_n_s_src_disc);
  Py_VISIT(traverse_module_state->__pyx_n_s_src_found);
  Py_VISIT(traverse_module_state->__pyx_n_s_src_found_in_ref);
  Py_VISIT(traverse_module_state->__pyx_n_s_src_p);
  Py_VISIT(traverse_module_state->__pyx_n_s_src_tree);
  Py_VISIT(traverse_module_state->__pyx_n_s_standardize);
  Py_VISIT(traverse_module_state->__pyx_n_s_start);
  Py_VISIT(traverse_module_state->__pyx_n_s_start_server);
  Py_VISIT(traverse_module_state->__pyx_n_s_startswith);
  Py_VISIT(traverse_module_state->__pyx_n_s_state);
  Py_VISIT(traverse_module_state->__pyx_kp_u_static_gui_html_tree);
  Py_VISIT(traverse_module_state->__pyx_n_s_staticmethod);
  Py_VISIT(traverse_module_state->__pyx_n_s_strategy);
  Py_VISIT(traverse_module_state->__pyx_kp_s_stringsource);
  Py_VISIT(traverse_module_state->__pyx_n_s_subtree);
  Py_VISIT(traverse_module_state->__pyx_n_s_subtree_content);
  Py_VISIT(traverse_module_state->__pyx_n_s_subtree_nw);
  Py_VISIT(traverse_module_state->__pyx_n_s_subtrees);
  Py_VISIT(traverse_module_state->__pyx_n_s_sum);
  Py_VISIT(traverse_module_state->__pyx_n_s_super);
  Py_VISIT(traverse_module_state->__pyx_n_s_support);
  Py_VISIT(traverse_module_state->__pyx_n_u_support);
  Py_VISIT(traverse_module_state->__pyx_n_s_support_fn);
  Py_VISIT(traverse_module_state->__pyx_n_s_support_t1);
  Py_VISIT(traverse_module_state->__pyx_n_s_support_t2);
  Py_VISIT(traverse_module_state->__pyx_n_s_swap_children);
  Py_VISIT(traverse_module_state->__pyx_n_s_t1);
  Py_VISIT(traverse_module_state->__pyx_n_s_t1_leaves);
  Py_VISIT(traverse_module_state->__pyx_n_s_t1_leaves_all);
  Py_VISIT(traverse_module_state->__pyx_n_s_t2);
  Py_VISIT(traverse_module_state->__pyx_n_s_t2_leaves);
  Py_VISIT(traverse_module_state->__pyx_n_s_t2_leaves_all);
  Py_VISIT(traverse_module_state->__pyx_n_u_table);
  Py_VISIT(traverse_module_state->__pyx_n_s_target_t);
  Py_VISIT(traverse_module_state->__pyx_n_s_target_trees);
  Py_VISIT(traverse_module_state->__pyx_n_s_test);
  Py_VISIT(traverse_module_state->__pyx_n_s_text_viz);
  Py_VISIT(traverse_module_state->__pyx_n_s_thread);
  Py_VISIT(traverse_module_state->__pyx_n_s_throw);
  Py_VISIT(traverse_module_state->__pyx_n_s_time);
  Py_VISIT(traverse_module_state->__pyx_n_s_to_keep);
  Py_VISIT(traverse_module_state->__pyx_n_s_to_str);
  Py_VISIT(traverse_module_state->__pyx_n_s_to_ultrametric);
  Py_VISIT(traverse_module_state->__pyx_n_s_tools);
  Py_VISIT(traverse_module_state->__pyx_n_s_topological);
  Py_VISIT(traverse_module_state->__pyx_n_u_topology);
  Py_VISIT(traverse_module_state->__pyx_n_s_total_d);
  Py_VISIT(traverse_module_state->__pyx_n_s_total_rf);
  Py_VISIT(traverse_module_state->__pyx_n_s_total_valid_ref_edges);
  Py_VISIT(traverse_module_state->__pyx_n_s_translate_nodes);
  Py_VISIT(traverse_module_state->__pyx_n_s_traverse);
  Py_VISIT(traverse_module_state->__pyx_n_s_traverse_bfs);
  Py_VISIT(traverse_module_state->__pyx_n_s_tree);
  Py_VISIT(traverse_module_state->__pyx_n_s_tree_sizes);
  Py_VISIT(traverse_module_state->__pyx_n_s_tree_style);
  Py_VISIT(traverse_module_state->__pyx_n_s_treediff);
  Py_VISIT(traverse_module_state->__pyx_n_s_treeko_d);
  Py_VISIT(traverse_module_state->__pyx_n_u_treeko_dist);
  Py_VISIT(traverse_module_state->__pyx_n_s_treeview);
  Py_VISIT(traverse_module_state->__pyx_n_s_treeview_main);
  Py_VISIT(traverse_module_state->__pyx_n_s_uniquenodes);
  Py_VISIT(traverse_module_state->__pyx_n_s_units);
  Py_VISIT(traverse_module_state->__pyx_n_s_unroot);
  Py_VISIT(traverse_module_state->__pyx_n_s_unrooted);
  Py_VISIT(traverse_module_state->__pyx_n_s_unrooted_trees);
  Py_VISIT(traverse_module_state->__pyx_n_s_up);
  Py_VISIT(traverse_module_state->__pyx_n_s_update);
  Py_VISIT(traverse_module_state->__pyx_n_s_use_collateral);
  Py_VISIT(traverse_module_state->__pyx_n_s_use_setstate);
  Py_VISIT(traverse_module_state->__pyx_n_s_usecolor);
  Py_VISIT(traverse_module_state->__pyx_n_s_utils);
  Py_VISIT(traverse_module_state->__pyx_n_s_valid_ref_edges);
  Py_VISIT(traverse_module_state->__pyx_n_s_valid_src_edges);
  Py_VISIT(traverse_module_state->__pyx_n_s_value);
  Py_VISIT(traverse_module_state->__pyx_n_s_values);
  Py_VISIT(traverse_module_state->__pyx_n_s_verbose);
  Py_VISIT(traverse_module_state->__pyx_n_s_visited_node);
  Py_VISIT(traverse_module_state->__pyx_n_s_visitor_key);
  Py_VISIT(traverse_module_state->__pyx_n_s_visitors);
  Py_VISIT(traverse_module_state->__pyx_n_s_visitors2nodes);
  Py_VISIT(traverse_module_state->__pyx_n_s_w);
  Py_VISIT(traverse_module_state->__pyx_n_u_w);
  Py_VISIT(traverse_module_state->__pyx_n_s_warn);
  Py_VISIT(traverse_module_state->__pyx_n_s_warnings);
  Py_VISIT(traverse_module_state->__pyx_n_s_webdriver);
  Py_VISIT(traverse_module_state->__pyx_n_s_weight_fn);
  Py_VISIT(traverse_module_state->__pyx_n_s_win_name);
  Py_VISIT(traverse_module_state->__pyx_kp_u_window_size);
  Py_VISIT(traverse_module_state->__pyx_n_s_write);
  Py_VISIT(traverse_module_state->__pyx_n_s_x);
  Py_VISIT(traverse_module_state->__pyx_n_s_y);
  Py_VISIT(traverse_module_state->__pyx_n_u_yule);
  Py_VISIT(traverse_module_state->__pyx_float_0_0);
  Py_VISIT(traverse_module_state->__pyx_float_1_0);
  Py_VISIT(traverse_module_state->__pyx_int_0);
  Py_VISIT(traverse_module_state->__pyx_int_1);
  Py_VISIT(traverse_module_state->__pyx_int_2);
  Py_VISIT(traverse_module_state->__pyx_int_5);
  Py_VISIT(traverse_module_state->__pyx_int_90);
  Py_VISIT(traverse_module_state->__pyx_int_1000);
  Py_VISIT(traverse_module_state->__pyx_int_27868033);
  Py_VISIT(traverse_module_state->__pyx_int_43033374);
  Py_VISIT(traverse_module_state->__pyx_int_151323765);
  Py_VISIT(traverse_module_state->__pyx_int_neg_1);
  Py_VISIT(traverse_module_state->__pyx_k__24);
  Py_VISIT(traverse_module_state->__pyx_slice_);
  Py_VISIT(traverse_module_state->__pyx_tuple__6);
  Py_VISIT(traverse_module_state->__pyx_slice__35);
  Py_VISIT(traverse_module_state->__pyx_slice__38);
  Py_VISIT(traverse_module_state->__pyx_tuple__16);
  Py_VISIT(traverse_module_state->__pyx_tuple__26);
  Py_VISIT(traverse_module_state->__pyx_tuple__28);
  Py_VISIT(traverse_module_state->__pyx_tuple__30);
  Py_VISIT(traverse_module_state->__pyx_tuple__31);
  Py_VISIT(traverse_module_state->__pyx_tuple__33);
  Py_VISIT(traverse_module_state->__pyx_tuple__39);
  Py_VISIT(traverse_module_state->__pyx_tuple__41);
  Py_VISIT(traverse_module_state->__pyx_tuple__43);
  Py_VISIT(traverse_module_state->__pyx_tuple__45);
  Py_VISIT(traverse_module_state->__pyx_tuple__46);
  Py_VISIT(traverse_module_state->__pyx_tuple__48);
  Py_VISIT(traverse_module_state->__pyx_tuple__49);
  Py_VISIT(traverse_module_state->__pyx_tuple__51);
  Py_VISIT(traverse_module_state->__pyx_tuple__53);
  Py_VISIT(traverse_module_state->__pyx_tuple__54);
  Py_VISIT(traverse_module_state->__pyx_tuple__56);
  Py_VISIT(traverse_module_state->__pyx_tuple__58);
  Py_VISIT(traverse_module_state->__pyx_tuple__60);
  Py_VISIT(traverse_module_state->__pyx_tuple__62);
  Py_VISIT(traverse_module_state->__pyx_tuple__63);
  Py_VISIT(traverse_module_state->__pyx_tuple__65);
  Py_VISIT(traverse_module_state->__pyx_tuple__67);
  Py_VISIT(traverse_module_state->__pyx_tuple__68);
  Py_VISIT(traverse_module_state->__pyx_tuple__70);
  Py_VISIT(traverse_module_state->__pyx_tuple__72);
  Py_VISIT(traverse_module_state->__pyx_tuple__74);
  Py_VISIT(traverse_module_state->__pyx_tuple__76);
  Py_VISIT(traverse_module_state->__pyx_tuple__78);
  Py_VISIT(traverse_module_state->__pyx_tuple__79);
  Py_VISIT(traverse_module_state->__pyx_tuple__81);
  Py_VISIT(traverse_module_state->__pyx_tuple__83);
  Py_VISIT(traverse_module_state->__pyx_tuple__85);
  Py_VISIT(traverse_module_state->__pyx_tuple__88);
  Py_VISIT(traverse_module_state->__pyx_tuple__90);
  Py_VISIT(traverse_module_state->__pyx_tuple__91);
  Py_VISIT(traverse_module_state->__pyx_tuple__92);
  Py_VISIT(traverse_module_state->__pyx_tuple__93);
  Py_VISIT(traverse_module_state->__pyx_tuple__94);
  Py_VISIT(traverse_module_state->__pyx_tuple__95);
  Py_VISIT(traverse_module_state->__pyx_tuple__96);
  Py_VISIT(traverse_module_state->__pyx_tuple__97);
  Py_VISIT(traverse_module_state->__pyx_tuple__98);
  Py_VISIT(traverse_module_state->__pyx_tuple__99);
  Py_VISIT(traverse_module_state->__pyx_codeobj__7);
  Py_VISIT(traverse_module_state->__pyx_codeobj__8);
  Py_VISIT(traverse_module_state->__pyx_codeobj__9);
  Py_VISIT(traverse_module_state->__pyx_tuple__101);
  Py_VISIT(traverse_module_state->__pyx_tuple__103);
  Py_VISIT(traverse_module_state->__pyx_tuple__105);
  Py_VISIT(traverse_module_state->__pyx_tuple__106);
  Py_VISIT(traverse_module_state->__pyx_tuple__108);
  Py_VISIT(traverse_module_state->__pyx_tuple__109);
  Py_VISIT(traverse_module_state->__pyx_tuple__111);
  Py_VISIT(traverse_module_state->__pyx_tuple__113);
  Py_VISIT(traverse_module_state->__pyx_tuple__115);
  Py_VISIT(traverse_module_state->__pyx_tuple__117);
  Py_VISIT(traverse_module_state->__pyx_tuple__118);
  Py_VISIT(traverse_module_state->__pyx_tuple__122);
  Py_VISIT(traverse_module_state->__pyx_tuple__124);
  Py_VISIT(traverse_module_state->__pyx_tuple__126);
  Py_VISIT(traverse_module_state->__pyx_tuple__127);
  Py_VISIT(traverse_module_state->__pyx_tuple__129);
  Py_VISIT(traverse_module_state->__pyx_tuple__130);
  Py_VISIT(traverse_module_state->__pyx_tuple__132);
  Py_VISIT(traverse_module_state->__pyx_tuple__133);
  Py_VISIT(traverse_module_state->__pyx_tuple__135);
  Py_VISIT(traverse_module_state->__pyx_tuple__137);
  Py_VISIT(traverse_module_state->__pyx_tuple__138);
  Py_VISIT(traverse_module_state->__pyx_tuple__140);
  Py_VISIT(traverse_module_state->__pyx_tuple__141);
  Py_VISIT(traverse_module_state->__pyx_tuple__143);
  Py_VISIT(traverse_module_state->__pyx_tuple__144);
  Py_VISIT(traverse_module_state->__pyx_tuple__146);
  Py_VISIT(traverse_module_state->__pyx_tuple__148);
  Py_VISIT(traverse_module_state->__pyx_tuple__149);
  Py_VISIT(traverse_module_state->__pyx_tuple__151);
  Py_VISIT(traverse_module_state->__pyx_tuple__152);
  Py_VISIT(traverse_module_state->__pyx_tuple__154);
  Py_VISIT(traverse_module_state->__pyx_tuple__155);
  Py_VISIT(traverse_module_state->__pyx_tuple__157);
  Py_VISIT(traverse_module_state->__pyx_tuple__159);
  Py_VISIT(traverse_module_state->__pyx_tuple__160);
  Py_VISIT(traverse_module_state->__pyx_tuple__162);
  Py_VISIT(traverse_module_state->__pyx_tuple__163);
  Py_VISIT(traverse_module_state->__pyx_tuple__165);
  Py_VISIT(traverse_module_state->__pyx_tuple__166);
  Py_VISIT(traverse_module_state->__pyx_tuple__167);
  Py_VISIT(traverse_module_state->__pyx_tuple__169);
  Py_VISIT(traverse_module_state->__pyx_tuple__170);
  Py_VISIT(traverse_module_state->__pyx_tuple__172);
  Py_VISIT(traverse_module_state->__pyx_tuple__174);
  Py_VISIT(traverse_module_state->__pyx_tuple__176);
  Py_VISIT(traverse_module_state->__pyx_tuple__178);
  Py_VISIT(traverse_module_state->__pyx_tuple__179);
  Py_VISIT(traverse_module_state->__pyx_tuple__180);
  Py_VISIT(traverse_module_state->__pyx_tuple__182);
  Py_VISIT(traverse_module_state->__pyx_tuple__183);
  Py_VISIT(traverse_module_state->__pyx_tuple__185);
  Py_VISIT(traverse_module_state->__pyx_tuple__186);
  Py_VISIT(traverse_module_state->__pyx_tuple__188);
  Py_VISIT(traverse_module_state->__pyx_tuple__190);
  Py_VISIT(traverse_module_state->__pyx_tuple__192);
  Py_VISIT(traverse_module_state->__pyx_tuple__194);
  Py_VISIT(traverse_module_state->__pyx_tuple__195);
  Py_VISIT(traverse_module_state->__pyx_tuple__197);
  Py_VISIT(traverse_module_state->__pyx_tuple__199);
  Py_VISIT(traverse_module_state->__pyx_tuple__201);
  Py_VISIT(traverse_module_state->__pyx_codeobj__10);
  Py_VISIT(traverse_module_state->__pyx_codeobj__11);
  Py_VISIT(traverse_module_state->__pyx_codeobj__12);
  Py_VISIT(traverse_module_state->__pyx_codeobj__13);
  Py_VISIT(traverse_module_state->__pyx_codeobj__14);
  Py_VISIT(traverse_module_state->__pyx_codeobj__17);
  Py_VISIT(traverse_module_state->__pyx_codeobj__18);
  Py_VISIT(traverse_module_state->__pyx_codeobj__19);
  Py_VISIT(traverse_module_state->__pyx_codeobj__25);
  Py_VISIT(traverse_module_state->__pyx_codeobj__27);
  Py_VISIT(traverse_module_state->__pyx_codeobj__29);
  Py_VISIT(traverse_module_state->__pyx_codeobj__32);
  Py_VISIT(traverse_module_state->__pyx_codeobj__34);
  Py_VISIT(traverse_module_state->__pyx_codeobj__36);
  Py_VISIT(traverse_module_state->__pyx_codeobj__37);
  Py_VISIT(traverse_module_state->__pyx_codeobj__40);
  Py_VISIT(traverse_module_state->__pyx_codeobj__42);
  Py_VISIT(traverse_module_state->__pyx_codeobj__44);
  Py_VISIT(traverse_module_state->__pyx_codeobj__47);
  Py_VISIT(traverse_module_state->__pyx_codeobj__50);
  Py_VISIT(traverse_module_state->__pyx_codeobj__52);
  Py_VISIT(traverse_module_state->__pyx_codeobj__55);
  Py_VISIT(traverse_module_state->__pyx_codeobj__57);
  Py_VISIT(traverse_module_state->__pyx_codeobj__59);
  Py_VISIT(traverse_module_state->__pyx_codeobj__61);
  Py_VISIT(traverse_module_state->__pyx_codeobj__64);
  Py_VISIT(traverse_module_state->__pyx_codeobj__66);
  Py_VISIT(traverse_module_state->__pyx_codeobj__69);
  Py_VISIT(traverse_module_state->__pyx_codeobj__71);
  Py_VISIT(traverse_module_state->__pyx_codeobj__73);
  Py_VISIT(traverse_module_state->__pyx_codeobj__75);
  Py_VISIT(traverse_module_state->__pyx_codeobj__77);
  Py_VISIT(traverse_module_state->__pyx_codeobj__80);
  Py_VISIT(traverse_module_state->__pyx_codeobj__82);
  Py_VISIT(traverse_module_state->__pyx_codeobj__84);
  Py_VISIT(traverse_module_state->__pyx_codeobj__86);
  Py_VISIT(traverse_module_state->__pyx_codeobj__87);
  Py_VISIT(traverse_module_state->__pyx_codeobj__89);
  Py_VISIT(traverse_module_state->__pyx_codeobj__100);
  Py_VISIT(traverse_module_state->__pyx_codeobj__102);
  Py_VISIT(traverse_module_state->__pyx_codeobj__104);
  Py_VISIT(traverse_module_state->__pyx_codeobj__107);
  Py_VISIT(traverse_module_state->__pyx_codeobj__110);
  Py_VISIT(traverse_module_state->__pyx_codeobj__112);
  Py_VISIT(traverse_module_state->__pyx_codeobj__114);
  Py_VISIT(traverse_module_state->__pyx_codeobj__116);
  Py_VISIT(traverse_module_state->__pyx_codeobj__119);
  Py_VISIT(traverse_module_state->__pyx_codeobj__120);
  Py_VISIT(traverse_module_state->__pyx_codeobj__123);
  Py_VISIT(traverse_module_state->__pyx_codeobj__125);
  Py_VISIT(traverse_module_state->__pyx_codeobj__128);
  Py_VISIT(traverse_module_state->__pyx_codeobj__131);
  Py_VISIT(traverse_module_state->__pyx_codeobj__134);
  Py_VISIT(traverse_module_state->__pyx_codeobj__136);
  Py_VISIT(traverse_module_state->__pyx_codeobj__139);
  Py_VISIT(traverse_module_state->__pyx_codeobj__142);
  Py_VISIT(traverse_module_state->__pyx_codeobj__145);
  Py_VISIT(traverse_module_state->__pyx_codeobj__147);
  Py_VISIT(traverse_module_state->__pyx_codeobj__150);
  Py_VISIT(traverse_module_state->__pyx_codeobj__153);
  Py_VISIT(traverse_module_state->__pyx_codeobj__156);
  Py_VISIT(traverse_module_state->__pyx_codeobj__158);
  Py_VISIT(traverse_module_state->__pyx_codeobj__161);
  Py_VISIT(traverse_module_state->__pyx_codeobj__164);
  Py_VISIT(traverse_module_state->__pyx_codeobj__168);
  Py_VISIT(traverse_module_state->__pyx_codeobj__171);
  Py_VISIT(traverse_module_state->__pyx_codeobj__173);
  Py_VISIT(traverse_module_state->__pyx_codeobj__175);
  Py_VISIT(traverse_module_state->__pyx_codeobj__177);
  Py_VISIT(traverse_module_state->__pyx_codeobj__181);
  Py_VISIT(traverse_module_state->__pyx_codeobj__184);
  Py_VISIT(traverse_module_state->__pyx_codeobj__187);
  Py_VISIT(traverse_module_state->__pyx_codeobj__189);
  Py_VISIT(traverse_module_state->__pyx_codeobj__191);
  Py_VISIT(traverse_module_state->__pyx_codeobj__193);
  Py_VISIT(traverse_module_state->__pyx_codeobj__196);
  Py_VISIT(traverse_module_state->__pyx_codeobj__198);
  Py_VISIT(traverse_module_state->__pyx_codeobj__200);
  Py_VISIT(traverse_module_state->__pyx_codeobj__202);
  return 0;
}
#endif
/* #### Code section: module_state_defines ### */
#define __pyx_d __pyx_mstate_global->__pyx_d
#define __pyx_b __pyx_mstate_global->__pyx_b
#define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime
#define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple
#define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes
#define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode
#ifdef __Pyx_CyFunction_USED
#define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType
#endif
#ifdef __Pyx_FusedFunction_USED
#define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType
#endif
#ifdef __Pyx_Generator_USED
#define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType
#endif
#ifdef __Pyx_IterableCoroutine_USED
#define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType
#endif
#ifdef __Pyx_Coroutine_USED
#define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType
#endif
#ifdef __Pyx_Coroutine_USED
#define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType
#endif
#if CYTHON_USE_MODULE_STATE
#define __pyx_type_4ete4_4core_4tree_Tree __pyx_mstate_global->__pyx_type_4ete4_4core_4tree_Tree
#define __pyx_type_4ete4_4core_4tree___pyx_scope_struct__genexpr __pyx_mstate_global->__pyx_type_4ete4_4core_4tree___pyx_scope_struct__genexpr
#define __pyx_type_4ete4_4core_4tree___pyx_scope_struct_1___getitem__ __pyx_mstate_global->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_1___getitem__
#define __pyx_type_4ete4_4core_4tree___pyx_scope_struct_2_genexpr __pyx_mstate_global->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_2_genexpr
#define __pyx_type_4ete4_4core_4tree___pyx_scope_struct_3___contains__ __pyx_mstate_global->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_3___contains__
#define __pyx_type_4ete4_4core_4tree___pyx_scope_struct_4_genexpr __pyx_mstate_global->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_4_genexpr
#define __pyx_type_4ete4_4core_4tree___pyx_scope_struct_5___iter__ __pyx_mstate_global->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_5___iter__
#define __pyx_type_4ete4_4core_4tree___pyx_scope_struct_6_remove_child __pyx_mstate_global->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_6_remove_child
#define __pyx_type_4ete4_4core_4tree___pyx_scope_struct_7_genexpr __pyx_mstate_global->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_7_genexpr
#define __pyx_type_4ete4_4core_4tree___pyx_scope_struct_8_prune __pyx_mstate_global->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_8_prune
#define __pyx_type_4ete4_4core_4tree___pyx_scope_struct_9_leaves __pyx_mstate_global->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_9_leaves
#define __pyx_type_4ete4_4core_4tree___pyx_scope_struct_10_leaf_names __pyx_mstate_global->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_10_leaf_names
#define __pyx_type_4ete4_4core_4tree___pyx_scope_struct_11_descendants __pyx_mstate_global->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_11_descendants
#define __pyx_type_4ete4_4core_4tree___pyx_scope_struct_12_traverse __pyx_mstate_global->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_12_traverse
#define __pyx_type_4ete4_4core_4tree___pyx_scope_struct_13_iter_prepostorder __pyx_mstate_global->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_13_iter_prepostorder
#define __pyx_type_4ete4_4core_4tree___pyx_scope_struct_14_ancestors __pyx_mstate_global->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_14_ancestors
#define __pyx_type_4ete4_4core_4tree___pyx_scope_struct_15_lineage __pyx_mstate_global->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_15_lineage
#define __pyx_type_4ete4_4core_4tree___pyx_scope_struct_16_search_nodes __pyx_mstate_global->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_16_search_nodes
#define __pyx_type_4ete4_4core_4tree___pyx_scope_struct_17_genexpr __pyx_mstate_global->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_17_genexpr
#define __pyx_type_4ete4_4core_4tree___pyx_scope_struct_18_search_descendants __pyx_mstate_global->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_18_search_descendants
#define __pyx_type_4ete4_4core_4tree___pyx_scope_struct_19_search_ancestors __pyx_mstate_global->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_19_search_ancestors
#define __pyx_type_4ete4_4core_4tree___pyx_scope_struct_20_genexpr __pyx_mstate_global->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_20_genexpr
#define __pyx_type_4ete4_4core_4tree___pyx_scope_struct_21_get_distance __pyx_mstate_global->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_21_get_distance
#define __pyx_type_4ete4_4core_4tree___pyx_scope_struct_22_genexpr __pyx_mstate_global->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_22_genexpr
#define __pyx_type_4ete4_4core_4tree___pyx_scope_struct_23_genexpr __pyx_mstate_global->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_23_genexpr
#define __pyx_type_4ete4_4core_4tree___pyx_scope_struct_24_sort_descendants __pyx_mstate_global->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_24_sort_descendants
#define __pyx_type_4ete4_4core_4tree___pyx_scope_struct_25_get_cached_content __pyx_mstate_global->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_25_get_cached_content
#define __pyx_type_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds __pyx_mstate_global->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds
#define __pyx_type_4ete4_4core_4tree___pyx_scope_struct_27_genexpr __pyx_mstate_global->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_27_genexpr
#define __pyx_type_4ete4_4core_4tree___pyx_scope_struct_28_genexpr __pyx_mstate_global->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_28_genexpr
#define __pyx_type_4ete4_4core_4tree___pyx_scope_struct_29_genexpr __pyx_mstate_global->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_29_genexpr
#define __pyx_type_4ete4_4core_4tree___pyx_scope_struct_30_genexpr __pyx_mstate_global->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_30_genexpr
#define __pyx_type_4ete4_4core_4tree___pyx_scope_struct_31_from_common __pyx_mstate_global->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_31_from_common
#define __pyx_type_4ete4_4core_4tree___pyx_scope_struct_32_genexpr __pyx_mstate_global->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_32_genexpr
#define __pyx_type_4ete4_4core_4tree___pyx_scope_struct_33_genexpr __pyx_mstate_global->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_33_genexpr
#define __pyx_type_4ete4_4core_4tree___pyx_scope_struct_34_genexpr __pyx_mstate_global->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_34_genexpr
#define __pyx_type_4ete4_4core_4tree___pyx_scope_struct_35_genexpr __pyx_mstate_global->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_35_genexpr
#define __pyx_type_4ete4_4core_4tree___pyx_scope_struct_36_genexpr __pyx_mstate_global->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_36_genexpr
#define __pyx_type_4ete4_4core_4tree___pyx_scope_struct_37_genexpr __pyx_mstate_global->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_37_genexpr
#define __pyx_type_4ete4_4core_4tree___pyx_scope_struct_38_compare __pyx_mstate_global->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_38_compare
#define __pyx_type_4ete4_4core_4tree___pyx_scope_struct_39_edges __pyx_mstate_global->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_39_edges
#define __pyx_type_4ete4_4core_4tree___pyx_scope_struct_40_get_topology_id __pyx_mstate_global->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_40_get_topology_id
#define __pyx_type_4ete4_4core_4tree___pyx_scope_struct_41_genexpr __pyx_mstate_global->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_41_genexpr
#define __pyx_type_4ete4_4core_4tree___pyx_scope_struct_42_genexpr __pyx_mstate_global->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_42_genexpr
#define __pyx_type_4ete4_4core_4tree___pyx_scope_struct_43_is_monophyletic __pyx_mstate_global->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_43_is_monophyletic
#define __pyx_type_4ete4_4core_4tree___pyx_scope_struct_44_genexpr __pyx_mstate_global->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_44_genexpr
#define __pyx_type_4ete4_4core_4tree___pyx_scope_struct_45_check_monophyly __pyx_mstate_global->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_45_check_monophyly
#define __pyx_type_4ete4_4core_4tree___pyx_scope_struct_46_genexpr __pyx_mstate_global->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_46_genexpr
#define __pyx_type_4ete4_4core_4tree___pyx_scope_struct_47_genexpr __pyx_mstate_global->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_47_genexpr
#define __pyx_type_4ete4_4core_4tree___pyx_scope_struct_48_get_monophyletic __pyx_mstate_global->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_48_get_monophyletic
#define __pyx_type_4ete4_4core_4tree___pyx_scope_struct_49_expand_polytomies __pyx_mstate_global->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_49_expand_polytomies
#define __pyx_type_4ete4_4core_4tree___pyx_scope_struct_50_add_leaf __pyx_mstate_global->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_50_add_leaf
#define __pyx_type_4ete4_4core_4tree___pyx_scope_struct_51_enum_unordered __pyx_mstate_global->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_51_enum_unordered
#define __pyx_type_4ete4_4core_4tree___pyx_scope_struct_52_genexpr __pyx_mstate_global->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_52_genexpr
#define __pyx_type_4ete4_4core_4tree___pyx_scope_struct_53_from_parent_child_table __pyx_mstate_global->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_53_from_parent_child_table
#define __pyx_type_4ete4_4core_4tree___pyx_scope_struct_54_from_skbio __pyx_mstate_global->__pyx_type_4ete4_4core_4tree___pyx_scope_struct_54_from_skbio
#endif
#define __pyx_ptype_4ete4_4core_4tree_Tree __pyx_mstate_global->__pyx_ptype_4ete4_4core_4tree_Tree
#define __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct__genexpr __pyx_mstate_global->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct__genexpr
#define __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_1___getitem__ __pyx_mstate_global->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_1___getitem__
#define __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_2_genexpr __pyx_mstate_global->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_2_genexpr
#define __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_3___contains__ __pyx_mstate_global->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_3___contains__
#define __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_4_genexpr __pyx_mstate_global->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_4_genexpr
#define __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_5___iter__ __pyx_mstate_global->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_5___iter__
#define __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_6_remove_child __pyx_mstate_global->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_6_remove_child
#define __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_7_genexpr __pyx_mstate_global->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_7_genexpr
#define __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_8_prune __pyx_mstate_global->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_8_prune
#define __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_9_leaves __pyx_mstate_global->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_9_leaves
#define __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_10_leaf_names __pyx_mstate_global->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_10_leaf_names
#define __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_11_descendants __pyx_mstate_global->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_11_descendants
#define __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_12_traverse __pyx_mstate_global->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_12_traverse
#define __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_13_iter_prepostorder __pyx_mstate_global->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_13_iter_prepostorder
#define __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_14_ancestors __pyx_mstate_global->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_14_ancestors
#define __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_15_lineage __pyx_mstate_global->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_15_lineage
#define __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_16_search_nodes __pyx_mstate_global->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_16_search_nodes
#define __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_17_genexpr __pyx_mstate_global->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_17_genexpr
#define __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_18_search_descendants __pyx_mstate_global->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_18_search_descendants
#define __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_19_search_ancestors __pyx_mstate_global->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_19_search_ancestors
#define __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_20_genexpr __pyx_mstate_global->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_20_genexpr
#define __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_21_get_distance __pyx_mstate_global->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_21_get_distance
#define __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_22_genexpr __pyx_mstate_global->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_22_genexpr
#define __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_23_genexpr __pyx_mstate_global->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_23_genexpr
#define __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_24_sort_descendants __pyx_mstate_global->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_24_sort_descendants
#define __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_25_get_cached_content __pyx_mstate_global->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_25_get_cached_content
#define __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds __pyx_mstate_global->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds
#define __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_27_genexpr __pyx_mstate_global->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_27_genexpr
#define __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_28_genexpr __pyx_mstate_global->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_28_genexpr
#define __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_29_genexpr __pyx_mstate_global->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_29_genexpr
#define __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_30_genexpr __pyx_mstate_global->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_30_genexpr
#define __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_31_from_common __pyx_mstate_global->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_31_from_common
#define __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_32_genexpr __pyx_mstate_global->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_32_genexpr
#define __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_33_genexpr __pyx_mstate_global->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_33_genexpr
#define __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_34_genexpr __pyx_mstate_global->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_34_genexpr
#define __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_35_genexpr __pyx_mstate_global->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_35_genexpr
#define __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_36_genexpr __pyx_mstate_global->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_36_genexpr
#define __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_37_genexpr __pyx_mstate_global->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_37_genexpr
#define __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_38_compare __pyx_mstate_global->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_38_compare
#define __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_39_edges __pyx_mstate_global->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_39_edges
#define __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_40_get_topology_id __pyx_mstate_global->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_40_get_topology_id
#define __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_41_genexpr __pyx_mstate_global->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_41_genexpr
#define __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_42_genexpr __pyx_mstate_global->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_42_genexpr
#define __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_43_is_monophyletic __pyx_mstate_global->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_43_is_monophyletic
#define __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_44_genexpr __pyx_mstate_global->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_44_genexpr
#define __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_45_check_monophyly __pyx_mstate_global->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_45_check_monophyly
#define __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_46_genexpr __pyx_mstate_global->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_46_genexpr
#define __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_47_genexpr __pyx_mstate_global->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_47_genexpr
#define __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_48_get_monophyletic __pyx_mstate_global->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_48_get_monophyletic
#define __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_49_expand_polytomies __pyx_mstate_global->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_49_expand_polytomies
#define __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_50_add_leaf __pyx_mstate_global->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_50_add_leaf
#define __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_51_enum_unordered __pyx_mstate_global->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_51_enum_unordered
#define __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_52_genexpr __pyx_mstate_global->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_52_genexpr
#define __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_53_from_parent_child_table __pyx_mstate_global->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_53_from_parent_child_table
#define __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_54_from_skbio __pyx_mstate_global->__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_54_from_skbio
#define __pyx_kp_u_127_0_0_1 __pyx_mstate_global->__pyx_kp_u_127_0_0_1
#define __pyx_kp_u_A_parent_node_is_required_to_add __pyx_mstate_global->__pyx_kp_u_A_parent_node_is_required_to_add
#define __pyx_kp_u_Ambiguous_node_name __pyx_mstate_global->__pyx_kp_u_Ambiguous_node_name
#define __pyx_n_s_AssertionError __pyx_mstate_global->__pyx_n_s_AssertionError
#define __pyx_kp_u_Both_trees_contain_polytomies_Tr __pyx_mstate_global->__pyx_kp_u_Both_trees_contain_polytomies_Tr
#define __pyx_kp_u_Can_only_check_nodes_or_names_in __pyx_mstate_global->__pyx_kp_u_Can_only_check_nodes_or_names_in
#define __pyx_kp_u_Cannot_pop_child_not_found __pyx_mstate_global->__pyx_kp_u_Cannot_pop_child_not_found
#define __pyx_kp_u_Cannot_remove_child_not_found __pyx_mstate_global->__pyx_kp_u_Cannot_remove_child_not_found
#define __pyx_kp_u_Cannot_remove_sister_because_the __pyx_mstate_global->__pyx_kp_u_Cannot_remove_sister_because_the
#define __pyx_kp_u_Cannot_render_image_missing_modu __pyx_mstate_global->__pyx_kp_u_Cannot_render_image_missing_modu
#define __pyx_n_s_Chrome __pyx_mstate_global->__pyx_n_s_Chrome
#define __pyx_kp_u_Duplicated_items_found_in_refere __pyx_mstate_global->__pyx_kp_u_Duplicated_items_found_in_refere
#define __pyx_kp_u_Duplicated_items_found_in_target __pyx_mstate_global->__pyx_kp_u_Duplicated_items_found_in_target
#define __pyx_n_u_ETE __pyx_mstate_global->__pyx_n_u_ETE
#define __pyx_n_s_FACE_POSITIONS __pyx_mstate_global->__pyx_n_s_FACE_POSITIONS
#define __pyx_n_s_Face __pyx_mstate_global->__pyx_n_s_Face
#define __pyx_n_s_FaceAreas __pyx_mstate_global->__pyx_n_s_FaceAreas
#define __pyx_n_s_FaceContainer __pyx_mstate_global->__pyx_n_s_FaceContainer
#define __pyx_kp_u_Found_polytomy_larger_than_curre __pyx_mstate_global->__pyx_kp_u_Found_polytomy_larger_than_curre
#define __pyx_kp_s_Incompatible_checksums_0x_x_vs_0 __pyx_mstate_global->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0
#define __pyx_kp_u_Incorrect_child_type __pyx_mstate_global->__pyx_kp_u_Incorrect_child_type
#define __pyx_n_s_IndexError __pyx_mstate_global->__pyx_n_s_IndexError
#define __pyx_kp_u_Invalid_copy_method __pyx_mstate_global->__pyx_kp_u_Invalid_copy_method
#define __pyx_kp_u_Invalid_node_id __pyx_mstate_global->__pyx_kp_u_Invalid_node_id
#define __pyx_kp_u_Invalid_node_type __pyx_mstate_global->__pyx_kp_u_Invalid_node_type
#define __pyx_kp_u_Max_distance_g __pyx_mstate_global->__pyx_kp_u_Max_distance_g
#define __pyx_n_s_ModuleNotFoundError __pyx_mstate_global->__pyx_n_s_ModuleNotFoundError
#define __pyx_kp_u_Most_distant_node_s __pyx_mstate_global->__pyx_kp_u_Most_distant_node_s
#define __pyx_n_u_NA __pyx_mstate_global->__pyx_n_u_NA
#define __pyx_n_u_No __pyx_mstate_global->__pyx_n_u_No
#define __pyx_kp_u_No_children __pyx_mstate_global->__pyx_kp_u_No_children
#define __pyx_kp_u_No_common_ancestor_for_nodes __pyx_mstate_global->__pyx_kp_u_No_common_ancestor_for_nodes
#define __pyx_kp_u_No_node_found_with_name __pyx_mstate_global->__pyx_kp_u_No_node_found_with_name
#define __pyx_n_s_NodeStyle __pyx_mstate_global->__pyx_n_s_NodeStyle
#define __pyx_kp_u_Node_has __pyx_mstate_global->__pyx_kp_u_Node_has
#define __pyx_kp_u_Number_of_leaf_nodes_d __pyx_mstate_global->__pyx_kp_u_Number_of_leaf_nodes_d
#define __pyx_n_s_Options __pyx_mstate_global->__pyx_n_s_Options
#define __pyx_n_s_PARSERS __pyx_mstate_global->__pyx_n_s_PARSERS
#define __pyx_n_s_PickleError __pyx_mstate_global->__pyx_n_s_PickleError
#define __pyx_kp_u_Rooted_s __pyx_mstate_global->__pyx_kp_u_Rooted_s
#define __pyx_n_s_StopIteration __pyx_mstate_global->__pyx_n_s_StopIteration
#define __pyx_n_s_TipTuple __pyx_mstate_global->__pyx_n_s_TipTuple
#define __pyx_kp_u_Total_number_of_nodes_d __pyx_mstate_global->__pyx_kp_u_Total_number_of_nodes_d
#define __pyx_kp_u_Tree __pyx_mstate_global->__pyx_kp_u_Tree
#define __pyx_n_s_TreeError __pyx_mstate_global->__pyx_n_s_TreeError
#define __pyx_n_s_TreeNode __pyx_mstate_global->__pyx_n_s_TreeNode
#define __pyx_n_s_Tree_2 __pyx_mstate_global->__pyx_n_s_Tree_2
#define __pyx_n_s_Tree___iter __pyx_mstate_global->__pyx_n_s_Tree___iter
#define __pyx_n_s_Tree___reduce_cython __pyx_mstate_global->__pyx_n_s_Tree___reduce_cython
#define __pyx_n_s_Tree___setstate_cython __pyx_mstate_global->__pyx_n_s_Tree___setstate_cython
#define __pyx_n_s_Tree__diff __pyx_mstate_global->__pyx_n_s_Tree__diff
#define __pyx_n_s_Tree__get_farthest_and_closest_l __pyx_mstate_global->__pyx_n_s_Tree__get_farthest_and_closest_l
#define __pyx_n_s_Tree__translate_nodes __pyx_mstate_global->__pyx_n_s_Tree__translate_nodes
#define __pyx_n_s_Tree_add_child __pyx_mstate_global->__pyx_n_s_Tree_add_child
#define __pyx_n_s_Tree_add_children __pyx_mstate_global->__pyx_n_s_Tree_add_children
#define __pyx_n_s_Tree_add_face __pyx_mstate_global->__pyx_n_s_Tree_add_face
#define __pyx_n_s_Tree_add_prop __pyx_mstate_global->__pyx_n_s_Tree_add_prop
#define __pyx_n_s_Tree_add_props __pyx_mstate_global->__pyx_n_s_Tree_add_props
#define __pyx_n_s_Tree_add_sister __pyx_mstate_global->__pyx_n_s_Tree_add_sister
#define __pyx_n_s_Tree_ancestors __pyx_mstate_global->__pyx_n_s_Tree_ancestors
#define __pyx_n_s_Tree_check_monophyly __pyx_mstate_global->__pyx_n_s_Tree_check_monophyly
#define __pyx_n_s_Tree_common_ancestor __pyx_mstate_global->__pyx_n_s_Tree_common_ancestor
#define __pyx_n_s_Tree_compare __pyx_mstate_global->__pyx_n_s_Tree_compare
#define __pyx_n_s_Tree_cophenetic_matrix __pyx_mstate_global->__pyx_n_s_Tree_cophenetic_matrix
#define __pyx_n_s_Tree_copy __pyx_mstate_global->__pyx_n_s_Tree_copy
#define __pyx_n_s_Tree_del_prop __pyx_mstate_global->__pyx_n_s_Tree_del_prop
#define __pyx_n_s_Tree_delete __pyx_mstate_global->__pyx_n_s_Tree_delete
#define __pyx_n_s_Tree_descendants __pyx_mstate_global->__pyx_n_s_Tree_descendants
#define __pyx_n_s_Tree_describe __pyx_mstate_global->__pyx_n_s_Tree_describe
#define __pyx_n_s_Tree_detach __pyx_mstate_global->__pyx_n_s_Tree_detach
#define __pyx_n_s_Tree_edges __pyx_mstate_global->__pyx_n_s_Tree_edges
#define __pyx_n_s_Tree_expand_polytomies __pyx_mstate_global->__pyx_n_s_Tree_expand_polytomies
#define __pyx_n_s_Tree_explore __pyx_mstate_global->__pyx_n_s_Tree_explore
#define __pyx_n_s_Tree_from_parent_child_table __pyx_mstate_global->__pyx_n_s_Tree_from_parent_child_table
#define __pyx_n_s_Tree_from_skbio __pyx_mstate_global->__pyx_n_s_Tree_from_skbio
#define __pyx_n_s_Tree_get_cached_content __pyx_mstate_global->__pyx_n_s_Tree_get_cached_content
#define __pyx_n_s_Tree_get_children __pyx_mstate_global->__pyx_n_s_Tree_get_children
#define __pyx_n_s_Tree_get_closest_leaf __pyx_mstate_global->__pyx_n_s_Tree_get_closest_leaf
#define __pyx_n_s_Tree_get_distance __pyx_mstate_global->__pyx_n_s_Tree_get_distance
#define __pyx_n_s_Tree_get_farthest_leaf __pyx_mstate_global->__pyx_n_s_Tree_get_farthest_leaf
#define __pyx_n_s_Tree_get_farthest_node __pyx_mstate_global->__pyx_n_s_Tree_get_farthest_node
#define __pyx_n_s_Tree_get_midpoint_outgroup __pyx_mstate_global->__pyx_n_s_Tree_get_midpoint_outgroup
#define __pyx_n_s_Tree_get_monophyletic __pyx_mstate_global->__pyx_n_s_Tree_get_monophyletic
#define __pyx_n_s_Tree_get_prop __pyx_mstate_global->__pyx_n_s_Tree_get_prop
#define __pyx_n_s_Tree_get_sisters __pyx_mstate_global->__pyx_n_s_Tree_get_sisters
#define __pyx_n_s_Tree_get_topology_id __pyx_mstate_global->__pyx_n_s_Tree_get_topology_id
#define __pyx_n_s_Tree_is_monophyletic __pyx_mstate_global->__pyx_n_s_Tree_is_monophyletic
#define __pyx_n_s_Tree_iter_prepostorder __pyx_mstate_global->__pyx_n_s_Tree_iter_prepostorder
#define __pyx_n_s_Tree_ladderize __pyx_mstate_global->__pyx_n_s_Tree_ladderize
#define __pyx_n_s_Tree_leaf_names __pyx_mstate_global->__pyx_n_s_Tree_leaf_names
#define __pyx_n_s_Tree_leaves __pyx_mstate_global->__pyx_n_s_Tree_leaves
#define __pyx_n_s_Tree_lineage __pyx_mstate_global->__pyx_n_s_Tree_lineage
#define __pyx_n_s_Tree_mean_distance __pyx_mstate_global->__pyx_n_s_Tree_mean_distance
#define __pyx_n_s_Tree_pop_child __pyx_mstate_global->__pyx_n_s_Tree_pop_child
#define __pyx_n_s_Tree_populate __pyx_mstate_global->__pyx_n_s_Tree_populate
#define __pyx_n_s_Tree_prune __pyx_mstate_global->__pyx_n_s_Tree_prune
#define __pyx_n_s_Tree_remove_child __pyx_mstate_global->__pyx_n_s_Tree_remove_child
#define __pyx_n_s_Tree_remove_children __pyx_mstate_global->__pyx_n_s_Tree_remove_children
#define __pyx_n_s_Tree_remove_sister __pyx_mstate_global->__pyx_n_s_Tree_remove_sister
#define __pyx_n_s_Tree_render __pyx_mstate_global->__pyx_n_s_Tree_render
#define __pyx_n_s_Tree_render_sm __pyx_mstate_global->__pyx_n_s_Tree_render_sm
#define __pyx_n_s_Tree_resolve_polytomy __pyx_mstate_global->__pyx_n_s_Tree_resolve_polytomy
#define __pyx_n_s_Tree_reverse_children __pyx_mstate_global->__pyx_n_s_Tree_reverse_children
#define __pyx_n_s_Tree_robinson_foulds __pyx_mstate_global->__pyx_n_s_Tree_robinson_foulds
#define __pyx_n_s_Tree_search_ancestors __pyx_mstate_global->__pyx_n_s_Tree_search_ancestors
#define __pyx_n_s_Tree_search_descendants __pyx_mstate_global->__pyx_n_s_Tree_search_descendants
#define __pyx_n_s_Tree_search_leaves_by_name __pyx_mstate_global->__pyx_n_s_Tree_search_leaves_by_name
#define __pyx_n_s_Tree_search_nodes __pyx_mstate_global->__pyx_n_s_Tree_search_nodes
#define __pyx_n_s_Tree_set_outgroup __pyx_mstate_global->__pyx_n_s_Tree_set_outgroup
#define __pyx_n_s_Tree_set_style __pyx_mstate_global->__pyx_n_s_Tree_set_style
#define __pyx_n_s_Tree_show __pyx_mstate_global->__pyx_n_s_Tree_show
#define __pyx_n_s_Tree_sort_descendants __pyx_mstate_global->__pyx_n_s_Tree_sort_descendants
#define __pyx_n_s_Tree_standardize __pyx_mstate_global->__pyx_n_s_Tree_standardize
#define __pyx_n_s_Tree_swap_children __pyx_mstate_global->__pyx_n_s_Tree_swap_children
#define __pyx_n_s_Tree_to_str __pyx_mstate_global->__pyx_n_s_Tree_to_str
#define __pyx_n_s_Tree_to_ultrametric __pyx_mstate_global->__pyx_n_s_Tree_to_ultrametric
#define __pyx_n_s_Tree_traverse __pyx_mstate_global->__pyx_n_s_Tree_traverse
#define __pyx_n_s_Tree_unroot __pyx_mstate_global->__pyx_n_s_Tree_unroot
#define __pyx_n_s_Tree_write __pyx_mstate_global->__pyx_n_s_Tree_write
#define __pyx_n_s_TypeError __pyx_mstate_global->__pyx_n_s_TypeError
#define __pyx_kp_u_Unknown_output_for_diff __pyx_mstate_global->__pyx_kp_u_Unknown_output_for_diff
#define __pyx_kp_u_Unknown_strategy __pyx_mstate_global->__pyx_kp_u_Unknown_strategy
#define __pyx_kp_u_Unrooted_tree_found_You_may_want __pyx_mstate_global->__pyx_kp_u_Unrooted_tree_found_You_may_want
#define __pyx_n_s_ValueError __pyx_mstate_global->__pyx_n_s_ValueError
#define __pyx_kp_u_Wrote_file __pyx_mstate_global->__pyx_kp_u_Wrote_file
#define __pyx_n_u_Yes __pyx_mstate_global->__pyx_n_u_Yes
#define __pyx_n_s__121 __pyx_mstate_global->__pyx_n_s__121
#define __pyx_kp_u__15 __pyx_mstate_global->__pyx_kp_u__15
#define __pyx_kp_u__2 __pyx_mstate_global->__pyx_kp_u__2
#define __pyx_kp_u__20 __pyx_mstate_global->__pyx_kp_u__20
#define __pyx_n_s__203 __pyx_mstate_global->__pyx_n_s__203
#define __pyx_n_s__21 __pyx_mstate_global->__pyx_n_s__21
#define __pyx_kp_u__22 __pyx_mstate_global->__pyx_kp_u__22
#define __pyx_kp_u__23 __pyx_mstate_global->__pyx_kp_u__23
#define __pyx_n_s__3 __pyx_mstate_global->__pyx_n_s__3
#define __pyx_kp_u__3 __pyx_mstate_global->__pyx_kp_u__3
#define __pyx_kp_u__4 __pyx_mstate_global->__pyx_kp_u__4
#define __pyx_kp_u__5 __pyx_mstate_global->__pyx_kp_u__5
#define __pyx_n_s_a __pyx_mstate_global->__pyx_n_s_a
#define __pyx_n_s_add __pyx_mstate_global->__pyx_n_s_add
#define __pyx_n_s_add_argument __pyx_mstate_global->__pyx_n_s_add_argument
#define __pyx_n_s_add_child __pyx_mstate_global->__pyx_n_s_add_child
#define __pyx_n_s_add_children __pyx_mstate_global->__pyx_n_s_add_children
#define __pyx_n_s_add_face __pyx_mstate_global->__pyx_n_s_add_face
#define __pyx_n_s_add_leaf __pyx_mstate_global->__pyx_n_s_add_leaf
#define __pyx_n_s_add_prop __pyx_mstate_global->__pyx_n_s_add_prop
#define __pyx_n_s_add_props __pyx_mstate_global->__pyx_n_s_add_props
#define __pyx_n_s_add_sister __pyx_mstate_global->__pyx_n_s_add_sister
#define __pyx_n_s_add_tree __pyx_mstate_global->__pyx_n_s_add_tree
#define __pyx_n_s_all_leaves __pyx_mstate_global->__pyx_n_s_all_leaves
#define __pyx_n_s_all_max_rf __pyx_mstate_global->__pyx_n_s_all_max_rf
#define __pyx_n_s_all_nodes __pyx_mstate_global->__pyx_n_s_all_nodes
#define __pyx_n_s_all_rf __pyx_mstate_global->__pyx_n_s_all_rf
#define __pyx_n_s_alld __pyx_mstate_global->__pyx_n_s_alld
#define __pyx_n_s_allleaves __pyx_mstate_global->__pyx_n_s_allleaves
#define __pyx_n_s_ancestors __pyx_mstate_global->__pyx_n_s_ancestors
#define __pyx_n_s_append __pyx_mstate_global->__pyx_n_s_append
#define __pyx_n_s_args __pyx_mstate_global->__pyx_n_s_args
#define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines
#define __pyx_kp_u_at __pyx_mstate_global->__pyx_kp_u_at
#define __pyx_n_s_attr __pyx_mstate_global->__pyx_n_s_attr
#define __pyx_n_s_autodetect_duplications __pyx_mstate_global->__pyx_n_s_autodetect_duplications
#define __pyx_n_s_b __pyx_mstate_global->__pyx_n_s_b
#define __pyx_kp_u_bad_parser __pyx_mstate_global->__pyx_kp_u_bad_parser
#define __pyx_n_s_bprops __pyx_mstate_global->__pyx_n_s_bprops
#define __pyx_n_s_branch __pyx_mstate_global->__pyx_n_s_branch
#define __pyx_kp_u_branch_right __pyx_mstate_global->__pyx_kp_u_branch_right
#define __pyx_n_s_cached_content __pyx_mstate_global->__pyx_n_s_cached_content
#define __pyx_n_s_cascade __pyx_mstate_global->__pyx_n_s_cascade
#define __pyx_n_s_cdist __pyx_mstate_global->__pyx_n_s_cdist
#define __pyx_n_s_ch __pyx_mstate_global->__pyx_n_s_ch
#define __pyx_n_s_check_monophyly __pyx_mstate_global->__pyx_n_s_check_monophyly
#define __pyx_n_s_check_monophyly_locals_genexpr __pyx_mstate_global->__pyx_n_s_check_monophyly_locals_genexpr
#define __pyx_n_s_child __pyx_mstate_global->__pyx_n_s_child
#define __pyx_n_s_child_idx __pyx_mstate_global->__pyx_n_s_child_idx
#define __pyx_n_s_child_name __pyx_mstate_global->__pyx_n_s_child_name
#define __pyx_n_s_children __pyx_mstate_global->__pyx_n_s_children
#define __pyx_kp_u_children_Use_reverse_children_i __pyx_mstate_global->__pyx_kp_u_children_Use_reverse_children_i
#define __pyx_n_s_childtrees __pyx_mstate_global->__pyx_n_s_childtrees
#define __pyx_n_s_class __pyx_mstate_global->__pyx_n_s_class
#define __pyx_n_s_class_getitem __pyx_mstate_global->__pyx_n_s_class_getitem
#define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback
#define __pyx_n_s_close __pyx_mstate_global->__pyx_n_s_close
#define __pyx_n_s_cmp_nodes __pyx_mstate_global->__pyx_n_s_cmp_nodes
#define __pyx_n_s_cmp_to_key __pyx_mstate_global->__pyx_n_s_cmp_to_key
#define __pyx_n_s_color __pyx_mstate_global->__pyx_n_s_color
#define __pyx_n_s_column __pyx_mstate_global->__pyx_n_s_column
#define __pyx_n_s_columns __pyx_mstate_global->__pyx_n_s_columns
#define __pyx_n_s_combinations __pyx_mstate_global->__pyx_n_s_combinations
#define __pyx_n_s_common __pyx_mstate_global->__pyx_n_s_common
#define __pyx_n_s_common_ancestor __pyx_mstate_global->__pyx_n_s_common_ancestor
#define __pyx_n_s_common_edges __pyx_mstate_global->__pyx_n_s_common_edges
#define __pyx_n_u_common_edges __pyx_mstate_global->__pyx_n_u_common_edges
#define __pyx_n_s_common_names __pyx_mstate_global->__pyx_n_s_common_names
#define __pyx_n_s_compact __pyx_mstate_global->__pyx_n_s_compact
#define __pyx_n_s_compare __pyx_mstate_global->__pyx_n_s_compare
#define __pyx_n_s_compare_2 __pyx_mstate_global->__pyx_n_s_compare_2
#define __pyx_n_s_compare_locals__compare __pyx_mstate_global->__pyx_n_s_compare_locals__compare
#define __pyx_n_s_compare_locals__safe_div __pyx_mstate_global->__pyx_n_s_compare_locals__safe_div
#define __pyx_n_s_compress __pyx_mstate_global->__pyx_n_s_compress
#define __pyx_n_s_conditions __pyx_mstate_global->__pyx_n_s_conditions
#define __pyx_n_s_container_type __pyx_mstate_global->__pyx_n_s_container_type
#define __pyx_n_s_contains___locals_genexpr __pyx_mstate_global->__pyx_n_s_contains___locals_genexpr
#define __pyx_n_s_cophenetic_matrix __pyx_mstate_global->__pyx_n_s_cophenetic_matrix
#define __pyx_n_s_cophenetic_matrix_locals_genexpr __pyx_mstate_global->__pyx_n_s_cophenetic_matrix_locals_genexpr
#define __pyx_n_s_copy __pyx_mstate_global->__pyx_n_s_copy
#define __pyx_n_s_corr1 __pyx_mstate_global->__pyx_n_s_corr1
#define __pyx_n_s_corr2 __pyx_mstate_global->__pyx_n_s_corr2
#define __pyx_n_s_correct_by_polytomy_size __pyx_mstate_global->__pyx_n_s_correct_by_polytomy_size
#define __pyx_n_u_cpickle __pyx_mstate_global->__pyx_n_u_cpickle
#define __pyx_n_s_current __pyx_mstate_global->__pyx_n_s_current
#define __pyx_n_s_d __pyx_mstate_global->__pyx_n_s_d
#define __pyx_n_s_data __pyx_mstate_global->__pyx_n_s_data
#define __pyx_n_s_deepcopy __pyx_mstate_global->__pyx_n_s_deepcopy
#define __pyx_n_u_deepcopy __pyx_mstate_global->__pyx_n_u_deepcopy
#define __pyx_n_s_default __pyx_mstate_global->__pyx_n_s_default
#define __pyx_n_s_del_prop __pyx_mstate_global->__pyx_n_s_del_prop
#define __pyx_n_s_delete __pyx_mstate_global->__pyx_n_s_delete
#define __pyx_n_s_delete_orphan __pyx_mstate_global->__pyx_n_s_delete_orphan
#define __pyx_n_s_depth __pyx_mstate_global->__pyx_n_s_depth
#define __pyx_n_s_descendants __pyx_mstate_global->__pyx_n_s_descendants
#define __pyx_n_s_describe __pyx_mstate_global->__pyx_n_s_describe
#define __pyx_n_s_detach __pyx_mstate_global->__pyx_n_s_detach
#define __pyx_n_s_diameter __pyx_mstate_global->__pyx_n_s_diameter
#define __pyx_n_s_dict __pyx_mstate_global->__pyx_n_s_dict
#define __pyx_n_s_dict_2 __pyx_mstate_global->__pyx_n_s_dict_2
#define __pyx_n_s_diff __pyx_mstate_global->__pyx_n_s_diff
#define __pyx_n_u_diffs __pyx_mstate_global->__pyx_n_u_diffs
#define __pyx_n_u_diffs_tab __pyx_mstate_global->__pyx_n_u_diffs_tab
#define __pyx_n_s_difftable __pyx_mstate_global->__pyx_n_s_difftable
#define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable
#define __pyx_kp_u_disable_breakpad __pyx_mstate_global->__pyx_kp_u_disable_breakpad
#define __pyx_kp_u_disable_logging __pyx_mstate_global->__pyx_kp_u_disable_logging
#define __pyx_n_s_discard_t1 __pyx_mstate_global->__pyx_n_s_discard_t1
#define __pyx_n_s_discard_t2 __pyx_mstate_global->__pyx_n_s_discard_t2
#define __pyx_n_s_dist __pyx_mstate_global->__pyx_n_s_dist
#define __pyx_n_u_dist __pyx_mstate_global->__pyx_n_u_dist
#define __pyx_n_s_dist_fn __pyx_mstate_global->__pyx_n_s_dist_fn
#define __pyx_n_s_distance __pyx_mstate_global->__pyx_n_s_distance
#define __pyx_n_s_doc __pyx_mstate_global->__pyx_n_s_doc
#define __pyx_n_s_dpi __pyx_mstate_global->__pyx_n_s_dpi
#define __pyx_n_s_drawer __pyx_mstate_global->__pyx_n_s_drawer
#define __pyx_n_s_driver __pyx_mstate_global->__pyx_n_s_driver
#define __pyx_n_s_dump __pyx_mstate_global->__pyx_n_s_dump
#define __pyx_n_s_dumps __pyx_mstate_global->__pyx_n_s_dumps
#define __pyx_n_s_e __pyx_mstate_global->__pyx_n_s_e
#define __pyx_n_s_edge_keys __pyx_mstate_global->__pyx_n_s_edge_keys
#define __pyx_n_s_edges __pyx_mstate_global->__pyx_n_s_edges
#define __pyx_n_s_edges1 __pyx_mstate_global->__pyx_n_s_edges1
#define __pyx_n_s_edges2 __pyx_mstate_global->__pyx_n_s_edges2
#define __pyx_n_u_effective_tree_size __pyx_mstate_global->__pyx_n_u_effective_tree_size
#define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable
#define __pyx_n_s_enter __pyx_mstate_global->__pyx_n_s_enter
#define __pyx_n_s_enum_unordered __pyx_mstate_global->__pyx_n_s_enum_unordered
#define __pyx_n_s_enumerate __pyx_mstate_global->__pyx_n_s_enumerate
#define __pyx_n_u_ete __pyx_mstate_global->__pyx_n_u_ete
#define __pyx_n_s_ete4_core_tree __pyx_mstate_global->__pyx_n_s_ete4_core_tree
#define __pyx_kp_s_ete4_core_tree_pyx __pyx_mstate_global->__pyx_kp_s_ete4_core_tree_pyx
#define __pyx_n_s_ete_ch __pyx_mstate_global->__pyx_n_s_ete_ch
#define __pyx_n_s_ete_diff __pyx_mstate_global->__pyx_n_s_ete_diff
#define __pyx_n_s_ete_format __pyx_mstate_global->__pyx_n_s_ete_format
#define __pyx_n_s_ete_node __pyx_mstate_global->__pyx_n_s_ete_node
#define __pyx_n_s_exit __pyx_mstate_global->__pyx_n_s_exit
#define __pyx_n_s_expand_polytomies __pyx_mstate_global->__pyx_n_s_expand_polytomies
#define __pyx_kp_u_expand_polytomies_and_correct_by __pyx_mstate_global->__pyx_kp_u_expand_polytomies_and_correct_by
#define __pyx_kp_u_expand_polytomies_and_unrooted_t __pyx_mstate_global->__pyx_kp_u_expand_polytomies_and_unrooted_t
#define __pyx_n_s_expand_polytomies_locals_TipTupl __pyx_mstate_global->__pyx_n_s_expand_polytomies_locals_TipTupl
#define __pyx_n_s_expand_polytomies_locals_add_lea __pyx_mstate_global->__pyx_n_s_expand_polytomies_locals_add_lea
#define __pyx_n_s_expand_polytomies_locals_enum_un __pyx_mstate_global->__pyx_n_s_expand_polytomies_locals_enum_un
#define __pyx_n_s_explore __pyx_mstate_global->__pyx_n_s_explore
#define __pyx_n_s_explorer __pyx_mstate_global->__pyx_n_s_explorer
#define __pyx_n_s_extract_data_parser __pyx_mstate_global->__pyx_n_s_extract_data_parser
#define __pyx_n_s_face __pyx_mstate_global->__pyx_n_s_face
#define __pyx_kp_u_face_2 __pyx_mstate_global->__pyx_kp_u_face_2
#define __pyx_n_s_face_area __pyx_mstate_global->__pyx_n_s_face_area
#define __pyx_n_u_faces __pyx_mstate_global->__pyx_n_u_faces
#define __pyx_n_s_farthest_dist __pyx_mstate_global->__pyx_n_s_farthest_dist
#define __pyx_n_s_farthest_node __pyx_mstate_global->__pyx_n_s_farthest_node
#define __pyx_n_s_fdist __pyx_mstate_global->__pyx_n_s_fdist
#define __pyx_n_s_file_name __pyx_mstate_global->__pyx_n_s_file_name
#define __pyx_n_s_fnode __pyx_mstate_global->__pyx_n_s_fnode
#define __pyx_n_s_format_root_node __pyx_mstate_global->__pyx_n_s_format_root_node
#define __pyx_n_s_fp __pyx_mstate_global->__pyx_n_s_fp
#define __pyx_n_s_from_common __pyx_mstate_global->__pyx_n_s_from_common
#define __pyx_n_s_from_parent_child_table __pyx_mstate_global->__pyx_n_s_from_parent_child_table
#define __pyx_n_s_from_parent_child_table_locals_g __pyx_mstate_global->__pyx_n_s_from_parent_child_table_locals_g
#define __pyx_n_s_from_skbio __pyx_mstate_global->__pyx_n_s_from_skbio
#define __pyx_n_s_from_skbio_locals_get_ete_node __pyx_mstate_global->__pyx_n_s_from_skbio_locals_get_ete_node
#define __pyx_n_s_functools __pyx_mstate_global->__pyx_n_s_functools
#define __pyx_kp_u_gc __pyx_mstate_global->__pyx_kp_u_gc
#define __pyx_n_s_genexpr __pyx_mstate_global->__pyx_n_s_genexpr
#define __pyx_n_s_get __pyx_mstate_global->__pyx_n_s_get
#define __pyx_n_s_get_cached_content __pyx_mstate_global->__pyx_n_s_get_cached_content
#define __pyx_n_s_get_cached_content_locals_get_co __pyx_mstate_global->__pyx_n_s_get_cached_content_locals_get_co
#define __pyx_n_s_get_children __pyx_mstate_global->__pyx_n_s_get_children
#define __pyx_n_s_get_closest_leaf __pyx_mstate_global->__pyx_n_s_get_closest_leaf
#define __pyx_n_s_get_content __pyx_mstate_global->__pyx_n_s_get_content
#define __pyx_n_s_get_distance __pyx_mstate_global->__pyx_n_s_get_distance
#define __pyx_n_s_get_distance_fn __pyx_mstate_global->__pyx_n_s_get_distance_fn
#define __pyx_n_s_get_distance_locals_genexpr __pyx_mstate_global->__pyx_n_s_get_distance_locals_genexpr
#define __pyx_n_s_get_ete_node __pyx_mstate_global->__pyx_n_s_get_ete_node
#define __pyx_n_s_get_farthest_and_closest_leaves __pyx_mstate_global->__pyx_n_s_get_farthest_and_closest_leaves
#define __pyx_n_s_get_farthest_and_closest_leaves_2 __pyx_mstate_global->__pyx_n_s_get_farthest_and_closest_leaves_2
#define __pyx_n_s_get_farthest_leaf __pyx_mstate_global->__pyx_n_s_get_farthest_leaf
#define __pyx_n_s_get_farthest_node __pyx_mstate_global->__pyx_n_s_get_farthest_node
#define __pyx_n_s_get_farthest_node_locals_lambda __pyx_mstate_global->__pyx_n_s_get_farthest_node_locals_lambda
#define __pyx_n_s_get_img __pyx_mstate_global->__pyx_n_s_get_img
#define __pyx_n_s_get_midpoint_outgroup __pyx_mstate_global->__pyx_n_s_get_midpoint_outgroup
#define __pyx_n_s_get_monophyletic __pyx_mstate_global->__pyx_n_s_get_monophyletic
#define __pyx_n_s_get_monophyletic_locals_lambda __pyx_mstate_global->__pyx_n_s_get_monophyletic_locals_lambda
#define __pyx_n_s_get_node __pyx_mstate_global->__pyx_n_s_get_node
#define __pyx_n_s_get_prop __pyx_mstate_global->__pyx_n_s_get_prop
#define __pyx_n_s_get_sisters __pyx_mstate_global->__pyx_n_s_get_sisters
#define __pyx_n_s_get_speciation_trees __pyx_mstate_global->__pyx_n_s_get_speciation_trees
#define __pyx_n_s_get_topology_id __pyx_mstate_global->__pyx_n_s_get_topology_id
#define __pyx_n_s_get_topology_id_locals_genexpr __pyx_mstate_global->__pyx_n_s_get_topology_id_locals_genexpr
#define __pyx_n_s_getitem___locals_genexpr __pyx_mstate_global->__pyx_n_s_getitem___locals_genexpr
#define __pyx_n_s_getstate __pyx_mstate_global->__pyx_n_s_getstate
#define __pyx_n_s_h __pyx_mstate_global->__pyx_n_s_h
#define __pyx_n_s_has_duplications __pyx_mstate_global->__pyx_n_s_has_duplications
#define __pyx_n_s_has_prop __pyx_mstate_global->__pyx_n_s_has_prop
#define __pyx_n_s_hash __pyx_mstate_global->__pyx_n_s_hash
#define __pyx_n_s_hashlib __pyx_mstate_global->__pyx_n_s_hashlib
#define __pyx_kp_u_headless __pyx_mstate_global->__pyx_kp_u_headless
#define __pyx_n_s_hex __pyx_mstate_global->__pyx_n_s_hex
#define __pyx_n_s_hexdigest __pyx_mstate_global->__pyx_n_s_hexdigest
#define __pyx_n_s_host __pyx_mstate_global->__pyx_n_s_host
#define __pyx_kp_u_http __pyx_mstate_global->__pyx_kp_u_http
#define __pyx_n_s_i __pyx_mstate_global->__pyx_n_s_i
#define __pyx_n_s_id __pyx_mstate_global->__pyx_n_s_id
#define __pyx_n_u_id __pyx_mstate_global->__pyx_n_u_id
#define __pyx_n_u_img_style __pyx_mstate_global->__pyx_n_u_img_style
#define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import
#define __pyx_n_s_include_root __pyx_mstate_global->__pyx_n_s_include_root
#define __pyx_n_s_include_self __pyx_mstate_global->__pyx_n_s_include_self
#define __pyx_n_s_indent __pyx_mstate_global->__pyx_n_s_indent
#define __pyx_n_u_indent __pyx_mstate_global->__pyx_n_u_indent
#define __pyx_n_s_index __pyx_mstate_global->__pyx_n_s_index
#define __pyx_n_s_inf __pyx_mstate_global->__pyx_n_s_inf
#define __pyx_kp_u_init_from_dict_data_should_not_u __pyx_mstate_global->__pyx_kp_u_init_from_dict_data_should_not_u
#define __pyx_kp_u_init_from_empty_data_should_not __pyx_mstate_global->__pyx_kp_u_init_from_empty_data_should_not
#define __pyx_kp_u_init_from_parsed_content_cannot __pyx_mstate_global->__pyx_kp_u_init_from_parsed_content_cannot
#define __pyx_n_s_init_subclass __pyx_mstate_global->__pyx_n_s_init_subclass
#define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing
#define __pyx_kp_u_inline __pyx_mstate_global->__pyx_kp_u_inline
#define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine
#define __pyx_n_s_is_leaf __pyx_mstate_global->__pyx_n_s_is_leaf
#define __pyx_n_s_is_leaf_fn __pyx_mstate_global->__pyx_n_s_is_leaf_fn
#define __pyx_n_s_is_monophyletic __pyx_mstate_global->__pyx_n_s_is_monophyletic
#define __pyx_n_s_is_monophyletic_locals_genexpr __pyx_mstate_global->__pyx_n_s_is_monophyletic_locals_genexpr
#define __pyx_kp_u_is_not_a_Face_instance __pyx_mstate_global->__pyx_kp_u_is_not_a_Face_instance
#define __pyx_n_s_is_root __pyx_mstate_global->__pyx_n_s_is_root
#define __pyx_kp_u_isenabled __pyx_mstate_global->__pyx_kp_u_isenabled
#define __pyx_n_s_issubset __pyx_mstate_global->__pyx_n_s_issubset
#define __pyx_n_s_items __pyx_mstate_global->__pyx_n_s_items
#define __pyx_n_s_iter __pyx_mstate_global->__pyx_n_s_iter
#define __pyx_n_s_iter_prepostorder __pyx_mstate_global->__pyx_n_s_iter_prepostorder
#define __pyx_n_s_itertools __pyx_mstate_global->__pyx_n_s_itertools
#define __pyx_n_s_join __pyx_mstate_global->__pyx_n_s_join
#define __pyx_n_s_k1 __pyx_mstate_global->__pyx_n_s_k1
#define __pyx_n_s_k2 __pyx_mstate_global->__pyx_n_s_k2
#define __pyx_n_s_keep_server __pyx_mstate_global->__pyx_n_s_keep_server
#define __pyx_n_s_key __pyx_mstate_global->__pyx_n_s_key
#define __pyx_n_s_keys __pyx_mstate_global->__pyx_n_s_keys
#define __pyx_n_s_kwargs __pyx_mstate_global->__pyx_n_s_kwargs
#define __pyx_n_s_label __pyx_mstate_global->__pyx_n_s_label
#define __pyx_n_s_labels __pyx_mstate_global->__pyx_n_s_labels
#define __pyx_n_s_ladderize __pyx_mstate_global->__pyx_n_s_ladderize
#define __pyx_n_s_layout __pyx_mstate_global->__pyx_n_s_layout
#define __pyx_n_s_layouts __pyx_mstate_global->__pyx_n_s_layouts
#define __pyx_n_s_leaf __pyx_mstate_global->__pyx_n_s_leaf
#define __pyx_n_s_leaf1 __pyx_mstate_global->__pyx_n_s_leaf1
#define __pyx_n_s_leaf2 __pyx_mstate_global->__pyx_n_s_leaf2
#define __pyx_n_s_leaf_distances __pyx_mstate_global->__pyx_n_s_leaf_distances
#define __pyx_n_s_leaf_names __pyx_mstate_global->__pyx_n_s_leaf_names
#define __pyx_n_s_leaf_values __pyx_mstate_global->__pyx_n_s_leaf_values
#define __pyx_n_s_leaves __pyx_mstate_global->__pyx_n_s_leaves
#define __pyx_n_s_leaves_descendant __pyx_mstate_global->__pyx_n_s_leaves_descendant
#define __pyx_n_s_leaves_extra __pyx_mstate_global->__pyx_n_s_leaves_extra
#define __pyx_n_s_leaves_from_ancestor __pyx_mstate_global->__pyx_n_s_leaves_from_ancestor
#define __pyx_n_s_leaves_locals_lambda __pyx_mstate_global->__pyx_n_s_leaves_locals_lambda
#define __pyx_n_s_leaves_only __pyx_mstate_global->__pyx_n_s_leaves_only
#define __pyx_n_s_left __pyx_mstate_global->__pyx_n_s_left
#define __pyx_n_s_len___locals_genexpr __pyx_mstate_global->__pyx_n_s_len___locals_genexpr
#define __pyx_n_u_length __pyx_mstate_global->__pyx_n_u_length
#define __pyx_n_u_levelorder __pyx_mstate_global->__pyx_n_u_levelorder
#define __pyx_n_s_lineage __pyx_mstate_global->__pyx_n_s_lineage
#define __pyx_n_s_loads __pyx_mstate_global->__pyx_n_s_loads
#define __pyx_n_s_lower __pyx_mstate_global->__pyx_n_s_lower
#define __pyx_n_s_m __pyx_mstate_global->__pyx_n_s_m
#define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main
#define __pyx_n_s_map_attributes __pyx_mstate_global->__pyx_n_s_map_attributes
#define __pyx_n_s_map_prop __pyx_mstate_global->__pyx_n_s_map_prop
#define __pyx_n_s_map_properties __pyx_mstate_global->__pyx_n_s_map_properties
#define __pyx_n_s_math __pyx_mstate_global->__pyx_n_s_math
#define __pyx_n_s_max __pyx_mstate_global->__pyx_n_s_max
#define __pyx_n_s_max_dist __pyx_mstate_global->__pyx_n_s_max_dist
#define __pyx_n_s_max_node __pyx_mstate_global->__pyx_n_s_max_node
#define __pyx_n_s_max_parts __pyx_mstate_global->__pyx_n_s_max_parts
#define __pyx_n_s_max_rf __pyx_mstate_global->__pyx_n_s_max_rf
#define __pyx_n_u_max_rf __pyx_mstate_global->__pyx_n_u_max_rf
#define __pyx_n_s_max_treeko_splits_to_be_artifact __pyx_mstate_global->__pyx_n_s_max_treeko_splits_to_be_artifact
#define __pyx_n_s_maxrf __pyx_mstate_global->__pyx_n_s_maxrf
#define __pyx_n_s_md5 __pyx_mstate_global->__pyx_n_s_md5
#define __pyx_n_s_mean __pyx_mstate_global->__pyx_n_s_mean
#define __pyx_n_s_mean_distance __pyx_mstate_global->__pyx_n_s_mean_distance
#define __pyx_n_s_metaclass __pyx_mstate_global->__pyx_n_s_metaclass
#define __pyx_n_s_method __pyx_mstate_global->__pyx_n_s_method
#define __pyx_kp_u_metrics_recording_only __pyx_mstate_global->__pyx_kp_u_metrics_recording_only
#define __pyx_n_s_min_comparison __pyx_mstate_global->__pyx_n_s_min_comparison
#define __pyx_n_s_min_dist __pyx_mstate_global->__pyx_n_s_min_dist
#define __pyx_n_s_min_node __pyx_mstate_global->__pyx_n_s_min_node
#define __pyx_n_s_min_support_ref __pyx_mstate_global->__pyx_n_s_min_support_ref
#define __pyx_n_s_min_support_source __pyx_mstate_global->__pyx_n_s_min_support_source
#define __pyx_n_s_min_support_t1 __pyx_mstate_global->__pyx_n_s_min_support_t1
#define __pyx_n_s_min_support_t2 __pyx_mstate_global->__pyx_n_s_min_support_t2
#define __pyx_n_s_model __pyx_mstate_global->__pyx_n_s_model
#define __pyx_n_s_module __pyx_mstate_global->__pyx_n_s_module
#define __pyx_n_u_monophyletic __pyx_mstate_global->__pyx_n_u_monophyletic
#define __pyx_n_s_movingnode __pyx_mstate_global->__pyx_n_s_movingnode
#define __pyx_n_s_mro_entries __pyx_mstate_global->__pyx_n_s_mro_entries
#define __pyx_kp_u_multiple_trees_use_nexus_load_in __pyx_mstate_global->__pyx_kp_u_multiple_trees_use_nexus_load_in
#define __pyx_n_s_n __pyx_mstate_global->__pyx_n_s_n
#define __pyx_n_s_n2count __pyx_mstate_global->__pyx_n_s_n2count
#define __pyx_n_s_n2depth __pyx_mstate_global->__pyx_n_s_n2depth
#define __pyx_n_s_n2subtrees __pyx_mstate_global->__pyx_n_s_n2subtrees
#define __pyx_n_s_n2values __pyx_mstate_global->__pyx_n_s_n2values
#define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name
#define __pyx_n_u_name __pyx_mstate_global->__pyx_n_u_name
#define __pyx_n_s_name2node __pyx_mstate_global->__pyx_n_s_name2node
#define __pyx_n_s_name_2 __pyx_mstate_global->__pyx_n_s_name_2
#define __pyx_n_s_names __pyx_mstate_global->__pyx_n_s_names
#define __pyx_n_s_ncommon __pyx_mstate_global->__pyx_n_s_ncommon
#define __pyx_n_s_ndups __pyx_mstate_global->__pyx_n_s_ndups
#define __pyx_n_s_new __pyx_mstate_global->__pyx_n_s_new
#define __pyx_n_s_new_node __pyx_mstate_global->__pyx_n_s_new_node
#define __pyx_n_s_new_tree __pyx_mstate_global->__pyx_n_s_new_tree
#define __pyx_n_s_newick __pyx_mstate_global->__pyx_n_s_newick
#define __pyx_n_u_newick __pyx_mstate_global->__pyx_n_u_newick
#define __pyx_kp_u_newick_extended __pyx_mstate_global->__pyx_kp_u_newick_extended
#define __pyx_n_s_newick_only __pyx_mstate_global->__pyx_n_s_newick_only
#define __pyx_n_s_nexus __pyx_mstate_global->__pyx_n_s_nexus
#define __pyx_n_u_nexus __pyx_mstate_global->__pyx_n_u_nexus
#define __pyx_n_s_node __pyx_mstate_global->__pyx_n_s_node
#define __pyx_n_s_node1 __pyx_mstate_global->__pyx_n_s_node1
#define __pyx_n_s_node2 __pyx_mstate_global->__pyx_n_s_node2
#define __pyx_n_s_node2path __pyx_mstate_global->__pyx_n_s_node2path
#define __pyx_n_s_node_leaves __pyx_mstate_global->__pyx_n_s_node_leaves
#define __pyx_n_s_nodename __pyx_mstate_global->__pyx_n_s_nodename
#define __pyx_n_s_nodes __pyx_mstate_global->__pyx_n_s_nodes
#define __pyx_n_s_nodes_by_name __pyx_mstate_global->__pyx_n_s_nodes_by_name
#define __pyx_n_u_norm_rf __pyx_mstate_global->__pyx_n_u_norm_rf
#define __pyx_kp_u_not_in __pyx_mstate_global->__pyx_kp_u_not_in
#define __pyx_n_s_ntrees __pyx_mstate_global->__pyx_n_s_ntrees
#define __pyx_n_s_nw __pyx_mstate_global->__pyx_n_s_nw
#define __pyx_n_s_open __pyx_mstate_global->__pyx_n_s_open
#define __pyx_n_s_open_browser __pyx_mstate_global->__pyx_n_s_open_browser
#define __pyx_n_s_operations __pyx_mstate_global->__pyx_n_s_operations
#define __pyx_n_s_ops __pyx_mstate_global->__pyx_n_s_ops
#define __pyx_n_s_options __pyx_mstate_global->__pyx_n_s_options
#define __pyx_n_s_order __pyx_mstate_global->__pyx_n_s_order
#define __pyx_n_s_orig_target_size __pyx_mstate_global->__pyx_n_s_orig_target_size
#define __pyx_n_s_origin_t __pyx_mstate_global->__pyx_n_s_origin_t
#define __pyx_n_s_origin_trees __pyx_mstate_global->__pyx_n_s_origin_trees
#define __pyx_n_s_outfile __pyx_mstate_global->__pyx_n_s_outfile
#define __pyx_n_s_output __pyx_mstate_global->__pyx_n_s_output
#define __pyx_n_s_p __pyx_mstate_global->__pyx_n_s_p
#define __pyx_n_u_paraphyletic __pyx_mstate_global->__pyx_n_u_paraphyletic
#define __pyx_n_s_parent __pyx_mstate_global->__pyx_n_s_parent
#define __pyx_n_s_parent_child_table __pyx_mstate_global->__pyx_n_s_parent_child_table
#define __pyx_n_s_parent_name __pyx_mstate_global->__pyx_n_s_parent_name
#define __pyx_n_s_parser __pyx_mstate_global->__pyx_n_s_parser
#define __pyx_n_s_parser_extract __pyx_mstate_global->__pyx_n_s_parser_extract
#define __pyx_n_s_path __pyx_mstate_global->__pyx_n_s_path
#define __pyx_n_s_paths __pyx_mstate_global->__pyx_n_s_paths
#define __pyx_n_s_pickle __pyx_mstate_global->__pyx_n_s_pickle
#define __pyx_n_u_polyphyletic __pyx_mstate_global->__pyx_n_u_polyphyletic
#define __pyx_n_s_polytomy_correction __pyx_mstate_global->__pyx_n_s_polytomy_correction
#define __pyx_n_s_polytomy_size_limit __pyx_mstate_global->__pyx_n_s_polytomy_size_limit
#define __pyx_n_s_pop __pyx_mstate_global->__pyx_n_s_pop
#define __pyx_n_s_pop_child __pyx_mstate_global->__pyx_n_s_pop_child
#define __pyx_n_s_popitem __pyx_mstate_global->__pyx_n_s_popitem
#define __pyx_n_s_populate __pyx_mstate_global->__pyx_n_s_populate
#define __pyx_n_s_port __pyx_mstate_global->__pyx_n_s_port
#define __pyx_n_s_position __pyx_mstate_global->__pyx_n_s_position
#define __pyx_kp_u_position_2 __pyx_mstate_global->__pyx_kp_u_position_2
#define __pyx_n_s_post __pyx_mstate_global->__pyx_n_s_post
#define __pyx_n_u_postorder __pyx_mstate_global->__pyx_n_u_postorder
#define __pyx_n_s_preorder __pyx_mstate_global->__pyx_n_s_preorder
#define __pyx_n_u_preorder __pyx_mstate_global->__pyx_n_u_preorder
#define __pyx_n_s_prepare __pyx_mstate_global->__pyx_n_s_prepare
#define __pyx_n_s_preserve_branch_length __pyx_mstate_global->__pyx_n_s_preserve_branch_length
#define __pyx_n_s_prev __pyx_mstate_global->__pyx_n_s_prev
#define __pyx_n_s_prevent_nondicotomic __pyx_mstate_global->__pyx_n_s_prevent_nondicotomic
#define __pyx_n_s_print __pyx_mstate_global->__pyx_n_s_print
#define __pyx_n_s_product __pyx_mstate_global->__pyx_n_s_product
#define __pyx_n_s_prop __pyx_mstate_global->__pyx_n_s_prop
#define __pyx_n_s_prop1 __pyx_mstate_global->__pyx_n_s_prop1
#define __pyx_n_s_prop2 __pyx_mstate_global->__pyx_n_s_prop2
#define __pyx_n_s_prop_t1 __pyx_mstate_global->__pyx_n_s_prop_t1
#define __pyx_n_s_prop_t2 __pyx_mstate_global->__pyx_n_s_prop_t2
#define __pyx_n_s_props __pyx_mstate_global->__pyx_n_s_props
#define __pyx_n_s_prune __pyx_mstate_global->__pyx_n_s_prune
#define __pyx_n_s_prune_locals_cmp_nodes __pyx_mstate_global->__pyx_n_s_prune_locals_cmp_nodes
#define __pyx_n_s_px __pyx_mstate_global->__pyx_n_s_px
#define __pyx_n_u_px __pyx_mstate_global->__pyx_n_u_px
#define __pyx_n_s_px0 __pyx_mstate_global->__pyx_n_s_px0
#define __pyx_n_s_py __pyx_mstate_global->__pyx_n_s_py
#define __pyx_n_s_pyx_PickleError __pyx_mstate_global->__pyx_n_s_pyx_PickleError
#define __pyx_n_s_pyx_checksum __pyx_mstate_global->__pyx_n_s_pyx_checksum
#define __pyx_n_s_pyx_result __pyx_mstate_global->__pyx_n_s_pyx_result
#define __pyx_n_s_pyx_state __pyx_mstate_global->__pyx_n_s_pyx_state
#define __pyx_n_s_pyx_type __pyx_mstate_global->__pyx_n_s_pyx_type
#define __pyx_n_s_pyx_unpickle_Tree __pyx_mstate_global->__pyx_n_s_pyx_unpickle_Tree
#define __pyx_n_s_qualname __pyx_mstate_global->__pyx_n_s_qualname
#define __pyx_n_s_quit __pyx_mstate_global->__pyx_n_s_quit
#define __pyx_n_s_range __pyx_mstate_global->__pyx_n_s_range
#define __pyx_n_u_raw __pyx_mstate_global->__pyx_n_u_raw
#define __pyx_n_s_reduce __pyx_mstate_global->__pyx_n_s_reduce
#define __pyx_n_s_reduce_cython __pyx_mstate_global->__pyx_n_s_reduce_cython
#define __pyx_n_s_reduce_ex __pyx_mstate_global->__pyx_n_s_reduce_ex
#define __pyx_n_s_ref_disc __pyx_mstate_global->__pyx_n_s_ref_disc
#define __pyx_n_u_ref_edges __pyx_mstate_global->__pyx_n_u_ref_edges
#define __pyx_n_u_ref_edges_in_source __pyx_mstate_global->__pyx_n_u_ref_edges_in_source
#define __pyx_n_s_ref_found __pyx_mstate_global->__pyx_n_s_ref_found
#define __pyx_n_s_ref_found_in_src __pyx_mstate_global->__pyx_n_s_ref_found_in_src
#define __pyx_n_s_ref_p __pyx_mstate_global->__pyx_n_s_ref_p
#define __pyx_n_s_ref_tree __pyx_mstate_global->__pyx_n_s_ref_tree
#define __pyx_n_s_ref_tree_attr __pyx_mstate_global->__pyx_n_s_ref_tree_attr
#define __pyx_n_s_remove __pyx_mstate_global->__pyx_n_s_remove
#define __pyx_n_s_remove_child __pyx_mstate_global->__pyx_n_s_remove_child
#define __pyx_n_s_remove_child_locals_genexpr __pyx_mstate_global->__pyx_n_s_remove_child_locals_genexpr
#define __pyx_n_s_remove_children __pyx_mstate_global->__pyx_n_s_remove_children
#define __pyx_n_s_remove_sister __pyx_mstate_global->__pyx_n_s_remove_sister
#define __pyx_n_s_remove_tree __pyx_mstate_global->__pyx_n_s_remove_tree
#define __pyx_n_s_render __pyx_mstate_global->__pyx_n_s_render
#define __pyx_n_s_render_sm __pyx_mstate_global->__pyx_n_s_render_sm
#define __pyx_n_s_render_tree __pyx_mstate_global->__pyx_n_s_render_tree
#define __pyx_n_s_resolve_polytomy __pyx_mstate_global->__pyx_n_s_resolve_polytomy
#define __pyx_n_s_result __pyx_mstate_global->__pyx_n_s_result
#define __pyx_kp_u_return __pyx_mstate_global->__pyx_kp_u_return
#define __pyx_n_s_return_format __pyx_mstate_global->__pyx_n_s_return_format
#define __pyx_n_s_reverse __pyx_mstate_global->__pyx_n_s_reverse
#define __pyx_n_s_reverse_children __pyx_mstate_global->__pyx_n_s_reverse_children
#define __pyx_n_s_rf __pyx_mstate_global->__pyx_n_s_rf
#define __pyx_n_u_rf __pyx_mstate_global->__pyx_n_u_rf
#define __pyx_n_s_rf_max __pyx_mstate_global->__pyx_n_s_rf_max
#define __pyx_n_s_right __pyx_mstate_global->__pyx_n_s_right
#define __pyx_n_s_robinson_foulds __pyx_mstate_global->__pyx_n_s_robinson_foulds
#define __pyx_n_s_robinson_foulds_locals_from_comm __pyx_mstate_global->__pyx_n_s_robinson_foulds_locals_from_comm
#define __pyx_n_s_robinson_foulds_locals_genexpr __pyx_mstate_global->__pyx_n_s_robinson_foulds_locals_genexpr
#define __pyx_n_s_robinson_foulds_locals_has_prop __pyx_mstate_global->__pyx_n_s_robinson_foulds_locals_has_prop
#define __pyx_n_s_root __pyx_mstate_global->__pyx_n_s_root
#define __pyx_n_s_rooting __pyx_mstate_global->__pyx_n_s_rooting
#define __pyx_kp_u_s __pyx_mstate_global->__pyx_kp_u_s
#define __pyx_n_s_s1 __pyx_mstate_global->__pyx_n_s_s1
#define __pyx_n_s_s2 __pyx_mstate_global->__pyx_n_s_s2
#define __pyx_n_s_safe_div __pyx_mstate_global->__pyx_n_s_safe_div
#define __pyx_n_s_save_screenshot __pyx_mstate_global->__pyx_n_s_save_screenshot
#define __pyx_n_s_search_ancestors __pyx_mstate_global->__pyx_n_s_search_ancestors
#define __pyx_n_s_search_ancestors_locals_genexpr __pyx_mstate_global->__pyx_n_s_search_ancestors_locals_genexpr
#define __pyx_n_s_search_descendants __pyx_mstate_global->__pyx_n_s_search_descendants
#define __pyx_n_s_search_leaves_by_name __pyx_mstate_global->__pyx_n_s_search_leaves_by_name
#define __pyx_n_s_search_nodes __pyx_mstate_global->__pyx_n_s_search_nodes
#define __pyx_n_s_search_nodes_locals_genexpr __pyx_mstate_global->__pyx_n_s_search_nodes_locals_genexpr
#define __pyx_n_s_seed __pyx_mstate_global->__pyx_n_s_seed
#define __pyx_n_s_seen __pyx_mstate_global->__pyx_n_s_seen
#define __pyx_n_s_selenium __pyx_mstate_global->__pyx_n_s_selenium
#define __pyx_n_s_selenium_webdriver_chrome_option __pyx_mstate_global->__pyx_n_s_selenium_webdriver_chrome_option
#define __pyx_n_s_self __pyx_mstate_global->__pyx_n_s_self
#define __pyx_n_s_send __pyx_mstate_global->__pyx_n_s_send
#define __pyx_n_s_server __pyx_mstate_global->__pyx_n_s_server
#define __pyx_n_s_server_address __pyx_mstate_global->__pyx_n_s_server_address
#define __pyx_n_s_server_close __pyx_mstate_global->__pyx_n_s_server_close
#define __pyx_n_s_set_name __pyx_mstate_global->__pyx_n_s_set_name
#define __pyx_n_s_set_outgroup __pyx_mstate_global->__pyx_n_s_set_outgroup
#define __pyx_n_s_set_style __pyx_mstate_global->__pyx_n_s_set_style
#define __pyx_n_s_setdefault __pyx_mstate_global->__pyx_n_s_setdefault
#define __pyx_n_s_setstate __pyx_mstate_global->__pyx_n_s_setstate
#define __pyx_n_s_setstate_cython __pyx_mstate_global->__pyx_n_s_setstate_cython
#define __pyx_n_s_show __pyx_mstate_global->__pyx_n_s_show
#define __pyx_n_s_show_difftable __pyx_mstate_global->__pyx_n_s_show_difftable
#define __pyx_n_s_show_difftable_summary __pyx_mstate_global->__pyx_n_s_show_difftable_summary
#define __pyx_n_s_show_difftable_tab __pyx_mstate_global->__pyx_n_s_show_difftable_tab
#define __pyx_n_s_show_difftable_topo __pyx_mstate_global->__pyx_n_s_show_difftable_topo
#define __pyx_n_s_show_internal __pyx_mstate_global->__pyx_n_s_show_internal
#define __pyx_n_s_show_tree __pyx_mstate_global->__pyx_n_s_show_tree
#define __pyx_n_s_shutdown __pyx_mstate_global->__pyx_n_s_shutdown
#define __pyx_n_s_side1 __pyx_mstate_global->__pyx_n_s_side1
#define __pyx_n_s_side2 __pyx_mstate_global->__pyx_n_s_side2
#define __pyx_n_s_sister __pyx_mstate_global->__pyx_n_s_sister
#define __pyx_n_s_sisters __pyx_mstate_global->__pyx_n_s_sisters
#define __pyx_n_s_size __pyx_mstate_global->__pyx_n_s_size
#define __pyx_n_s_size1 __pyx_mstate_global->__pyx_n_s_size1
#define __pyx_n_s_size2 __pyx_mstate_global->__pyx_n_s_size2
#define __pyx_n_s_skbio __pyx_mstate_global->__pyx_n_s_skbio
#define __pyx_n_s_skbioTreeNode __pyx_mstate_global->__pyx_n_s_skbioTreeNode
#define __pyx_n_s_skbio_node __pyx_mstate_global->__pyx_n_s_skbio_node
#define __pyx_n_s_skbio_tree __pyx_mstate_global->__pyx_n_s_skbio_tree
#define __pyx_n_s_skip_large_polytomies __pyx_mstate_global->__pyx_n_s_skip_large_polytomies
#define __pyx_n_s_sleep __pyx_mstate_global->__pyx_n_s_sleep
#define __pyx_n_s_smallest __pyx_mstate_global->__pyx_n_s_smallest
#define __pyx_n_s_smartview __pyx_mstate_global->__pyx_n_s_smartview
#define __pyx_n_s_sort __pyx_mstate_global->__pyx_n_s_sort
#define __pyx_n_s_sort_descendants __pyx_mstate_global->__pyx_n_s_sort_descendants
#define __pyx_n_s_sort_descendants_locals_lambda __pyx_mstate_global->__pyx_n_s_sort_descendants_locals_lambda
#define __pyx_n_s_sorted __pyx_mstate_global->__pyx_n_s_sorted
#define __pyx_n_s_sorted_nodes __pyx_mstate_global->__pyx_n_s_sorted_nodes
#define __pyx_n_u_source_edges __pyx_mstate_global->__pyx_n_u_source_edges
#define __pyx_n_u_source_edges_in_ref __pyx_mstate_global->__pyx_n_u_source_edges_in_ref
#define __pyx_n_u_source_subtrees __pyx_mstate_global->__pyx_n_u_source_subtrees
#define __pyx_n_s_source_tree __pyx_mstate_global->__pyx_n_s_source_tree
#define __pyx_n_s_source_tree_attr __pyx_mstate_global->__pyx_n_s_source_tree_attr
#define __pyx_n_s_sp_naming_function __pyx_mstate_global->__pyx_n_s_sp_naming_function
#define __pyx_n_s_sp_trees __pyx_mstate_global->__pyx_n_s_sp_trees
#define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec
#define __pyx_n_u_speciesFunction __pyx_mstate_global->__pyx_n_u_speciesFunction
#define __pyx_n_s_src_disc __pyx_mstate_global->__pyx_n_s_src_disc
#define __pyx_n_s_src_found __pyx_mstate_global->__pyx_n_s_src_found
#define __pyx_n_s_src_found_in_ref __pyx_mstate_global->__pyx_n_s_src_found_in_ref
#define __pyx_n_s_src_p __pyx_mstate_global->__pyx_n_s_src_p
#define __pyx_n_s_src_tree __pyx_mstate_global->__pyx_n_s_src_tree
#define __pyx_n_s_standardize __pyx_mstate_global->__pyx_n_s_standardize
#define __pyx_n_s_start __pyx_mstate_global->__pyx_n_s_start
#define __pyx_n_s_start_server __pyx_mstate_global->__pyx_n_s_start_server
#define __pyx_n_s_startswith __pyx_mstate_global->__pyx_n_s_startswith
#define __pyx_n_s_state __pyx_mstate_global->__pyx_n_s_state
#define __pyx_kp_u_static_gui_html_tree __pyx_mstate_global->__pyx_kp_u_static_gui_html_tree
#define __pyx_n_s_staticmethod __pyx_mstate_global->__pyx_n_s_staticmethod
#define __pyx_n_s_strategy __pyx_mstate_global->__pyx_n_s_strategy
#define __pyx_kp_s_stringsource __pyx_mstate_global->__pyx_kp_s_stringsource
#define __pyx_n_s_subtree __pyx_mstate_global->__pyx_n_s_subtree
#define __pyx_n_s_subtree_content __pyx_mstate_global->__pyx_n_s_subtree_content
#define __pyx_n_s_subtree_nw __pyx_mstate_global->__pyx_n_s_subtree_nw
#define __pyx_n_s_subtrees __pyx_mstate_global->__pyx_n_s_subtrees
#define __pyx_n_s_sum __pyx_mstate_global->__pyx_n_s_sum
#define __pyx_n_s_super __pyx_mstate_global->__pyx_n_s_super
#define __pyx_n_s_support __pyx_mstate_global->__pyx_n_s_support
#define __pyx_n_u_support __pyx_mstate_global->__pyx_n_u_support
#define __pyx_n_s_support_fn __pyx_mstate_global->__pyx_n_s_support_fn
#define __pyx_n_s_support_t1 __pyx_mstate_global->__pyx_n_s_support_t1
#define __pyx_n_s_support_t2 __pyx_mstate_global->__pyx_n_s_support_t2
#define __pyx_n_s_swap_children __pyx_mstate_global->__pyx_n_s_swap_children
#define __pyx_n_s_t1 __pyx_mstate_global->__pyx_n_s_t1
#define __pyx_n_s_t1_leaves __pyx_mstate_global->__pyx_n_s_t1_leaves
#define __pyx_n_s_t1_leaves_all __pyx_mstate_global->__pyx_n_s_t1_leaves_all
#define __pyx_n_s_t2 __pyx_mstate_global->__pyx_n_s_t2
#define __pyx_n_s_t2_leaves __pyx_mstate_global->__pyx_n_s_t2_leaves
#define __pyx_n_s_t2_leaves_all __pyx_mstate_global->__pyx_n_s_t2_leaves_all
#define __pyx_n_u_table __pyx_mstate_global->__pyx_n_u_table
#define __pyx_n_s_target_t __pyx_mstate_global->__pyx_n_s_target_t
#define __pyx_n_s_target_trees __pyx_mstate_global->__pyx_n_s_target_trees
#define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test
#define __pyx_n_s_text_viz __pyx_mstate_global->__pyx_n_s_text_viz
#define __pyx_n_s_thread __pyx_mstate_global->__pyx_n_s_thread
#define __pyx_n_s_throw __pyx_mstate_global->__pyx_n_s_throw
#define __pyx_n_s_time __pyx_mstate_global->__pyx_n_s_time
#define __pyx_n_s_to_keep __pyx_mstate_global->__pyx_n_s_to_keep
#define __pyx_n_s_to_str __pyx_mstate_global->__pyx_n_s_to_str
#define __pyx_n_s_to_ultrametric __pyx_mstate_global->__pyx_n_s_to_ultrametric
#define __pyx_n_s_tools __pyx_mstate_global->__pyx_n_s_tools
#define __pyx_n_s_topological __pyx_mstate_global->__pyx_n_s_topological
#define __pyx_n_u_topology __pyx_mstate_global->__pyx_n_u_topology
#define __pyx_n_s_total_d __pyx_mstate_global->__pyx_n_s_total_d
#define __pyx_n_s_total_rf __pyx_mstate_global->__pyx_n_s_total_rf
#define __pyx_n_s_total_valid_ref_edges __pyx_mstate_global->__pyx_n_s_total_valid_ref_edges
#define __pyx_n_s_translate_nodes __pyx_mstate_global->__pyx_n_s_translate_nodes
#define __pyx_n_s_traverse __pyx_mstate_global->__pyx_n_s_traverse
#define __pyx_n_s_traverse_bfs __pyx_mstate_global->__pyx_n_s_traverse_bfs
#define __pyx_n_s_tree __pyx_mstate_global->__pyx_n_s_tree
#define __pyx_n_s_tree_sizes __pyx_mstate_global->__pyx_n_s_tree_sizes
#define __pyx_n_s_tree_style __pyx_mstate_global->__pyx_n_s_tree_style
#define __pyx_n_s_treediff __pyx_mstate_global->__pyx_n_s_treediff
#define __pyx_n_s_treeko_d __pyx_mstate_global->__pyx_n_s_treeko_d
#define __pyx_n_u_treeko_dist __pyx_mstate_global->__pyx_n_u_treeko_dist
#define __pyx_n_s_treeview __pyx_mstate_global->__pyx_n_s_treeview
#define __pyx_n_s_treeview_main __pyx_mstate_global->__pyx_n_s_treeview_main
#define __pyx_n_s_uniquenodes __pyx_mstate_global->__pyx_n_s_uniquenodes
#define __pyx_n_s_units __pyx_mstate_global->__pyx_n_s_units
#define __pyx_n_s_unroot __pyx_mstate_global->__pyx_n_s_unroot
#define __pyx_n_s_unrooted __pyx_mstate_global->__pyx_n_s_unrooted
#define __pyx_n_s_unrooted_trees __pyx_mstate_global->__pyx_n_s_unrooted_trees
#define __pyx_n_s_up __pyx_mstate_global->__pyx_n_s_up
#define __pyx_n_s_update __pyx_mstate_global->__pyx_n_s_update
#define __pyx_n_s_use_collateral __pyx_mstate_global->__pyx_n_s_use_collateral
#define __pyx_n_s_use_setstate __pyx_mstate_global->__pyx_n_s_use_setstate
#define __pyx_n_s_usecolor __pyx_mstate_global->__pyx_n_s_usecolor
#define __pyx_n_s_utils __pyx_mstate_global->__pyx_n_s_utils
#define __pyx_n_s_valid_ref_edges __pyx_mstate_global->__pyx_n_s_valid_ref_edges
#define __pyx_n_s_valid_src_edges __pyx_mstate_global->__pyx_n_s_valid_src_edges
#define __pyx_n_s_value __pyx_mstate_global->__pyx_n_s_value
#define __pyx_n_s_values __pyx_mstate_global->__pyx_n_s_values
#define __pyx_n_s_verbose __pyx_mstate_global->__pyx_n_s_verbose
#define __pyx_n_s_visited_node __pyx_mstate_global->__pyx_n_s_visited_node
#define __pyx_n_s_visitor_key __pyx_mstate_global->__pyx_n_s_visitor_key
#define __pyx_n_s_visitors __pyx_mstate_global->__pyx_n_s_visitors
#define __pyx_n_s_visitors2nodes __pyx_mstate_global->__pyx_n_s_visitors2nodes
#define __pyx_n_s_w __pyx_mstate_global->__pyx_n_s_w
#define __pyx_n_u_w __pyx_mstate_global->__pyx_n_u_w
#define __pyx_n_s_warn __pyx_mstate_global->__pyx_n_s_warn
#define __pyx_n_s_warnings __pyx_mstate_global->__pyx_n_s_warnings
#define __pyx_n_s_webdriver __pyx_mstate_global->__pyx_n_s_webdriver
#define __pyx_n_s_weight_fn __pyx_mstate_global->__pyx_n_s_weight_fn
#define __pyx_n_s_win_name __pyx_mstate_global->__pyx_n_s_win_name
#define __pyx_kp_u_window_size __pyx_mstate_global->__pyx_kp_u_window_size
#define __pyx_n_s_write __pyx_mstate_global->__pyx_n_s_write
#define __pyx_n_s_x __pyx_mstate_global->__pyx_n_s_x
#define __pyx_n_s_y __pyx_mstate_global->__pyx_n_s_y
#define __pyx_n_u_yule __pyx_mstate_global->__pyx_n_u_yule
#define __pyx_float_0_0 __pyx_mstate_global->__pyx_float_0_0
#define __pyx_float_1_0 __pyx_mstate_global->__pyx_float_1_0
#define __pyx_int_0 __pyx_mstate_global->__pyx_int_0
#define __pyx_int_1 __pyx_mstate_global->__pyx_int_1
#define __pyx_int_2 __pyx_mstate_global->__pyx_int_2
#define __pyx_int_5 __pyx_mstate_global->__pyx_int_5
#define __pyx_int_90 __pyx_mstate_global->__pyx_int_90
#define __pyx_int_1000 __pyx_mstate_global->__pyx_int_1000
#define __pyx_int_27868033 __pyx_mstate_global->__pyx_int_27868033
#define __pyx_int_43033374 __pyx_mstate_global->__pyx_int_43033374
#define __pyx_int_151323765 __pyx_mstate_global->__pyx_int_151323765
#define __pyx_int_neg_1 __pyx_mstate_global->__pyx_int_neg_1
#define __pyx_k__24 __pyx_mstate_global->__pyx_k__24
#define __pyx_slice_ __pyx_mstate_global->__pyx_slice_
#define __pyx_tuple__6 __pyx_mstate_global->__pyx_tuple__6
#define __pyx_slice__35 __pyx_mstate_global->__pyx_slice__35
#define __pyx_slice__38 __pyx_mstate_global->__pyx_slice__38
#define __pyx_tuple__16 __pyx_mstate_global->__pyx_tuple__16
#define __pyx_tuple__26 __pyx_mstate_global->__pyx_tuple__26
#define __pyx_tuple__28 __pyx_mstate_global->__pyx_tuple__28
#define __pyx_tuple__30 __pyx_mstate_global->__pyx_tuple__30
#define __pyx_tuple__31 __pyx_mstate_global->__pyx_tuple__31
#define __pyx_tuple__33 __pyx_mstate_global->__pyx_tuple__33
#define __pyx_tuple__39 __pyx_mstate_global->__pyx_tuple__39
#define __pyx_tuple__41 __pyx_mstate_global->__pyx_tuple__41
#define __pyx_tuple__43 __pyx_mstate_global->__pyx_tuple__43
#define __pyx_tuple__45 __pyx_mstate_global->__pyx_tuple__45
#define __pyx_tuple__46 __pyx_mstate_global->__pyx_tuple__46
#define __pyx_tuple__48 __pyx_mstate_global->__pyx_tuple__48
#define __pyx_tuple__49 __pyx_mstate_global->__pyx_tuple__49
#define __pyx_tuple__51 __pyx_mstate_global->__pyx_tuple__51
#define __pyx_tuple__53 __pyx_mstate_global->__pyx_tuple__53
#define __pyx_tuple__54 __pyx_mstate_global->__pyx_tuple__54
#define __pyx_tuple__56 __pyx_mstate_global->__pyx_tuple__56
#define __pyx_tuple__58 __pyx_mstate_global->__pyx_tuple__58
#define __pyx_tuple__60 __pyx_mstate_global->__pyx_tuple__60
#define __pyx_tuple__62 __pyx_mstate_global->__pyx_tuple__62
#define __pyx_tuple__63 __pyx_mstate_global->__pyx_tuple__63
#define __pyx_tuple__65 __pyx_mstate_global->__pyx_tuple__65
#define __pyx_tuple__67 __pyx_mstate_global->__pyx_tuple__67
#define __pyx_tuple__68 __pyx_mstate_global->__pyx_tuple__68
#define __pyx_tuple__70 __pyx_mstate_global->__pyx_tuple__70
#define __pyx_tuple__72 __pyx_mstate_global->__pyx_tuple__72
#define __pyx_tuple__74 __pyx_mstate_global->__pyx_tuple__74
#define __pyx_tuple__76 __pyx_mstate_global->__pyx_tuple__76
#define __pyx_tuple__78 __pyx_mstate_global->__pyx_tuple__78
#define __pyx_tuple__79 __pyx_mstate_global->__pyx_tuple__79
#define __pyx_tuple__81 __pyx_mstate_global->__pyx_tuple__81
#define __pyx_tuple__83 __pyx_mstate_global->__pyx_tuple__83
#define __pyx_tuple__85 __pyx_mstate_global->__pyx_tuple__85
#define __pyx_tuple__88 __pyx_mstate_global->__pyx_tuple__88
#define __pyx_tuple__90 __pyx_mstate_global->__pyx_tuple__90
#define __pyx_tuple__91 __pyx_mstate_global->__pyx_tuple__91
#define __pyx_tuple__92 __pyx_mstate_global->__pyx_tuple__92
#define __pyx_tuple__93 __pyx_mstate_global->__pyx_tuple__93
#define __pyx_tuple__94 __pyx_mstate_global->__pyx_tuple__94
#define __pyx_tuple__95 __pyx_mstate_global->__pyx_tuple__95
#define __pyx_tuple__96 __pyx_mstate_global->__pyx_tuple__96
#define __pyx_tuple__97 __pyx_mstate_global->__pyx_tuple__97
#define __pyx_tuple__98 __pyx_mstate_global->__pyx_tuple__98
#define __pyx_tuple__99 __pyx_mstate_global->__pyx_tuple__99
#define __pyx_codeobj__7 __pyx_mstate_global->__pyx_codeobj__7
#define __pyx_codeobj__8 __pyx_mstate_global->__pyx_codeobj__8
#define __pyx_codeobj__9 __pyx_mstate_global->__pyx_codeobj__9
#define __pyx_tuple__101 __pyx_mstate_global->__pyx_tuple__101
#define __pyx_tuple__103 __pyx_mstate_global->__pyx_tuple__103
#define __pyx_tuple__105 __pyx_mstate_global->__pyx_tuple__105
#define __pyx_tuple__106 __pyx_mstate_global->__pyx_tuple__106
#define __pyx_tuple__108 __pyx_mstate_global->__pyx_tuple__108
#define __pyx_tuple__109 __pyx_mstate_global->__pyx_tuple__109
#define __pyx_tuple__111 __pyx_mstate_global->__pyx_tuple__111
#define __pyx_tuple__113 __pyx_mstate_global->__pyx_tuple__113
#define __pyx_tuple__115 __pyx_mstate_global->__pyx_tuple__115
#define __pyx_tuple__117 __pyx_mstate_global->__pyx_tuple__117
#define __pyx_tuple__118 __pyx_mstate_global->__pyx_tuple__118
#define __pyx_tuple__122 __pyx_mstate_global->__pyx_tuple__122
#define __pyx_tuple__124 __pyx_mstate_global->__pyx_tuple__124
#define __pyx_tuple__126 __pyx_mstate_global->__pyx_tuple__126
#define __pyx_tuple__127 __pyx_mstate_global->__pyx_tuple__127
#define __pyx_tuple__129 __pyx_mstate_global->__pyx_tuple__129
#define __pyx_tuple__130 __pyx_mstate_global->__pyx_tuple__130
#define __pyx_tuple__132 __pyx_mstate_global->__pyx_tuple__132
#define __pyx_tuple__133 __pyx_mstate_global->__pyx_tuple__133
#define __pyx_tuple__135 __pyx_mstate_global->__pyx_tuple__135
#define __pyx_tuple__137 __pyx_mstate_global->__pyx_tuple__137
#define __pyx_tuple__138 __pyx_mstate_global->__pyx_tuple__138
#define __pyx_tuple__140 __pyx_mstate_global->__pyx_tuple__140
#define __pyx_tuple__141 __pyx_mstate_global->__pyx_tuple__141
#define __pyx_tuple__143 __pyx_mstate_global->__pyx_tuple__143
#define __pyx_tuple__144 __pyx_mstate_global->__pyx_tuple__144
#define __pyx_tuple__146 __pyx_mstate_global->__pyx_tuple__146
#define __pyx_tuple__148 __pyx_mstate_global->__pyx_tuple__148
#define __pyx_tuple__149 __pyx_mstate_global->__pyx_tuple__149
#define __pyx_tuple__151 __pyx_mstate_global->__pyx_tuple__151
#define __pyx_tuple__152 __pyx_mstate_global->__pyx_tuple__152
#define __pyx_tuple__154 __pyx_mstate_global->__pyx_tuple__154
#define __pyx_tuple__155 __pyx_mstate_global->__pyx_tuple__155
#define __pyx_tuple__157 __pyx_mstate_global->__pyx_tuple__157
#define __pyx_tuple__159 __pyx_mstate_global->__pyx_tuple__159
#define __pyx_tuple__160 __pyx_mstate_global->__pyx_tuple__160
#define __pyx_tuple__162 __pyx_mstate_global->__pyx_tuple__162
#define __pyx_tuple__163 __pyx_mstate_global->__pyx_tuple__163
#define __pyx_tuple__165 __pyx_mstate_global->__pyx_tuple__165
#define __pyx_tuple__166 __pyx_mstate_global->__pyx_tuple__166
#define __pyx_tuple__167 __pyx_mstate_global->__pyx_tuple__167
#define __pyx_tuple__169 __pyx_mstate_global->__pyx_tuple__169
#define __pyx_tuple__170 __pyx_mstate_global->__pyx_tuple__170
#define __pyx_tuple__172 __pyx_mstate_global->__pyx_tuple__172
#define __pyx_tuple__174 __pyx_mstate_global->__pyx_tuple__174
#define __pyx_tuple__176 __pyx_mstate_global->__pyx_tuple__176
#define __pyx_tuple__178 __pyx_mstate_global->__pyx_tuple__178
#define __pyx_tuple__179 __pyx_mstate_global->__pyx_tuple__179
#define __pyx_tuple__180 __pyx_mstate_global->__pyx_tuple__180
#define __pyx_tuple__182 __pyx_mstate_global->__pyx_tuple__182
#define __pyx_tuple__183 __pyx_mstate_global->__pyx_tuple__183
#define __pyx_tuple__185 __pyx_mstate_global->__pyx_tuple__185
#define __pyx_tuple__186 __pyx_mstate_global->__pyx_tuple__186
#define __pyx_tuple__188 __pyx_mstate_global->__pyx_tuple__188
#define __pyx_tuple__190 __pyx_mstate_global->__pyx_tuple__190
#define __pyx_tuple__192 __pyx_mstate_global->__pyx_tuple__192
#define __pyx_tuple__194 __pyx_mstate_global->__pyx_tuple__194
#define __pyx_tuple__195 __pyx_mstate_global->__pyx_tuple__195
#define __pyx_tuple__197 __pyx_mstate_global->__pyx_tuple__197
#define __pyx_tuple__199 __pyx_mstate_global->__pyx_tuple__199
#define __pyx_tuple__201 __pyx_mstate_global->__pyx_tuple__201
#define __pyx_codeobj__10 __pyx_mstate_global->__pyx_codeobj__10
#define __pyx_codeobj__11 __pyx_mstate_global->__pyx_codeobj__11
#define __pyx_codeobj__12 __pyx_mstate_global->__pyx_codeobj__12
#define __pyx_codeobj__13 __pyx_mstate_global->__pyx_codeobj__13
#define __pyx_codeobj__14 __pyx_mstate_global->__pyx_codeobj__14
#define __pyx_codeobj__17 __pyx_mstate_global->__pyx_codeobj__17
#define __pyx_codeobj__18 __pyx_mstate_global->__pyx_codeobj__18
#define __pyx_codeobj__19 __pyx_mstate_global->__pyx_codeobj__19
#define __pyx_codeobj__25 __pyx_mstate_global->__pyx_codeobj__25
#define __pyx_codeobj__27 __pyx_mstate_global->__pyx_codeobj__27
#define __pyx_codeobj__29 __pyx_mstate_global->__pyx_codeobj__29
#define __pyx_codeobj__32 __pyx_mstate_global->__pyx_codeobj__32
#define __pyx_codeobj__34 __pyx_mstate_global->__pyx_codeobj__34
#define __pyx_codeobj__36 __pyx_mstate_global->__pyx_codeobj__36
#define __pyx_codeobj__37 __pyx_mstate_global->__pyx_codeobj__37
#define __pyx_codeobj__40 __pyx_mstate_global->__pyx_codeobj__40
#define __pyx_codeobj__42 __pyx_mstate_global->__pyx_codeobj__42
#define __pyx_codeobj__44 __pyx_mstate_global->__pyx_codeobj__44
#define __pyx_codeobj__47 __pyx_mstate_global->__pyx_codeobj__47
#define __pyx_codeobj__50 __pyx_mstate_global->__pyx_codeobj__50
#define __pyx_codeobj__52 __pyx_mstate_global->__pyx_codeobj__52
#define __pyx_codeobj__55 __pyx_mstate_global->__pyx_codeobj__55
#define __pyx_codeobj__57 __pyx_mstate_global->__pyx_codeobj__57
#define __pyx_codeobj__59 __pyx_mstate_global->__pyx_codeobj__59
#define __pyx_codeobj__61 __pyx_mstate_global->__pyx_codeobj__61
#define __pyx_codeobj__64 __pyx_mstate_global->__pyx_codeobj__64
#define __pyx_codeobj__66 __pyx_mstate_global->__pyx_codeobj__66
#define __pyx_codeobj__69 __pyx_mstate_global->__pyx_codeobj__69
#define __pyx_codeobj__71 __pyx_mstate_global->__pyx_codeobj__71
#define __pyx_codeobj__73 __pyx_mstate_global->__pyx_codeobj__73
#define __pyx_codeobj__75 __pyx_mstate_global->__pyx_codeobj__75
#define __pyx_codeobj__77 __pyx_mstate_global->__pyx_codeobj__77
#define __pyx_codeobj__80 __pyx_mstate_global->__pyx_codeobj__80
#define __pyx_codeobj__82 __pyx_mstate_global->__pyx_codeobj__82
#define __pyx_codeobj__84 __pyx_mstate_global->__pyx_codeobj__84
#define __pyx_codeobj__86 __pyx_mstate_global->__pyx_codeobj__86
#define __pyx_codeobj__87 __pyx_mstate_global->__pyx_codeobj__87
#define __pyx_codeobj__89 __pyx_mstate_global->__pyx_codeobj__89
#define __pyx_codeobj__100 __pyx_mstate_global->__pyx_codeobj__100
#define __pyx_codeobj__102 __pyx_mstate_global->__pyx_codeobj__102
#define __pyx_codeobj__104 __pyx_mstate_global->__pyx_codeobj__104
#define __pyx_codeobj__107 __pyx_mstate_global->__pyx_codeobj__107
#define __pyx_codeobj__110 __pyx_mstate_global->__pyx_codeobj__110
#define __pyx_codeobj__112 __pyx_mstate_global->__pyx_codeobj__112
#define __pyx_codeobj__114 __pyx_mstate_global->__pyx_codeobj__114
#define __pyx_codeobj__116 __pyx_mstate_global->__pyx_codeobj__116
#define __pyx_codeobj__119 __pyx_mstate_global->__pyx_codeobj__119
#define __pyx_codeobj__120 __pyx_mstate_global->__pyx_codeobj__120
#define __pyx_codeobj__123 __pyx_mstate_global->__pyx_codeobj__123
#define __pyx_codeobj__125 __pyx_mstate_global->__pyx_codeobj__125
#define __pyx_codeobj__128 __pyx_mstate_global->__pyx_codeobj__128
#define __pyx_codeobj__131 __pyx_mstate_global->__pyx_codeobj__131
#define __pyx_codeobj__134 __pyx_mstate_global->__pyx_codeobj__134
#define __pyx_codeobj__136 __pyx_mstate_global->__pyx_codeobj__136
#define __pyx_codeobj__139 __pyx_mstate_global->__pyx_codeobj__139
#define __pyx_codeobj__142 __pyx_mstate_global->__pyx_codeobj__142
#define __pyx_codeobj__145 __pyx_mstate_global->__pyx_codeobj__145
#define __pyx_codeobj__147 __pyx_mstate_global->__pyx_codeobj__147
#define __pyx_codeobj__150 __pyx_mstate_global->__pyx_codeobj__150
#define __pyx_codeobj__153 __pyx_mstate_global->__pyx_codeobj__153
#define __pyx_codeobj__156 __pyx_mstate_global->__pyx_codeobj__156
#define __pyx_codeobj__158 __pyx_mstate_global->__pyx_codeobj__158
#define __pyx_codeobj__161 __pyx_mstate_global->__pyx_codeobj__161
#define __pyx_codeobj__164 __pyx_mstate_global->__pyx_codeobj__164
#define __pyx_codeobj__168 __pyx_mstate_global->__pyx_codeobj__168
#define __pyx_codeobj__171 __pyx_mstate_global->__pyx_codeobj__171
#define __pyx_codeobj__173 __pyx_mstate_global->__pyx_codeobj__173
#define __pyx_codeobj__175 __pyx_mstate_global->__pyx_codeobj__175
#define __pyx_codeobj__177 __pyx_mstate_global->__pyx_codeobj__177
#define __pyx_codeobj__181 __pyx_mstate_global->__pyx_codeobj__181
#define __pyx_codeobj__184 __pyx_mstate_global->__pyx_codeobj__184
#define __pyx_codeobj__187 __pyx_mstate_global->__pyx_codeobj__187
#define __pyx_codeobj__189 __pyx_mstate_global->__pyx_codeobj__189
#define __pyx_codeobj__191 __pyx_mstate_global->__pyx_codeobj__191
#define __pyx_codeobj__193 __pyx_mstate_global->__pyx_codeobj__193
#define __pyx_codeobj__196 __pyx_mstate_global->__pyx_codeobj__196
#define __pyx_codeobj__198 __pyx_mstate_global->__pyx_codeobj__198
#define __pyx_codeobj__200 __pyx_mstate_global->__pyx_codeobj__200
#define __pyx_codeobj__202 __pyx_mstate_global->__pyx_codeobj__202
/* #### Code section: module_code ### */

/* "ete4/core/tree.pyx":41
 *     cdef public (double, double) size  # sum of lengths, number of leaves
 * 
 *     def __init__(self, data=None, children=None, parser=None):             # <<<<<<<<<<<<<<
 *         """
 *         :param data: A string or file object with the description of
 */

/* Python wrapper */
static int __pyx_pw_4ete4_4core_4tree_4Tree_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
PyDoc_STRVAR(__pyx_doc_4ete4_4core_4tree_4Tree___init__, "\n        :param data: A string or file object with the description of\n            the tree as a newick, or a dict with the contents of a\n            single node.\n        :param children: List of nodes to add as children of this one.\n        :param parser: A description of how to parse a newick to\n            create a tree. It can be a single number specifying the\n            format or a structure with a fine-grained description of\n            how to interpret nodes (see ``newick.pyx``).\n\n        Examples::\n\n          t1 = Tree()  # empty tree\n          t2 = Tree({'name': 'A'})\n          t3 = Tree('(A:1,(B:1,(C:1,D:1):0.5):0.5);')\n          t4 = Tree(open('/home/user/my-tree.nw'))\n        ");
#if CYTHON_UPDATE_DESCRIPTOR_DOC
struct wrapperbase __pyx_wrapperbase_4ete4_4core_4tree_4Tree___init__;
#endif
static int __pyx_pw_4ete4_4core_4tree_4Tree_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_data = 0;
  PyObject *__pyx_v_children = 0;
  PyObject *__pyx_v_parser = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_children,&__pyx_n_s_parser,0};
    values[0] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)Py_None));
    values[1] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)Py_None));
    values[2] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data);
          if (value) { values[0] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 41, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_children);
          if (value) { values[1] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 41, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_parser);
          if (value) { values[2] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 41, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 41, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_data = values[0];
    __pyx_v_children = values[1];
    __pyx_v_parser = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 3, __pyx_nargs); __PYX_ERR(0, 41, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("ete4.core.tree.Tree.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree___init__(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self), __pyx_v_data, __pyx_v_children, __pyx_v_parser);

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

static int __pyx_pf_4ete4_4core_4tree_4Tree___init__(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_data, PyObject *__pyx_v_children, PyObject *__pyx_v_parser) {
  PyObject *__pyx_v_tree = NULL;
  PyObject *__pyx_v_trees = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __pyx_ctuple_double__and_double __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  unsigned int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *(*__pyx_t_9)(PyObject *);
  PyObject *__pyx_t_10 = NULL;
  Py_ssize_t __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);
  __Pyx_INCREF(__pyx_v_data);
  __Pyx_INCREF(__pyx_v_parser);

  /* "ete4/core/tree.pyx":59
 *           t4 = Tree(open('/home/user/my-tree.nw'))
 *         """
 *         self.up = None             # <<<<<<<<<<<<<<
 *         self.children = children or []
 * 
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->up);
  __Pyx_DECREF((PyObject *)__pyx_v_self->up);
  __pyx_v_self->up = ((struct __pyx_obj_4ete4_4core_4tree_Tree *)Py_None);

  /* "ete4/core/tree.pyx":60
 *         """
 *         self.up = None
 *         self.children = children or []             # <<<<<<<<<<<<<<
 * 
 *         self.size = (0, 0)
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_children); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 60, __pyx_L1_error)
  if (!__pyx_t_2) {
  } else {
    __Pyx_INCREF(__pyx_v_children);
    __pyx_t_1 = __pyx_v_children;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 60, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_1 = __pyx_t_3;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_L3_bool_binop_done:;
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_children, __pyx_t_1) < 0) __PYX_ERR(0, 60, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ete4/core/tree.pyx":62
 *         self.children = children or []
 * 
 *         self.size = (0, 0)             # <<<<<<<<<<<<<<
 * 
 *         # Initialize easy cases and return.
 */
  __pyx_t_4.f0 = 0.0;
  __pyx_t_4.f1 = 0.0;
  __pyx_v_self->size = __pyx_t_4;

  /* "ete4/core/tree.pyx":65
 * 
 *         # Initialize easy cases and return.
 *         if data is None:             # <<<<<<<<<<<<<<
 *             assert parser is None, 'init from empty data should not use parser'
 *             self.props = {}
 */
  __pyx_t_2 = (__pyx_v_data == Py_None);
  if (__pyx_t_2) {

    /* "ete4/core/tree.pyx":66
 *         # Initialize easy cases and return.
 *         if data is None:
 *             assert parser is None, 'init from empty data should not use parser'             # <<<<<<<<<<<<<<
 *             self.props = {}
 *             return
 */
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {
      __pyx_t_2 = (__pyx_v_parser == Py_None);
      if (unlikely(!__pyx_t_2)) {
        __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_kp_u_init_from_empty_data_should_not, 0, 0);
        __PYX_ERR(0, 66, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(0, 66, __pyx_L1_error)
    #endif

    /* "ete4/core/tree.pyx":67
 *         if data is None:
 *             assert parser is None, 'init from empty data should not use parser'
 *             self.props = {}             # <<<<<<<<<<<<<<
 *             return
 * 
 */
    __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 67, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __Pyx_GOTREF(__pyx_v_self->props);
    __Pyx_DECREF(__pyx_v_self->props);
    __pyx_v_self->props = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "ete4/core/tree.pyx":68
 *             assert parser is None, 'init from empty data should not use parser'
 *             self.props = {}
 *             return             # <<<<<<<<<<<<<<
 * 
 *         if type(data) is dict:
 */
    __pyx_r = 0;
    goto __pyx_L0;

    /* "ete4/core/tree.pyx":65
 * 
 *         # Initialize easy cases and return.
 *         if data is None:             # <<<<<<<<<<<<<<
 *             assert parser is None, 'init from empty data should not use parser'
 *             self.props = {}
 */
  }

  /* "ete4/core/tree.pyx":70
 *             return
 * 
 *         if type(data) is dict:             # <<<<<<<<<<<<<<
 *             assert parser is None, 'init from dict data should not use parser'
 *             self.props = data.copy()
 */
  __pyx_t_2 = (((PyObject *)Py_TYPE(__pyx_v_data)) == ((PyObject *)(&PyDict_Type)));
  if (__pyx_t_2) {

    /* "ete4/core/tree.pyx":71
 * 
 *         if type(data) is dict:
 *             assert parser is None, 'init from dict data should not use parser'             # <<<<<<<<<<<<<<
 *             self.props = data.copy()
 *             return
 */
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {
      __pyx_t_2 = (__pyx_v_parser == Py_None);
      if (unlikely(!__pyx_t_2)) {
        __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_kp_u_init_from_dict_data_should_not_u, 0, 0);
        __PYX_ERR(0, 71, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(0, 71, __pyx_L1_error)
    #endif

    /* "ete4/core/tree.pyx":72
 *         if type(data) is dict:
 *             assert parser is None, 'init from dict data should not use parser'
 *             self.props = data.copy()             # <<<<<<<<<<<<<<
 *             return
 * 
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 72, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 72, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("dict", __pyx_t_1))) __PYX_ERR(0, 72, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_1);
    __Pyx_GOTREF(__pyx_v_self->props);
    __Pyx_DECREF(__pyx_v_self->props);
    __pyx_v_self->props = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "ete4/core/tree.pyx":73
 *             assert parser is None, 'init from dict data should not use parser'
 *             self.props = data.copy()
 *             return             # <<<<<<<<<<<<<<
 * 
 *         # At this point we are going to parse data.
 */
    __pyx_r = 0;
    goto __pyx_L0;

    /* "ete4/core/tree.pyx":70
 *             return
 * 
 *         if type(data) is dict:             # <<<<<<<<<<<<<<
 *             assert parser is None, 'init from dict data should not use parser'
 *             self.props = data.copy()
 */
  }

  /* "ete4/core/tree.pyx":76
 * 
 *         # At this point we are going to parse data.
 *         assert not children, 'init from parsed content cannot have children'             # <<<<<<<<<<<<<<
 * 
 *         data, parser = extract_data_parser(data, parser)
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_children); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 76, __pyx_L1_error)
    __pyx_t_7 = (!__pyx_t_2);
    if (unlikely(!__pyx_t_7)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_kp_u_init_from_parsed_content_cannot, 0, 0);
      __PYX_ERR(0, 76, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 76, __pyx_L1_error)
  #endif

  /* "ete4/core/tree.pyx":78
 *         assert not children, 'init from parsed content cannot have children'
 * 
 *         data, parser = extract_data_parser(data, parser)             # <<<<<<<<<<<<<<
 * 
 *         # Initialize depending on what we are parsing.
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_extract_data_parser); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 78, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_v_data, __pyx_v_parser};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 78, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 78, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_5);
    #else
    __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 78, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 78, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_8 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 78, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_8);
    index = 0; __pyx_t_3 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_3)) goto __pyx_L7_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 1; __pyx_t_5 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_5)) goto __pyx_L7_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 78, __pyx_L1_error)
    __pyx_t_9 = NULL;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    goto __pyx_L8_unpacking_done;
    __pyx_L7_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_9 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 78, __pyx_L1_error)
    __pyx_L8_unpacking_done:;
  }
  __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_3);
  __pyx_t_3 = 0;
  __Pyx_DECREF_SET(__pyx_v_parser, __pyx_t_5);
  __pyx_t_5 = 0;

  /* "ete4/core/tree.pyx":81
 * 
 *         # Initialize depending on what we are parsing.
 *         if type(parser) is dict:             # <<<<<<<<<<<<<<
 *             tree = newick.loads(data, parser, self.__class__)
 *         elif parser == 'newick':
 */
  __pyx_t_7 = (((PyObject *)Py_TYPE(__pyx_v_parser)) == ((PyObject *)(&PyDict_Type)));
  if (__pyx_t_7) {

    /* "ete4/core/tree.pyx":82
 *         # Initialize depending on what we are parsing.
 *         if type(parser) is dict:
 *             tree = newick.loads(data, parser, self.__class__)             # <<<<<<<<<<<<<<
 *         elif parser == 'newick':
 *             tree = newick.loads(data, None, self.__class__)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_newick); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 82, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_loads); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 82, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 82, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_8 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[4] = {__pyx_t_8, __pyx_v_data, __pyx_v_parser, __pyx_t_5};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 3+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 82, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __pyx_v_tree = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "ete4/core/tree.pyx":81
 * 
 *         # Initialize depending on what we are parsing.
 *         if type(parser) is dict:             # <<<<<<<<<<<<<<
 *             tree = newick.loads(data, parser, self.__class__)
 *         elif parser == 'newick':
 */
    goto __pyx_L9;
  }

  /* "ete4/core/tree.pyx":83
 *         if type(parser) is dict:
 *             tree = newick.loads(data, parser, self.__class__)
 *         elif parser == 'newick':             # <<<<<<<<<<<<<<
 *             tree = newick.loads(data, None, self.__class__)
 *         elif parser in newick.PARSERS:
 */
  __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_parser, __pyx_n_u_newick, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 83, __pyx_L1_error)
  if (__pyx_t_7) {

    /* "ete4/core/tree.pyx":84
 *             tree = newick.loads(data, parser, self.__class__)
 *         elif parser == 'newick':
 *             tree = newick.loads(data, None, self.__class__)             # <<<<<<<<<<<<<<
 *         elif parser in newick.PARSERS:
 *             tree = newick.loads(data, newick.PARSERS[parser], self.__class__)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_newick); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 84, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_loads); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 84, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 84, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[4] = {__pyx_t_8, __pyx_v_data, Py_None, __pyx_t_3};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 3+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __pyx_v_tree = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "ete4/core/tree.pyx":83
 *         if type(parser) is dict:
 *             tree = newick.loads(data, parser, self.__class__)
 *         elif parser == 'newick':             # <<<<<<<<<<<<<<
 *             tree = newick.loads(data, None, self.__class__)
 *         elif parser in newick.PARSERS:
 */
    goto __pyx_L9;
  }

  /* "ete4/core/tree.pyx":85
 *         elif parser == 'newick':
 *             tree = newick.loads(data, None, self.__class__)
 *         elif parser in newick.PARSERS:             # <<<<<<<<<<<<<<
 *             tree = newick.loads(data, newick.PARSERS[parser], self.__class__)
 *         elif parser == 'ete':
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_newick); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 85, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_PARSERS); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 85, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_7 = (__Pyx_PySequence_ContainsTF(__pyx_v_parser, __pyx_t_5, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 85, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_7) {

    /* "ete4/core/tree.pyx":86
 *             tree = newick.loads(data, None, self.__class__)
 *         elif parser in newick.PARSERS:
 *             tree = newick.loads(data, newick.PARSERS[parser], self.__class__)             # <<<<<<<<<<<<<<
 *         elif parser == 'ete':
 *             tree = ete_format.loads(data)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_newick); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 86, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_loads); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 86, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_newick); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 86, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_PARSERS); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 86, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_8, __pyx_v_parser); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 86, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 86, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_10 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_10)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[4] = {__pyx_t_10, __pyx_v_data, __pyx_t_1, __pyx_t_8};
      __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 3+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 86, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __pyx_v_tree = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "ete4/core/tree.pyx":85
 *         elif parser == 'newick':
 *             tree = newick.loads(data, None, self.__class__)
 *         elif parser in newick.PARSERS:             # <<<<<<<<<<<<<<
 *             tree = newick.loads(data, newick.PARSERS[parser], self.__class__)
 *         elif parser == 'ete':
 */
    goto __pyx_L9;
  }

  /* "ete4/core/tree.pyx":87
 *         elif parser in newick.PARSERS:
 *             tree = newick.loads(data, newick.PARSERS[parser], self.__class__)
 *         elif parser == 'ete':             # <<<<<<<<<<<<<<
 *             tree = ete_format.loads(data)
 *         elif parser == 'indent':
 */
  __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_parser, __pyx_n_u_ete, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 87, __pyx_L1_error)
  if (__pyx_t_7) {

    /* "ete4/core/tree.pyx":88
 *             tree = newick.loads(data, newick.PARSERS[parser], self.__class__)
 *         elif parser == 'ete':
 *             tree = ete_format.loads(data)             # <<<<<<<<<<<<<<
 *         elif parser == 'indent':
 *             tree = indent.loads(data)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ete_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 88, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_loads); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 88, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_data};
      __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 88, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __pyx_v_tree = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "ete4/core/tree.pyx":87
 *         elif parser in newick.PARSERS:
 *             tree = newick.loads(data, newick.PARSERS[parser], self.__class__)
 *         elif parser == 'ete':             # <<<<<<<<<<<<<<
 *             tree = ete_format.loads(data)
 *         elif parser == 'indent':
 */
    goto __pyx_L9;
  }

  /* "ete4/core/tree.pyx":89
 *         elif parser == 'ete':
 *             tree = ete_format.loads(data)
 *         elif parser == 'indent':             # <<<<<<<<<<<<<<
 *             tree = indent.loads(data)
 *         elif parser == 'nexus':
 */
  __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_parser, __pyx_n_u_indent, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 89, __pyx_L1_error)
  if (__pyx_t_7) {

    /* "ete4/core/tree.pyx":90
 *             tree = ete_format.loads(data)
 *         elif parser == 'indent':
 *             tree = indent.loads(data)             # <<<<<<<<<<<<<<
 *         elif parser == 'nexus':
 *             trees = nexus.loads(data)  # NOTE: Using the default newick parser
 */
    __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_indent); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 90, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_loads); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 90, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_data};
      __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 90, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __pyx_v_tree = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "ete4/core/tree.pyx":89
 *         elif parser == 'ete':
 *             tree = ete_format.loads(data)
 *         elif parser == 'indent':             # <<<<<<<<<<<<<<
 *             tree = indent.loads(data)
 *         elif parser == 'nexus':
 */
    goto __pyx_L9;
  }

  /* "ete4/core/tree.pyx":91
 *         elif parser == 'indent':
 *             tree = indent.loads(data)
 *         elif parser == 'nexus':             # <<<<<<<<<<<<<<
 *             trees = nexus.loads(data)  # NOTE: Using the default newick parser
 *             assert len(trees) == 1, 'multiple trees - use nexus.load() instead?'
 */
  __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_parser, __pyx_n_u_nexus, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 91, __pyx_L1_error)
  if (likely(__pyx_t_7)) {

    /* "ete4/core/tree.pyx":92
 *             tree = indent.loads(data)
 *         elif parser == 'nexus':
 *             trees = nexus.loads(data)  # NOTE: Using the default newick parser             # <<<<<<<<<<<<<<
 *             assert len(trees) == 1, 'multiple trees - use nexus.load() instead?'
 *             tree = trees.popitem()[1]  # take the only tree
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_nexus); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 92, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_loads); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 92, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_data};
      __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 92, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __pyx_v_trees = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "ete4/core/tree.pyx":93
 *         elif parser == 'nexus':
 *             trees = nexus.loads(data)  # NOTE: Using the default newick parser
 *             assert len(trees) == 1, 'multiple trees - use nexus.load() instead?'             # <<<<<<<<<<<<<<
 *             tree = trees.popitem()[1]  # take the only tree
 *         else:
 */
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {
      __pyx_t_11 = PyObject_Length(__pyx_v_trees); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(0, 93, __pyx_L1_error)
      __pyx_t_7 = (__pyx_t_11 == 1);
      if (unlikely(!__pyx_t_7)) {
        __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_kp_u_multiple_trees_use_nexus_load_in, 0, 0);
        __PYX_ERR(0, 93, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(0, 93, __pyx_L1_error)
    #endif

    /* "ete4/core/tree.pyx":94
 *             trees = nexus.loads(data)  # NOTE: Using the default newick parser
 *             assert len(trees) == 1, 'multiple trees - use nexus.load() instead?'
 *             tree = trees.popitem()[1]  # take the only tree             # <<<<<<<<<<<<<<
 *         else:
 *             raise ValueError(f'bad parser: {parser}')
 */
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_trees, __pyx_n_s_popitem); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 94, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_3 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 94, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_5, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 94, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_tree = __pyx_t_8;
    __pyx_t_8 = 0;

    /* "ete4/core/tree.pyx":91
 *         elif parser == 'indent':
 *             tree = indent.loads(data)
 *         elif parser == 'nexus':             # <<<<<<<<<<<<<<
 *             trees = nexus.loads(data)  # NOTE: Using the default newick parser
 *             assert len(trees) == 1, 'multiple trees - use nexus.load() instead?'
 */
    goto __pyx_L9;
  }

  /* "ete4/core/tree.pyx":96
 *             tree = trees.popitem()[1]  # take the only tree
 *         else:
 *             raise ValueError(f'bad parser: {parser}')             # <<<<<<<<<<<<<<
 * 
 *         self.props = tree.props
 */
  /*else*/ {
    __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_v_parser, __pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 96, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_kp_u_bad_parser, __pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 96, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 96, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_8, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __PYX_ERR(0, 96, __pyx_L1_error)
  }
  __pyx_L9:;

  /* "ete4/core/tree.pyx":98
 *             raise ValueError(f'bad parser: {parser}')
 * 
 *         self.props = tree.props             # <<<<<<<<<<<<<<
 *         self.children = tree.children
 * 
 */
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_tree, __pyx_n_s_props); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 98, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (!(likely(PyDict_CheckExact(__pyx_t_8))||((__pyx_t_8) == Py_None) || __Pyx_RaiseUnexpectedTypeError("dict", __pyx_t_8))) __PYX_ERR(0, 98, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_8);
  __Pyx_GOTREF(__pyx_v_self->props);
  __Pyx_DECREF(__pyx_v_self->props);
  __pyx_v_self->props = ((PyObject*)__pyx_t_8);
  __pyx_t_8 = 0;

  /* "ete4/core/tree.pyx":99
 * 
 *         self.props = tree.props
 *         self.children = tree.children             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_tree, __pyx_n_s_children); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 99, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_children, __pyx_t_8) < 0) __PYX_ERR(0, 99, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "ete4/core/tree.pyx":41
 *     cdef public (double, double) size  # sum of lengths, number of leaves
 * 
 *     def __init__(self, data=None, children=None, parser=None):             # <<<<<<<<<<<<<<
 *         """
 *         :param data: A string or file object with the description of
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("ete4.core.tree.Tree.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_tree);
  __Pyx_XDECREF(__pyx_v_trees);
  __Pyx_XDECREF(__pyx_v_data);
  __Pyx_XDECREF(__pyx_v_parser);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ete4/core/tree.pyx":101
 *         self.children = tree.children
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def name(self):
 *         return str(self.props.get('name')) if 'name' in self.props else None
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_4name_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_4name_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_4name___get__(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self));

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

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_4name___get__(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 1);

  /* "ete4/core/tree.pyx":103
 *     @property
 *     def name(self):
 *         return str(self.props.get('name')) if 'name' in self.props else None             # <<<<<<<<<<<<<<
 * 
 *     @name.setter
 */
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(__pyx_v_self->props == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(0, 103, __pyx_L1_error)
  }
  __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_n_u_name, __pyx_v_self->props, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 103, __pyx_L1_error)
  if (__pyx_t_2) {
    if (unlikely(__pyx_v_self->props == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
      __PYX_ERR(0, 103, __pyx_L1_error)
    }
    __pyx_t_3 = __Pyx_PyDict_GetItemDefault(__pyx_v_self->props, __pyx_n_u_name, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 103, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_Unicode(__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_1 = __pyx_t_4;
    __pyx_t_4 = 0;
  } else {
    __Pyx_INCREF(Py_None);
    __pyx_t_1 = Py_None;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "ete4/core/tree.pyx":101
 *         self.children = tree.children
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def name(self):
 *         return str(self.props.get('name')) if 'name' in self.props else None
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("ete4.core.tree.Tree.name.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ete4/core/tree.pyx":105
 *         return str(self.props.get('name')) if 'name' in self.props else None
 * 
 *     @name.setter             # <<<<<<<<<<<<<<
 *     def name(self, value):
 *         if value is not None:
 */

/* Python wrapper */
static int __pyx_pw_4ete4_4core_4tree_4Tree_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_4ete4_4core_4tree_4Tree_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_4name_2__set__(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_4ete4_4core_4tree_4Tree_4name_2__set__(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 1);

  /* "ete4/core/tree.pyx":107
 *     @name.setter
 *     def name(self, value):
 *         if value is not None:             # <<<<<<<<<<<<<<
 *             self.props['name'] = str(value)
 *         else:
 */
  __pyx_t_1 = (__pyx_v_value != Py_None);
  if (__pyx_t_1) {

    /* "ete4/core/tree.pyx":108
 *     def name(self, value):
 *         if value is not None:
 *             self.props['name'] = str(value)             # <<<<<<<<<<<<<<
 *         else:
 *             self.props.pop('name', None)
 */
    __pyx_t_2 = __Pyx_PyObject_Unicode(__pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 108, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (unlikely(__pyx_v_self->props == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 108, __pyx_L1_error)
    }
    if (unlikely((PyDict_SetItem(__pyx_v_self->props, __pyx_n_u_name, __pyx_t_2) < 0))) __PYX_ERR(0, 108, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "ete4/core/tree.pyx":107
 *     @name.setter
 *     def name(self, value):
 *         if value is not None:             # <<<<<<<<<<<<<<
 *             self.props['name'] = str(value)
 *         else:
 */
    goto __pyx_L3;
  }

  /* "ete4/core/tree.pyx":110
 *             self.props['name'] = str(value)
 *         else:
 *             self.props.pop('name', None)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  /*else*/ {
    if (unlikely(__pyx_v_self->props == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "pop");
      __PYX_ERR(0, 110, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_PyDict_Pop(__pyx_v_self->props, __pyx_n_u_name, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 110, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_L3:;

  /* "ete4/core/tree.pyx":105
 *         return str(self.props.get('name')) if 'name' in self.props else None
 * 
 *     @name.setter             # <<<<<<<<<<<<<<
 *     def name(self, value):
 *         if value is not None:
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("ete4.core.tree.Tree.name.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ete4/core/tree.pyx":112
 *             self.props.pop('name', None)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def dist(self):
 *         return float(self.props['dist']) if 'dist' in self.props else None
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_4dist_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_4dist_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_4dist___get__(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self));

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

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_4dist___get__(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 1);

  /* "ete4/core/tree.pyx":114
 *     @property
 *     def dist(self):
 *         return float(self.props['dist']) if 'dist' in self.props else None             # <<<<<<<<<<<<<<
 * 
 *     @dist.setter
 */
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(__pyx_v_self->props == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(0, 114, __pyx_L1_error)
  }
  __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_n_u_dist, __pyx_v_self->props, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 114, __pyx_L1_error)
  if (__pyx_t_2) {
    if (unlikely(__pyx_v_self->props == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 114, __pyx_L1_error)
    }
    __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_self->props, __pyx_n_u_dist); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 114, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyNumber_Float(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 114, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_1 = __pyx_t_4;
    __pyx_t_4 = 0;
  } else {
    __Pyx_INCREF(Py_None);
    __pyx_t_1 = Py_None;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "ete4/core/tree.pyx":112
 *             self.props.pop('name', None)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def dist(self):
 *         return float(self.props['dist']) if 'dist' in self.props else None
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("ete4.core.tree.Tree.dist.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ete4/core/tree.pyx":116
 *         return float(self.props['dist']) if 'dist' in self.props else None
 * 
 *     @dist.setter             # <<<<<<<<<<<<<<
 *     def dist(self, value):
 *         if value is not None:
 */

/* Python wrapper */
static int __pyx_pw_4ete4_4core_4tree_4Tree_4dist_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_4ete4_4core_4tree_4Tree_4dist_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_4dist_2__set__(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_4ete4_4core_4tree_4Tree_4dist_2__set__(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 1);

  /* "ete4/core/tree.pyx":118
 *     @dist.setter
 *     def dist(self, value):
 *         if value is not None:             # <<<<<<<<<<<<<<
 *             self.props['dist'] = float(value)
 *         else:
 */
  __pyx_t_1 = (__pyx_v_value != Py_None);
  if (__pyx_t_1) {

    /* "ete4/core/tree.pyx":119
 *     def dist(self, value):
 *         if value is not None:
 *             self.props['dist'] = float(value)             # <<<<<<<<<<<<<<
 *         else:
 *             self.props.pop('dist', None)
 */
    __pyx_t_2 = __Pyx_PyNumber_Float(__pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 119, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (unlikely(__pyx_v_self->props == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 119, __pyx_L1_error)
    }
    if (unlikely((PyDict_SetItem(__pyx_v_self->props, __pyx_n_u_dist, __pyx_t_2) < 0))) __PYX_ERR(0, 119, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "ete4/core/tree.pyx":118
 *     @dist.setter
 *     def dist(self, value):
 *         if value is not None:             # <<<<<<<<<<<<<<
 *             self.props['dist'] = float(value)
 *         else:
 */
    goto __pyx_L3;
  }

  /* "ete4/core/tree.pyx":121
 *             self.props['dist'] = float(value)
 *         else:
 *             self.props.pop('dist', None)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  /*else*/ {
    if (unlikely(__pyx_v_self->props == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "pop");
      __PYX_ERR(0, 121, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_PyDict_Pop(__pyx_v_self->props, __pyx_n_u_dist, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 121, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_L3:;

  /* "ete4/core/tree.pyx":116
 *         return float(self.props['dist']) if 'dist' in self.props else None
 * 
 *     @dist.setter             # <<<<<<<<<<<<<<
 *     def dist(self, value):
 *         if value is not None:
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("ete4.core.tree.Tree.dist.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ete4/core/tree.pyx":123
 *             self.props.pop('dist', None)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def support(self):
 *         return float(self.props['support']) if 'support' in self.props else None
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_7support_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_7support_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_7support___get__(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self));

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

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_7support___get__(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 1);

  /* "ete4/core/tree.pyx":125
 *     @property
 *     def support(self):
 *         return float(self.props['support']) if 'support' in self.props else None             # <<<<<<<<<<<<<<
 * 
 *     @support.setter
 */
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(__pyx_v_self->props == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(0, 125, __pyx_L1_error)
  }
  __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_n_u_support, __pyx_v_self->props, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 125, __pyx_L1_error)
  if (__pyx_t_2) {
    if (unlikely(__pyx_v_self->props == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 125, __pyx_L1_error)
    }
    __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_self->props, __pyx_n_u_support); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 125, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyNumber_Float(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 125, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_1 = __pyx_t_4;
    __pyx_t_4 = 0;
  } else {
    __Pyx_INCREF(Py_None);
    __pyx_t_1 = Py_None;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "ete4/core/tree.pyx":123
 *             self.props.pop('dist', None)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def support(self):
 *         return float(self.props['support']) if 'support' in self.props else None
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("ete4.core.tree.Tree.support.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ete4/core/tree.pyx":127
 *         return float(self.props['support']) if 'support' in self.props else None
 * 
 *     @support.setter             # <<<<<<<<<<<<<<
 *     def support(self, value):
 *         if value is not None:
 */

/* Python wrapper */
static int __pyx_pw_4ete4_4core_4tree_4Tree_7support_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_4ete4_4core_4tree_4Tree_7support_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_7support_2__set__(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_4ete4_4core_4tree_4Tree_7support_2__set__(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 1);

  /* "ete4/core/tree.pyx":129
 *     @support.setter
 *     def support(self, value):
 *         if value is not None:             # <<<<<<<<<<<<<<
 *             self.props['support'] = float(value)
 *         else:
 */
  __pyx_t_1 = (__pyx_v_value != Py_None);
  if (__pyx_t_1) {

    /* "ete4/core/tree.pyx":130
 *     def support(self, value):
 *         if value is not None:
 *             self.props['support'] = float(value)             # <<<<<<<<<<<<<<
 *         else:
 *             self.props.pop('support', None)
 */
    __pyx_t_2 = __Pyx_PyNumber_Float(__pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 130, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (unlikely(__pyx_v_self->props == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 130, __pyx_L1_error)
    }
    if (unlikely((PyDict_SetItem(__pyx_v_self->props, __pyx_n_u_support, __pyx_t_2) < 0))) __PYX_ERR(0, 130, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "ete4/core/tree.pyx":129
 *     @support.setter
 *     def support(self, value):
 *         if value is not None:             # <<<<<<<<<<<<<<
 *             self.props['support'] = float(value)
 *         else:
 */
    goto __pyx_L3;
  }

  /* "ete4/core/tree.pyx":132
 *             self.props['support'] = float(value)
 *         else:
 *             self.props.pop('support', None)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  /*else*/ {
    if (unlikely(__pyx_v_self->props == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "pop");
      __PYX_ERR(0, 132, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_PyDict_Pop(__pyx_v_self->props, __pyx_n_u_support, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 132, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_L3:;

  /* "ete4/core/tree.pyx":127
 *         return float(self.props['support']) if 'support' in self.props else None
 * 
 *     @support.setter             # <<<<<<<<<<<<<<
 *     def support(self, value):
 *         if value is not None:
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("ete4.core.tree.Tree.support.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ete4/core/tree.pyx":134
 *             self.props.pop('support', None)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def children(self):
 *         return self._children
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_8children_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_8children_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_8children___get__(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self));

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

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_8children___get__(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 1);

  /* "ete4/core/tree.pyx":136
 *     @property
 *     def children(self):
 *         return self._children             # <<<<<<<<<<<<<<
 * 
 *     @children.setter
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_children);
  __pyx_r = __pyx_v_self->_children;
  goto __pyx_L0;

  /* "ete4/core/tree.pyx":134
 *             self.props.pop('support', None)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def children(self):
 *         return self._children
 */

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

/* "ete4/core/tree.pyx":138
 *         return self._children
 * 
 *     @children.setter             # <<<<<<<<<<<<<<
 *     def children(self, children):
 *         self._children = []
 */

/* Python wrapper */
static int __pyx_pw_4ete4_4core_4tree_4Tree_8children_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_children); /*proto*/
static int __pyx_pw_4ete4_4core_4tree_4Tree_8children_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_children) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_8children_2__set__(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self), ((PyObject *)__pyx_v_children));

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

static int __pyx_pf_4ete4_4core_4tree_4Tree_8children_2__set__(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_children) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 1);

  /* "ete4/core/tree.pyx":140
 *     @children.setter
 *     def children(self, children):
 *         self._children = []             # <<<<<<<<<<<<<<
 *         self.add_children(children)
 * 
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->_children);
  __Pyx_DECREF(__pyx_v_self->_children);
  __pyx_v_self->_children = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "ete4/core/tree.pyx":141
 *     def children(self, children):
 *         self._children = []
 *         self.add_children(children)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_children); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 141, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_children};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 141, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ete4/core/tree.pyx":138
 *         return self._children
 * 
 *     @children.setter             # <<<<<<<<<<<<<<
 *     def children(self, children):
 *         self._children = []
 */

  /* 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_AddTraceback("ete4.core.tree.Tree.children.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ete4/core/tree.pyx":143
 *         self.add_children(children)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def is_leaf(self):
 *         """Return True if the current node is a leaf."""
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_7is_leaf_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_7is_leaf_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_7is_leaf___get__(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self));

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

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_7is_leaf___get__(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 1);

  /* "ete4/core/tree.pyx":146
 *     def is_leaf(self):
 *         """Return True if the current node is a leaf."""
 *         return not self.children             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_children); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 146, __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, 146, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyBool_FromLong((!__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 146, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "ete4/core/tree.pyx":143
 *         self.add_children(children)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def is_leaf(self):
 *         """Return True if the current node is a leaf."""
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("ete4.core.tree.Tree.is_leaf.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ete4/core/tree.pyx":148
 *         return not self.children
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def is_root(self):
 *         """Return True if the current node has no parent."""
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_7is_root_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_7is_root_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_7is_root___get__(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self));

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

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_7is_root___get__(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 1);

  /* "ete4/core/tree.pyx":151
 *     def is_root(self):
 *         """Return True if the current node has no parent."""
 *         return self.up is None             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = (((PyObject *)__pyx_v_self->up) == Py_None);
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 151, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "ete4/core/tree.pyx":148
 *         return not self.children
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def is_root(self):
 *         """Return True if the current node has no parent."""
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("ete4.core.tree.Tree.is_root.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ete4/core/tree.pyx":153
 *         return self.up is None
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def root(self):
 *         """Return the absolute root node of the current tree structure."""
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_4root_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_4root_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_4root___get__(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self));

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

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_4root___get__(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self) {
  struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_node = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__get__", 1);

  /* "ete4/core/tree.pyx":156
 *     def root(self):
 *         """Return the absolute root node of the current tree structure."""
 *         node = self             # <<<<<<<<<<<<<<
 *         while node.up is not None:
 *             node = node.up
 */
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_v_node = __pyx_v_self;

  /* "ete4/core/tree.pyx":157
 *         """Return the absolute root node of the current tree structure."""
 *         node = self
 *         while node.up is not None:             # <<<<<<<<<<<<<<
 *             node = node.up
 *         return node
 */
  while (1) {
    __pyx_t_1 = (((PyObject *)__pyx_v_node->up) != Py_None);
    if (!__pyx_t_1) break;

    /* "ete4/core/tree.pyx":158
 *         node = self
 *         while node.up is not None:
 *             node = node.up             # <<<<<<<<<<<<<<
 *         return node
 * 
 */
    __pyx_t_2 = ((PyObject *)__pyx_v_node->up);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v_node, ((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_t_2));
    __pyx_t_2 = 0;
  }

  /* "ete4/core/tree.pyx":159
 *         while node.up is not None:
 *             node = node.up
 *         return node             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_node);
  __pyx_r = ((PyObject *)__pyx_v_node);
  goto __pyx_L0;

  /* "ete4/core/tree.pyx":153
 *         return self.up is None
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def root(self):
 *         """Return the absolute root node of the current tree structure."""
 */

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

/* "ete4/core/tree.pyx":161
 *         return node
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def id(self):
 *         """Return node_id (list of relative hops from root to node)."""
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_2id_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_2id_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_2id___get__(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self));

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

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_2id___get__(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self) {
  PyObject *__pyx_v_reversed_id = NULL;
  struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_node = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  unsigned int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 1);

  /* "ete4/core/tree.pyx":164
 *     def id(self):
 *         """Return node_id (list of relative hops from root to node)."""
 *         reversed_id = []             # <<<<<<<<<<<<<<
 *         node = self
 *         while node.up is not None:
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 164, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_reversed_id = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "ete4/core/tree.pyx":165
 *         """Return node_id (list of relative hops from root to node)."""
 *         reversed_id = []
 *         node = self             # <<<<<<<<<<<<<<
 *         while node.up is not None:
 *             reversed_id.append(node.up.children.index(node))
 */
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_v_node = __pyx_v_self;

  /* "ete4/core/tree.pyx":166
 *         reversed_id = []
 *         node = self
 *         while node.up is not None:             # <<<<<<<<<<<<<<
 *             reversed_id.append(node.up.children.index(node))
 *             node = node.up
 */
  while (1) {
    __pyx_t_2 = (((PyObject *)__pyx_v_node->up) != Py_None);
    if (!__pyx_t_2) break;

    /* "ete4/core/tree.pyx":167
 *         node = self
 *         while node.up is not None:
 *             reversed_id.append(node.up.children.index(node))             # <<<<<<<<<<<<<<
 *             node = node.up
 *         return tuple(reversed_id[::-1])  # will look like  (0, 0, 1, 0)
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_node->up), __pyx_n_s_children); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 167, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 167, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, ((PyObject *)__pyx_v_node)};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 167, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_reversed_id, __pyx_t_1); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 167, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "ete4/core/tree.pyx":168
 *         while node.up is not None:
 *             reversed_id.append(node.up.children.index(node))
 *             node = node.up             # <<<<<<<<<<<<<<
 *         return tuple(reversed_id[::-1])  # will look like  (0, 0, 1, 0)
 * 
 */
    __pyx_t_1 = ((PyObject *)__pyx_v_node->up);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_node, ((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_t_1));
    __pyx_t_1 = 0;
  }

  /* "ete4/core/tree.pyx":169
 *             reversed_id.append(node.up.children.index(node))
 *             node = node.up
 *         return tuple(reversed_id[::-1])  # will look like  (0, 0, 1, 0)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_reversed_id, __pyx_slice_); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 169, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 169, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "ete4/core/tree.pyx":161
 *         return node
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def id(self):
 *         """Return node_id (list of relative hops from root to node)."""
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("ete4.core.tree.Tree.id.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_reversed_id);
  __Pyx_XDECREF((PyObject *)__pyx_v_node);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ete4/core/tree.pyx":171
 *         return tuple(reversed_id[::-1])  # will look like  (0, 0, 1, 0)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def level(self):
 *         """Return the number of nodes between this node and the root."""
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_5level_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_5level_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_5level___get__(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self));

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

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_5level___get__(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self) {
  PyObject *__pyx_v_n = NULL;
  struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_node = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 1);

  /* "ete4/core/tree.pyx":174
 *     def level(self):
 *         """Return the number of nodes between this node and the root."""
 *         n = 0             # <<<<<<<<<<<<<<
 *         node = self.up
 *         while node is not None:
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_v_n = __pyx_int_0;

  /* "ete4/core/tree.pyx":175
 *         """Return the number of nodes between this node and the root."""
 *         n = 0
 *         node = self.up             # <<<<<<<<<<<<<<
 *         while node is not None:
 *             n += 1
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_self->up);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_node = ((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "ete4/core/tree.pyx":176
 *         n = 0
 *         node = self.up
 *         while node is not None:             # <<<<<<<<<<<<<<
 *             n += 1
 *             node = node.up
 */
  while (1) {
    __pyx_t_2 = (((PyObject *)__pyx_v_node) != Py_None);
    if (!__pyx_t_2) break;

    /* "ete4/core/tree.pyx":177
 *         node = self.up
 *         while node is not None:
 *             n += 1             # <<<<<<<<<<<<<<
 *             node = node.up
 *         return n
 */
    __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_n, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 177, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_n, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "ete4/core/tree.pyx":178
 *         while node is not None:
 *             n += 1
 *             node = node.up             # <<<<<<<<<<<<<<
 *         return n
 * 
 */
    __pyx_t_1 = ((PyObject *)__pyx_v_node->up);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_node, ((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_t_1));
    __pyx_t_1 = 0;
  }

  /* "ete4/core/tree.pyx":179
 *             n += 1
 *             node = node.up
 *         return n             # <<<<<<<<<<<<<<
 * 
 *     def get_prop(self, prop, default=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_n);
  __pyx_r = __pyx_v_n;
  goto __pyx_L0;

  /* "ete4/core/tree.pyx":171
 *         return tuple(reversed_id[::-1])  # will look like  (0, 0, 1, 0)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def level(self):
 *         """Return the number of nodes between this node and the root."""
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("ete4.core.tree.Tree.level.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_n);
  __Pyx_XDECREF((PyObject *)__pyx_v_node);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ete4/core/tree.pyx":181
 *         return n
 * 
 *     def get_prop(self, prop, default=None):             # <<<<<<<<<<<<<<
 *         """Return the node's property prop (an attribute or in self.props)."""
 *         attr = getattr(self, prop, None)
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_3get_prop(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_4ete4_4core_4tree_4Tree_2get_prop, "Tree.get_prop(self, prop, default=None)\nReturn the node's property prop (an attribute or in self.props).");
static PyMethodDef __pyx_mdef_4ete4_4core_4tree_4Tree_3get_prop = {"get_prop", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_3get_prop, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_2get_prop};
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_3get_prop(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_prop = 0;
  PyObject *__pyx_v_default = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_prop (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_prop,&__pyx_n_s_default,0};
    values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_prop)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 181, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_default);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 181, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_prop") < 0)) __PYX_ERR(0, 181, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_prop = values[0];
    __pyx_v_default = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_prop", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 181, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("ete4.core.tree.Tree.get_prop", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_2get_prop(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self), __pyx_v_prop, __pyx_v_default);

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

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_2get_prop(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_prop, PyObject *__pyx_v_default) {
  PyObject *__pyx_v_attr = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_prop", 1);

  /* "ete4/core/tree.pyx":183
 *     def get_prop(self, prop, default=None):
 *         """Return the node's property prop (an attribute or in self.props)."""
 *         attr = getattr(self, prop, None)             # <<<<<<<<<<<<<<
 *         return attr if attr is not None else self.props.get(prop, default)
 * 
 */
  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_v_prop, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 183, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_attr = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "ete4/core/tree.pyx":184
 *         """Return the node's property prop (an attribute or in self.props)."""
 *         attr = getattr(self, prop, None)
 *         return attr if attr is not None else self.props.get(prop, default)             # <<<<<<<<<<<<<<
 * 
 *     def __bool__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = (__pyx_v_attr != Py_None);
  if (__pyx_t_2) {
    __Pyx_INCREF(__pyx_v_attr);
    __pyx_t_1 = __pyx_v_attr;
  } else {
    if (unlikely(__pyx_v_self->props == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
      __PYX_ERR(0, 184, __pyx_L1_error)
    }
    __pyx_t_3 = __Pyx_PyDict_GetItemDefault(__pyx_v_self->props, __pyx_v_prop, __pyx_v_default); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 184, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "ete4/core/tree.pyx":181
 *         return n
 * 
 *     def get_prop(self, prop, default=None):             # <<<<<<<<<<<<<<
 *         """Return the node's property prop (an attribute or in self.props)."""
 *         attr = getattr(self, prop, None)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("ete4.core.tree.Tree.get_prop", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_attr);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ete4/core/tree.pyx":186
 *         return attr if attr is not None else self.props.get(prop, default)
 * 
 *     def __bool__(self):             # <<<<<<<<<<<<<<
 *         # If this is not defined, bool(t) will call len(t) (terribly slow!).
 *         return True
 */

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

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

static int __pyx_pf_4ete4_4core_4tree_4Tree_4__bool__(CYTHON_UNUSED struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self) {
  int __pyx_r;

  /* "ete4/core/tree.pyx":188
 *     def __bool__(self):
 *         # If this is not defined, bool(t) will call len(t) (terribly slow!).
 *         return True             # <<<<<<<<<<<<<<
 * 
 *     def __len__(self):
 */
  __pyx_r = 1;
  goto __pyx_L0;

  /* "ete4/core/tree.pyx":186
 *         return attr if attr is not None else self.props.get(prop, default)
 * 
 *     def __bool__(self):             # <<<<<<<<<<<<<<
 *         # If this is not defined, bool(t) will call len(t) (terribly slow!).
 *         return True
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "ete4/core/tree.pyx":190
 *         return True
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         """Return the number of leaves."""
 *         return sum(1 for _ in self.leaves())
 */

/* Python wrapper */
static Py_ssize_t __pyx_pw_4ete4_4core_4tree_4Tree_7__len__(PyObject *__pyx_v_self); /*proto*/
PyDoc_STRVAR(__pyx_doc_4ete4_4core_4tree_4Tree_6__len__, "Return the number of leaves.");
#if CYTHON_UPDATE_DESCRIPTOR_DOC
struct wrapperbase __pyx_wrapperbase_4ete4_4core_4tree_4Tree_6__len__;
#endif
static Py_ssize_t __pyx_pw_4ete4_4core_4tree_4Tree_7__len__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_6__len__(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_4ete4_4core_4tree_4Tree_7__len___2generator13(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "ete4/core/tree.pyx":192
 *     def __len__(self):
 *         """Return the number of leaves."""
 *         return sum(1 for _ in self.leaves())             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, node_id):
 */

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_7__len___genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct__genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct__genexpr *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct__genexpr(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct__genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct__genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 192, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4ete4_4core_4tree_4Tree_7__len___2generator13, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_len___locals_genexpr, __pyx_n_s_ete4_core_tree); if (unlikely(!gen)) __PYX_ERR(0, 192, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("ete4.core.tree.Tree.__len__.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

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

/* "ete4/core/tree.pyx":190
 *         return True
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         """Return the number of leaves."""
 *         return sum(1 for _ in self.leaves())
 */

static Py_ssize_t __pyx_pf_4ete4_4core_4tree_4Tree_6__len__(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self) {
  PyObject *__pyx_gb_4ete4_4core_4tree_4Tree_7__len___2generator13 = 0;
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__len__", 1);

  /* "ete4/core/tree.pyx":192
 *     def __len__(self):
 *         """Return the number of leaves."""
 *         return sum(1 for _ in self.leaves())             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, node_id):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_leaves); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 192, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_t_2 = __pyx_pf_4ete4_4core_4tree_4Tree_7__len___genexpr(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 192, __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_sum, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 192, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_5;
  goto __pyx_L0;

  /* "ete4/core/tree.pyx":190
 *         return True
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         """Return the number of leaves."""
 *         return sum(1 for _ in self.leaves())
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("ete4.core.tree.Tree.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_gb_4ete4_4core_4tree_4Tree_7__len___2generator13);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ete4/core/tree.pyx":194
 *         return sum(1 for _ in self.leaves())
 * 
 *     def __getitem__(self, node_id):             # <<<<<<<<<<<<<<
 *         """Return the node that matches the given node_id."""
 *         try:
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_9__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_node_id); /*proto*/
PyDoc_STRVAR(__pyx_doc_4ete4_4core_4tree_4Tree_8__getitem__, "Return the node that matches the given node_id.");
#if CYTHON_UPDATE_DESCRIPTOR_DOC
struct wrapperbase __pyx_wrapperbase_4ete4_4core_4tree_4Tree_8__getitem__;
#endif
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_9__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_node_id) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_8__getitem__(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self), ((PyObject *)__pyx_v_node_id));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_4ete4_4core_4tree_4Tree_11__getitem___2generator14(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "ete4/core/tree.pyx":198
 *         try:
 *             if type(node_id) == str:    # node_id can be the name of a node
 *                 return next(n for n in self.traverse() if n.name == node_id)             # <<<<<<<<<<<<<<
 *             elif type(node_id) == int:  # or the index of a child
 *                 return self.children[node_id]
 */

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_11__getitem___genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_2_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_2_genexpr *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_2_genexpr(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_2_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_2_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 198, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_1___getitem__ *) __pyx_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope);
  __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4ete4_4core_4tree_4Tree_11__getitem___2generator14, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_getitem___locals_genexpr, __pyx_n_s_ete4_core_tree); if (unlikely(!gen)) __PYX_ERR(0, 198, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("ete4.core.tree.Tree.__getitem__.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_4ete4_4core_4tree_4Tree_11__getitem___2generator14(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_2_genexpr *__pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_2_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L7_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 198, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 198, __pyx_L1_error) }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1);
    __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 198, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 198, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 198, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 198, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 198, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 198, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 198, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 198, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 198, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_n);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_n, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_n, __pyx_n_s_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 198, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_node_id)) { __Pyx_RaiseClosureNameError("node_id"); __PYX_ERR(0, 198, __pyx_L1_error) }
    __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_node_id, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 198, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 198, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_6) {
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_n);
      __pyx_r = __pyx_cur_scope->__pyx_v_n;
      __Pyx_XGIVEREF(__pyx_t_1);
      __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
      __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
      __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
      /* return from generator, yielding value */
      __pyx_generator->resume_label = 1;
      return __pyx_r;
      __pyx_L7_resume_from_yield:;
      __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
      __pyx_cur_scope->__pyx_t_0 = 0;
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
      __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
      if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 198, __pyx_L1_error)
    }
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

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

/* "ete4/core/tree.pyx":194
 *         return sum(1 for _ in self.leaves())
 * 
 *     def __getitem__(self, node_id):             # <<<<<<<<<<<<<<
 *         """Return the node that matches the given node_id."""
 *         try:
 */

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_8__getitem__(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_node_id) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_1___getitem__ *__pyx_cur_scope;
  PyObject *__pyx_v_node = NULL;
  PyObject *__pyx_v_i = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_e = NULL;
  PyObject *__pyx_gb_4ete4_4core_4tree_4Tree_11__getitem___2generator14 = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  unsigned int __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  PyObject *(*__pyx_t_10)(PyObject *);
  int __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  int __pyx_t_16;
  char const *__pyx_t_17;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  PyObject *__pyx_t_23 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getitem__", 0);
  __pyx_cur_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_1___getitem__ *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_1___getitem__(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_1___getitem__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_1___getitem__ *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 194, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_node_id = __pyx_v_node_id;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_node_id);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_node_id);

  /* "ete4/core/tree.pyx":196
 *     def __getitem__(self, node_id):
 *         """Return the node that matches the given node_id."""
 *         try:             # <<<<<<<<<<<<<<
 *             if type(node_id) == str:    # node_id can be the name of a node
 *                 return next(n for n in self.traverse() if n.name == node_id)
 */
  {
    __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:*/ {

      /* "ete4/core/tree.pyx":197
 *         """Return the node that matches the given node_id."""
 *         try:
 *             if type(node_id) == str:    # node_id can be the name of a node             # <<<<<<<<<<<<<<
 *                 return next(n for n in self.traverse() if n.name == node_id)
 *             elif type(node_id) == int:  # or the index of a child
 */
      __pyx_t_4 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_cur_scope->__pyx_v_node_id)), ((PyObject *)(&PyUnicode_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 197, __pyx_L3_error)
      __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 197, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_5) {

        /* "ete4/core/tree.pyx":198
 *         try:
 *             if type(node_id) == str:    # node_id can be the name of a node
 *                 return next(n for n in self.traverse() if n.name == node_id)             # <<<<<<<<<<<<<<
 *             elif type(node_id) == int:  # or the index of a child
 *                 return self.children[node_id]
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_traverse); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 198, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_7 = NULL;
        __pyx_t_8 = 0;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_8 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
          __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 0+__pyx_t_8);
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 198, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        }
        __pyx_t_6 = __pyx_pf_4ete4_4core_4tree_4Tree_11__getitem___genexpr(((PyObject*)__pyx_cur_scope), __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 198, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = __Pyx_PyIter_Next(__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 198, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_r = __pyx_t_4;
        __pyx_t_4 = 0;
        goto __pyx_L7_try_return;

        /* "ete4/core/tree.pyx":197
 *         """Return the node that matches the given node_id."""
 *         try:
 *             if type(node_id) == str:    # node_id can be the name of a node             # <<<<<<<<<<<<<<
 *                 return next(n for n in self.traverse() if n.name == node_id)
 *             elif type(node_id) == int:  # or the index of a child
 */
      }

      /* "ete4/core/tree.pyx":199
 *             if type(node_id) == str:    # node_id can be the name of a node
 *                 return next(n for n in self.traverse() if n.name == node_id)
 *             elif type(node_id) == int:  # or the index of a child             # <<<<<<<<<<<<<<
 *                 return self.children[node_id]
 *             else:                       # or a list/tuple of a descendant
 */
      __pyx_t_4 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_cur_scope->__pyx_v_node_id)), ((PyObject *)(&PyInt_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 199, __pyx_L3_error)
      __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 199, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_5) {

        /* "ete4/core/tree.pyx":200
 *                 return next(n for n in self.traverse() if n.name == node_id)
 *             elif type(node_id) == int:  # or the index of a child
 *                 return self.children[node_id]             # <<<<<<<<<<<<<<
 *             else:                       # or a list/tuple of a descendant
 *                 node = self
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_children); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 200, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_t_4, __pyx_cur_scope->__pyx_v_node_id); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 200, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_r = __pyx_t_6;
        __pyx_t_6 = 0;
        goto __pyx_L7_try_return;

        /* "ete4/core/tree.pyx":199
 *             if type(node_id) == str:    # node_id can be the name of a node
 *                 return next(n for n in self.traverse() if n.name == node_id)
 *             elif type(node_id) == int:  # or the index of a child             # <<<<<<<<<<<<<<
 *                 return self.children[node_id]
 *             else:                       # or a list/tuple of a descendant
 */
      }

      /* "ete4/core/tree.pyx":202
 *                 return self.children[node_id]
 *             else:                       # or a list/tuple of a descendant
 *                 node = self             # <<<<<<<<<<<<<<
 *                 for i in node_id:
 *                     node = node.children[i]
 */
      /*else*/ {
        __Pyx_INCREF((PyObject *)__pyx_v_self);
        __pyx_v_node = ((PyObject *)__pyx_v_self);

        /* "ete4/core/tree.pyx":203
 *             else:                       # or a list/tuple of a descendant
 *                 node = self
 *                 for i in node_id:             # <<<<<<<<<<<<<<
 *                     node = node.children[i]
 *                 return node
 */
        if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_node_id)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_node_id)) {
          __pyx_t_6 = __pyx_cur_scope->__pyx_v_node_id; __Pyx_INCREF(__pyx_t_6);
          __pyx_t_9 = 0;
          __pyx_t_10 = NULL;
        } else {
          __pyx_t_9 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_node_id); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 203, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_10 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 203, __pyx_L3_error)
        }
        for (;;) {
          if (likely(!__pyx_t_10)) {
            if (likely(PyList_CheckExact(__pyx_t_6))) {
              {
                Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6);
                #if !CYTHON_ASSUME_SAFE_MACROS
                if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 203, __pyx_L3_error)
                #endif
                if (__pyx_t_9 >= __pyx_temp) break;
              }
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_4 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_9); __Pyx_INCREF(__pyx_t_4); __pyx_t_9++; if (unlikely((0 < 0))) __PYX_ERR(0, 203, __pyx_L3_error)
              #else
              __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 203, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_4);
              #endif
            } else {
              {
                Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_6);
                #if !CYTHON_ASSUME_SAFE_MACROS
                if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 203, __pyx_L3_error)
                #endif
                if (__pyx_t_9 >= __pyx_temp) break;
              }
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_9); __Pyx_INCREF(__pyx_t_4); __pyx_t_9++; if (unlikely((0 < 0))) __PYX_ERR(0, 203, __pyx_L3_error)
              #else
              __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 203, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_4);
              #endif
            }
          } else {
            __pyx_t_4 = __pyx_t_10(__pyx_t_6);
            if (unlikely(!__pyx_t_4)) {
              PyObject* exc_type = PyErr_Occurred();
              if (exc_type) {
                if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                else __PYX_ERR(0, 203, __pyx_L3_error)
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_4);
          }
          __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_4);
          __pyx_t_4 = 0;

          /* "ete4/core/tree.pyx":204
 *                 node = self
 *                 for i in node_id:
 *                     node = node.children[i]             # <<<<<<<<<<<<<<
 *                 return node
 *         except StopIteration:
 */
          __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_node, __pyx_n_s_children); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 204, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_t_4, __pyx_v_i); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 204, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF_SET(__pyx_v_node, __pyx_t_7);
          __pyx_t_7 = 0;

          /* "ete4/core/tree.pyx":203
 *             else:                       # or a list/tuple of a descendant
 *                 node = self
 *                 for i in node_id:             # <<<<<<<<<<<<<<
 *                     node = node.children[i]
 *                 return node
 */
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

        /* "ete4/core/tree.pyx":205
 *                 for i in node_id:
 *                     node = node.children[i]
 *                 return node             # <<<<<<<<<<<<<<
 *         except StopIteration:
 *             raise TreeError(f'No node found with name: {node_id}')
 */
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(__pyx_v_node);
        __pyx_r = __pyx_v_node;
        goto __pyx_L7_try_return;
      }

      /* "ete4/core/tree.pyx":196
 *     def __getitem__(self, node_id):
 *         """Return the node that matches the given node_id."""
 *         try:             # <<<<<<<<<<<<<<
 *             if type(node_id) == str:    # node_id can be the name of a node
 *                 return next(n for n in self.traverse() if n.name == node_id)
 */
    }
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "ete4/core/tree.pyx":206
 *                     node = node.children[i]
 *                 return node
 *         except StopIteration:             # <<<<<<<<<<<<<<
 *             raise TreeError(f'No node found with name: {node_id}')
 *         except (IndexError, TypeError) as e:
 */
    __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_StopIteration);
    if (__pyx_t_11) {
      __Pyx_AddTraceback("ete4.core.tree.Tree.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_4) < 0) __PYX_ERR(0, 206, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_4);

      /* "ete4/core/tree.pyx":207
 *                 return node
 *         except StopIteration:
 *             raise TreeError(f'No node found with name: {node_id}')             # <<<<<<<<<<<<<<
 *         except (IndexError, TypeError) as e:
 *             raise TreeError(f'Invalid node_id: {node_id}')
 */
      __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_TreeError); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 207, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_14 = __Pyx_PyObject_FormatSimple(__pyx_cur_scope->__pyx_v_node_id, __pyx_empty_unicode); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 207, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_14);
      __pyx_t_15 = __Pyx_PyUnicode_Concat(__pyx_kp_u_No_node_found_with_name, __pyx_t_14); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 207, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_15);
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_14 = NULL;
      __pyx_t_8 = 0;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_13))) {
        __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13);
        if (likely(__pyx_t_14)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
          __Pyx_INCREF(__pyx_t_14);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_13, function);
          __pyx_t_8 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_14, __pyx_t_15};
        __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_13, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 207, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      }
      __Pyx_Raise(__pyx_t_12, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __PYX_ERR(0, 207, __pyx_L5_except_error)
    }

    /* "ete4/core/tree.pyx":208
 *         except StopIteration:
 *             raise TreeError(f'No node found with name: {node_id}')
 *         except (IndexError, TypeError) as e:             # <<<<<<<<<<<<<<
 *             raise TreeError(f'Invalid node_id: {node_id}')
 * 
 */
    __pyx_t_11 = __Pyx_PyErr_ExceptionMatches2(__pyx_builtin_IndexError, __pyx_builtin_TypeError);
    if (__pyx_t_11) {
      __Pyx_AddTraceback("ete4.core.tree.Tree.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_7, &__pyx_t_6) < 0) __PYX_ERR(0, 208, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_7);
      __pyx_v_e = __pyx_t_7;
      /*try:*/ {

        /* "ete4/core/tree.pyx":209
 *             raise TreeError(f'No node found with name: {node_id}')
 *         except (IndexError, TypeError) as e:
 *             raise TreeError(f'Invalid node_id: {node_id}')             # <<<<<<<<<<<<<<
 * 
 *     def __add__(self, value):
 */
        __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_TreeError); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 209, __pyx_L20_error)
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_15 = __Pyx_PyObject_FormatSimple(__pyx_cur_scope->__pyx_v_node_id, __pyx_empty_unicode); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 209, __pyx_L20_error)
        __Pyx_GOTREF(__pyx_t_15);
        __pyx_t_14 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Invalid_node_id, __pyx_t_15); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 209, __pyx_L20_error)
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        __pyx_t_15 = NULL;
        __pyx_t_8 = 0;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_13))) {
          __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_13);
          if (likely(__pyx_t_15)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
            __Pyx_INCREF(__pyx_t_15);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_13, function);
            __pyx_t_8 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_15, __pyx_t_14};
          __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_13, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
          __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 209, __pyx_L20_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        }
        __Pyx_Raise(__pyx_t_12, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __PYX_ERR(0, 209, __pyx_L20_error)
      }

      /* "ete4/core/tree.pyx":208
 *         except StopIteration:
 *             raise TreeError(f'No node found with name: {node_id}')
 *         except (IndexError, TypeError) as e:             # <<<<<<<<<<<<<<
 *             raise TreeError(f'Invalid node_id: {node_id}')
 * 
 */
      /*finally:*/ {
        __pyx_L20_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_21, &__pyx_t_22, &__pyx_t_23);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20) < 0)) __Pyx_ErrFetch(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __Pyx_XGOTREF(__pyx_t_23);
          __pyx_t_11 = __pyx_lineno; __pyx_t_16 = __pyx_clineno; __pyx_t_17 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
          }
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_XGIVEREF(__pyx_t_23);
            __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_22, __pyx_t_23);
          }
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_XGIVEREF(__pyx_t_20);
          __Pyx_ErrRestore(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0;
          __pyx_lineno = __pyx_t_11; __pyx_clineno = __pyx_t_16; __pyx_filename = __pyx_t_17;
          goto __pyx_L5_except_error;
        }
      }
    }
    goto __pyx_L5_except_error;

    /* "ete4/core/tree.pyx":196
 *     def __getitem__(self, node_id):
 *         """Return the node that matches the given node_id."""
 *         try:             # <<<<<<<<<<<<<<
 *             if type(node_id) == str:    # node_id can be the name of a node
 *                 return next(n for n in self.traverse() if n.name == node_id)
 */
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L7_try_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
  }

  /* "ete4/core/tree.pyx":194
 *         return sum(1 for _ in self.leaves())
 * 
 *     def __getitem__(self, node_id):             # <<<<<<<<<<<<<<
 *         """Return the node that matches the given node_id."""
 *         try:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_AddTraceback("ete4.core.tree.Tree.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_node);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_e);
  __Pyx_XDECREF(__pyx_gb_4ete4_4core_4tree_4Tree_11__getitem___2generator14);
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ete4/core/tree.pyx":211
 *             raise TreeError(f'Invalid node_id: {node_id}')
 * 
 *     def __add__(self, value):             # <<<<<<<<<<<<<<
 *         """Sum trees. t1 + t2 returns a new tree with children=[t1, t2]."""
 *         # Should a make the sum with two copies of the original trees?
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_11__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
PyDoc_STRVAR(__pyx_doc_4ete4_4core_4tree_4Tree_10__add__, "Sum trees. t1 + t2 returns a new tree with children=[t1, t2].");
#if CYTHON_UPDATE_DESCRIPTOR_DOC
struct wrapperbase __pyx_wrapperbase_4ete4_4core_4tree_4Tree_10__add__;
#endif
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_11__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__add__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_10__add__(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_10__add__(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_value) {
  PyObject *__pyx_v_new_root = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  unsigned int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__add__", 1);

  /* "ete4/core/tree.pyx":214
 *         """Sum trees. t1 + t2 returns a new tree with children=[t1, t2]."""
 *         # Should a make the sum with two copies of the original trees?
 *         if type(value) == self.__class__:             # <<<<<<<<<<<<<<
 *             new_root = self.__class__()
 *             new_root.add_child(self)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 214, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_value)), __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 214, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 214, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (likely(__pyx_t_3)) {

    /* "ete4/core/tree.pyx":215
 *         # Should a make the sum with two copies of the original trees?
 *         if type(value) == self.__class__:
 *             new_root = self.__class__()             # <<<<<<<<<<<<<<
 *             new_root.add_child(self)
 *             new_root.add_child(value)
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 215, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 215, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __pyx_v_new_root = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "ete4/core/tree.pyx":216
 *         if type(value) == self.__class__:
 *             new_root = self.__class__()
 *             new_root.add_child(self)             # <<<<<<<<<<<<<<
 *             new_root.add_child(value)
 *             return new_root
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_new_root, __pyx_n_s_add_child); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 216, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, ((PyObject *)__pyx_v_self)};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 216, __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;

    /* "ete4/core/tree.pyx":217
 *             new_root = self.__class__()
 *             new_root.add_child(self)
 *             new_root.add_child(value)             # <<<<<<<<<<<<<<
 *             return new_root
 *         else:
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_new_root, __pyx_n_s_add_child); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_value};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 217, __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;

    /* "ete4/core/tree.pyx":218
 *             new_root.add_child(self)
 *             new_root.add_child(value)
 *             return new_root             # <<<<<<<<<<<<<<
 *         else:
 *             raise TreeError("Invalid node type")
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_new_root);
    __pyx_r = __pyx_v_new_root;
    goto __pyx_L0;

    /* "ete4/core/tree.pyx":214
 *         """Sum trees. t1 + t2 returns a new tree with children=[t1, t2]."""
 *         # Should a make the sum with two copies of the original trees?
 *         if type(value) == self.__class__:             # <<<<<<<<<<<<<<
 *             new_root = self.__class__()
 *             new_root.add_child(self)
 */
  }

  /* "ete4/core/tree.pyx":220
 *             return new_root
 *         else:
 *             raise TreeError("Invalid node type")             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_TreeError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 220, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (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_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_u_Invalid_node_type};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 220, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 220, __pyx_L1_error)
  }

  /* "ete4/core/tree.pyx":211
 *             raise TreeError(f'Invalid node_id: {node_id}')
 * 
 *     def __add__(self, value):             # <<<<<<<<<<<<<<
 *         """Sum trees. t1 + t2 returns a new tree with children=[t1, t2]."""
 *         # Should a make the sum with two copies of the original trees?
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("ete4.core.tree.Tree.__add__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_new_root);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ete4/core/tree.pyx":222
 *             raise TreeError("Invalid node type")
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         name_str = (' ' + repr(self.name)) if self.name else ''
 *         return '<Tree%s at %s>' % (name_str, hex(self.__hash__()))
 */

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

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

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_12__repr__(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self) {
  PyObject *__pyx_v_name_str = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  Py_UCS4 __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  unsigned int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 1);

  /* "ete4/core/tree.pyx":223
 * 
 *     def __repr__(self):
 *         name_str = (' ' + repr(self.name)) if self.name else ''             # <<<<<<<<<<<<<<
 *         return '<Tree%s at %s>' % (name_str, hex(self.__hash__()))
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 223, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 223, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 223, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyObject_Repr(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 223, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyNumber_Add(__pyx_kp_u__2, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 223, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(__pyx_kp_u__3);
    __pyx_t_1 = __pyx_kp_u__3;
  }
  __pyx_v_name_str = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "ete4/core/tree.pyx":224
 *     def __repr__(self):
 *         name_str = (' ' + repr(self.name)) if self.name else ''
 *         return '<Tree%s at %s>' % (name_str, hex(self.__hash__()))             # <<<<<<<<<<<<<<
 * 
 *     def __str__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = 0;
  __pyx_t_6 = 127;
  __Pyx_INCREF(__pyx_kp_u_Tree);
  __pyx_t_5 += 5;
  __Pyx_GIVEREF(__pyx_kp_u_Tree);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_Tree);
  __pyx_t_2 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_name_str), __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_6;
  __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
  __pyx_t_2 = 0;
  __Pyx_INCREF(__pyx_kp_u_at);
  __pyx_t_5 += 4;
  __Pyx_GIVEREF(__pyx_kp_u_at);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_at);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_hash); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = NULL;
  __pyx_t_8 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_8 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_8, 0+__pyx_t_8);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 224, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_hex, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_4), __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_6;
  __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_2);
  __pyx_t_2 = 0;
  __Pyx_INCREF(__pyx_kp_u__4);
  __pyx_t_5 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__4);
  PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u__4);
  __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_1, 5, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "ete4/core/tree.pyx":222
 *             raise TreeError("Invalid node type")
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         name_str = (' ' + repr(self.name)) if self.name else ''
 *         return '<Tree%s at %s>' % (name_str, hex(self.__hash__()))
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("ete4.core.tree.Tree.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_name_str);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ete4/core/tree.pyx":226
 *         return '<Tree%s at %s>' % (name_str, hex(self.__hash__()))
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         """Return a string with an ascii drawing of the tree."""
 *         return self.to_str(show_internal=False, compact=True, props=['name'])
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_15__str__(PyObject *__pyx_v_self); /*proto*/
PyDoc_STRVAR(__pyx_doc_4ete4_4core_4tree_4Tree_14__str__, "Return a string with an ascii drawing of the tree.");
#if CYTHON_UPDATE_DESCRIPTOR_DOC
struct wrapperbase __pyx_wrapperbase_4ete4_4core_4tree_4Tree_14__str__;
#endif
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_15__str__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_14__str__(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self));

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

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_14__str__(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__str__", 1);

  /* "ete4/core/tree.pyx":228
 *     def __str__(self):
 *         """Return a string with an ascii drawing of the tree."""
 *         return self.to_str(show_internal=False, compact=True, props=['name'])             # <<<<<<<<<<<<<<
 * 
 *     def to_str(self, show_internal=True, compact=False, props=None,
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_to_str); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_show_internal, Py_False) < 0) __PYX_ERR(0, 228, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_compact, Py_True) < 0) __PYX_ERR(0, 228, __pyx_L1_error)
  __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_n_u_name);
  __Pyx_GIVEREF(__pyx_n_u_name);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_u_name)) __PYX_ERR(0, 228, __pyx_L1_error);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_props, __pyx_t_3) < 0) __PYX_ERR(0, 228, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "ete4/core/tree.pyx":226
 *         return '<Tree%s at %s>' % (name_str, hex(self.__hash__()))
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         """Return a string with an ascii drawing of the tree."""
 *         return self.to_str(show_internal=False, compact=True, props=['name'])
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("ete4.core.tree.Tree.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ete4/core/tree.pyx":230
 *         return self.to_str(show_internal=False, compact=True, props=['name'])
 * 
 *     def to_str(self, show_internal=True, compact=False, props=None,             # <<<<<<<<<<<<<<
 *                px=None, py=None, px0=0, cascade=False):
 *         """Return a string containing an ascii drawing of the tree.
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_17to_str(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_4ete4_4core_4tree_4Tree_16to_str, "Tree.to_str(self, show_internal=True, compact=False, props=None, px=None, py=None, px0=0, cascade=False)\nReturn a string containing an ascii drawing of the tree.\n\n        :param show_internal: If True, show the internal nodes too.\n        :param compact: If True, use exactly one line per tip.\n        :param props: List of node properties to show. If None, show all.\n        :param px, py, px0: Paddings (x, y, x for leaves). Overrides `compact`.\n        :param cascade: Use a cascade representation. Overrides\n            `show_internal`, `compact`, `px`, `py`, `px0`.\n        ");
static PyMethodDef __pyx_mdef_4ete4_4core_4tree_4Tree_17to_str = {"to_str", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_17to_str, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_16to_str};
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_17to_str(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_show_internal = 0;
  PyObject *__pyx_v_compact = 0;
  PyObject *__pyx_v_props = 0;
  PyObject *__pyx_v_px = 0;
  PyObject *__pyx_v_py = 0;
  PyObject *__pyx_v_px0 = 0;
  PyObject *__pyx_v_cascade = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[7] = {0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_str (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_show_internal,&__pyx_n_s_compact,&__pyx_n_s_props,&__pyx_n_s_px,&__pyx_n_s_py,&__pyx_n_s_px0,&__pyx_n_s_cascade,0};
    values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_True));
    values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_False));
    values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));

    /* "ete4/core/tree.pyx":231
 * 
 *     def to_str(self, show_internal=True, compact=False, props=None,
 *                px=None, py=None, px0=0, cascade=False):             # <<<<<<<<<<<<<<
 *         """Return a string containing an ascii drawing of the tree.
 * 
 */
    values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    values[5] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_0));
    values[6] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_False));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_show_internal);
          if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 230, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_compact);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 230, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_props);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 230, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_px);
          if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 230, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_py);
          if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 230, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_px0);
          if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 230, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_cascade);
          if (value) { values[6] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 230, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "to_str") < 0)) __PYX_ERR(0, 230, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_show_internal = values[0];
    __pyx_v_compact = values[1];
    __pyx_v_props = values[2];
    __pyx_v_px = values[3];
    __pyx_v_py = values[4];
    __pyx_v_px0 = values[5];
    __pyx_v_cascade = values[6];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("to_str", 0, 0, 7, __pyx_nargs); __PYX_ERR(0, 230, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("ete4.core.tree.Tree.to_str", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_16to_str(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self), __pyx_v_show_internal, __pyx_v_compact, __pyx_v_props, __pyx_v_px, __pyx_v_py, __pyx_v_px0, __pyx_v_cascade);

  /* "ete4/core/tree.pyx":230
 *         return self.to_str(show_internal=False, compact=True, props=['name'])
 * 
 *     def to_str(self, show_internal=True, compact=False, props=None,             # <<<<<<<<<<<<<<
 *                px=None, py=None, px0=0, cascade=False):
 *         """Return a string containing an ascii drawing of the tree.
 */

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

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_16to_str(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_show_internal, PyObject *__pyx_v_compact, PyObject *__pyx_v_props, PyObject *__pyx_v_px, PyObject *__pyx_v_py, PyObject *__pyx_v_px0, PyObject *__pyx_v_cascade) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_str", 1);

  /* "ete4/core/tree.pyx":241
 *             `show_internal`, `compact`, `px`, `py`, `px0`.
 *         """
 *         return text_viz.to_str(self, show_internal, compact, props,             # <<<<<<<<<<<<<<
 *                                px, py, px0, cascade)
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_text_viz); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_to_str); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ete4/core/tree.pyx":242
 *         """
 *         return text_viz.to_str(self, show_internal, compact, props,
 *                                px, py, px0, cascade)             # <<<<<<<<<<<<<<
 * 
 *     def __contains__(self, node):
 */
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[9] = {__pyx_t_2, ((PyObject *)__pyx_v_self), __pyx_v_show_internal, __pyx_v_compact, __pyx_v_props, __pyx_v_px, __pyx_v_py, __pyx_v_px0, __pyx_v_cascade};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 8+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 241, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "ete4/core/tree.pyx":230
 *         return self.to_str(show_internal=False, compact=True, props=['name'])
 * 
 *     def to_str(self, show_internal=True, compact=False, props=None,             # <<<<<<<<<<<<<<
 *                px=None, py=None, px0=0, cascade=False):
 *         """Return a string containing an ascii drawing of the tree.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("ete4.core.tree.Tree.to_str", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ete4/core/tree.pyx":244
 *                                px, py, px0, cascade)
 * 
 *     def __contains__(self, node):             # <<<<<<<<<<<<<<
 *         """Return True if the tree contains the given node.
 * 
 */

/* Python wrapper */
static int __pyx_pw_4ete4_4core_4tree_4Tree_19__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_node); /*proto*/
PyDoc_STRVAR(__pyx_doc_4ete4_4core_4tree_4Tree_18__contains__, "Return True if the tree contains the given node.\n\n        :param node: A Tree instance or a name (the name of a node).\n        ");
#if CYTHON_UPDATE_DESCRIPTOR_DOC
struct wrapperbase __pyx_wrapperbase_4ete4_4core_4tree_4Tree_18__contains__;
#endif
static int __pyx_pw_4ete4_4core_4tree_4Tree_19__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_node) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__contains__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_18__contains__(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self), ((PyObject *)__pyx_v_node));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_4ete4_4core_4tree_4Tree_12__contains___2generator15(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "ete4/core/tree.pyx":252
 *             return node in self.traverse()
 *         elif type(node) == str:
 *             return any(n.name == node for n in self.traverse())             # <<<<<<<<<<<<<<
 *         else:
 *             raise TreeError('Can only check nodes or names in a Tree')
 */

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_12__contains___genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_4_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_4_genexpr *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_4_genexpr(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_4_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_4_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 252, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_3___contains__ *) __pyx_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope);
  __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4ete4_4core_4tree_4Tree_12__contains___2generator15, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_contains___locals_genexpr, __pyx_n_s_ete4_core_tree); if (unlikely(!gen)) __PYX_ERR(0, 252, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("ete4.core.tree.Tree.__contains__.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_4ete4_4core_4tree_4Tree_12__contains___2generator15(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_4_genexpr *__pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_4_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 252, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 252, __pyx_L1_error) }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1);
    __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 252, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 252, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 252, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 252, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 252, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 252, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 252, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 252, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 252, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_n);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_n, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_n, __pyx_n_s_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 252, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_node)) { __Pyx_RaiseClosureNameError("node"); __PYX_ERR(0, 252, __pyx_L1_error) }
    __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_node, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 252, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 252, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_6) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_True);
      __pyx_r = Py_True;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

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

/* "ete4/core/tree.pyx":244
 *                                px, py, px0, cascade)
 * 
 *     def __contains__(self, node):             # <<<<<<<<<<<<<<
 *         """Return True if the tree contains the given node.
 * 
 */

static int __pyx_pf_4ete4_4core_4tree_4Tree_18__contains__(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_node) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_3___contains__ *__pyx_cur_scope;
  PyObject *__pyx_gb_4ete4_4core_4tree_4Tree_12__contains___2generator15 = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  unsigned int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__contains__", 0);
  __pyx_cur_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_3___contains__ *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_3___contains__(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_3___contains__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_3___contains__ *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 244, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_node = __pyx_v_node;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_node);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_node);

  /* "ete4/core/tree.pyx":249
 *         :param node: A Tree instance or a name (the name of a node).
 *         """
 *         if isinstance(node, self.__class__):             # <<<<<<<<<<<<<<
 *             return node in self.traverse()
 *         elif type(node) == str:
 */
  __pyx_t_1 = __pyx_cur_scope->__pyx_v_node;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 249, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_IsInstance(__pyx_t_1, __pyx_t_2); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 249, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "ete4/core/tree.pyx":250
 *         """
 *         if isinstance(node, self.__class__):
 *             return node in self.traverse()             # <<<<<<<<<<<<<<
 *         elif type(node) == str:
 *             return any(n.name == node for n in self.traverse())
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_traverse); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 250, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 250, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_cur_scope->__pyx_v_node, __pyx_t_2, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 250, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = __pyx_t_3;
    goto __pyx_L0;

    /* "ete4/core/tree.pyx":249
 *         :param node: A Tree instance or a name (the name of a node).
 *         """
 *         if isinstance(node, self.__class__):             # <<<<<<<<<<<<<<
 *             return node in self.traverse()
 *         elif type(node) == str:
 */
  }

  /* "ete4/core/tree.pyx":251
 *         if isinstance(node, self.__class__):
 *             return node in self.traverse()
 *         elif type(node) == str:             # <<<<<<<<<<<<<<
 *             return any(n.name == node for n in self.traverse())
 *         else:
 */
  __pyx_t_2 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_cur_scope->__pyx_v_node)), ((PyObject *)(&PyUnicode_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 251, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 251, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (likely(__pyx_t_3)) {

    /* "ete4/core/tree.pyx":252
 *             return node in self.traverse()
 *         elif type(node) == str:
 *             return any(n.name == node for n in self.traverse())             # <<<<<<<<<<<<<<
 *         else:
 *             raise TreeError('Can only check nodes or names in a Tree')
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_traverse); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 252, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 252, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __pyx_t_1 = __pyx_pf_4ete4_4core_4tree_4Tree_12__contains___genexpr(((PyObject*)__pyx_cur_scope), __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 252, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_Generator_Next(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 252, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 252, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = __pyx_t_6;
    goto __pyx_L0;

    /* "ete4/core/tree.pyx":251
 *         if isinstance(node, self.__class__):
 *             return node in self.traverse()
 *         elif type(node) == str:             # <<<<<<<<<<<<<<
 *             return any(n.name == node for n in self.traverse())
 *         else:
 */
  }

  /* "ete4/core/tree.pyx":254
 *             return any(n.name == node for n in self.traverse())
 *         else:
 *             raise TreeError('Can only check nodes or names in a Tree')             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_TreeError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 254, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (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_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_u_Can_only_check_nodes_or_names_in};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 254, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 254, __pyx_L1_error)
  }

  /* "ete4/core/tree.pyx":244
 *                                px, py, px0, cascade)
 * 
 *     def __contains__(self, node):             # <<<<<<<<<<<<<<
 *         """Return True if the tree contains the given node.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("ete4.core.tree.Tree.__contains__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_gb_4ete4_4core_4tree_4Tree_12__contains___2generator15);
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_4ete4_4core_4tree_4Tree_22generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "ete4/core/tree.pyx":256
 *             raise TreeError('Can only check nodes or names in a Tree')
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         """Yield all the terminal nodes (leaves)."""
 *         yield from self.leaves()
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_21__iter__(PyObject *__pyx_v_self); /*proto*/
PyDoc_STRVAR(__pyx_doc_4ete4_4core_4tree_4Tree_20__iter__, "Yield all the terminal nodes (leaves).");
#if CYTHON_UPDATE_DESCRIPTOR_DOC
struct wrapperbase __pyx_wrapperbase_4ete4_4core_4tree_4Tree_20__iter__;
#endif
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_21__iter__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_20__iter__(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self));

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

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_20__iter__(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_5___iter__ *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__iter__", 0);
  __pyx_cur_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_5___iter__ *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_5___iter__(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_5___iter__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_5___iter__ *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 256, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4ete4_4core_4tree_4Tree_22generator, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iter, __pyx_n_s_Tree___iter, __pyx_n_s_ete4_core_tree); if (unlikely(!gen)) __PYX_ERR(0, 256, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("ete4.core.tree.Tree.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_4ete4_4core_4tree_4Tree_22generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_5___iter__ *__pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_5___iter__ *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L4_resume_from_yield_from;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 256, __pyx_L1_error)

  /* "ete4/core/tree.pyx":258
 *     def __iter__(self):
 *         """Yield all the terminal nodes (leaves)."""
 *         yield from self.leaves()             # <<<<<<<<<<<<<<
 * 
 *     def add_prop(self, name, value):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_leaves); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 258, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_r = __Pyx_Generator_Yield_From(__pyx_generator, __pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_XGOTREF(__pyx_r);
  if (likely(__pyx_r)) {
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L4_resume_from_yield_from:;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 258, __pyx_L1_error)
  } else {
    PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType();
    if (exc_type) {
      if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear();
      else __PYX_ERR(0, 258, __pyx_L1_error)
    }
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "ete4/core/tree.pyx":256
 *             raise TreeError('Can only check nodes or names in a Tree')
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         """Yield all the terminal nodes (leaves)."""
 *         yield from self.leaves()
 */

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

/* "ete4/core/tree.pyx":260
 *         yield from self.leaves()
 * 
 *     def add_prop(self, name, value):             # <<<<<<<<<<<<<<
 *         """Add or update node's property to the given value."""
 *         self.props[name] = value
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_24add_prop(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_4ete4_4core_4tree_4Tree_23add_prop, "Tree.add_prop(self, name, value)\nAdd or update node's property to the given value.");
static PyMethodDef __pyx_mdef_4ete4_4core_4tree_4Tree_24add_prop = {"add_prop", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_24add_prop, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_23add_prop};
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_24add_prop(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_value = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add_prop (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_value,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 260, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 260, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("add_prop", 1, 2, 2, 1); __PYX_ERR(0, 260, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "add_prop") < 0)) __PYX_ERR(0, 260, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_name = values[0];
    __pyx_v_value = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("add_prop", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 260, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("ete4.core.tree.Tree.add_prop", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_23add_prop(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self), __pyx_v_name, __pyx_v_value);

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

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_23add_prop(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("add_prop", 1);

  /* "ete4/core/tree.pyx":262
 *     def add_prop(self, name, value):
 *         """Add or update node's property to the given value."""
 *         self.props[name] = value             # <<<<<<<<<<<<<<
 * 
 *     def add_props(self, **props):
 */
  if (unlikely(__pyx_v_self->props == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(0, 262, __pyx_L1_error)
  }
  if (unlikely((PyDict_SetItem(__pyx_v_self->props, __pyx_v_name, __pyx_v_value) < 0))) __PYX_ERR(0, 262, __pyx_L1_error)

  /* "ete4/core/tree.pyx":260
 *         yield from self.leaves()
 * 
 *     def add_prop(self, name, value):             # <<<<<<<<<<<<<<
 *         """Add or update node's property to the given value."""
 *         self.props[name] = value
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("ete4.core.tree.Tree.add_prop", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ete4/core/tree.pyx":264
 *         self.props[name] = value
 * 
 *     def add_props(self, **props):             # <<<<<<<<<<<<<<
 *         """Add or update several properties."""
 *         for name, value in props.items():
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_26add_props(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_4ete4_4core_4tree_4Tree_25add_props, "Tree.add_props(self, **props)\nAdd or update several properties.");
static PyMethodDef __pyx_mdef_4ete4_4core_4tree_4Tree_26add_props = {"add_props", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_26add_props, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_25add_props};
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_26add_props(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_props = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add_props (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("add_props", 1, 0, 0, __pyx_nargs); return NULL;}
  if (__pyx_kwds && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "add_props", 1))) return NULL;
  if (__pyx_kwds) {
    __pyx_v_props = __Pyx_KwargsAsDict_FASTCALL(__pyx_kwds, __pyx_kwvalues);
    if (unlikely(!__pyx_v_props)) return NULL;
    __Pyx_GOTREF(__pyx_v_props);
  } else {
    __pyx_v_props = PyDict_New();
    if (unlikely(!__pyx_v_props)) return NULL;
    __Pyx_GOTREF(__pyx_v_props);
  }
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_25add_props(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self), __pyx_v_props);

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

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_25add_props(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_props) {
  PyObject *__pyx_v_name = NULL;
  PyObject *__pyx_v_value = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("add_props", 1);

  /* "ete4/core/tree.pyx":266
 *     def add_props(self, **props):
 *         """Add or update several properties."""
 *         for name, value in props.items():             # <<<<<<<<<<<<<<
 *             self.props[name] = value
 * 
 */
  __pyx_t_2 = 0;
  __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_props, 1, __pyx_n_s_items, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 266, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_1);
  __pyx_t_1 = __pyx_t_5;
  __pyx_t_5 = 0;
  while (1) {
    __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, &__pyx_t_5, &__pyx_t_6, NULL, __pyx_t_4);
    if (unlikely(__pyx_t_7 == 0)) break;
    if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 266, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "ete4/core/tree.pyx":267
 *         """Add or update several properties."""
 *         for name, value in props.items():
 *             self.props[name] = value             # <<<<<<<<<<<<<<
 * 
 *     def del_prop(self, name):
 */
    if (unlikely(__pyx_v_self->props == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 267, __pyx_L1_error)
    }
    if (unlikely((PyDict_SetItem(__pyx_v_self->props, __pyx_v_name, __pyx_v_value) < 0))) __PYX_ERR(0, 267, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ete4/core/tree.pyx":264
 *         self.props[name] = value
 * 
 *     def add_props(self, **props):             # <<<<<<<<<<<<<<
 *         """Add or update several properties."""
 *         for name, value in props.items():
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("ete4.core.tree.Tree.add_props", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ete4/core/tree.pyx":269
 *             self.props[name] = value
 * 
 *     def del_prop(self, name):             # <<<<<<<<<<<<<<
 *         """Delete a node's property."""
 *         self.props.pop(name, None)
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_28del_prop(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_4ete4_4core_4tree_4Tree_27del_prop, "Tree.del_prop(self, name)\nDelete a node's property.");
static PyMethodDef __pyx_mdef_4ete4_4core_4tree_4Tree_28del_prop = {"del_prop", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_28del_prop, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_27del_prop};
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_28del_prop(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_name = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("del_prop (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 269, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "del_prop") < 0)) __PYX_ERR(0, 269, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_name = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("del_prop", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 269, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("ete4.core.tree.Tree.del_prop", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_27del_prop(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self), __pyx_v_name);

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

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_27del_prop(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_name) {
  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("del_prop", 1);

  /* "ete4/core/tree.pyx":271
 *     def del_prop(self, name):
 *         """Delete a node's property."""
 *         self.props.pop(name, None)             # <<<<<<<<<<<<<<
 * 
 *     # Topology management
 */
  if (unlikely(__pyx_v_self->props == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "pop");
    __PYX_ERR(0, 271, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_PyDict_Pop(__pyx_v_self->props, __pyx_v_name, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 271, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ete4/core/tree.pyx":269
 *             self.props[name] = value
 * 
 *     def del_prop(self, name):             # <<<<<<<<<<<<<<
 *         """Delete a node's property."""
 *         self.props.pop(name, None)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("ete4.core.tree.Tree.del_prop", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ete4/core/tree.pyx":274
 * 
 *     # Topology management
 *     def add_child(self, child=None, name=None, dist=None, support=None):             # <<<<<<<<<<<<<<
 *         """Add a new child to this node and return it.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_30add_child(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_4ete4_4core_4tree_4Tree_29add_child, "Tree.add_child(self, child=None, name=None, dist=None, support=None)\nAdd a new child to this node and return it.\n\n        If child node is not suplied, a new node instance will be created.\n\n        :param child: Node to be added as a child.\n        :param name: Name that will be given to the child.\n        :param dist: Distance from the node to the child.\n        :param support: Support value of child partition.\n        ");
static PyMethodDef __pyx_mdef_4ete4_4core_4tree_4Tree_30add_child = {"add_child", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_30add_child, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_29add_child};
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_30add_child(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_child = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_dist = 0;
  PyObject *__pyx_v_support = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add_child (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_child,&__pyx_n_s_name,&__pyx_n_s_dist,&__pyx_n_s_support,0};
    values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_child);
          if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 274, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 274, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dist);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 274, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_support);
          if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 274, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "add_child") < 0)) __PYX_ERR(0, 274, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_child = values[0];
    __pyx_v_name = values[1];
    __pyx_v_dist = values[2];
    __pyx_v_support = values[3];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("add_child", 0, 0, 4, __pyx_nargs); __PYX_ERR(0, 274, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("ete4.core.tree.Tree.add_child", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_29add_child(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self), __pyx_v_child, __pyx_v_name, __pyx_v_dist, __pyx_v_support);

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

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_29add_child(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_child, PyObject *__pyx_v_name, PyObject *__pyx_v_dist, PyObject *__pyx_v_support) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  unsigned int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("add_child", 0);
  __Pyx_INCREF(__pyx_v_child);

  /* "ete4/core/tree.pyx":284
 *         :param support: Support value of child partition.
 *         """
 *         if child and type(child) != self.__class__:             # <<<<<<<<<<<<<<
 *             raise TreeError(f'Incorrect child type: {type(child)}')
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_child); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 284, __pyx_L1_error)
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 284, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_child)), __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 284, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 284, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (unlikely(__pyx_t_1)) {

    /* "ete4/core/tree.pyx":285
 *         """
 *         if child and type(child) != self.__class__:
 *             raise TreeError(f'Incorrect child type: {type(child)}')             # <<<<<<<<<<<<<<
 * 
 *         if child is None:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_TreeError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 285, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_PyObject_FormatSimple(((PyObject *)Py_TYPE(__pyx_v_child)), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 285, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Incorrect_child_type, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 285, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_6};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 285, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(0, 285, __pyx_L1_error)

    /* "ete4/core/tree.pyx":284
 *         :param support: Support value of child partition.
 *         """
 *         if child and type(child) != self.__class__:             # <<<<<<<<<<<<<<
 *             raise TreeError(f'Incorrect child type: {type(child)}')
 * 
 */
  }

  /* "ete4/core/tree.pyx":287
 *             raise TreeError(f'Incorrect child type: {type(child)}')
 * 
 *         if child is None:             # <<<<<<<<<<<<<<
 *             child = self.__class__()  # can be Tree(), PhyloTree(), etc.
 * 
 */
  __pyx_t_1 = (__pyx_v_child == Py_None);
  if (__pyx_t_1) {

    /* "ete4/core/tree.pyx":288
 * 
 *         if child is None:
 *             child = self.__class__()  # can be Tree(), PhyloTree(), etc.             # <<<<<<<<<<<<<<
 * 
 *         if name is not None:
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 288, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 288, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF_SET(__pyx_v_child, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "ete4/core/tree.pyx":287
 *             raise TreeError(f'Incorrect child type: {type(child)}')
 * 
 *         if child is None:             # <<<<<<<<<<<<<<
 *             child = self.__class__()  # can be Tree(), PhyloTree(), etc.
 * 
 */
  }

  /* "ete4/core/tree.pyx":290
 *             child = self.__class__()  # can be Tree(), PhyloTree(), etc.
 * 
 *         if name is not None:             # <<<<<<<<<<<<<<
 *             child.name = name
 *         if dist is not None:
 */
  __pyx_t_1 = (__pyx_v_name != Py_None);
  if (__pyx_t_1) {

    /* "ete4/core/tree.pyx":291
 * 
 *         if name is not None:
 *             child.name = name             # <<<<<<<<<<<<<<
 *         if dist is not None:
 *             child.dist = dist
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_child, __pyx_n_s_name, __pyx_v_name) < 0) __PYX_ERR(0, 291, __pyx_L1_error)

    /* "ete4/core/tree.pyx":290
 *             child = self.__class__()  # can be Tree(), PhyloTree(), etc.
 * 
 *         if name is not None:             # <<<<<<<<<<<<<<
 *             child.name = name
 *         if dist is not None:
 */
  }

  /* "ete4/core/tree.pyx":292
 *         if name is not None:
 *             child.name = name
 *         if dist is not None:             # <<<<<<<<<<<<<<
 *             child.dist = dist
 *         if support is not None:
 */
  __pyx_t_1 = (__pyx_v_dist != Py_None);
  if (__pyx_t_1) {

    /* "ete4/core/tree.pyx":293
 *             child.name = name
 *         if dist is not None:
 *             child.dist = dist             # <<<<<<<<<<<<<<
 *         if support is not None:
 *             child.support = support
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_child, __pyx_n_s_dist, __pyx_v_dist) < 0) __PYX_ERR(0, 293, __pyx_L1_error)

    /* "ete4/core/tree.pyx":292
 *         if name is not None:
 *             child.name = name
 *         if dist is not None:             # <<<<<<<<<<<<<<
 *             child.dist = dist
 *         if support is not None:
 */
  }

  /* "ete4/core/tree.pyx":294
 *         if dist is not None:
 *             child.dist = dist
 *         if support is not None:             # <<<<<<<<<<<<<<
 *             child.support = support
 * 
 */
  __pyx_t_1 = (__pyx_v_support != Py_None);
  if (__pyx_t_1) {

    /* "ete4/core/tree.pyx":295
 *             child.dist = dist
 *         if support is not None:
 *             child.support = support             # <<<<<<<<<<<<<<
 * 
 *         child.up = self
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_child, __pyx_n_s_support, __pyx_v_support) < 0) __PYX_ERR(0, 295, __pyx_L1_error)

    /* "ete4/core/tree.pyx":294
 *         if dist is not None:
 *             child.dist = dist
 *         if support is not None:             # <<<<<<<<<<<<<<
 *             child.support = support
 * 
 */
  }

  /* "ete4/core/tree.pyx":297
 *             child.support = support
 * 
 *         child.up = self             # <<<<<<<<<<<<<<
 *         self.children.append(child)
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_child, __pyx_n_s_up, ((PyObject *)__pyx_v_self)) < 0) __PYX_ERR(0, 297, __pyx_L1_error)

  /* "ete4/core/tree.pyx":298
 * 
 *         child.up = self
 *         self.children.append(child)             # <<<<<<<<<<<<<<
 * 
 *         return child
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_children); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_v_child); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 298, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ete4/core/tree.pyx":300
 *         self.children.append(child)
 * 
 *         return child             # <<<<<<<<<<<<<<
 * 
 *     def add_children(self, nodes):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_child);
  __pyx_r = __pyx_v_child;
  goto __pyx_L0;

  /* "ete4/core/tree.pyx":274
 * 
 *     # Topology management
 *     def add_child(self, child=None, name=None, dist=None, support=None):             # <<<<<<<<<<<<<<
 *         """Add a new child to this node and return it.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("ete4.core.tree.Tree.add_child", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_child);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ete4/core/tree.pyx":302
 *         return child
 * 
 *     def add_children(self, nodes):             # <<<<<<<<<<<<<<
 *         """Set the given nodes as children of this node."""
 *         for node in nodes:
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_32add_children(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_4ete4_4core_4tree_4Tree_31add_children, "Tree.add_children(self, nodes)\nSet the given nodes as children of this node.");
static PyMethodDef __pyx_mdef_4ete4_4core_4tree_4Tree_32add_children = {"add_children", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_32add_children, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_31add_children};
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_32add_children(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_nodes = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add_children (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nodes,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_nodes)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 302, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "add_children") < 0)) __PYX_ERR(0, 302, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_nodes = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("add_children", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 302, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("ete4.core.tree.Tree.add_children", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_31add_children(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self), __pyx_v_nodes);

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

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_31add_children(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_nodes) {
  PyObject *__pyx_v_node = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  unsigned int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("add_children", 1);

  /* "ete4/core/tree.pyx":304
 *     def add_children(self, nodes):
 *         """Set the given nodes as children of this node."""
 *         for node in nodes:             # <<<<<<<<<<<<<<
 *             self.add_child(node)
 *         return nodes
 */
  if (likely(PyList_CheckExact(__pyx_v_nodes)) || PyTuple_CheckExact(__pyx_v_nodes)) {
    __pyx_t_1 = __pyx_v_nodes; __Pyx_INCREF(__pyx_t_1);
    __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_nodes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 304, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 304, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 304, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 304, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 304, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 304, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 304, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 304, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 304, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_node, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "ete4/core/tree.pyx":305
 *         """Set the given nodes as children of this node."""
 *         for node in nodes:
 *             self.add_child(node)             # <<<<<<<<<<<<<<
 *         return nodes
 * 
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_child); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 305, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_node};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 305, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ete4/core/tree.pyx":304
 *     def add_children(self, nodes):
 *         """Set the given nodes as children of this node."""
 *         for node in nodes:             # <<<<<<<<<<<<<<
 *             self.add_child(node)
 *         return nodes
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ete4/core/tree.pyx":306
 *         for node in nodes:
 *             self.add_child(node)
 *         return nodes             # <<<<<<<<<<<<<<
 * 
 *     def pop_child(self, child_idx=-1):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_nodes);
  __pyx_r = __pyx_v_nodes;
  goto __pyx_L0;

  /* "ete4/core/tree.pyx":302
 *         return child
 * 
 *     def add_children(self, nodes):             # <<<<<<<<<<<<<<
 *         """Set the given nodes as children of this node."""
 *         for node in nodes:
 */

  /* 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("ete4.core.tree.Tree.add_children", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_node);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ete4/core/tree.pyx":308
 *         return nodes
 * 
 *     def pop_child(self, child_idx=-1):             # <<<<<<<<<<<<<<
 *         try:
 *             child = self.children.pop(child_idx)  # parent removes child
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_34pop_child(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_4ete4_4core_4tree_4Tree_33pop_child, "Tree.pop_child(self, child_idx=-1)");
static PyMethodDef __pyx_mdef_4ete4_4core_4tree_4Tree_34pop_child = {"pop_child", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_34pop_child, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_33pop_child};
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_34pop_child(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_child_idx = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("pop_child (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_child_idx,0};
    values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_neg_1));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_child_idx);
          if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 308, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "pop_child") < 0)) __PYX_ERR(0, 308, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_child_idx = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("pop_child", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 308, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("ete4.core.tree.Tree.pop_child", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_33pop_child(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self), __pyx_v_child_idx);

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

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_33pop_child(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_child_idx) {
  PyObject *__pyx_v_child = NULL;
  PyObject *__pyx_v_e = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  unsigned int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  Py_ssize_t __pyx_t_13;
  Py_UCS4 __pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  int __pyx_t_16;
  char const *__pyx_t_17;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  PyObject *__pyx_t_23 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("pop_child", 1);

  /* "ete4/core/tree.pyx":309
 * 
 *     def pop_child(self, child_idx=-1):
 *         try:             # <<<<<<<<<<<<<<
 *             child = self.children.pop(child_idx)  # parent removes child
 * 
 */
  {
    __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:*/ {

      /* "ete4/core/tree.pyx":310
 *     def pop_child(self, child_idx=-1):
 *         try:
 *             child = self.children.pop(child_idx)  # parent removes child             # <<<<<<<<<<<<<<
 * 
 *             if child.up is self:  # (it may point to another already!)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_children); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 310, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_pop); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 310, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = NULL;
      __pyx_t_7 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_7 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_child_idx};
        __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 310, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __pyx_v_child = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ete4/core/tree.pyx":312
 *             child = self.children.pop(child_idx)  # parent removes child
 * 
 *             if child.up is self:  # (it may point to another already!)             # <<<<<<<<<<<<<<
 *                 child.up = None  # child removes parent
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_child, __pyx_n_s_up); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 312, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_8 = (__pyx_t_4 == ((PyObject *)__pyx_v_self));
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_8) {

        /* "ete4/core/tree.pyx":313
 * 
 *             if child.up is self:  # (it may point to another already!)
 *                 child.up = None  # child removes parent             # <<<<<<<<<<<<<<
 * 
 *             return child
 */
        if (__Pyx_PyObject_SetAttrStr(__pyx_v_child, __pyx_n_s_up, Py_None) < 0) __PYX_ERR(0, 313, __pyx_L3_error)

        /* "ete4/core/tree.pyx":312
 *             child = self.children.pop(child_idx)  # parent removes child
 * 
 *             if child.up is self:  # (it may point to another already!)             # <<<<<<<<<<<<<<
 *                 child.up = None  # child removes parent
 * 
 */
      }

      /* "ete4/core/tree.pyx":315
 *                 child.up = None  # child removes parent
 * 
 *             return child             # <<<<<<<<<<<<<<
 *         except ValueError as e:
 *             raise TreeError(f'Cannot pop child: not found ({e})')
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_child);
      __pyx_r = __pyx_v_child;
      goto __pyx_L7_try_return;

      /* "ete4/core/tree.pyx":309
 * 
 *     def pop_child(self, child_idx=-1):
 *         try:             # <<<<<<<<<<<<<<
 *             child = self.children.pop(child_idx)  # parent removes child
 * 
 */
    }
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "ete4/core/tree.pyx":316
 * 
 *             return child
 *         except ValueError as e:             # <<<<<<<<<<<<<<
 *             raise TreeError(f'Cannot pop child: not found ({e})')
 * 
 */
    __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError);
    if (__pyx_t_9) {
      __Pyx_AddTraceback("ete4.core.tree.Tree.pop_child", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_5) < 0) __PYX_ERR(0, 316, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_e = __pyx_t_6;
      /*try:*/ {

        /* "ete4/core/tree.pyx":317
 *             return child
 *         except ValueError as e:
 *             raise TreeError(f'Cannot pop child: not found ({e})')             # <<<<<<<<<<<<<<
 * 
 *     def remove_child(self, child):
 */
        __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_TreeError); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 317, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_12 = PyTuple_New(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 317, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = 0;
        __pyx_t_14 = 127;
        __Pyx_INCREF(__pyx_kp_u_Cannot_pop_child_not_found);
        __pyx_t_13 += 29;
        __Pyx_GIVEREF(__pyx_kp_u_Cannot_pop_child_not_found);
        PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_kp_u_Cannot_pop_child_not_found);
        __pyx_t_15 = __Pyx_PyObject_FormatSimple(__pyx_v_e, __pyx_empty_unicode); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 317, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_15);
        __pyx_t_14 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_15) > __pyx_t_14) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_15) : __pyx_t_14;
        __pyx_t_13 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_15);
        __Pyx_GIVEREF(__pyx_t_15);
        PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_15);
        __pyx_t_15 = 0;
        __Pyx_INCREF(__pyx_kp_u__5);
        __pyx_t_13 += 1;
        __Pyx_GIVEREF(__pyx_kp_u__5);
        PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_kp_u__5);
        __pyx_t_15 = __Pyx_PyUnicode_Join(__pyx_t_12, 3, __pyx_t_13, __pyx_t_14); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 317, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_15);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = NULL;
        __pyx_t_7 = 0;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_11))) {
          __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11);
          if (likely(__pyx_t_12)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
            __Pyx_INCREF(__pyx_t_12);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_11, function);
            __pyx_t_7 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_15};
          __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
          if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 317, __pyx_L15_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        }
        __Pyx_Raise(__pyx_t_10, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __PYX_ERR(0, 317, __pyx_L15_error)
      }

      /* "ete4/core/tree.pyx":316
 * 
 *             return child
 *         except ValueError as e:             # <<<<<<<<<<<<<<
 *             raise TreeError(f'Cannot pop child: not found ({e})')
 * 
 */
      /*finally:*/ {
        __pyx_L15_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_21, &__pyx_t_22, &__pyx_t_23);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20) < 0)) __Pyx_ErrFetch(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __Pyx_XGOTREF(__pyx_t_23);
          __pyx_t_9 = __pyx_lineno; __pyx_t_16 = __pyx_clineno; __pyx_t_17 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
          }
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_XGIVEREF(__pyx_t_23);
            __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_22, __pyx_t_23);
          }
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_XGIVEREF(__pyx_t_20);
          __Pyx_ErrRestore(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0;
          __pyx_lineno = __pyx_t_9; __pyx_clineno = __pyx_t_16; __pyx_filename = __pyx_t_17;
          goto __pyx_L5_except_error;
        }
      }
    }
    goto __pyx_L5_except_error;

    /* "ete4/core/tree.pyx":309
 * 
 *     def pop_child(self, child_idx=-1):
 *         try:             # <<<<<<<<<<<<<<
 *             child = self.children.pop(child_idx)  # parent removes child
 * 
 */
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L7_try_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
  }

  /* "ete4/core/tree.pyx":308
 *         return nodes
 * 
 *     def pop_child(self, child_idx=-1):             # <<<<<<<<<<<<<<
 *         try:
 *             child = self.children.pop(child_idx)  # parent removes child
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_AddTraceback("ete4.core.tree.Tree.pop_child", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_child);
  __Pyx_XDECREF(__pyx_v_e);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ete4/core/tree.pyx":319
 *             raise TreeError(f'Cannot pop child: not found ({e})')
 * 
 *     def remove_child(self, child):             # <<<<<<<<<<<<<<
 *         """Remove child from this node and return it.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_36remove_child(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_4ete4_4core_4tree_4Tree_35remove_child, "Tree.remove_child(self, child)\nRemove child from this node and return it.\n\n        After calling this function, parent and child nodes still exit,\n        but are no longer connected.\n        ");
static PyMethodDef __pyx_mdef_4ete4_4core_4tree_4Tree_36remove_child = {"remove_child", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_36remove_child, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_35remove_child};
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_36remove_child(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_child = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("remove_child (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_child,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_child)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 319, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "remove_child") < 0)) __PYX_ERR(0, 319, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_child = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("remove_child", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 319, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("ete4.core.tree.Tree.remove_child", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_35remove_child(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self), __pyx_v_child);

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

/* "ete4/core/tree.pyx":327
 *         try:
 *             if type(child) == str:  # translate into a node
 *                 child = next(n for n in self.children if n.name == child)             # <<<<<<<<<<<<<<
 * 
 *             self.children.remove(child)  # parent removes child
 */

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_12remove_child_genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_7_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_7_genexpr *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_7_genexpr(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_7_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_7_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 327, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_6_remove_child *) __pyx_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope);
  __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4ete4_4core_4tree_4Tree_12remove_child_2generator16, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_remove_child_locals_genexpr, __pyx_n_s_ete4_core_tree); if (unlikely(!gen)) __PYX_ERR(0, 327, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("ete4.core.tree.Tree.remove_child.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_4ete4_4core_4tree_4Tree_12remove_child_2generator16(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_7_genexpr *__pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_7_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L7_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 327, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 327, __pyx_L1_error) }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1);
    __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 327, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 327, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 327, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 327, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 327, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 327, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 327, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 327, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 327, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_n);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_n, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_n, __pyx_n_s_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 327, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_child)) { __Pyx_RaiseClosureNameError("child"); __PYX_ERR(0, 327, __pyx_L1_error) }
    __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_child, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 327, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 327, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_6) {
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_n);
      __pyx_r = __pyx_cur_scope->__pyx_v_n;
      __Pyx_XGIVEREF(__pyx_t_1);
      __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
      __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
      __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
      /* return from generator, yielding value */
      __pyx_generator->resume_label = 1;
      return __pyx_r;
      __pyx_L7_resume_from_yield:;
      __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
      __pyx_cur_scope->__pyx_t_0 = 0;
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
      __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
      if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 327, __pyx_L1_error)
    }
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

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

/* "ete4/core/tree.pyx":319
 *             raise TreeError(f'Cannot pop child: not found ({e})')
 * 
 *     def remove_child(self, child):             # <<<<<<<<<<<<<<
 *         """Remove child from this node and return it.
 * 
 */

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_35remove_child(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_child) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_6_remove_child *__pyx_cur_scope;
  PyObject *__pyx_v_e = NULL;
  PyObject *__pyx_gb_4ete4_4core_4tree_4Tree_12remove_child_2generator16 = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  unsigned int __pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  Py_ssize_t __pyx_t_13;
  Py_UCS4 __pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  int __pyx_t_16;
  char const *__pyx_t_17;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  PyObject *__pyx_t_23 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("remove_child", 0);
  __pyx_cur_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_6_remove_child *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_6_remove_child(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_6_remove_child, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_6_remove_child *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 319, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_child = __pyx_v_child;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_child);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_child);

  /* "ete4/core/tree.pyx":325
 *         but are no longer connected.
 *         """
 *         try:             # <<<<<<<<<<<<<<
 *             if type(child) == str:  # translate into a node
 *                 child = next(n for n in self.children if n.name == child)
 */
  {
    __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:*/ {

      /* "ete4/core/tree.pyx":326
 *         """
 *         try:
 *             if type(child) == str:  # translate into a node             # <<<<<<<<<<<<<<
 *                 child = next(n for n in self.children if n.name == child)
 * 
 */
      __pyx_t_4 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_cur_scope->__pyx_v_child)), ((PyObject *)(&PyUnicode_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 326, __pyx_L3_error)
      __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 326, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_5) {

        /* "ete4/core/tree.pyx":327
 *         try:
 *             if type(child) == str:  # translate into a node
 *                 child = next(n for n in self.children if n.name == child)             # <<<<<<<<<<<<<<
 * 
 *             self.children.remove(child)  # parent removes child
 */
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_children); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 327, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_6 = __pyx_pf_4ete4_4core_4tree_4Tree_12remove_child_genexpr(((PyObject*)__pyx_cur_scope), __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 327, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = __Pyx_PyIter_Next(__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 327, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_child);
        __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_child, __pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_4);
        __pyx_t_4 = 0;

        /* "ete4/core/tree.pyx":326
 *         """
 *         try:
 *             if type(child) == str:  # translate into a node             # <<<<<<<<<<<<<<
 *                 child = next(n for n in self.children if n.name == child)
 * 
 */
      }

      /* "ete4/core/tree.pyx":329
 *                 child = next(n for n in self.children if n.name == child)
 * 
 *             self.children.remove(child)  # parent removes child             # <<<<<<<<<<<<<<
 * 
 *             if child.up == self:  # (it may point to another already!)
 */
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_children); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 329, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_remove); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 329, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      __pyx_t_8 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_cur_scope->__pyx_v_child};
        __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 329, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ete4/core/tree.pyx":331
 *             self.children.remove(child)  # parent removes child
 * 
 *             if child.up == self:  # (it may point to another already!)             # <<<<<<<<<<<<<<
 *                 child.up = None  # child removes parent
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_child, __pyx_n_s_up); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 331, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_7 = PyObject_RichCompare(__pyx_t_4, ((PyObject *)__pyx_v_self), Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 331, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 331, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (__pyx_t_5) {

        /* "ete4/core/tree.pyx":332
 * 
 *             if child.up == self:  # (it may point to another already!)
 *                 child.up = None  # child removes parent             # <<<<<<<<<<<<<<
 * 
 *             return child
 */
        if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_child, __pyx_n_s_up, Py_None) < 0) __PYX_ERR(0, 332, __pyx_L3_error)

        /* "ete4/core/tree.pyx":331
 *             self.children.remove(child)  # parent removes child
 * 
 *             if child.up == self:  # (it may point to another already!)             # <<<<<<<<<<<<<<
 *                 child.up = None  # child removes parent
 * 
 */
      }

      /* "ete4/core/tree.pyx":334
 *                 child.up = None  # child removes parent
 * 
 *             return child             # <<<<<<<<<<<<<<
 *         except (StopIteration, ValueError) as e:
 *             raise TreeError(f'Cannot remove child: not found ({e})')
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_child);
      __pyx_r = __pyx_cur_scope->__pyx_v_child;
      goto __pyx_L7_try_return;

      /* "ete4/core/tree.pyx":325
 *         but are no longer connected.
 *         """
 *         try:             # <<<<<<<<<<<<<<
 *             if type(child) == str:  # translate into a node
 *                 child = next(n for n in self.children if n.name == child)
 */
    }
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "ete4/core/tree.pyx":335
 * 
 *             return child
 *         except (StopIteration, ValueError) as e:             # <<<<<<<<<<<<<<
 *             raise TreeError(f'Cannot remove child: not found ({e})')
 * 
 */
    __pyx_t_9 = __Pyx_PyErr_ExceptionMatches2(__pyx_builtin_StopIteration, __pyx_builtin_ValueError);
    if (__pyx_t_9) {
      __Pyx_AddTraceback("ete4.core.tree.Tree.remove_child", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_4, &__pyx_t_6) < 0) __PYX_ERR(0, 335, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_4);
      __pyx_v_e = __pyx_t_4;
      /*try:*/ {

        /* "ete4/core/tree.pyx":336
 *             return child
 *         except (StopIteration, ValueError) as e:
 *             raise TreeError(f'Cannot remove child: not found ({e})')             # <<<<<<<<<<<<<<
 * 
 *     def remove_children(self):
 */
        __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_TreeError); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 336, __pyx_L16_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_12 = PyTuple_New(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 336, __pyx_L16_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = 0;
        __pyx_t_14 = 127;
        __Pyx_INCREF(__pyx_kp_u_Cannot_remove_child_not_found);
        __pyx_t_13 += 32;
        __Pyx_GIVEREF(__pyx_kp_u_Cannot_remove_child_not_found);
        PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_kp_u_Cannot_remove_child_not_found);
        __pyx_t_15 = __Pyx_PyObject_FormatSimple(__pyx_v_e, __pyx_empty_unicode); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 336, __pyx_L16_error)
        __Pyx_GOTREF(__pyx_t_15);
        __pyx_t_14 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_15) > __pyx_t_14) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_15) : __pyx_t_14;
        __pyx_t_13 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_15);
        __Pyx_GIVEREF(__pyx_t_15);
        PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_15);
        __pyx_t_15 = 0;
        __Pyx_INCREF(__pyx_kp_u__5);
        __pyx_t_13 += 1;
        __Pyx_GIVEREF(__pyx_kp_u__5);
        PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_kp_u__5);
        __pyx_t_15 = __Pyx_PyUnicode_Join(__pyx_t_12, 3, __pyx_t_13, __pyx_t_14); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 336, __pyx_L16_error)
        __Pyx_GOTREF(__pyx_t_15);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = NULL;
        __pyx_t_8 = 0;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_11))) {
          __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11);
          if (likely(__pyx_t_12)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
            __Pyx_INCREF(__pyx_t_12);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_11, function);
            __pyx_t_8 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_15};
          __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
          if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 336, __pyx_L16_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        }
        __Pyx_Raise(__pyx_t_10, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __PYX_ERR(0, 336, __pyx_L16_error)
      }

      /* "ete4/core/tree.pyx":335
 * 
 *             return child
 *         except (StopIteration, ValueError) as e:             # <<<<<<<<<<<<<<
 *             raise TreeError(f'Cannot remove child: not found ({e})')
 * 
 */
      /*finally:*/ {
        __pyx_L16_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_21, &__pyx_t_22, &__pyx_t_23);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20) < 0)) __Pyx_ErrFetch(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __Pyx_XGOTREF(__pyx_t_23);
          __pyx_t_9 = __pyx_lineno; __pyx_t_16 = __pyx_clineno; __pyx_t_17 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
          }
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_XGIVEREF(__pyx_t_23);
            __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_22, __pyx_t_23);
          }
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_XGIVEREF(__pyx_t_20);
          __Pyx_ErrRestore(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0;
          __pyx_lineno = __pyx_t_9; __pyx_clineno = __pyx_t_16; __pyx_filename = __pyx_t_17;
          goto __pyx_L5_except_error;
        }
      }
    }
    goto __pyx_L5_except_error;

    /* "ete4/core/tree.pyx":325
 *         but are no longer connected.
 *         """
 *         try:             # <<<<<<<<<<<<<<
 *             if type(child) == str:  # translate into a node
 *                 child = next(n for n in self.children if n.name == child)
 */
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L7_try_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
  }

  /* "ete4/core/tree.pyx":319
 *             raise TreeError(f'Cannot pop child: not found ({e})')
 * 
 *     def remove_child(self, child):             # <<<<<<<<<<<<<<
 *         """Remove child from this node and return it.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_AddTraceback("ete4.core.tree.Tree.remove_child", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_e);
  __Pyx_XDECREF(__pyx_gb_4ete4_4core_4tree_4Tree_12remove_child_2generator16);
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ete4/core/tree.pyx":338
 *             raise TreeError(f'Cannot remove child: not found ({e})')
 * 
 *     def remove_children(self):             # <<<<<<<<<<<<<<
 *         """Remove all children from this node and return a list with them."""
 *         children = list(self.children)  # we need to make a copy of the list!
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_38remove_children(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_4ete4_4core_4tree_4Tree_37remove_children, "Tree.remove_children(self)\nRemove all children from this node and return a list with them.");
static PyMethodDef __pyx_mdef_4ete4_4core_4tree_4Tree_38remove_children = {"remove_children", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_38remove_children, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_37remove_children};
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_38remove_children(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("remove_children (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("remove_children", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "remove_children", 0))) return NULL;
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_37remove_children(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self));

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

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_37remove_children(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self) {
  PyObject *__pyx_v_children = NULL;
  PyObject *__pyx_8genexpr4__pyx_v_node = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  unsigned int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("remove_children", 1);

  /* "ete4/core/tree.pyx":340
 *     def remove_children(self):
 *         """Remove all children from this node and return a list with them."""
 *         children = list(self.children)  # we need to make a copy of the list!             # <<<<<<<<<<<<<<
 *         return [self.remove_child(node) for node in children]
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_children); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 340, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PySequence_ListKeepNew(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 340, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_children = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "ete4/core/tree.pyx":341
 *         """Remove all children from this node and return a list with them."""
 *         children = list(self.children)  # we need to make a copy of the list!
 *         return [self.remove_child(node) for node in children]             # <<<<<<<<<<<<<<
 * 
 *     def add_sister(self, sister=None, name=None, dist=None):
 */
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 341, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __pyx_v_children; __Pyx_INCREF(__pyx_t_1);
    __pyx_t_3 = 0;
    for (;;) {
      {
        Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
        #if !CYTHON_ASSUME_SAFE_MACROS
        if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 341, __pyx_L5_error)
        #endif
        if (__pyx_t_3 >= __pyx_temp) break;
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 341, __pyx_L5_error)
      #else
      __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 341, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_4);
      #endif
      __Pyx_XDECREF_SET(__pyx_8genexpr4__pyx_v_node, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_remove_child); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 341, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      __pyx_t_7 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
          __pyx_t_7 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_8genexpr4__pyx_v_node};
        __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 341, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 341, __pyx_L5_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_node); __pyx_8genexpr4__pyx_v_node = 0;
    goto __pyx_L9_exit_scope;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_node); __pyx_8genexpr4__pyx_v_node = 0;
    goto __pyx_L1_error;
    __pyx_L9_exit_scope:;
  } /* exit inner scope */
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "ete4/core/tree.pyx":338
 *             raise TreeError(f'Cannot remove child: not found ({e})')
 * 
 *     def remove_children(self):             # <<<<<<<<<<<<<<
 *         """Remove all children from this node and return a list with them."""
 *         children = list(self.children)  # we need to make a copy of the list!
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("ete4.core.tree.Tree.remove_children", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_children);
  __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_node);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ete4/core/tree.pyx":343
 *         return [self.remove_child(node) for node in children]
 * 
 *     def add_sister(self, sister=None, name=None, dist=None):             # <<<<<<<<<<<<<<
 *         """Add a sister to this node and return it.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_40add_sister(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_4ete4_4core_4tree_4Tree_39add_sister, "Tree.add_sister(self, sister=None, name=None, dist=None)\nAdd a sister to this node and return it.\n\n        If sister node is not supplied, a new Tree instance will be created.\n        ");
static PyMethodDef __pyx_mdef_4ete4_4core_4tree_4Tree_40add_sister = {"add_sister", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_40add_sister, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_39add_sister};
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_40add_sister(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_sister = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_dist = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add_sister (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sister,&__pyx_n_s_name,&__pyx_n_s_dist,0};
    values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sister);
          if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 343, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 343, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dist);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 343, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "add_sister") < 0)) __PYX_ERR(0, 343, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_sister = values[0];
    __pyx_v_name = values[1];
    __pyx_v_dist = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("add_sister", 0, 0, 3, __pyx_nargs); __PYX_ERR(0, 343, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("ete4.core.tree.Tree.add_sister", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_39add_sister(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self), __pyx_v_sister, __pyx_v_name, __pyx_v_dist);

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

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_39add_sister(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_sister, PyObject *__pyx_v_name, PyObject *__pyx_v_dist) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  unsigned int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("add_sister", 1);

  /* "ete4/core/tree.pyx":348
 *         If sister node is not supplied, a new Tree instance will be created.
 *         """
 *         if self.up is None:             # <<<<<<<<<<<<<<
 *             raise TreeError("A parent node is required to add a sister")
 * 
 */
  __pyx_t_1 = (((PyObject *)__pyx_v_self->up) == Py_None);
  if (unlikely(__pyx_t_1)) {

    /* "ete4/core/tree.pyx":349
 *         """
 *         if self.up is None:
 *             raise TreeError("A parent node is required to add a sister")             # <<<<<<<<<<<<<<
 * 
 *         return self.up.add_child(child=sister, name=name, dist=dist)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_TreeError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 349, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_u_A_parent_node_is_required_to_add};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 349, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 349, __pyx_L1_error)

    /* "ete4/core/tree.pyx":348
 *         If sister node is not supplied, a new Tree instance will be created.
 *         """
 *         if self.up is None:             # <<<<<<<<<<<<<<
 *             raise TreeError("A parent node is required to add a sister")
 * 
 */
  }

  /* "ete4/core/tree.pyx":351
 *             raise TreeError("A parent node is required to add a sister")
 * 
 *         return self.up.add_child(child=sister, name=name, dist=dist)             # <<<<<<<<<<<<<<
 * 
 *     def remove_sister(self, sister=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->up), __pyx_n_s_add_child); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 351, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 351, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_child, __pyx_v_sister) < 0) __PYX_ERR(0, 351, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_name, __pyx_v_name) < 0) __PYX_ERR(0, 351, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dist, __pyx_v_dist) < 0) __PYX_ERR(0, 351, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 351, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "ete4/core/tree.pyx":343
 *         return [self.remove_child(node) for node in children]
 * 
 *     def add_sister(self, sister=None, name=None, dist=None):             # <<<<<<<<<<<<<<
 *         """Add a sister to this node and return it.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("ete4.core.tree.Tree.add_sister", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ete4/core/tree.pyx":353
 *         return self.up.add_child(child=sister, name=name, dist=dist)
 * 
 *     def remove_sister(self, sister=None):             # <<<<<<<<<<<<<<
 *         """Remove a sister node and return it.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_42remove_sister(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_4ete4_4core_4tree_4Tree_41remove_sister, "Tree.remove_sister(self, sister=None)\nRemove a sister node and return it.\n\n        It has the same effect as self.up.remove_child(sister). If a sister\n        node is not supplied, the first sister will be deleted.\n\n        :param sister: A node instance to be removed as a sister.\n        ");
static PyMethodDef __pyx_mdef_4ete4_4core_4tree_4Tree_42remove_sister = {"remove_sister", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_42remove_sister, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_41remove_sister};
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_42remove_sister(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_sister = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("remove_sister (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sister,0};
    values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sister);
          if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 353, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "remove_sister") < 0)) __PYX_ERR(0, 353, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_sister = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("remove_sister", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 353, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("ete4.core.tree.Tree.remove_sister", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_41remove_sister(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self), __pyx_v_sister);

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

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_41remove_sister(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_sister) {
  PyObject *__pyx_v_sisters = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("remove_sister", 1);

  /* "ete4/core/tree.pyx":361
 *         :param sister: A node instance to be removed as a sister.
 *         """
 *         sisters = self.get_sisters()             # <<<<<<<<<<<<<<
 *         if not sisters:
 *             raise TreeError("Cannot remove sister because there are no sisters")
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_sisters); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 361, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 361, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_v_sisters = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "ete4/core/tree.pyx":362
 *         """
 *         sisters = self.get_sisters()
 *         if not sisters:             # <<<<<<<<<<<<<<
 *             raise TreeError("Cannot remove sister because there are no sisters")
 * 
 */
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_sisters); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 362, __pyx_L1_error)
  __pyx_t_6 = (!__pyx_t_5);
  if (unlikely(__pyx_t_6)) {

    /* "ete4/core/tree.pyx":363
 *         sisters = self.get_sisters()
 *         if not sisters:
 *             raise TreeError("Cannot remove sister because there are no sisters")             # <<<<<<<<<<<<<<
 * 
 *         return self.up.remove_child(sister or sisters[0])
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_TreeError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 363, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    __pyx_t_4 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_4 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_u_Cannot_remove_sister_because_the};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 363, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 363, __pyx_L1_error)

    /* "ete4/core/tree.pyx":362
 *         """
 *         sisters = self.get_sisters()
 *         if not sisters:             # <<<<<<<<<<<<<<
 *             raise TreeError("Cannot remove sister because there are no sisters")
 * 
 */
  }

  /* "ete4/core/tree.pyx":365
 *             raise TreeError("Cannot remove sister because there are no sisters")
 * 
 *         return self.up.remove_child(sister or sisters[0])             # <<<<<<<<<<<<<<
 * 
 *     def delete(self, prevent_nondicotomic=True, preserve_branch_length=False):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->up), __pyx_n_s_remove_child); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 365, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_sister); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 365, __pyx_L1_error)
  if (!__pyx_t_6) {
  } else {
    __Pyx_INCREF(__pyx_v_sister);
    __pyx_t_3 = __pyx_v_sister;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_sisters, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 365, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_INCREF(__pyx_t_7);
  __pyx_t_3 = __pyx_t_7;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_L4_bool_binop_done:;
  __pyx_t_7 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 365, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "ete4/core/tree.pyx":353
 *         return self.up.add_child(child=sister, name=name, dist=dist)
 * 
 *     def remove_sister(self, sister=None):             # <<<<<<<<<<<<<<
 *         """Remove a sister node and return it.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("ete4.core.tree.Tree.remove_sister", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_sisters);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ete4/core/tree.pyx":367
 *         return self.up.remove_child(sister or sisters[0])
 * 
 *     def delete(self, prevent_nondicotomic=True, preserve_branch_length=False):             # <<<<<<<<<<<<<<
 *         """Delete node from the tree structure, keeping its children.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_44delete(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_4ete4_4core_4tree_4Tree_43delete, "Tree.delete(self, prevent_nondicotomic=True, preserve_branch_length=False)\nDelete node from the tree structure, keeping its children.\n\n        The children from the deleted node are transferred to the old parent.\n\n        :param prevent_nondicotomic: If True (default), it will also\n            delete parent nodes until no single-child nodes occur.\n        :param preserve_branch_length: If True, branch lengths\n            of the deleted nodes are transferred (summed up) to the\n            parent's branch, thus keeping original distances among\n            nodes.\n\n        Example::\n\n          t = Tree('(C,(B,A)H)root;')\n          print(t.to_str(props=['name']))\n          #       \342\225\255\342\225\264C\n          # \342\225\264root\342\225\266\342\224\244\n          #       \342\224\202   \342\225\255\342\225\264B\n          #       \342\225\260\342\225\264H\342\225\266\342\224\244\n          #           \342\225\260\342\225\264A\n\n          t['H'].delete()  # delete the \"H\" node\n          print(t.to_str(props=['name']))\n          #       \342\225\255\342\225\264C\n          #       \342\224\202\n          # \342\225\264root\342\225\266\342\224\274\342\225\264B\n          #       \342\224\202\n          #       \342\225\260\342\225\264A\n        ");
static PyMethodDef __pyx_mdef_4ete4_4core_4tree_4Tree_44delete = {"delete", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_44delete, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_43delete};
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_44delete(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_prevent_nondicotomic = 0;
  PyObject *__pyx_v_preserve_branch_length = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("delete (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_prevent_nondicotomic,&__pyx_n_s_preserve_branch_length,0};
    values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_True));
    values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_False));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_prevent_nondicotomic);
          if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 367, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_preserve_branch_length);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 367, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "delete") < 0)) __PYX_ERR(0, 367, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_prevent_nondicotomic = values[0];
    __pyx_v_preserve_branch_length = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("delete", 0, 0, 2, __pyx_nargs); __PYX_ERR(0, 367, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("ete4.core.tree.Tree.delete", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_43delete(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self), __pyx_v_prevent_nondicotomic, __pyx_v_preserve_branch_length);

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

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_43delete(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_prevent_nondicotomic, PyObject *__pyx_v_preserve_branch_length) {
  struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_parent = NULL;
  PyObject *__pyx_v_ch = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *(*__pyx_t_8)(PyObject *);
  unsigned int __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("delete", 1);

  /* "ete4/core/tree.pyx":397
 *           #       A
 *         """
 *         parent = self.up             # <<<<<<<<<<<<<<
 *         if not parent:
 *             return  # nothing to do, we cannot actually delete the root
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_self->up);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_parent = ((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "ete4/core/tree.pyx":398
 *         """
 *         parent = self.up
 *         if not parent:             # <<<<<<<<<<<<<<
 *             return  # nothing to do, we cannot actually delete the root
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_parent)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 398, __pyx_L1_error)
  __pyx_t_3 = (!__pyx_t_2);
  if (__pyx_t_3) {

    /* "ete4/core/tree.pyx":399
 *         parent = self.up
 *         if not parent:
 *             return  # nothing to do, we cannot actually delete the root             # <<<<<<<<<<<<<<
 * 
 *         if preserve_branch_length and 'dist' in self.props:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "ete4/core/tree.pyx":398
 *         """
 *         parent = self.up
 *         if not parent:             # <<<<<<<<<<<<<<
 *             return  # nothing to do, we cannot actually delete the root
 * 
 */
  }

  /* "ete4/core/tree.pyx":401
 *             return  # nothing to do, we cannot actually delete the root
 * 
 *         if preserve_branch_length and 'dist' in self.props:             # <<<<<<<<<<<<<<
 *             if len(self.children) == 1 and 'dist' in self.children[0].props:
 *                 self.children[0].dist += self.dist
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_preserve_branch_length); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 401, __pyx_L1_error)
  if (__pyx_t_2) {
  } else {
    __pyx_t_3 = __pyx_t_2;
    goto __pyx_L5_bool_binop_done;
  }
  if (unlikely(__pyx_v_self->props == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(0, 401, __pyx_L1_error)
  }
  __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_n_u_dist, __pyx_v_self->props, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 401, __pyx_L1_error)
  __pyx_t_3 = __pyx_t_2;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_3) {

    /* "ete4/core/tree.pyx":402
 * 
 *         if preserve_branch_length and 'dist' in self.props:
 *             if len(self.children) == 1 and 'dist' in self.children[0].props:             # <<<<<<<<<<<<<<
 *                 self.children[0].dist += self.dist
 *             elif len(parent.children) == 1 and 'dist' in parent.props:
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_children); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 402, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 402, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_2 = (__pyx_t_4 == 1);
    if (__pyx_t_2) {
    } else {
      __pyx_t_3 = __pyx_t_2;
      goto __pyx_L8_bool_binop_done;
    }
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_children); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 402, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 402, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_props); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 402, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_n_u_dist, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 402, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_3 = __pyx_t_2;
    __pyx_L8_bool_binop_done:;
    if (__pyx_t_3) {

      /* "ete4/core/tree.pyx":403
 *         if preserve_branch_length and 'dist' in self.props:
 *             if len(self.children) == 1 and 'dist' in self.children[0].props:
 *                 self.children[0].dist += self.dist             # <<<<<<<<<<<<<<
 *             elif len(parent.children) == 1 and 'dist' in parent.props:
 *                 parent.dist += self.dist
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_children); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 403, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 403, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_dist); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 403, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dist); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 403, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 403, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (__Pyx_PyObject_SetAttrStr(__pyx_t_5, __pyx_n_s_dist, __pyx_t_7) < 0) __PYX_ERR(0, 403, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "ete4/core/tree.pyx":402
 * 
 *         if preserve_branch_length and 'dist' in self.props:
 *             if len(self.children) == 1 and 'dist' in self.children[0].props:             # <<<<<<<<<<<<<<
 *                 self.children[0].dist += self.dist
 *             elif len(parent.children) == 1 and 'dist' in parent.props:
 */
      goto __pyx_L7;
    }

    /* "ete4/core/tree.pyx":404
 *             if len(self.children) == 1 and 'dist' in self.children[0].props:
 *                 self.children[0].dist += self.dist
 *             elif len(parent.children) == 1 and 'dist' in parent.props:             # <<<<<<<<<<<<<<
 *                 parent.dist += self.dist
 * 
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent), __pyx_n_s_children); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 404, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = PyObject_Length(__pyx_t_5); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 404, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_2 = (__pyx_t_4 == 1);
    if (__pyx_t_2) {
    } else {
      __pyx_t_3 = __pyx_t_2;
      goto __pyx_L10_bool_binop_done;
    }
    if (unlikely(__pyx_v_parent->props == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(0, 404, __pyx_L1_error)
    }
    __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_n_u_dist, __pyx_v_parent->props, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 404, __pyx_L1_error)
    __pyx_t_3 = __pyx_t_2;
    __pyx_L10_bool_binop_done:;
    if (__pyx_t_3) {

      /* "ete4/core/tree.pyx":405
 *                 self.children[0].dist += self.dist
 *             elif len(parent.children) == 1 and 'dist' in parent.props:
 *                 parent.dist += self.dist             # <<<<<<<<<<<<<<
 * 
 *         for ch in self.children:
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent), __pyx_n_s_dist); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 405, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dist); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 405, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 405, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_parent), __pyx_n_s_dist, __pyx_t_6) < 0) __PYX_ERR(0, 405, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "ete4/core/tree.pyx":404
 *             if len(self.children) == 1 and 'dist' in self.children[0].props:
 *                 self.children[0].dist += self.dist
 *             elif len(parent.children) == 1 and 'dist' in parent.props:             # <<<<<<<<<<<<<<
 *                 parent.dist += self.dist
 * 
 */
    }
    __pyx_L7:;

    /* "ete4/core/tree.pyx":401
 *             return  # nothing to do, we cannot actually delete the root
 * 
 *         if preserve_branch_length and 'dist' in self.props:             # <<<<<<<<<<<<<<
 *             if len(self.children) == 1 and 'dist' in self.children[0].props:
 *                 self.children[0].dist += self.dist
 */
  }

  /* "ete4/core/tree.pyx":407
 *                 parent.dist += self.dist
 * 
 *         for ch in self.children:             # <<<<<<<<<<<<<<
 *             parent.add_child(ch)
 * 
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_children); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 407, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) {
    __pyx_t_7 = __pyx_t_6; __Pyx_INCREF(__pyx_t_7);
    __pyx_t_4 = 0;
    __pyx_t_8 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 407, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 407, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  for (;;) {
    if (likely(!__pyx_t_8)) {
      if (likely(PyList_CheckExact(__pyx_t_7))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_7);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 407, __pyx_L1_error)
          #endif
          if (__pyx_t_4 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_6 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 407, __pyx_L1_error)
        #else
        __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 407, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_7);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 407, __pyx_L1_error)
          #endif
          if (__pyx_t_4 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 407, __pyx_L1_error)
        #else
        __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 407, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        #endif
      }
    } else {
      __pyx_t_6 = __pyx_t_8(__pyx_t_7);
      if (unlikely(!__pyx_t_6)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 407, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_6);
    }
    __Pyx_XDECREF_SET(__pyx_v_ch, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "ete4/core/tree.pyx":408
 * 
 *         for ch in self.children:
 *             parent.add_child(ch)             # <<<<<<<<<<<<<<
 * 
 *         parent.remove_child(self)
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent), __pyx_n_s_add_child); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 408, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = NULL;
    __pyx_t_9 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_9 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_ch};
      __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 408, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "ete4/core/tree.pyx":407
 *                 parent.dist += self.dist
 * 
 *         for ch in self.children:             # <<<<<<<<<<<<<<
 *             parent.add_child(ch)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "ete4/core/tree.pyx":410
 *             parent.add_child(ch)
 * 
 *         parent.remove_child(self)             # <<<<<<<<<<<<<<
 * 
 *         if prevent_nondicotomic and len(parent.children) == 1:
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent), __pyx_n_s_remove_child); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 410, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = NULL;
  __pyx_t_9 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
      __pyx_t_9 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, ((PyObject *)__pyx_v_self)};
    __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 410, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "ete4/core/tree.pyx":412
 *         parent.remove_child(self)
 * 
 *         if prevent_nondicotomic and len(parent.children) == 1:             # <<<<<<<<<<<<<<
 *             parent.delete(prevent_nondicotomic=prevent_nondicotomic,
 *                           preserve_branch_length=preserve_branch_length)
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_prevent_nondicotomic); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 412, __pyx_L1_error)
  if (__pyx_t_2) {
  } else {
    __pyx_t_3 = __pyx_t_2;
    goto __pyx_L16_bool_binop_done;
  }
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent), __pyx_n_s_children); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 412, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_4 = PyObject_Length(__pyx_t_7); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 412, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_2 = (__pyx_t_4 == 1);
  __pyx_t_3 = __pyx_t_2;
  __pyx_L16_bool_binop_done:;
  if (__pyx_t_3) {

    /* "ete4/core/tree.pyx":413
 * 
 *         if prevent_nondicotomic and len(parent.children) == 1:
 *             parent.delete(prevent_nondicotomic=prevent_nondicotomic,             # <<<<<<<<<<<<<<
 *                           preserve_branch_length=preserve_branch_length)
 * 
 */
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent), __pyx_n_s_delete); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 413, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 413, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_prevent_nondicotomic, __pyx_v_prevent_nondicotomic) < 0) __PYX_ERR(0, 413, __pyx_L1_error)

    /* "ete4/core/tree.pyx":414
 *         if prevent_nondicotomic and len(parent.children) == 1:
 *             parent.delete(prevent_nondicotomic=prevent_nondicotomic,
 *                           preserve_branch_length=preserve_branch_length)             # <<<<<<<<<<<<<<
 * 
 *     def detach(self):
 */
    if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_preserve_branch_length, __pyx_v_preserve_branch_length) < 0) __PYX_ERR(0, 413, __pyx_L1_error)

    /* "ete4/core/tree.pyx":413
 * 
 *         if prevent_nondicotomic and len(parent.children) == 1:
 *             parent.delete(prevent_nondicotomic=prevent_nondicotomic,             # <<<<<<<<<<<<<<
 *                           preserve_branch_length=preserve_branch_length)
 * 
 */
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 413, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __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;

    /* "ete4/core/tree.pyx":412
 *         parent.remove_child(self)
 * 
 *         if prevent_nondicotomic and len(parent.children) == 1:             # <<<<<<<<<<<<<<
 *             parent.delete(prevent_nondicotomic=prevent_nondicotomic,
 *                           preserve_branch_length=preserve_branch_length)
 */
  }

  /* "ete4/core/tree.pyx":367
 *         return self.up.remove_child(sister or sisters[0])
 * 
 *     def delete(self, prevent_nondicotomic=True, preserve_branch_length=False):             # <<<<<<<<<<<<<<
 *         """Delete node from the tree structure, keeping its children.
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("ete4.core.tree.Tree.delete", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_parent);
  __Pyx_XDECREF(__pyx_v_ch);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ete4/core/tree.pyx":416
 *                           preserve_branch_length=preserve_branch_length)
 * 
 *     def detach(self):             # <<<<<<<<<<<<<<
 *         """Detach this node (and descendants) from its parent and return itself.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_46detach(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_4ete4_4core_4tree_4Tree_45detach, "Tree.detach(self)\nDetach this node (and descendants) from its parent and return itself.\n\n        The detached node conserves all its structure of descendants,\n        and can be attached to another node with the :func:`add_child`\n        function. This mechanism can be seen as a \"cut and paste\".\n        ");
static PyMethodDef __pyx_mdef_4ete4_4core_4tree_4Tree_46detach = {"detach", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_46detach, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_45detach};
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_46detach(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("detach (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("detach", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "detach", 0))) return NULL;
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_45detach(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self));

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

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_45detach(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  unsigned int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("detach", 1);

  /* "ete4/core/tree.pyx":423
 *         function. This mechanism can be seen as a "cut and paste".
 *         """
 *         if self.up:             # <<<<<<<<<<<<<<
 *             self.up.children.remove(self)
 *             self.up = None
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_self->up)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 423, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "ete4/core/tree.pyx":424
 *         """
 *         if self.up:
 *             self.up.children.remove(self)             # <<<<<<<<<<<<<<
 *             self.up = None
 * 
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->up), __pyx_n_s_children); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 424, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_remove); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 424, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, ((PyObject *)__pyx_v_self)};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 424, __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;

    /* "ete4/core/tree.pyx":425
 *         if self.up:
 *             self.up.children.remove(self)
 *             self.up = None             # <<<<<<<<<<<<<<
 * 
 *         return self
 */
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    __Pyx_GOTREF((PyObject *)__pyx_v_self->up);
    __Pyx_DECREF((PyObject *)__pyx_v_self->up);
    __pyx_v_self->up = ((struct __pyx_obj_4ete4_4core_4tree_Tree *)Py_None);

    /* "ete4/core/tree.pyx":423
 *         function. This mechanism can be seen as a "cut and paste".
 *         """
 *         if self.up:             # <<<<<<<<<<<<<<
 *             self.up.children.remove(self)
 *             self.up = None
 */
  }

  /* "ete4/core/tree.pyx":427
 *             self.up = None
 * 
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def prune(self, nodes, preserve_branch_length=False):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "ete4/core/tree.pyx":416
 *                           preserve_branch_length=preserve_branch_length)
 * 
 *     def detach(self):             # <<<<<<<<<<<<<<
 *         """Detach this node (and descendants) from its parent and return itself.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("ete4.core.tree.Tree.detach", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ete4/core/tree.pyx":429
 *         return self
 * 
 *     def prune(self, nodes, preserve_branch_length=False):             # <<<<<<<<<<<<<<
 *         """Prune the topology conserving only the given nodes.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_48prune(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_4ete4_4core_4tree_4Tree_47prune, "Tree.prune(self, nodes, preserve_branch_length=False)\nPrune the topology conserving only the given nodes.\n\n        It will only retain the minimum number of nodes that conserve the\n        topological relationships among the requested nodes. The root node is\n        always conserved.\n\n        :param nodes: List of node names or objects that should be kept.\n        :param bool preserve_branch_length: If True, branch lengths\n            of the deleted nodes are transferred (summed up) to its\n            parent's branch, thus keeping original distances among nodes.\n\n        Examples::\n\n          t = Tree('(((((A,B)C)D,E)F,G)H,(I,J)K)root;')\n          print(t.to_str(props=['name']))\n          #                       \342\225\255\342\225\264A\n          #               \342\225\255\342\225\264D\342\225\266\342\225\214\342\225\264C\342\225\266\342\224\244\n          #           \342\225\255\342\225\264F\342\225\266\342\224\244       \342\225\260\342\225\264B\n          #           \342\224\202   \342\224\202\n          #       \342\225\255\342\225\264H\342\225\266\342\224\244   \342\225\260\342\225\264E\n          #       \342\224\202   \342\224\202\n          # \342\225\264root\342\225\266\342\224\244   \342\225\260\342\225\264G\n          #       \342\224\202\n          #       \342\224\202   \342\225\255\342\225\264I\n          #       \342\225\260\342\225\264K\342\225\266\342\224\244\n          #           \342\225\260\342\225\264J\n\n          t1 = t.copy()\n          t1.prune(['A', 'B'])\n          print(t1.to_str(props=['name']))\n          #       \342\225\255\342\225\264A\n          # \342\225\264root\342\225\266\342\224\244\n          #       \342\225\260\342\225\264B\n\n          t2 = t.copy()\n          t2.prune(['A', 'B', 'C'])\n          print(t2.to_str(props=['name']))\n          #           \342\225\255\342\225\264A\n          # \342\225\264root\342\225\266\342\225\214\342\225\264C\342\225\266\342\224\244\n          #           \342\225""\260\342\225\264B\n\n          t3 = t.copy()\n          t3.prune(['A', 'B', 'I'])\n          print(t3.to_str(props=['name']))\n          #           \342\225\255\342\225\264A\n          #       \342\225\255\342\225\264C\342\225\266\342\224\244\n          # \342\225\264root\342\225\266\342\224\244   \342\225\260\342\225\264B\n          #       \342\224\202\n          #       \342\225\260\342\225\264I\n\n          t4 = t.copy()\n          t4.prune(['A', 'B', 'F', 'H'])\n          print(t4.to_str(props=['name']))\n          #               \342\225\255\342\225\264A\n          # \342\225\264root\342\225\266\342\225\214\342\225\264H\342\225\266\342\225\214\342\225\264F\342\225\266\342\224\244\n          #               \342\225\260\342\225\264B\n        ");
static PyMethodDef __pyx_mdef_4ete4_4core_4tree_4Tree_48prune = {"prune", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_48prune, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_47prune};
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_48prune(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_nodes = 0;
  PyObject *__pyx_v_preserve_branch_length = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("prune (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nodes,&__pyx_n_s_preserve_branch_length,0};
    values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_False));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_nodes)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 429, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_preserve_branch_length);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 429, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "prune") < 0)) __PYX_ERR(0, 429, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_nodes = values[0];
    __pyx_v_preserve_branch_length = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("prune", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 429, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("ete4.core.tree.Tree.prune", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_47prune(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self), __pyx_v_nodes, __pyx_v_preserve_branch_length);

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

/* "ete4/core/tree.pyx":487
 *           #               B
 *         """
 *         def cmp_nodes(x, y):             # <<<<<<<<<<<<<<
 *             # if several nodes are in the same path of two kept nodes,
 *             # only one should be maintained. This prioritize internal
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_5prune_1cmp_nodes(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_4ete4_4core_4tree_4Tree_5prune_1cmp_nodes = {"cmp_nodes", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_5prune_1cmp_nodes, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_5prune_1cmp_nodes(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_x = 0;
  PyObject *__pyx_v_y = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cmp_nodes (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 487, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 487, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("cmp_nodes", 1, 2, 2, 1); __PYX_ERR(0, 487, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "cmp_nodes") < 0)) __PYX_ERR(0, 487, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_x = values[0];
    __pyx_v_y = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cmp_nodes", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 487, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("ete4.core.tree.Tree.prune.cmp_nodes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_5prune_cmp_nodes(__pyx_self, __pyx_v_x, __pyx_v_y);

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

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_5prune_cmp_nodes(PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_8_prune *__pyx_cur_scope;
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_8_prune *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cmp_nodes", 1);
  __pyx_outer_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_8_prune *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "ete4/core/tree.pyx":492
 *             # nodes that are already in the to_keep list and then
 *             # deeper nodes (closer to the leaves).
 *             if n2depth[x] > n2depth[y]:             # <<<<<<<<<<<<<<
 *                 return -1
 *             elif n2depth[x] < n2depth[y]:
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_n2depth)) { __Pyx_RaiseClosureNameError("n2depth"); __PYX_ERR(0, 492, __pyx_L1_error) }
  if (unlikely(__pyx_cur_scope->__pyx_v_n2depth == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(0, 492, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_n2depth, __pyx_v_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 492, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(!__pyx_cur_scope->__pyx_v_n2depth)) { __Pyx_RaiseClosureNameError("n2depth"); __PYX_ERR(0, 492, __pyx_L1_error) }
  if (unlikely(__pyx_cur_scope->__pyx_v_n2depth == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(0, 492, __pyx_L1_error)
  }
  __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_n2depth, __pyx_v_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 492, __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, 492, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 492, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_4) {

    /* "ete4/core/tree.pyx":493
 *             # deeper nodes (closer to the leaves).
 *             if n2depth[x] > n2depth[y]:
 *                 return -1             # <<<<<<<<<<<<<<
 *             elif n2depth[x] < n2depth[y]:
 *                 return 1
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_int_neg_1);
    __pyx_r = __pyx_int_neg_1;
    goto __pyx_L0;

    /* "ete4/core/tree.pyx":492
 *             # nodes that are already in the to_keep list and then
 *             # deeper nodes (closer to the leaves).
 *             if n2depth[x] > n2depth[y]:             # <<<<<<<<<<<<<<
 *                 return -1
 *             elif n2depth[x] < n2depth[y]:
 */
  }

  /* "ete4/core/tree.pyx":494
 *             if n2depth[x] > n2depth[y]:
 *                 return -1
 *             elif n2depth[x] < n2depth[y]:             # <<<<<<<<<<<<<<
 *                 return 1
 *             else:
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_n2depth)) { __Pyx_RaiseClosureNameError("n2depth"); __PYX_ERR(0, 494, __pyx_L1_error) }
  if (unlikely(__pyx_cur_scope->__pyx_v_n2depth == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(0, 494, __pyx_L1_error)
  }
  __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_n2depth, __pyx_v_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 494, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (unlikely(!__pyx_cur_scope->__pyx_v_n2depth)) { __Pyx_RaiseClosureNameError("n2depth"); __PYX_ERR(0, 494, __pyx_L1_error) }
  if (unlikely(__pyx_cur_scope->__pyx_v_n2depth == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(0, 494, __pyx_L1_error)
  }
  __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_n2depth, __pyx_v_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 494, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 494, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 494, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "ete4/core/tree.pyx":495
 *                 return -1
 *             elif n2depth[x] < n2depth[y]:
 *                 return 1             # <<<<<<<<<<<<<<
 *             else:
 *                 return 0
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_int_1);
    __pyx_r = __pyx_int_1;
    goto __pyx_L0;

    /* "ete4/core/tree.pyx":494
 *             if n2depth[x] > n2depth[y]:
 *                 return -1
 *             elif n2depth[x] < n2depth[y]:             # <<<<<<<<<<<<<<
 *                 return 1
 *             else:
 */
  }

  /* "ete4/core/tree.pyx":497
 *                 return 1
 *             else:
 *                 return 0             # <<<<<<<<<<<<<<
 * 
 *         to_keep = set(self._translate_nodes(nodes))
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_int_0);
    __pyx_r = __pyx_int_0;
    goto __pyx_L0;
  }

  /* "ete4/core/tree.pyx":487
 *           #               B
 *         """
 *         def cmp_nodes(x, y):             # <<<<<<<<<<<<<<
 *             # if several nodes are in the same path of two kept nodes,
 *             # only one should be maintained. This prioritize internal
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("ete4.core.tree.Tree.prune.cmp_nodes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ete4/core/tree.pyx":429
 *         return self
 * 
 *     def prune(self, nodes, preserve_branch_length=False):             # <<<<<<<<<<<<<<
 *         """Prune the topology conserving only the given nodes.
 * 
 */

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_47prune(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_nodes, PyObject *__pyx_v_preserve_branch_length) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_8_prune *__pyx_cur_scope;
  PyObject *__pyx_v_cmp_nodes = 0;
  PyObject *__pyx_v_to_keep = NULL;
  PyObject *__pyx_v_start = NULL;
  PyObject *__pyx_v_node2path = NULL;
  PyObject *__pyx_v_n2count = NULL;
  PyObject *__pyx_v_seed = NULL;
  PyObject *__pyx_v_path = NULL;
  PyObject *__pyx_v_visited_node = NULL;
  PyObject *__pyx_v_depth = NULL;
  PyObject *__pyx_v_visitors2nodes = NULL;
  PyObject *__pyx_v_node = NULL;
  PyObject *__pyx_v_visitors = NULL;
  PyObject *__pyx_v_visitor_key = NULL;
  PyObject *__pyx_v_sorted_nodes = NULL;
  PyObject *__pyx_v_n = NULL;
  PyObject *__pyx_8genexpr5__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;
  unsigned int __pyx_t_4;
  Py_ssize_t __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;
  int __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  PyObject *(*__pyx_t_13)(PyObject *);
  int __pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  int __pyx_t_16;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("prune", 0);
  __pyx_cur_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_8_prune *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_8_prune(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_8_prune, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_8_prune *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 429, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __Pyx_INCREF(__pyx_v_nodes);

  /* "ete4/core/tree.pyx":487
 *           #               B
 *         """
 *         def cmp_nodes(x, y):             # <<<<<<<<<<<<<<
 *             # if several nodes are in the same path of two kept nodes,
 *             # only one should be maintained. This prioritize internal
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_5prune_1cmp_nodes, 0, __pyx_n_s_prune_locals_cmp_nodes, ((PyObject*)__pyx_cur_scope), __pyx_n_s_ete4_core_tree, __pyx_d, ((PyObject *)__pyx_codeobj__7)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 487, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_cmp_nodes = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "ete4/core/tree.pyx":499
 *                 return 0
 * 
 *         to_keep = set(self._translate_nodes(nodes))             # <<<<<<<<<<<<<<
 *         start = self.common_ancestor(to_keep)
 *         node2path = {n: n.lineage() for n in to_keep}
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_translate_nodes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 499, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_nodes};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 499, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_t_2 = PySet_New(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 499, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_to_keep = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "ete4/core/tree.pyx":500
 * 
 *         to_keep = set(self._translate_nodes(nodes))
 *         start = self.common_ancestor(to_keep)             # <<<<<<<<<<<<<<
 *         node2path = {n: n.lineage() for n in to_keep}
 *         to_keep.add(self)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_common_ancestor); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 500, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_to_keep};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 500, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_v_start = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "ete4/core/tree.pyx":501
 *         to_keep = set(self._translate_nodes(nodes))
 *         start = self.common_ancestor(to_keep)
 *         node2path = {n: n.lineage() for n in to_keep}             # <<<<<<<<<<<<<<
 *         to_keep.add(self)
 * 
 */
  { /* enter inner scope */
    __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 501, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = 0;
    __pyx_t_3 = __Pyx_set_iterator(__pyx_v_to_keep, 1, (&__pyx_t_6), (&__pyx_t_7)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 501, __pyx_L5_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_6, &__pyx_t_5, &__pyx_t_3, __pyx_t_7);
      if (unlikely(__pyx_t_8 == 0)) break;
      if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 501, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_XDECREF_SET(__pyx_8genexpr5__pyx_v_n, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_8genexpr5__pyx_v_n, __pyx_n_s_lineage); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 501, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = NULL;
      __pyx_t_4 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_9))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
        if (likely(__pyx_t_10)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_9, function);
          __pyx_t_4 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_10, NULL};
        __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 501, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
      if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_8genexpr5__pyx_v_n, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 501, __pyx_L5_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_n); __pyx_8genexpr5__pyx_v_n = 0;
    goto __pyx_L8_exit_scope;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_n); __pyx_8genexpr5__pyx_v_n = 0;
    goto __pyx_L1_error;
    __pyx_L8_exit_scope:;
  } /* exit inner scope */
  __pyx_v_node2path = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "ete4/core/tree.pyx":502
 *         start = self.common_ancestor(to_keep)
 *         node2path = {n: n.lineage() for n in to_keep}
 *         to_keep.add(self)             # <<<<<<<<<<<<<<
 * 
 *         # Calculate which kept nodes are visiting the same nodes in
 */
  __pyx_t_11 = PySet_Add(__pyx_v_to_keep, ((PyObject *)__pyx_v_self)); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 502, __pyx_L1_error)

  /* "ete4/core/tree.pyx":506
 *         # Calculate which kept nodes are visiting the same nodes in
 *         # their path to the common ancestor.
 *         n2count = {}             # <<<<<<<<<<<<<<
 *         n2depth = {}
 *         for seed, path in node2path.items():
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 506, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_n2count = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "ete4/core/tree.pyx":507
 *         # their path to the common ancestor.
 *         n2count = {}
 *         n2depth = {}             # <<<<<<<<<<<<<<
 *         for seed, path in node2path.items():
 *             for visited_node in path:
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 507, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_cur_scope->__pyx_v_n2depth = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "ete4/core/tree.pyx":508
 *         n2count = {}
 *         n2depth = {}
 *         for seed, path in node2path.items():             # <<<<<<<<<<<<<<
 *             for visited_node in path:
 *                 if visited_node not in n2depth:
 */
  __pyx_t_6 = 0;
  __pyx_t_1 = __Pyx_dict_iterator(__pyx_v_node2path, 1, __pyx_n_s_items, (&__pyx_t_5), (&__pyx_t_7)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 508, __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_8 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_5, &__pyx_t_6, &__pyx_t_1, &__pyx_t_3, NULL, __pyx_t_7);
    if (unlikely(__pyx_t_8 == 0)) break;
    if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 508, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_seed, __pyx_t_1);
    __pyx_t_1 = 0;
    __Pyx_XDECREF_SET(__pyx_v_path, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "ete4/core/tree.pyx":509
 *         n2depth = {}
 *         for seed, path in node2path.items():
 *             for visited_node in path:             # <<<<<<<<<<<<<<
 *                 if visited_node not in n2depth:
 *                     depth = visited_node.get_distance(visited_node, start,
 */
    if (likely(PyList_CheckExact(__pyx_v_path)) || PyTuple_CheckExact(__pyx_v_path)) {
      __pyx_t_3 = __pyx_v_path; __Pyx_INCREF(__pyx_t_3);
      __pyx_t_12 = 0;
      __pyx_t_13 = NULL;
    } else {
      __pyx_t_12 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 509, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_13 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 509, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_13)) {
        if (likely(PyList_CheckExact(__pyx_t_3))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 509, __pyx_L1_error)
            #endif
            if (__pyx_t_12 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_12); __Pyx_INCREF(__pyx_t_1); __pyx_t_12++; if (unlikely((0 < 0))) __PYX_ERR(0, 509, __pyx_L1_error)
          #else
          __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 509, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          #endif
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 509, __pyx_L1_error)
            #endif
            if (__pyx_t_12 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_12); __Pyx_INCREF(__pyx_t_1); __pyx_t_12++; if (unlikely((0 < 0))) __PYX_ERR(0, 509, __pyx_L1_error)
          #else
          __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 509, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          #endif
        }
      } else {
        __pyx_t_1 = __pyx_t_13(__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, 509, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_XDECREF_SET(__pyx_v_visited_node, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "ete4/core/tree.pyx":510
 *         for seed, path in node2path.items():
 *             for visited_node in path:
 *                 if visited_node not in n2depth:             # <<<<<<<<<<<<<<
 *                     depth = visited_node.get_distance(visited_node, start,
 *                                                       topological=True)
 */
      __pyx_t_14 = (__Pyx_PyDict_ContainsTF(__pyx_v_visited_node, __pyx_cur_scope->__pyx_v_n2depth, Py_NE)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 510, __pyx_L1_error)
      if (__pyx_t_14) {

        /* "ete4/core/tree.pyx":511
 *             for visited_node in path:
 *                 if visited_node not in n2depth:
 *                     depth = visited_node.get_distance(visited_node, start,             # <<<<<<<<<<<<<<
 *                                                       topological=True)
 *                     n2depth[visited_node] = depth
 */
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_visited_node, __pyx_n_s_get_distance); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 511, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 511, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_INCREF(__pyx_v_visited_node);
        __Pyx_GIVEREF(__pyx_v_visited_node);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_visited_node)) __PYX_ERR(0, 511, __pyx_L1_error);
        __Pyx_INCREF(__pyx_v_start);
        __Pyx_GIVEREF(__pyx_v_start);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_start)) __PYX_ERR(0, 511, __pyx_L1_error);

        /* "ete4/core/tree.pyx":512
 *                 if visited_node not in n2depth:
 *                     depth = visited_node.get_distance(visited_node, start,
 *                                                       topological=True)             # <<<<<<<<<<<<<<
 *                     n2depth[visited_node] = depth
 *                 if visited_node is not seed:
 */
        __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 512, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_topological, Py_True) < 0) __PYX_ERR(0, 512, __pyx_L1_error)

        /* "ete4/core/tree.pyx":511
 *             for visited_node in path:
 *                 if visited_node not in n2depth:
 *                     depth = visited_node.get_distance(visited_node, start,             # <<<<<<<<<<<<<<
 *                                                       topological=True)
 *                     n2depth[visited_node] = depth
 */
        __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 511, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_15);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_XDECREF_SET(__pyx_v_depth, __pyx_t_15);
        __pyx_t_15 = 0;

        /* "ete4/core/tree.pyx":513
 *                     depth = visited_node.get_distance(visited_node, start,
 *                                                       topological=True)
 *                     n2depth[visited_node] = depth             # <<<<<<<<<<<<<<
 *                 if visited_node is not seed:
 *                     n2count.setdefault(visited_node, set()).add(seed)
 */
        if (unlikely((PyDict_SetItem(__pyx_cur_scope->__pyx_v_n2depth, __pyx_v_visited_node, __pyx_v_depth) < 0))) __PYX_ERR(0, 513, __pyx_L1_error)

        /* "ete4/core/tree.pyx":510
 *         for seed, path in node2path.items():
 *             for visited_node in path:
 *                 if visited_node not in n2depth:             # <<<<<<<<<<<<<<
 *                     depth = visited_node.get_distance(visited_node, start,
 *                                                       topological=True)
 */
      }

      /* "ete4/core/tree.pyx":514
 *                                                       topological=True)
 *                     n2depth[visited_node] = depth
 *                 if visited_node is not seed:             # <<<<<<<<<<<<<<
 *                     n2count.setdefault(visited_node, set()).add(seed)
 * 
 */
      __pyx_t_14 = (__pyx_v_visited_node != __pyx_v_seed);
      if (__pyx_t_14) {

        /* "ete4/core/tree.pyx":515
 *                     n2depth[visited_node] = depth
 *                 if visited_node is not seed:
 *                     n2count.setdefault(visited_node, set()).add(seed)             # <<<<<<<<<<<<<<
 * 
 *         # if several internal nodes are in the path of exactly the same kept
 */
        __pyx_t_10 = PySet_New(0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 515, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_9 = __Pyx_PyDict_SetDefault(__pyx_v_n2count, __pyx_v_visited_node, __pyx_t_10, -1L); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 515, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_add); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 515, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = NULL;
        __pyx_t_4 = 0;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_10))) {
          __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10);
          if (likely(__pyx_t_9)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
            __Pyx_INCREF(__pyx_t_9);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_10, function);
            __pyx_t_4 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_seed};
          __pyx_t_15 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 515, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_15);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

        /* "ete4/core/tree.pyx":514
 *                                                       topological=True)
 *                     n2depth[visited_node] = depth
 *                 if visited_node is not seed:             # <<<<<<<<<<<<<<
 *                     n2count.setdefault(visited_node, set()).add(seed)
 * 
 */
      }

      /* "ete4/core/tree.pyx":509
 *         n2depth = {}
 *         for seed, path in node2path.items():
 *             for visited_node in path:             # <<<<<<<<<<<<<<
 *                 if visited_node not in n2depth:
 *                     depth = visited_node.get_distance(visited_node, start,
 */
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ete4/core/tree.pyx":519
 *         # if several internal nodes are in the path of exactly the same kept
 *         # nodes, only one (the deepest) should be maintain.
 *         visitors2nodes = {}             # <<<<<<<<<<<<<<
 *         for node, visitors in n2count.items():
 *             # keep nodes connection at least two other nodes
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 519, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_visitors2nodes = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "ete4/core/tree.pyx":520
 *         # nodes, only one (the deepest) should be maintain.
 *         visitors2nodes = {}
 *         for node, visitors in n2count.items():             # <<<<<<<<<<<<<<
 *             # keep nodes connection at least two other nodes
 *             if len(visitors)>1:
 */
  __pyx_t_5 = 0;
  __pyx_t_3 = __Pyx_dict_iterator(__pyx_v_n2count, 1, __pyx_n_s_items, (&__pyx_t_6), (&__pyx_t_7)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 520, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_2);
  __pyx_t_2 = __pyx_t_3;
  __pyx_t_3 = 0;
  while (1) {
    __pyx_t_8 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_6, &__pyx_t_5, &__pyx_t_3, &__pyx_t_15, NULL, __pyx_t_7);
    if (unlikely(__pyx_t_8 == 0)) break;
    if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 520, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GOTREF(__pyx_t_15);
    __Pyx_XDECREF_SET(__pyx_v_node, __pyx_t_3);
    __pyx_t_3 = 0;
    __Pyx_XDECREF_SET(__pyx_v_visitors, __pyx_t_15);
    __pyx_t_15 = 0;

    /* "ete4/core/tree.pyx":522
 *         for node, visitors in n2count.items():
 *             # keep nodes connection at least two other nodes
 *             if len(visitors)>1:             # <<<<<<<<<<<<<<
 *                 visitor_key = frozenset(visitors)
 *                 visitors2nodes.setdefault(visitor_key, set()).add(node)
 */
    __pyx_t_12 = PyObject_Length(__pyx_v_visitors); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 522, __pyx_L1_error)
    __pyx_t_14 = (__pyx_t_12 > 1);
    if (__pyx_t_14) {

      /* "ete4/core/tree.pyx":523
 *             # keep nodes connection at least two other nodes
 *             if len(visitors)>1:
 *                 visitor_key = frozenset(visitors)             # <<<<<<<<<<<<<<
 *                 visitors2nodes.setdefault(visitor_key, set()).add(node)
 * 
 */
      __pyx_t_15 = __Pyx_PyFrozenSet_New(__pyx_v_visitors); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 523, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_15);
      __Pyx_XDECREF_SET(__pyx_v_visitor_key, ((PyObject*)__pyx_t_15));
      __pyx_t_15 = 0;

      /* "ete4/core/tree.pyx":524
 *             if len(visitors)>1:
 *                 visitor_key = frozenset(visitors)
 *                 visitors2nodes.setdefault(visitor_key, set()).add(node)             # <<<<<<<<<<<<<<
 * 
 *         for visitors, nodes in visitors2nodes.items():
 */
      __pyx_t_3 = PySet_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 524, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_10 = __Pyx_PyDict_SetDefault(__pyx_v_visitors2nodes, __pyx_v_visitor_key, __pyx_t_3, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 524, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_add); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 524, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = NULL;
      __pyx_t_4 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_10)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_4 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_v_node};
        __pyx_t_15 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 524, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_15);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      }
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

      /* "ete4/core/tree.pyx":522
 *         for node, visitors in n2count.items():
 *             # keep nodes connection at least two other nodes
 *             if len(visitors)>1:             # <<<<<<<<<<<<<<
 *                 visitor_key = frozenset(visitors)
 *                 visitors2nodes.setdefault(visitor_key, set()).add(node)
 */
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ete4/core/tree.pyx":526
 *                 visitors2nodes.setdefault(visitor_key, set()).add(node)
 * 
 *         for visitors, nodes in visitors2nodes.items():             # <<<<<<<<<<<<<<
 *             if not (to_keep & nodes):
 *                 sorted_nodes = sorted(nodes, key=cmp_to_key(cmp_nodes))
 */
  __pyx_t_6 = 0;
  __pyx_t_15 = __Pyx_dict_iterator(__pyx_v_visitors2nodes, 1, __pyx_n_s_items, (&__pyx_t_5), (&__pyx_t_7)); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 526, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_2);
  __pyx_t_2 = __pyx_t_15;
  __pyx_t_15 = 0;
  while (1) {
    __pyx_t_8 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_5, &__pyx_t_6, &__pyx_t_15, &__pyx_t_3, NULL, __pyx_t_7);
    if (unlikely(__pyx_t_8 == 0)) break;
    if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 526, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_15);
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_visitors, __pyx_t_15);
    __pyx_t_15 = 0;
    __Pyx_DECREF_SET(__pyx_v_nodes, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "ete4/core/tree.pyx":527
 * 
 *         for visitors, nodes in visitors2nodes.items():
 *             if not (to_keep & nodes):             # <<<<<<<<<<<<<<
 *                 sorted_nodes = sorted(nodes, key=cmp_to_key(cmp_nodes))
 *                 to_keep.add(sorted_nodes[0])
 */
    __pyx_t_3 = PyNumber_And(__pyx_v_to_keep, __pyx_v_nodes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 527, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 527, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_16 = (!__pyx_t_14);
    if (__pyx_t_16) {

      /* "ete4/core/tree.pyx":528
 *         for visitors, nodes in visitors2nodes.items():
 *             if not (to_keep & nodes):
 *                 sorted_nodes = sorted(nodes, key=cmp_to_key(cmp_nodes))             # <<<<<<<<<<<<<<
 *                 to_keep.add(sorted_nodes[0])
 * 
 */
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 528, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_v_nodes);
      __Pyx_GIVEREF(__pyx_v_nodes);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_nodes)) __PYX_ERR(0, 528, __pyx_L1_error);
      __pyx_t_15 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 528, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_15);
      __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_cmp_to_key); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 528, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_1 = NULL;
      __pyx_t_4 = 0;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_9))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_9);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_9, function);
          __pyx_t_4 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_cmp_nodes};
        __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 528, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
      if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_key, __pyx_t_10) < 0) __PYX_ERR(0, 528, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_sorted, __pyx_t_3, __pyx_t_15); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 528, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_XDECREF_SET(__pyx_v_sorted_nodes, __pyx_t_10);
      __pyx_t_10 = 0;

      /* "ete4/core/tree.pyx":529
 *             if not (to_keep & nodes):
 *                 sorted_nodes = sorted(nodes, key=cmp_to_key(cmp_nodes))
 *                 to_keep.add(sorted_nodes[0])             # <<<<<<<<<<<<<<
 * 
 *         for n in self.descendants('postorder'):
 */
      __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_sorted_nodes, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 529, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_11 = PySet_Add(__pyx_v_to_keep, __pyx_t_10); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 529, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

      /* "ete4/core/tree.pyx":527
 * 
 *         for visitors, nodes in visitors2nodes.items():
 *             if not (to_keep & nodes):             # <<<<<<<<<<<<<<
 *                 sorted_nodes = sorted(nodes, key=cmp_to_key(cmp_nodes))
 *                 to_keep.add(sorted_nodes[0])
 */
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ete4/core/tree.pyx":531
 *                 to_keep.add(sorted_nodes[0])
 * 
 *         for n in self.descendants('postorder'):             # <<<<<<<<<<<<<<
 *             if n not in to_keep:
 *                 if preserve_branch_length and n.dist is not None:
 */
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_descendants); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 531, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_15 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_10))) {
    __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_10);
    if (likely(__pyx_t_15)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_15);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_10, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_15, __pyx_n_u_postorder};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 531, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  }
  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_10 = __pyx_t_2; __Pyx_INCREF(__pyx_t_10);
    __pyx_t_5 = 0;
    __pyx_t_13 = NULL;
  } else {
    __pyx_t_5 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 531, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_13 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_10); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 531, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_13)) {
      if (likely(PyList_CheckExact(__pyx_t_10))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_10);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 531, __pyx_L1_error)
          #endif
          if (__pyx_t_5 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 531, __pyx_L1_error)
        #else
        __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_10, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 531, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_10);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 531, __pyx_L1_error)
          #endif
          if (__pyx_t_5 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 531, __pyx_L1_error)
        #else
        __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_10, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 531, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_13(__pyx_t_10);
      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, 531, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "ete4/core/tree.pyx":532
 * 
 *         for n in self.descendants('postorder'):
 *             if n not in to_keep:             # <<<<<<<<<<<<<<
 *                 if preserve_branch_length and n.dist is not None:
 *                     if len(n.children) == 1:
 */
    __pyx_t_16 = (__Pyx_PySet_ContainsTF(__pyx_v_n, __pyx_v_to_keep, Py_NE)); if (unlikely((__pyx_t_16 < 0))) __PYX_ERR(0, 532, __pyx_L1_error)
    if (__pyx_t_16) {

      /* "ete4/core/tree.pyx":533
 *         for n in self.descendants('postorder'):
 *             if n not in to_keep:
 *                 if preserve_branch_length and n.dist is not None:             # <<<<<<<<<<<<<<
 *                     if len(n.children) == 1:
 *                         if n.children[0].dist is not None:
 */
      __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_v_preserve_branch_length); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 533, __pyx_L1_error)
      if (__pyx_t_14) {
      } else {
        __pyx_t_16 = __pyx_t_14;
        goto __pyx_L26_bool_binop_done;
      }
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_n, __pyx_n_s_dist); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 533, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_14 = (__pyx_t_2 != Py_None);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_16 = __pyx_t_14;
      __pyx_L26_bool_binop_done:;
      if (__pyx_t_16) {

        /* "ete4/core/tree.pyx":534
 *             if n not in to_keep:
 *                 if preserve_branch_length and n.dist is not None:
 *                     if len(n.children) == 1:             # <<<<<<<<<<<<<<
 *                         if n.children[0].dist is not None:
 *                             n.children[0].dist += n.dist
 */
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_n, __pyx_n_s_children); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 534, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_6 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 534, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_16 = (__pyx_t_6 == 1);
        if (__pyx_t_16) {

          /* "ete4/core/tree.pyx":535
 *                 if preserve_branch_length and n.dist is not None:
 *                     if len(n.children) == 1:
 *                         if n.children[0].dist is not None:             # <<<<<<<<<<<<<<
 *                             n.children[0].dist += n.dist
 *                     elif len(n.children) > 1 and n.up and n.up.dist is not None:
 */
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_n, __pyx_n_s_children); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 535, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_15 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 535, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_15);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_dist); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 535, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
          __pyx_t_16 = (__pyx_t_2 != Py_None);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (__pyx_t_16) {

            /* "ete4/core/tree.pyx":536
 *                     if len(n.children) == 1:
 *                         if n.children[0].dist is not None:
 *                             n.children[0].dist += n.dist             # <<<<<<<<<<<<<<
 *                     elif len(n.children) > 1 and n.up and n.up.dist is not None:
 *                         n.up.dist += n.dist
 */
            __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_n, __pyx_n_s_children); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 536, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_15 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 536, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_15);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_dist); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 536, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_n, __pyx_n_s_dist); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 536, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_9 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 536, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_9);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            if (__Pyx_PyObject_SetAttrStr(__pyx_t_15, __pyx_n_s_dist, __pyx_t_9) < 0) __PYX_ERR(0, 536, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
            __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

            /* "ete4/core/tree.pyx":535
 *                 if preserve_branch_length and n.dist is not None:
 *                     if len(n.children) == 1:
 *                         if n.children[0].dist is not None:             # <<<<<<<<<<<<<<
 *                             n.children[0].dist += n.dist
 *                     elif len(n.children) > 1 and n.up and n.up.dist is not None:
 */
          }

          /* "ete4/core/tree.pyx":534
 *             if n not in to_keep:
 *                 if preserve_branch_length and n.dist is not None:
 *                     if len(n.children) == 1:             # <<<<<<<<<<<<<<
 *                         if n.children[0].dist is not None:
 *                             n.children[0].dist += n.dist
 */
          goto __pyx_L28;
        }

        /* "ete4/core/tree.pyx":537
 *                         if n.children[0].dist is not None:
 *                             n.children[0].dist += n.dist
 *                     elif len(n.children) > 1 and n.up and n.up.dist is not None:             # <<<<<<<<<<<<<<
 *                         n.up.dist += n.dist
 * 
 */
        __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_n, __pyx_n_s_children); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 537, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_15);
        __pyx_t_6 = PyObject_Length(__pyx_t_15); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 537, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        __pyx_t_14 = (__pyx_t_6 > 1);
        if (__pyx_t_14) {
        } else {
          __pyx_t_16 = __pyx_t_14;
          goto __pyx_L30_bool_binop_done;
        }
        __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_n, __pyx_n_s_up); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 537, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_15);
        __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_15); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 537, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        if (__pyx_t_14) {
        } else {
          __pyx_t_16 = __pyx_t_14;
          goto __pyx_L30_bool_binop_done;
        }
        __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_n, __pyx_n_s_up); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 537, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_15);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_dist); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 537, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        __pyx_t_14 = (__pyx_t_9 != Py_None);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_16 = __pyx_t_14;
        __pyx_L30_bool_binop_done:;
        if (__pyx_t_16) {

          /* "ete4/core/tree.pyx":538
 *                             n.children[0].dist += n.dist
 *                     elif len(n.children) > 1 and n.up and n.up.dist is not None:
 *                         n.up.dist += n.dist             # <<<<<<<<<<<<<<
 * 
 *                 n.delete(prevent_nondicotomic=False)
 */
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_n, __pyx_n_s_up); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 538, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_dist); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 538, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_15);
          __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_n, __pyx_n_s_dist); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 538, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_15, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 538, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (__Pyx_PyObject_SetAttrStr(__pyx_t_9, __pyx_n_s_dist, __pyx_t_2) < 0) __PYX_ERR(0, 538, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

          /* "ete4/core/tree.pyx":537
 *                         if n.children[0].dist is not None:
 *                             n.children[0].dist += n.dist
 *                     elif len(n.children) > 1 and n.up and n.up.dist is not None:             # <<<<<<<<<<<<<<
 *                         n.up.dist += n.dist
 * 
 */
        }
        __pyx_L28:;

        /* "ete4/core/tree.pyx":533
 *         for n in self.descendants('postorder'):
 *             if n not in to_keep:
 *                 if preserve_branch_length and n.dist is not None:             # <<<<<<<<<<<<<<
 *                     if len(n.children) == 1:
 *                         if n.children[0].dist is not None:
 */
      }

      /* "ete4/core/tree.pyx":540
 *                         n.up.dist += n.dist
 * 
 *                 n.delete(prevent_nondicotomic=False)             # <<<<<<<<<<<<<<
 * 
 *     def reverse_children(self):
 */
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_n, __pyx_n_s_delete); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 540, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 540, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_prevent_nondicotomic, Py_False) < 0) __PYX_ERR(0, 540, __pyx_L1_error)
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 540, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "ete4/core/tree.pyx":532
 * 
 *         for n in self.descendants('postorder'):
 *             if n not in to_keep:             # <<<<<<<<<<<<<<
 *                 if preserve_branch_length and n.dist is not None:
 *                     if len(n.children) == 1:
 */
    }

    /* "ete4/core/tree.pyx":531
 *                 to_keep.add(sorted_nodes[0])
 * 
 *         for n in self.descendants('postorder'):             # <<<<<<<<<<<<<<
 *             if n not in to_keep:
 *                 if preserve_branch_length and n.dist is not None:
 */
  }
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "ete4/core/tree.pyx":429
 *         return self
 * 
 *     def prune(self, nodes, preserve_branch_length=False):             # <<<<<<<<<<<<<<
 *         """Prune the topology conserving only the given nodes.
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_AddTraceback("ete4.core.tree.Tree.prune", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_cmp_nodes);
  __Pyx_XDECREF(__pyx_v_to_keep);
  __Pyx_XDECREF(__pyx_v_start);
  __Pyx_XDECREF(__pyx_v_node2path);
  __Pyx_XDECREF(__pyx_v_n2count);
  __Pyx_XDECREF(__pyx_v_seed);
  __Pyx_XDECREF(__pyx_v_path);
  __Pyx_XDECREF(__pyx_v_visited_node);
  __Pyx_XDECREF(__pyx_v_depth);
  __Pyx_XDECREF(__pyx_v_visitors2nodes);
  __Pyx_XDECREF(__pyx_v_node);
  __Pyx_XDECREF(__pyx_v_visitors);
  __Pyx_XDECREF(__pyx_v_visitor_key);
  __Pyx_XDECREF(__pyx_v_sorted_nodes);
  __Pyx_XDECREF(__pyx_v_n);
  __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_n);
  __Pyx_XDECREF(__pyx_v_nodes);
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ete4/core/tree.pyx":542
 *                 n.delete(prevent_nondicotomic=False)
 * 
 *     def reverse_children(self):             # <<<<<<<<<<<<<<
 *         """Reverse current children order."""
 *         self.children.reverse()
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_50reverse_children(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_4ete4_4core_4tree_4Tree_49reverse_children, "Tree.reverse_children(self)\nReverse current children order.");
static PyMethodDef __pyx_mdef_4ete4_4core_4tree_4Tree_50reverse_children = {"reverse_children", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_50reverse_children, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_49reverse_children};
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_50reverse_children(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("reverse_children (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("reverse_children", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "reverse_children", 0))) return NULL;
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_49reverse_children(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self));

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

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_49reverse_children(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("reverse_children", 1);

  /* "ete4/core/tree.pyx":544
 *     def reverse_children(self):
 *         """Reverse current children order."""
 *         self.children.reverse()             # <<<<<<<<<<<<<<
 * 
 *     def swap_children(self):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_children); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 544, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_reverse); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 544, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 544, __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;

  /* "ete4/core/tree.pyx":542
 *                 n.delete(prevent_nondicotomic=False)
 * 
 *     def reverse_children(self):             # <<<<<<<<<<<<<<
 *         """Reverse current children order."""
 *         self.children.reverse()
 */

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

/* "ete4/core/tree.pyx":546
 *         self.children.reverse()
 * 
 *     def swap_children(self):             # <<<<<<<<<<<<<<
 *         """Like reverse, but if there are only two children."""
 *         n = len(self.children)
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_52swap_children(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_4ete4_4core_4tree_4Tree_51swap_children, "Tree.swap_children(self)\nLike reverse, but if there are only two children.");
static PyMethodDef __pyx_mdef_4ete4_4core_4tree_4Tree_52swap_children = {"swap_children", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_52swap_children, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_51swap_children};
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_52swap_children(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("swap_children (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("swap_children", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "swap_children", 0))) return NULL;
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_51swap_children(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self));

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

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_51swap_children(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self) {
  Py_ssize_t __pyx_v_n;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  Py_UCS4 __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  unsigned int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("swap_children", 1);

  /* "ete4/core/tree.pyx":548
 *     def swap_children(self):
 *         """Like reverse, but if there are only two children."""
 *         n = len(self.children)             # <<<<<<<<<<<<<<
 *         assert n == 2, f'Node has {n} children. Use reverse_children() instead?'
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_children); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 548, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 548, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_n = __pyx_t_2;

  /* "ete4/core/tree.pyx":549
 *         """Like reverse, but if there are only two children."""
 *         n = len(self.children)
 *         assert n == 2, f'Node has {n} children. Use reverse_children() instead?'             # <<<<<<<<<<<<<<
 * 
 *         self.children.reverse()
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_3 = (__pyx_v_n == 2);
    if (unlikely(!__pyx_t_3)) {
      __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 549, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = 0;
      __pyx_t_4 = 127;
      __Pyx_INCREF(__pyx_kp_u_Node_has);
      __pyx_t_2 += 9;
      __Pyx_GIVEREF(__pyx_kp_u_Node_has);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_Node_has);
      __pyx_t_5 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_n, 0, ' ', 'd'); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 549, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5);
      __pyx_t_5 = 0;
      __Pyx_INCREF(__pyx_kp_u_children_Use_reverse_children_i);
      __pyx_t_2 += 42;
      __Pyx_GIVEREF(__pyx_kp_u_children_Use_reverse_children_i);
      PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_children_Use_reverse_children_i);
      __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 549, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_t_5, 0, 0);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __PYX_ERR(0, 549, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 549, __pyx_L1_error)
  #endif

  /* "ete4/core/tree.pyx":551
 *         assert n == 2, f'Node has {n} children. Use reverse_children() instead?'
 * 
 *         self.children.reverse()             # <<<<<<<<<<<<<<
 * 
 *     def get_children(self):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_children); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 551, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_reverse); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 551, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = NULL;
  __pyx_t_7 = 0;
  #if CYTHON_UNPACK_METHODS
  if (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_7 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
    __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 551, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "ete4/core/tree.pyx":546
 *         self.children.reverse()
 * 
 *     def swap_children(self):             # <<<<<<<<<<<<<<
 *         """Like reverse, but if there are only two children."""
 *         n = len(self.children)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("ete4.core.tree.Tree.swap_children", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ete4/core/tree.pyx":553
 *         self.children.reverse()
 * 
 *     def get_children(self):             # <<<<<<<<<<<<<<
 *         """Return an independent list of the node's children."""
 *         # The returned list can be changed without affecting self.children.
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_54get_children(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_4ete4_4core_4tree_4Tree_53get_children, "Tree.get_children(self)\nReturn an independent list of the node's children.");
static PyMethodDef __pyx_mdef_4ete4_4core_4tree_4Tree_54get_children = {"get_children", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_54get_children, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_53get_children};
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_54get_children(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_children (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("get_children", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_children", 0))) return NULL;
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_53get_children(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self));

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

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_53get_children(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_children", 1);

  /* "ete4/core/tree.pyx":556
 *         """Return an independent list of the node's children."""
 *         # The returned list can be changed without affecting self.children.
 *         return self.children.copy()             # <<<<<<<<<<<<<<
 * 
 *     def get_sisters(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_children); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 556, __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, 556, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 556, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "ete4/core/tree.pyx":553
 *         self.children.reverse()
 * 
 *     def get_children(self):             # <<<<<<<<<<<<<<
 *         """Return an independent list of the node's children."""
 *         # The returned list can be changed without affecting self.children.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("ete4.core.tree.Tree.get_children", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ete4/core/tree.pyx":558
 *         return self.children.copy()
 * 
 *     def get_sisters(self):             # <<<<<<<<<<<<<<
 *         """Return a list of sister nodes (siblings)."""
 *         return ([node for node in self.up.children if node is not self]
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_56get_sisters(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_4ete4_4core_4tree_4Tree_55get_sisters, "Tree.get_sisters(self)\nReturn a list of sister nodes (siblings).");
static PyMethodDef __pyx_mdef_4ete4_4core_4tree_4Tree_56get_sisters = {"get_sisters", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_56get_sisters, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_55get_sisters};
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_56get_sisters(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_sisters (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("get_sisters", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_sisters", 0))) return NULL;
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_55get_sisters(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self));

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

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_55get_sisters(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self) {
  PyObject *__pyx_8genexpr6__pyx_v_node = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_sisters", 1);

  /* "ete4/core/tree.pyx":560
 *     def get_sisters(self):
 *         """Return a list of sister nodes (siblings)."""
 *         return ([node for node in self.up.children if node is not self]             # <<<<<<<<<<<<<<
 *                 if not self.is_root else [])
 * 
 */
  __Pyx_XDECREF(__pyx_r);

  /* "ete4/core/tree.pyx":561
 *         """Return a list of sister nodes (siblings)."""
 *         return ([node for node in self.up.children if node is not self]
 *                 if not self.is_root else [])             # <<<<<<<<<<<<<<
 * 
 *     def leaves(self, is_leaf_fn=None):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_root); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 561, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 561, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (!__pyx_t_3);
  if (__pyx_t_4) {
    { /* enter inner scope */

      /* "ete4/core/tree.pyx":560
 *     def get_sisters(self):
 *         """Return a list of sister nodes (siblings)."""
 *         return ([node for node in self.up.children if node is not self]             # <<<<<<<<<<<<<<
 *                 if not self.is_root else [])
 * 
 */
      __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 560, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->up), __pyx_n_s_children); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 560, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
        __pyx_t_6 = __pyx_t_5; __Pyx_INCREF(__pyx_t_6);
        __pyx_t_7 = 0;
        __pyx_t_8 = NULL;
      } else {
        __pyx_t_7 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 560, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 560, __pyx_L5_error)
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      for (;;) {
        if (likely(!__pyx_t_8)) {
          if (likely(PyList_CheckExact(__pyx_t_6))) {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6);
              #if !CYTHON_ASSUME_SAFE_MACROS
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 560, __pyx_L5_error)
              #endif
              if (__pyx_t_7 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_5 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 560, __pyx_L5_error)
            #else
            __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 560, __pyx_L5_error)
            __Pyx_GOTREF(__pyx_t_5);
            #endif
          } else {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_6);
              #if !CYTHON_ASSUME_SAFE_MACROS
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 560, __pyx_L5_error)
              #endif
              if (__pyx_t_7 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 560, __pyx_L5_error)
            #else
            __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 560, __pyx_L5_error)
            __Pyx_GOTREF(__pyx_t_5);
            #endif
          }
        } else {
          __pyx_t_5 = __pyx_t_8(__pyx_t_6);
          if (unlikely(!__pyx_t_5)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 560, __pyx_L5_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_5);
        }
        __Pyx_XDECREF_SET(__pyx_8genexpr6__pyx_v_node, __pyx_t_5);
        __pyx_t_5 = 0;
        __pyx_t_3 = (__pyx_8genexpr6__pyx_v_node != ((PyObject *)__pyx_v_self));
        if (__pyx_t_3) {
          if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_8genexpr6__pyx_v_node))) __PYX_ERR(0, 560, __pyx_L5_error)
        }
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_8genexpr6__pyx_v_node); __pyx_8genexpr6__pyx_v_node = 0;
      goto __pyx_L10_exit_scope;
      __pyx_L5_error:;
      __Pyx_XDECREF(__pyx_8genexpr6__pyx_v_node); __pyx_8genexpr6__pyx_v_node = 0;
      goto __pyx_L1_error;
      __pyx_L10_exit_scope:;
    } /* exit inner scope */
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
  } else {

    /* "ete4/core/tree.pyx":561
 *         """Return a list of sister nodes (siblings)."""
 *         return ([node for node in self.up.children if node is not self]
 *                 if not self.is_root else [])             # <<<<<<<<<<<<<<
 * 
 *     def leaves(self, is_leaf_fn=None):
 */
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 561, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "ete4/core/tree.pyx":558
 *         return self.children.copy()
 * 
 *     def get_sisters(self):             # <<<<<<<<<<<<<<
 *         """Return a list of sister nodes (siblings)."""
 *         return ([node for node in self.up.children if node is not self]
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("ete4.core.tree.Tree.get_sisters", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_8genexpr6__pyx_v_node);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_4ete4_4core_4tree_4Tree_59generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "ete4/core/tree.pyx":563
 *                 if not self.is_root else [])
 * 
 *     def leaves(self, is_leaf_fn=None):             # <<<<<<<<<<<<<<
 *         """Yield the terminal nodes (leaves) under this node."""
 *         is_leaf = is_leaf_fn or (lambda n: n.is_leaf)
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_58leaves(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_4ete4_4core_4tree_4Tree_57leaves, "Tree.leaves(self, is_leaf_fn=None)\nYield the terminal nodes (leaves) under this node.");
static PyMethodDef __pyx_mdef_4ete4_4core_4tree_4Tree_58leaves = {"leaves", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_58leaves, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_57leaves};
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_58leaves(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_is_leaf_fn = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("leaves (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_is_leaf_fn,0};
    values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_is_leaf_fn);
          if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 563, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "leaves") < 0)) __PYX_ERR(0, 563, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_is_leaf_fn = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("leaves", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 563, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("ete4.core.tree.Tree.leaves", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_57leaves(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self), __pyx_v_is_leaf_fn);

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

/* "ete4/core/tree.pyx":565
 *     def leaves(self, is_leaf_fn=None):
 *         """Yield the terminal nodes (leaves) under this node."""
 *         is_leaf = is_leaf_fn or (lambda n: n.is_leaf)             # <<<<<<<<<<<<<<
 *         for node in self.traverse("preorder", is_leaf):
 *             if is_leaf(node):
 */

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

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

static PyObject *__pyx_lambda_funcdef_lambda4(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_n) {
  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("lambda4", 1);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_n, __pyx_n_s_is_leaf); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 565, __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("ete4.core.tree.Tree.leaves.lambda4", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ete4/core/tree.pyx":563
 *                 if not self.is_root else [])
 * 
 *     def leaves(self, is_leaf_fn=None):             # <<<<<<<<<<<<<<
 *         """Yield the terminal nodes (leaves) under this node."""
 *         is_leaf = is_leaf_fn or (lambda n: n.is_leaf)
 */

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_57leaves(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_is_leaf_fn) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_9_leaves *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("leaves", 0);
  __pyx_cur_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_9_leaves *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_9_leaves(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_9_leaves, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_9_leaves *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 563, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __pyx_cur_scope->__pyx_v_is_leaf_fn = __pyx_v_is_leaf_fn;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_is_leaf_fn);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_is_leaf_fn);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4ete4_4core_4tree_4Tree_59generator1, __pyx_codeobj__8, (PyObject *) __pyx_cur_scope, __pyx_n_s_leaves, __pyx_n_s_Tree_leaves, __pyx_n_s_ete4_core_tree); if (unlikely(!gen)) __PYX_ERR(0, 563, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("ete4.core.tree.Tree.leaves", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_4ete4_4core_4tree_4Tree_59generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_9_leaves *__pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_9_leaves *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  unsigned int __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("leaves", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L9_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 563, __pyx_L1_error)

  /* "ete4/core/tree.pyx":565
 *     def leaves(self, is_leaf_fn=None):
 *         """Yield the terminal nodes (leaves) under this node."""
 *         is_leaf = is_leaf_fn or (lambda n: n.is_leaf)             # <<<<<<<<<<<<<<
 *         for node in self.traverse("preorder", is_leaf):
 *             if is_leaf(node):
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_is_leaf_fn); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 565, __pyx_L1_error)
  if (!__pyx_t_2) {
  } else {
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_is_leaf_fn);
    __pyx_t_1 = __pyx_cur_scope->__pyx_v_is_leaf_fn;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_6leaves_lambda4, 0, __pyx_n_s_leaves_locals_lambda, NULL, __pyx_n_s_ete4_core_tree, __pyx_d, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 565, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_1 = __pyx_t_3;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_L4_bool_binop_done:;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_is_leaf = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "ete4/core/tree.pyx":566
 *         """Yield the terminal nodes (leaves) under this node."""
 *         is_leaf = is_leaf_fn or (lambda n: n.is_leaf)
 *         for node in self.traverse("preorder", is_leaf):             # <<<<<<<<<<<<<<
 *             if is_leaf(node):
 *                 yield node
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_traverse); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 566, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_n_u_preorder, __pyx_cur_scope->__pyx_v_is_leaf};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 566, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3);
    __pyx_t_6 = 0;
    __pyx_t_7 = NULL;
  } else {
    __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 566, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 566, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_7)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 566, __pyx_L1_error)
          #endif
          if (__pyx_t_6 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 566, __pyx_L1_error)
        #else
        __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 566, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 566, __pyx_L1_error)
          #endif
          if (__pyx_t_6 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 566, __pyx_L1_error)
        #else
        __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 566, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_7(__pyx_t_3);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 566, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_node);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_node, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;

    /* "ete4/core/tree.pyx":567
 *         is_leaf = is_leaf_fn or (lambda n: n.is_leaf)
 *         for node in self.traverse("preorder", is_leaf):
 *             if is_leaf(node):             # <<<<<<<<<<<<<<
 *                 yield node
 * 
 */
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_is_leaf);
    __pyx_t_4 = __pyx_cur_scope->__pyx_v_is_leaf; __pyx_t_8 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_cur_scope->__pyx_v_node};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 567, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 567, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_2) {

      /* "ete4/core/tree.pyx":568
 *         for node in self.traverse("preorder", is_leaf):
 *             if is_leaf(node):
 *                 yield node             # <<<<<<<<<<<<<<
 * 
 *     def leaf_names(self, is_leaf_fn=None):
 */
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_node);
      __pyx_r = __pyx_cur_scope->__pyx_v_node;
      __Pyx_XGIVEREF(__pyx_t_3);
      __pyx_cur_scope->__pyx_t_0 = __pyx_t_3;
      __pyx_cur_scope->__pyx_t_1 = __pyx_t_6;
      __pyx_cur_scope->__pyx_t_2 = __pyx_t_7;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
      /* return from generator, yielding value */
      __pyx_generator->resume_label = 1;
      return __pyx_r;
      __pyx_L9_resume_from_yield:;
      __pyx_t_3 = __pyx_cur_scope->__pyx_t_0;
      __pyx_cur_scope->__pyx_t_0 = 0;
      __Pyx_XGOTREF(__pyx_t_3);
      __pyx_t_6 = __pyx_cur_scope->__pyx_t_1;
      __pyx_t_7 = __pyx_cur_scope->__pyx_t_2;
      if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 568, __pyx_L1_error)

      /* "ete4/core/tree.pyx":567
 *         is_leaf = is_leaf_fn or (lambda n: n.is_leaf)
 *         for node in self.traverse("preorder", is_leaf):
 *             if is_leaf(node):             # <<<<<<<<<<<<<<
 *                 yield node
 * 
 */
    }

    /* "ete4/core/tree.pyx":566
 *         """Yield the terminal nodes (leaves) under this node."""
 *         is_leaf = is_leaf_fn or (lambda n: n.is_leaf)
 *         for node in self.traverse("preorder", is_leaf):             # <<<<<<<<<<<<<<
 *             if is_leaf(node):
 *                 yield node
 */
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "ete4/core/tree.pyx":563
 *                 if not self.is_root else [])
 * 
 *     def leaves(self, is_leaf_fn=None):             # <<<<<<<<<<<<<<
 *         """Yield the terminal nodes (leaves) under this node."""
 *         is_leaf = is_leaf_fn or (lambda n: n.is_leaf)
 */

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

/* "ete4/core/tree.pyx":570
 *                 yield node
 * 
 *     def leaf_names(self, is_leaf_fn=None):             # <<<<<<<<<<<<<<
 *         """Yield the leaf names under this node."""
 *         for leaf in self.leaves(is_leaf_fn):
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_61leaf_names(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_4ete4_4core_4tree_4Tree_60leaf_names, "Tree.leaf_names(self, is_leaf_fn=None)\nYield the leaf names under this node.");
static PyMethodDef __pyx_mdef_4ete4_4core_4tree_4Tree_61leaf_names = {"leaf_names", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_61leaf_names, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_60leaf_names};
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_61leaf_names(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_is_leaf_fn = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("leaf_names (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_is_leaf_fn,0};
    values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_is_leaf_fn);
          if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 570, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "leaf_names") < 0)) __PYX_ERR(0, 570, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_is_leaf_fn = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("leaf_names", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 570, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("ete4.core.tree.Tree.leaf_names", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_60leaf_names(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self), __pyx_v_is_leaf_fn);

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

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_60leaf_names(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_is_leaf_fn) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_10_leaf_names *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("leaf_names", 0);
  __pyx_cur_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_10_leaf_names *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_10_leaf_names(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_10_leaf_names, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_10_leaf_names *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 570, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __pyx_cur_scope->__pyx_v_is_leaf_fn = __pyx_v_is_leaf_fn;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_is_leaf_fn);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_is_leaf_fn);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4ete4_4core_4tree_4Tree_62generator2, __pyx_codeobj__9, (PyObject *) __pyx_cur_scope, __pyx_n_s_leaf_names, __pyx_n_s_Tree_leaf_names, __pyx_n_s_ete4_core_tree); if (unlikely(!gen)) __PYX_ERR(0, 570, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("ete4.core.tree.Tree.leaf_names", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_4ete4_4core_4tree_4Tree_62generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_10_leaf_names *__pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_10_leaf_names *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("leaf_names", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 570, __pyx_L1_error)

  /* "ete4/core/tree.pyx":572
 *     def leaf_names(self, is_leaf_fn=None):
 *         """Yield the leaf names under this node."""
 *         for leaf in self.leaves(is_leaf_fn):             # <<<<<<<<<<<<<<
 *             yield leaf.name
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_leaves); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 572, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_cur_scope->__pyx_v_is_leaf_fn};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 572, __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_5 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 572, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 572, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_6)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 572, __pyx_L1_error)
          #endif
          if (__pyx_t_5 >= __pyx_temp) 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, 572, __pyx_L1_error)
        #else
        __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 572, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 572, __pyx_L1_error)
          #endif
          if (__pyx_t_5 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 572, __pyx_L1_error)
        #else
        __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 572, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_6(__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, 572, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_leaf);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_leaf, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;

    /* "ete4/core/tree.pyx":573
 *         """Yield the leaf names under this node."""
 *         for leaf in self.leaves(is_leaf_fn):
 *             yield leaf.name             # <<<<<<<<<<<<<<
 * 
 *     def descendants(self, strategy='levelorder', is_leaf_fn=None):
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_leaf, __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 573, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    __Pyx_XGIVEREF(__pyx_t_2);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_5;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_6;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_2);
    __pyx_t_5 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_6 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 573, __pyx_L1_error)

    /* "ete4/core/tree.pyx":572
 *     def leaf_names(self, is_leaf_fn=None):
 *         """Yield the leaf names under this node."""
 *         for leaf in self.leaves(is_leaf_fn):             # <<<<<<<<<<<<<<
 *             yield leaf.name
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "ete4/core/tree.pyx":570
 *                 yield node
 * 
 *     def leaf_names(self, is_leaf_fn=None):             # <<<<<<<<<<<<<<
 *         """Yield the leaf names under this node."""
 *         for leaf in self.leaves(is_leaf_fn):
 */

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

/* "ete4/core/tree.pyx":575
 *             yield leaf.name
 * 
 *     def descendants(self, strategy='levelorder', is_leaf_fn=None):             # <<<<<<<<<<<<<<
 *         """Yield all descendant nodes."""
 *         for node in self.traverse(strategy, is_leaf_fn):
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_64descendants(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_4ete4_4core_4tree_4Tree_63descendants, "Tree.descendants(self, strategy=u'levelorder', is_leaf_fn=None)\nYield all descendant nodes.");
static PyMethodDef __pyx_mdef_4ete4_4core_4tree_4Tree_64descendants = {"descendants", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_64descendants, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_63descendants};
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_64descendants(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_strategy = 0;
  PyObject *__pyx_v_is_leaf_fn = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("descendants (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_strategy,&__pyx_n_s_is_leaf_fn,0};
    values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_n_u_levelorder));
    values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_strategy);
          if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 575, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_is_leaf_fn);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 575, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "descendants") < 0)) __PYX_ERR(0, 575, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_strategy = values[0];
    __pyx_v_is_leaf_fn = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("descendants", 0, 0, 2, __pyx_nargs); __PYX_ERR(0, 575, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("ete4.core.tree.Tree.descendants", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_63descendants(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self), __pyx_v_strategy, __pyx_v_is_leaf_fn);

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

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_63descendants(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_strategy, PyObject *__pyx_v_is_leaf_fn) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_11_descendants *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("descendants", 0);
  __pyx_cur_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_11_descendants *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_11_descendants(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_11_descendants, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_11_descendants *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 575, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __pyx_cur_scope->__pyx_v_strategy = __pyx_v_strategy;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_strategy);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_strategy);
  __pyx_cur_scope->__pyx_v_is_leaf_fn = __pyx_v_is_leaf_fn;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_is_leaf_fn);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_is_leaf_fn);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4ete4_4core_4tree_4Tree_65generator3, __pyx_codeobj__10, (PyObject *) __pyx_cur_scope, __pyx_n_s_descendants, __pyx_n_s_Tree_descendants, __pyx_n_s_ete4_core_tree); if (unlikely(!gen)) __PYX_ERR(0, 575, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("ete4.core.tree.Tree.descendants", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_4ete4_4core_4tree_4Tree_65generator3(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_11_descendants *__pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_11_descendants *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("descendants", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L7_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 575, __pyx_L1_error)

  /* "ete4/core/tree.pyx":577
 *     def descendants(self, strategy='levelorder', is_leaf_fn=None):
 *         """Yield all descendant nodes."""
 *         for node in self.traverse(strategy, is_leaf_fn):             # <<<<<<<<<<<<<<
 *             if node is not self:
 *                 yield node
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_traverse); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 577, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_cur_scope->__pyx_v_strategy, __pyx_cur_scope->__pyx_v_is_leaf_fn};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 577, __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_5 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 577, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 577, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_6)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 577, __pyx_L1_error)
          #endif
          if (__pyx_t_5 >= __pyx_temp) 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, 577, __pyx_L1_error)
        #else
        __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 577, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 577, __pyx_L1_error)
          #endif
          if (__pyx_t_5 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 577, __pyx_L1_error)
        #else
        __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 577, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_6(__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, 577, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_node);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_node, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;

    /* "ete4/core/tree.pyx":578
 *         """Yield all descendant nodes."""
 *         for node in self.traverse(strategy, is_leaf_fn):
 *             if node is not self:             # <<<<<<<<<<<<<<
 *                 yield node
 * 
 */
    __pyx_t_7 = (__pyx_cur_scope->__pyx_v_node != ((PyObject *)__pyx_cur_scope->__pyx_v_self));
    if (__pyx_t_7) {

      /* "ete4/core/tree.pyx":579
 *         for node in self.traverse(strategy, is_leaf_fn):
 *             if node is not self:
 *                 yield node             # <<<<<<<<<<<<<<
 * 
 *     def traverse(self, strategy='levelorder', is_leaf_fn=None):
 */
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_node);
      __pyx_r = __pyx_cur_scope->__pyx_v_node;
      __Pyx_XGIVEREF(__pyx_t_2);
      __pyx_cur_scope->__pyx_t_0 = __pyx_t_2;
      __pyx_cur_scope->__pyx_t_1 = __pyx_t_5;
      __pyx_cur_scope->__pyx_t_2 = __pyx_t_6;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
      /* return from generator, yielding value */
      __pyx_generator->resume_label = 1;
      return __pyx_r;
      __pyx_L7_resume_from_yield:;
      __pyx_t_2 = __pyx_cur_scope->__pyx_t_0;
      __pyx_cur_scope->__pyx_t_0 = 0;
      __Pyx_XGOTREF(__pyx_t_2);
      __pyx_t_5 = __pyx_cur_scope->__pyx_t_1;
      __pyx_t_6 = __pyx_cur_scope->__pyx_t_2;
      if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 579, __pyx_L1_error)

      /* "ete4/core/tree.pyx":578
 *         """Yield all descendant nodes."""
 *         for node in self.traverse(strategy, is_leaf_fn):
 *             if node is not self:             # <<<<<<<<<<<<<<
 *                 yield node
 * 
 */
    }

    /* "ete4/core/tree.pyx":577
 *     def descendants(self, strategy='levelorder', is_leaf_fn=None):
 *         """Yield all descendant nodes."""
 *         for node in self.traverse(strategy, is_leaf_fn):             # <<<<<<<<<<<<<<
 *             if node is not self:
 *                 yield node
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "ete4/core/tree.pyx":575
 *             yield leaf.name
 * 
 *     def descendants(self, strategy='levelorder', is_leaf_fn=None):             # <<<<<<<<<<<<<<
 *         """Yield all descendant nodes."""
 *         for node in self.traverse(strategy, is_leaf_fn):
 */

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

/* "ete4/core/tree.pyx":581
 *                 yield node
 * 
 *     def traverse(self, strategy='levelorder', is_leaf_fn=None):             # <<<<<<<<<<<<<<
 *         """Traverse the tree structure under this node and yield the nodes.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_67traverse(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_4ete4_4core_4tree_4Tree_66traverse, "Tree.traverse(self, strategy=u'levelorder', is_leaf_fn=None)\nTraverse the tree structure under this node and yield the nodes.\n\n        There are three possible strategies. There is a breadth-first\n        search (BFS) named \"levelorder\", and two depth-first searches\n        (DFS) named \"preorder\" and \"postorder\".\n\n        :param strategy: Way in which the tree will be traversed. Can\n            be: \"preorder\" (first parent and then children),\n            \"postorder\" (first children and the parent), and\n            \"levelorder\" (nodes visited in order from root to leaves).\n        :param is_leaf_fn: Function to check if a node is terminal (a\n            \"leaf\"). The function should receive a node and return\n            True/False. Use this to traverse a tree by dynamically\n            collapsing internal nodes.\n        ");
static PyMethodDef __pyx_mdef_4ete4_4core_4tree_4Tree_67traverse = {"traverse", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_67traverse, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_66traverse};
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_67traverse(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_strategy = 0;
  PyObject *__pyx_v_is_leaf_fn = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("traverse (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_strategy,&__pyx_n_s_is_leaf_fn,0};
    values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_n_u_levelorder));
    values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_strategy);
          if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 581, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_is_leaf_fn);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 581, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "traverse") < 0)) __PYX_ERR(0, 581, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_strategy = values[0];
    __pyx_v_is_leaf_fn = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("traverse", 0, 0, 2, __pyx_nargs); __PYX_ERR(0, 581, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("ete4.core.tree.Tree.traverse", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_66traverse(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self), __pyx_v_strategy, __pyx_v_is_leaf_fn);

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

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_66traverse(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_strategy, PyObject *__pyx_v_is_leaf_fn) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_12_traverse *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("traverse", 0);
  __pyx_cur_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_12_traverse *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_12_traverse(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_12_traverse, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_12_traverse *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 581, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __pyx_cur_scope->__pyx_v_strategy = __pyx_v_strategy;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_strategy);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_strategy);
  __pyx_cur_scope->__pyx_v_is_leaf_fn = __pyx_v_is_leaf_fn;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_is_leaf_fn);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_is_leaf_fn);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4ete4_4core_4tree_4Tree_68generator4, __pyx_codeobj__11, (PyObject *) __pyx_cur_scope, __pyx_n_s_traverse, __pyx_n_s_Tree_traverse, __pyx_n_s_ete4_core_tree); if (unlikely(!gen)) __PYX_ERR(0, 581, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("ete4.core.tree.Tree.traverse", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_4ete4_4core_4tree_4Tree_68generator4(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_12_traverse *__pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_12_traverse *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  unsigned int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("traverse", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L5_resume_from_yield_from;
    case 2: goto __pyx_L6_resume_from_yield_from;
    case 3: goto __pyx_L7_resume_from_yield_from;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 581, __pyx_L1_error)

  /* "ete4/core/tree.pyx":597
 *             collapsing internal nodes.
 *         """
 *         if strategy == 'levelorder':             # <<<<<<<<<<<<<<
 *             yield from ops.traverse_bfs(self, is_leaf_fn)
 *         elif strategy == 'preorder':
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_cur_scope->__pyx_v_strategy, __pyx_n_u_levelorder, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 597, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "ete4/core/tree.pyx":598
 *         """
 *         if strategy == 'levelorder':
 *             yield from ops.traverse_bfs(self, is_leaf_fn)             # <<<<<<<<<<<<<<
 *         elif strategy == 'preorder':
 *             yield from ops.traverse(self, order=-1, is_leaf_fn=is_leaf_fn)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ops); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 598, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_traverse_bfs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 598, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_3, ((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_cur_scope->__pyx_v_is_leaf_fn};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 598, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __pyx_r = __Pyx_Generator_Yield_From(__pyx_generator, __pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XGOTREF(__pyx_r);
    if (likely(__pyx_r)) {
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
      /* return from generator, yielding value */
      __pyx_generator->resume_label = 1;
      return __pyx_r;
      __pyx_L5_resume_from_yield_from:;
      if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 598, __pyx_L1_error)
    } else {
      PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType();
      if (exc_type) {
        if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear();
        else __PYX_ERR(0, 598, __pyx_L1_error)
      }
    }

    /* "ete4/core/tree.pyx":597
 *             collapsing internal nodes.
 *         """
 *         if strategy == 'levelorder':             # <<<<<<<<<<<<<<
 *             yield from ops.traverse_bfs(self, is_leaf_fn)
 *         elif strategy == 'preorder':
 */
    goto __pyx_L4;
  }

  /* "ete4/core/tree.pyx":599
 *         if strategy == 'levelorder':
 *             yield from ops.traverse_bfs(self, is_leaf_fn)
 *         elif strategy == 'preorder':             # <<<<<<<<<<<<<<
 *             yield from ops.traverse(self, order=-1, is_leaf_fn=is_leaf_fn)
 *         elif strategy == 'postorder':
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_cur_scope->__pyx_v_strategy, __pyx_n_u_preorder, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 599, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "ete4/core/tree.pyx":600
 *             yield from ops.traverse_bfs(self, is_leaf_fn)
 *         elif strategy == 'preorder':
 *             yield from ops.traverse(self, order=-1, is_leaf_fn=is_leaf_fn)             # <<<<<<<<<<<<<<
 *         elif strategy == 'postorder':
 *             yield from ops.traverse(self, order=+1, is_leaf_fn=is_leaf_fn)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ops); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 600, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_traverse); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 600, __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, 600, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
    __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_cur_scope->__pyx_v_self))) __PYX_ERR(0, 600, __pyx_L1_error);
    __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 600, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_int_neg_1) < 0) __PYX_ERR(0, 600, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_is_leaf_fn, __pyx_cur_scope->__pyx_v_is_leaf_fn) < 0) __PYX_ERR(0, 600, __pyx_L1_error)
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 600, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __Pyx_Generator_Yield_From(__pyx_generator, __pyx_t_6);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XGOTREF(__pyx_r);
    if (likely(__pyx_r)) {
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
      /* return from generator, yielding value */
      __pyx_generator->resume_label = 2;
      return __pyx_r;
      __pyx_L6_resume_from_yield_from:;
      if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 600, __pyx_L1_error)
    } else {
      PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType();
      if (exc_type) {
        if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear();
        else __PYX_ERR(0, 600, __pyx_L1_error)
      }
    }

    /* "ete4/core/tree.pyx":599
 *         if strategy == 'levelorder':
 *             yield from ops.traverse_bfs(self, is_leaf_fn)
 *         elif strategy == 'preorder':             # <<<<<<<<<<<<<<
 *             yield from ops.traverse(self, order=-1, is_leaf_fn=is_leaf_fn)
 *         elif strategy == 'postorder':
 */
    goto __pyx_L4;
  }

  /* "ete4/core/tree.pyx":601
 *         elif strategy == 'preorder':
 *             yield from ops.traverse(self, order=-1, is_leaf_fn=is_leaf_fn)
 *         elif strategy == 'postorder':             # <<<<<<<<<<<<<<
 *             yield from ops.traverse(self, order=+1, is_leaf_fn=is_leaf_fn)
 *         else:
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_cur_scope->__pyx_v_strategy, __pyx_n_u_postorder, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 601, __pyx_L1_error)
  if (likely(__pyx_t_1)) {

    /* "ete4/core/tree.pyx":602
 *             yield from ops.traverse(self, order=-1, is_leaf_fn=is_leaf_fn)
 *         elif strategy == 'postorder':
 *             yield from ops.traverse(self, order=+1, is_leaf_fn=is_leaf_fn)             # <<<<<<<<<<<<<<
 *         else:
 *             raise TreeError(f'Unknown strategy: {strategy}')
 */
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ops); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 602, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_traverse); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 602, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 602, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
    __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_cur_scope->__pyx_v_self))) __PYX_ERR(0, 602, __pyx_L1_error);
    __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 602, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_order, __pyx_int_1) < 0) __PYX_ERR(0, 602, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_is_leaf_fn, __pyx_cur_scope->__pyx_v_is_leaf_fn) < 0) __PYX_ERR(0, 602, __pyx_L1_error)
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 602, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = __Pyx_Generator_Yield_From(__pyx_generator, __pyx_t_4);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XGOTREF(__pyx_r);
    if (likely(__pyx_r)) {
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
      /* return from generator, yielding value */
      __pyx_generator->resume_label = 3;
      return __pyx_r;
      __pyx_L7_resume_from_yield_from:;
      if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 602, __pyx_L1_error)
    } else {
      PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType();
      if (exc_type) {
        if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear();
        else __PYX_ERR(0, 602, __pyx_L1_error)
      }
    }

    /* "ete4/core/tree.pyx":601
 *         elif strategy == 'preorder':
 *             yield from ops.traverse(self, order=-1, is_leaf_fn=is_leaf_fn)
 *         elif strategy == 'postorder':             # <<<<<<<<<<<<<<
 *             yield from ops.traverse(self, order=+1, is_leaf_fn=is_leaf_fn)
 *         else:
 */
    goto __pyx_L4;
  }

  /* "ete4/core/tree.pyx":604
 *             yield from ops.traverse(self, order=+1, is_leaf_fn=is_leaf_fn)
 *         else:
 *             raise TreeError(f'Unknown strategy: {strategy}')             # <<<<<<<<<<<<<<
 * 
 *     def iter_prepostorder(self, is_leaf_fn=None):
 */
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_TreeError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 604, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = __Pyx_PyObject_FormatSimple(__pyx_cur_scope->__pyx_v_strategy, __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 604, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Unknown_strategy, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 604, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_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_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_3};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 604, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(0, 604, __pyx_L1_error)
  }
  __pyx_L4:;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "ete4/core/tree.pyx":581
 *                 yield node
 * 
 *     def traverse(self, strategy='levelorder', is_leaf_fn=None):             # <<<<<<<<<<<<<<
 *         """Traverse the tree structure under this node and yield the nodes.
 * 
 */

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

/* "ete4/core/tree.pyx":606
 *             raise TreeError(f'Unknown strategy: {strategy}')
 * 
 *     def iter_prepostorder(self, is_leaf_fn=None):             # <<<<<<<<<<<<<<
 *         """Yield all nodes in a tree in both pre and post order.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_70iter_prepostorder(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_4ete4_4core_4tree_4Tree_69iter_prepostorder, "Tree.iter_prepostorder(self, is_leaf_fn=None)\nYield all nodes in a tree in both pre and post order.\n\n        Each iteration returns a postorder flag (True if node is being visited\n        in postorder) and a node instance.\n        ");
static PyMethodDef __pyx_mdef_4ete4_4core_4tree_4Tree_70iter_prepostorder = {"iter_prepostorder", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_70iter_prepostorder, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_69iter_prepostorder};
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_70iter_prepostorder(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_is_leaf_fn = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("iter_prepostorder (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_is_leaf_fn,0};
    values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_is_leaf_fn);
          if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 606, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "iter_prepostorder") < 0)) __PYX_ERR(0, 606, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_is_leaf_fn = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("iter_prepostorder", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 606, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("ete4.core.tree.Tree.iter_prepostorder", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_69iter_prepostorder(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self), __pyx_v_is_leaf_fn);

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

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_69iter_prepostorder(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_is_leaf_fn) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_13_iter_prepostorder *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("iter_prepostorder", 0);
  __pyx_cur_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_13_iter_prepostorder *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_13_iter_prepostorder(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_13_iter_prepostorder, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_13_iter_prepostorder *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 606, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __pyx_cur_scope->__pyx_v_is_leaf_fn = __pyx_v_is_leaf_fn;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_is_leaf_fn);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_is_leaf_fn);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4ete4_4core_4tree_4Tree_71generator5, __pyx_codeobj__12, (PyObject *) __pyx_cur_scope, __pyx_n_s_iter_prepostorder, __pyx_n_s_Tree_iter_prepostorder, __pyx_n_s_ete4_core_tree); if (unlikely(!gen)) __PYX_ERR(0, 606, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("ete4.core.tree.Tree.iter_prepostorder", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_4ete4_4core_4tree_4Tree_71generator5(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_13_iter_prepostorder *__pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_13_iter_prepostorder *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  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_RefNannyDeclarations
  __Pyx_RefNannySetupContext("iter_prepostorder", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L8_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 606, __pyx_L1_error)

  /* "ete4/core/tree.pyx":612
 *         in postorder) and a node instance.
 *         """
 *         path = []  # path of nodes from the root to the current one             # <<<<<<<<<<<<<<
 *         for node in ops.traverse(self, order=0, is_leaf_fn=is_leaf_fn):
 *             seen = path and node is path[-1]  # has the current node been seen?
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 612, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_path = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "ete4/core/tree.pyx":613
 *         """
 *         path = []  # path of nodes from the root to the current one
 *         for node in ops.traverse(self, order=0, is_leaf_fn=is_leaf_fn):             # <<<<<<<<<<<<<<
 *             seen = path and node is path[-1]  # has the current node been seen?
 *             yield seen, node
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ops); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 613, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_traverse); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 613, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 613, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_cur_scope->__pyx_v_self))) __PYX_ERR(0, 613, __pyx_L1_error);
  __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 613, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_int_0) < 0) __PYX_ERR(0, 613, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_is_leaf_fn, __pyx_cur_scope->__pyx_v_is_leaf_fn) < 0) __PYX_ERR(0, 613, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 613, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
    __pyx_t_3 = __pyx_t_4; __Pyx_INCREF(__pyx_t_3);
    __pyx_t_5 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 613, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 613, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  for (;;) {
    if (likely(!__pyx_t_6)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 613, __pyx_L1_error)
          #endif
          if (__pyx_t_5 >= __pyx_temp) 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, 613, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 613, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 613, __pyx_L1_error)
          #endif
          if (__pyx_t_5 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 613, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 613, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_6(__pyx_t_3);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 613, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_node);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_node, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;

    /* "ete4/core/tree.pyx":614
 *         path = []  # path of nodes from the root to the current one
 *         for node in ops.traverse(self, order=0, is_leaf_fn=is_leaf_fn):
 *             seen = path and node is path[-1]  # has the current node been seen?             # <<<<<<<<<<<<<<
 *             yield seen, node
 *             if seen:
 */
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_path); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 614, __pyx_L1_error)
    if (__pyx_t_7) {
    } else {
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_path);
      __pyx_t_4 = __pyx_cur_scope->__pyx_v_path;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_cur_scope->__pyx_v_path, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 614, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = (__pyx_cur_scope->__pyx_v_node == __pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 614, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __pyx_t_1;
    __pyx_t_1 = 0;
    __pyx_L6_bool_binop_done:;
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_seen);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_seen, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;

    /* "ete4/core/tree.pyx":615
 *         for node in ops.traverse(self, order=0, is_leaf_fn=is_leaf_fn):
 *             seen = path and node is path[-1]  # has the current node been seen?
 *             yield seen, node             # <<<<<<<<<<<<<<
 *             if seen:
 *                 path.pop()
 */
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 615, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_seen);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_seen);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_cur_scope->__pyx_v_seen)) __PYX_ERR(0, 615, __pyx_L1_error);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_node);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_node);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_cur_scope->__pyx_v_node)) __PYX_ERR(0, 615, __pyx_L1_error);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    __Pyx_XGIVEREF(__pyx_t_3);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_3;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_5;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_6;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L8_resume_from_yield:;
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_3);
    __pyx_t_5 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_6 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 615, __pyx_L1_error)

    /* "ete4/core/tree.pyx":616
 *             seen = path and node is path[-1]  # has the current node been seen?
 *             yield seen, node
 *             if seen:             # <<<<<<<<<<<<<<
 *                 path.pop()
 *             elif not node.is_leaf:
 */
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_seen); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 616, __pyx_L1_error)
    if (__pyx_t_7) {

      /* "ete4/core/tree.pyx":617
 *             yield seen, node
 *             if seen:
 *                 path.pop()             # <<<<<<<<<<<<<<
 *             elif not node.is_leaf:
 *                 path.append(node)
 */
      __pyx_t_4 = __Pyx_PyList_Pop(__pyx_cur_scope->__pyx_v_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 617, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ete4/core/tree.pyx":616
 *             seen = path and node is path[-1]  # has the current node been seen?
 *             yield seen, node
 *             if seen:             # <<<<<<<<<<<<<<
 *                 path.pop()
 *             elif not node.is_leaf:
 */
      goto __pyx_L9;
    }

    /* "ete4/core/tree.pyx":618
 *             if seen:
 *                 path.pop()
 *             elif not node.is_leaf:             # <<<<<<<<<<<<<<
 *                 path.append(node)
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s_is_leaf); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 618, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 618, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_8 = (!__pyx_t_7);
    if (__pyx_t_8) {

      /* "ete4/core/tree.pyx":619
 *                 path.pop()
 *             elif not node.is_leaf:
 *                 path.append(node)             # <<<<<<<<<<<<<<
 * 
 *     def ancestors(self, root=None, include_root=True):
 */
      __pyx_t_9 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_path, __pyx_cur_scope->__pyx_v_node); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 619, __pyx_L1_error)

      /* "ete4/core/tree.pyx":618
 *             if seen:
 *                 path.pop()
 *             elif not node.is_leaf:             # <<<<<<<<<<<<<<
 *                 path.append(node)
 * 
 */
    }
    __pyx_L9:;

    /* "ete4/core/tree.pyx":613
 *         """
 *         path = []  # path of nodes from the root to the current one
 *         for node in ops.traverse(self, order=0, is_leaf_fn=is_leaf_fn):             # <<<<<<<<<<<<<<
 *             seen = path and node is path[-1]  # has the current node been seen?
 *             yield seen, node
 */
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "ete4/core/tree.pyx":606
 *             raise TreeError(f'Unknown strategy: {strategy}')
 * 
 *     def iter_prepostorder(self, is_leaf_fn=None):             # <<<<<<<<<<<<<<
 *         """Yield all nodes in a tree in both pre and post order.
 * 
 */

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

/* "ete4/core/tree.pyx":621
 *                 path.append(node)
 * 
 *     def ancestors(self, root=None, include_root=True):             # <<<<<<<<<<<<<<
 *         """Yield all ancestor nodes of this node (up to the root if given)."""
 *         # root === n1 === n2 === .. === nN === node  ->  [nN, .., n2, n1, root]
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_73ancestors(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_4ete4_4core_4tree_4Tree_72ancestors, "Tree.ancestors(self, root=None, include_root=True)\nYield all ancestor nodes of this node (up to the root if given).");
static PyMethodDef __pyx_mdef_4ete4_4core_4tree_4Tree_73ancestors = {"ancestors", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_73ancestors, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_72ancestors};
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_73ancestors(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_root = 0;
  PyObject *__pyx_v_include_root = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ancestors (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_root,&__pyx_n_s_include_root,0};
    values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_True));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_root);
          if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 621, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_include_root);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 621, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "ancestors") < 0)) __PYX_ERR(0, 621, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_root = values[0];
    __pyx_v_include_root = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ancestors", 0, 0, 2, __pyx_nargs); __PYX_ERR(0, 621, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("ete4.core.tree.Tree.ancestors", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_72ancestors(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self), __pyx_v_root, __pyx_v_include_root);

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

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_72ancestors(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_root, PyObject *__pyx_v_include_root) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_14_ancestors *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ancestors", 0);
  __pyx_cur_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_14_ancestors *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_14_ancestors(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_14_ancestors, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_14_ancestors *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 621, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __pyx_cur_scope->__pyx_v_root = __pyx_v_root;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_root);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_root);
  __pyx_cur_scope->__pyx_v_include_root = __pyx_v_include_root;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_include_root);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_include_root);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4ete4_4core_4tree_4Tree_74generator6, __pyx_codeobj__13, (PyObject *) __pyx_cur_scope, __pyx_n_s_ancestors, __pyx_n_s_Tree_ancestors, __pyx_n_s_ete4_core_tree); if (unlikely(!gen)) __PYX_ERR(0, 621, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("ete4.core.tree.Tree.ancestors", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_4ete4_4core_4tree_4Tree_74generator6(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_14_ancestors *__pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_14_ancestors *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ancestors", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L7_resume_from_yield;
    case 2: goto __pyx_L11_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 621, __pyx_L1_error)

  /* "ete4/core/tree.pyx":624
 *         """Yield all ancestor nodes of this node (up to the root if given)."""
 *         # root === n1 === n2 === .. === nN === node  ->  [nN, .., n2, n1, root]
 *         node = self             # <<<<<<<<<<<<<<
 * 
 *         if node is root:
 */
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __pyx_cur_scope->__pyx_v_node = __pyx_cur_scope->__pyx_v_self;

  /* "ete4/core/tree.pyx":626
 *         node = self
 * 
 *         if node is root:             # <<<<<<<<<<<<<<
 *             return  # node is not an ancestor of itself
 * 
 */
  __pyx_t_1 = (((PyObject *)__pyx_cur_scope->__pyx_v_node) == __pyx_cur_scope->__pyx_v_root);
  if (__pyx_t_1) {

    /* "ete4/core/tree.pyx":627
 * 
 *         if node is root:
 *             return  # node is not an ancestor of itself             # <<<<<<<<<<<<<<
 * 
 *         while node.up is not root:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = NULL;
    goto __pyx_L0;

    /* "ete4/core/tree.pyx":626
 *         node = self
 * 
 *         if node is root:             # <<<<<<<<<<<<<<
 *             return  # node is not an ancestor of itself
 * 
 */
  }

  /* "ete4/core/tree.pyx":629
 *             return  # node is not an ancestor of itself
 * 
 *         while node.up is not root:             # <<<<<<<<<<<<<<
 *             node = node.up
 *             yield node
 */
  while (1) {
    __pyx_t_1 = (((PyObject *)__pyx_cur_scope->__pyx_v_node->up) != __pyx_cur_scope->__pyx_v_root);
    if (!__pyx_t_1) break;

    /* "ete4/core/tree.pyx":630
 * 
 *         while node.up is not root:
 *             node = node.up             # <<<<<<<<<<<<<<
 *             yield node
 * 
 */
    __pyx_t_2 = ((PyObject *)__pyx_cur_scope->__pyx_v_node->up);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope->__pyx_v_node);
    __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_node, ((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_t_2));
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_2 = 0;

    /* "ete4/core/tree.pyx":631
 *         while node.up is not root:
 *             node = node.up
 *             yield node             # <<<<<<<<<<<<<<
 * 
 *         if root is not None and include_root:
 */
    __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_node);
    __pyx_r = ((PyObject *)__pyx_cur_scope->__pyx_v_node);
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L7_resume_from_yield:;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 631, __pyx_L1_error)
  }

  /* "ete4/core/tree.pyx":633
 *             yield node
 * 
 *         if root is not None and include_root:             # <<<<<<<<<<<<<<
 *             yield root
 * 
 */
  __pyx_t_3 = (__pyx_cur_scope->__pyx_v_root != Py_None);
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L9_bool_binop_done;
  }
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_include_root); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 633, __pyx_L1_error)
  __pyx_t_1 = __pyx_t_3;
  __pyx_L9_bool_binop_done:;
  if (__pyx_t_1) {

    /* "ete4/core/tree.pyx":634
 * 
 *         if root is not None and include_root:
 *             yield root             # <<<<<<<<<<<<<<
 * 
 *     def lineage(self, root=None, include_root=True):
 */
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_root);
    __pyx_r = __pyx_cur_scope->__pyx_v_root;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 2;
    return __pyx_r;
    __pyx_L11_resume_from_yield:;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 634, __pyx_L1_error)

    /* "ete4/core/tree.pyx":633
 *             yield node
 * 
 *         if root is not None and include_root:             # <<<<<<<<<<<<<<
 *             yield root
 * 
 */
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "ete4/core/tree.pyx":621
 *                 path.append(node)
 * 
 *     def ancestors(self, root=None, include_root=True):             # <<<<<<<<<<<<<<
 *         """Yield all ancestor nodes of this node (up to the root if given)."""
 *         # root === n1 === n2 === .. === nN === node  ->  [nN, .., n2, n1, root]
 */

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

/* "ete4/core/tree.pyx":636
 *             yield root
 * 
 *     def lineage(self, root=None, include_root=True):             # <<<<<<<<<<<<<<
 *         """Yield all nodes in the lineage of this node (up to root if given)."""
 *         if not include_root and self is root:
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_76lineage(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_4ete4_4core_4tree_4Tree_75lineage, "Tree.lineage(self, root=None, include_root=True)\nYield all nodes in the lineage of this node (up to root if given).");
static PyMethodDef __pyx_mdef_4ete4_4core_4tree_4Tree_76lineage = {"lineage", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_76lineage, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_75lineage};
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_76lineage(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_root = 0;
  PyObject *__pyx_v_include_root = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lineage (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_root,&__pyx_n_s_include_root,0};
    values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_True));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_root);
          if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 636, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_include_root);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 636, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lineage") < 0)) __PYX_ERR(0, 636, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_root = values[0];
    __pyx_v_include_root = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("lineage", 0, 0, 2, __pyx_nargs); __PYX_ERR(0, 636, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("ete4.core.tree.Tree.lineage", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_75lineage(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self), __pyx_v_root, __pyx_v_include_root);

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

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_75lineage(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_root, PyObject *__pyx_v_include_root) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_15_lineage *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("lineage", 0);
  __pyx_cur_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_15_lineage *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_15_lineage(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_15_lineage, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_15_lineage *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 636, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __pyx_cur_scope->__pyx_v_root = __pyx_v_root;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_root);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_root);
  __pyx_cur_scope->__pyx_v_include_root = __pyx_v_include_root;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_include_root);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_include_root);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4ete4_4core_4tree_4Tree_77generator7, __pyx_codeobj__14, (PyObject *) __pyx_cur_scope, __pyx_n_s_lineage, __pyx_n_s_Tree_lineage, __pyx_n_s_ete4_core_tree); if (unlikely(!gen)) __PYX_ERR(0, 636, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("ete4.core.tree.Tree.lineage", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_4ete4_4core_4tree_4Tree_77generator7(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_15_lineage *__pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_15_lineage *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  unsigned int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lineage", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L7_resume_from_yield;
    case 2: goto __pyx_L8_resume_from_yield_from;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 636, __pyx_L1_error)

  /* "ete4/core/tree.pyx":638
 *     def lineage(self, root=None, include_root=True):
 *         """Yield all nodes in the lineage of this node (up to root if given)."""
 *         if not include_root and self is root:             # <<<<<<<<<<<<<<
 *             return  # the node itself would not be in its lineage
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_include_root); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 638, __pyx_L1_error)
  __pyx_t_3 = (!__pyx_t_2);
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_3 = (((PyObject *)__pyx_cur_scope->__pyx_v_self) == __pyx_cur_scope->__pyx_v_root);
  __pyx_t_1 = __pyx_t_3;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_1) {

    /* "ete4/core/tree.pyx":639
 *         """Yield all nodes in the lineage of this node (up to root if given)."""
 *         if not include_root and self is root:
 *             return  # the node itself would not be in its lineage             # <<<<<<<<<<<<<<
 * 
 *         # Same as ancestors() but also yielding itself first.
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = NULL;
    goto __pyx_L0;

    /* "ete4/core/tree.pyx":638
 *     def lineage(self, root=None, include_root=True):
 *         """Yield all nodes in the lineage of this node (up to root if given)."""
 *         if not include_root and self is root:             # <<<<<<<<<<<<<<
 *             return  # the node itself would not be in its lineage
 * 
 */
  }

  /* "ete4/core/tree.pyx":642
 * 
 *         # Same as ancestors() but also yielding itself first.
 *         yield self             # <<<<<<<<<<<<<<
 *         yield from self.ancestors(root, include_root)
 * 
 */
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __pyx_r = ((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  /* return from generator, yielding value */
  __pyx_generator->resume_label = 1;
  return __pyx_r;
  __pyx_L7_resume_from_yield:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 642, __pyx_L1_error)

  /* "ete4/core/tree.pyx":643
 *         # Same as ancestors() but also yielding itself first.
 *         yield self
 *         yield from self.ancestors(root, include_root)             # <<<<<<<<<<<<<<
 * 
 *     def _translate_nodes(self, nodes):
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_ancestors); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 643, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  __pyx_t_7 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
      __pyx_t_7 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_cur_scope->__pyx_v_root, __pyx_cur_scope->__pyx_v_include_root};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 643, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __pyx_r = __Pyx_Generator_Yield_From(__pyx_generator, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_XGOTREF(__pyx_r);
  if (likely(__pyx_r)) {
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 2;
    return __pyx_r;
    __pyx_L8_resume_from_yield_from:;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 643, __pyx_L1_error)
  } else {
    PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType();
    if (exc_type) {
      if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear();
      else __PYX_ERR(0, 643, __pyx_L1_error)
    }
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "ete4/core/tree.pyx":636
 *             yield root
 * 
 *     def lineage(self, root=None, include_root=True):             # <<<<<<<<<<<<<<
 *         """Yield all nodes in the lineage of this node (up to root if given)."""
 *         if not include_root and self is root:
 */

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

/* "ete4/core/tree.pyx":645
 *         yield from self.ancestors(root, include_root)
 * 
 *     def _translate_nodes(self, nodes):             # <<<<<<<<<<<<<<
 *         """Return a list of nodes that correspond to the given names or nodes."""
 *         # ['A', self['B'], 'C'] -> [self['A'], self['B'], self['C']]
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_79_translate_nodes(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_4ete4_4core_4tree_4Tree_78_translate_nodes, "Tree._translate_nodes(self, nodes)\nReturn a list of nodes that correspond to the given names or nodes.");
static PyMethodDef __pyx_mdef_4ete4_4core_4tree_4Tree_79_translate_nodes = {"_translate_nodes", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_79_translate_nodes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_78_translate_nodes};
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_79_translate_nodes(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_nodes = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_translate_nodes (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nodes,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_nodes)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 645, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_translate_nodes") < 0)) __PYX_ERR(0, 645, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_nodes = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_translate_nodes", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 645, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("ete4.core.tree.Tree._translate_nodes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_78_translate_nodes(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self), __pyx_v_nodes);

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

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_78_translate_nodes(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_nodes) {
  PyObject *__pyx_v_names = NULL;
  PyObject *__pyx_v_name2node = NULL;
  PyObject *__pyx_v_node = NULL;
  PyObject *__pyx_8genexpr7__pyx_v_n = NULL;
  PyObject *__pyx_8genexpr8__pyx_v_n = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  PyObject *__pyx_t_7 = NULL;
  unsigned int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_translate_nodes", 1);

  /* "ete4/core/tree.pyx":648
 *         """Return a list of nodes that correspond to the given names or nodes."""
 *         # ['A', self['B'], 'C'] -> [self['A'], self['B'], self['C']]
 *         assert type(nodes) in [list, tuple, set, frozenset]             # <<<<<<<<<<<<<<
 * 
 *         names = {n for n in nodes if type(n) == str}
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_nodes)));
    __pyx_t_1 = ((PyObject *)Py_TYPE(__pyx_v_nodes));
    __pyx_t_3 = PyObject_RichCompare(((PyObject *)__pyx_t_1), ((PyObject *)(&PyList_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 648, __pyx_L1_error)
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 648, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (!__pyx_t_4) {
    } else {
      __pyx_t_2 = __pyx_t_4;
      goto __pyx_L3_bool_binop_done;
    }
    __pyx_t_3 = PyObject_RichCompare(((PyObject *)__pyx_t_1), ((PyObject *)(&PyTuple_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 648, __pyx_L1_error)
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 648, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (!__pyx_t_4) {
    } else {
      __pyx_t_2 = __pyx_t_4;
      goto __pyx_L3_bool_binop_done;
    }
    __pyx_t_3 = PyObject_RichCompare(((PyObject *)__pyx_t_1), ((PyObject *)(&PySet_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 648, __pyx_L1_error)
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 648, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (!__pyx_t_4) {
    } else {
      __pyx_t_2 = __pyx_t_4;
      goto __pyx_L3_bool_binop_done;
    }
    __pyx_t_3 = PyObject_RichCompare(((PyObject *)__pyx_t_1), ((PyObject *)(&PyFrozenSet_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 648, __pyx_L1_error)
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 648, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_2 = __pyx_t_4;
    __pyx_L3_bool_binop_done:;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __pyx_t_2;
    if (unlikely(!__pyx_t_4)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 648, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 648, __pyx_L1_error)
  #endif

  /* "ete4/core/tree.pyx":650
 *         assert type(nodes) in [list, tuple, set, frozenset]
 * 
 *         names = {n for n in nodes if type(n) == str}             # <<<<<<<<<<<<<<
 * 
 *         if not names:
 */
  { /* enter inner scope */
    __pyx_t_1 = PySet_New(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 650, __pyx_L9_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (likely(PyList_CheckExact(__pyx_v_nodes)) || PyTuple_CheckExact(__pyx_v_nodes)) {
      __pyx_t_3 = __pyx_v_nodes; __Pyx_INCREF(__pyx_t_3);
      __pyx_t_5 = 0;
      __pyx_t_6 = NULL;
    } else {
      __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_nodes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 650, __pyx_L9_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 650, __pyx_L9_error)
    }
    for (;;) {
      if (likely(!__pyx_t_6)) {
        if (likely(PyList_CheckExact(__pyx_t_3))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 650, __pyx_L9_error)
            #endif
            if (__pyx_t_5 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_7 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 650, __pyx_L9_error)
          #else
          __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 650, __pyx_L9_error)
          __Pyx_GOTREF(__pyx_t_7);
          #endif
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 650, __pyx_L9_error)
            #endif
            if (__pyx_t_5 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 650, __pyx_L9_error)
          #else
          __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 650, __pyx_L9_error)
          __Pyx_GOTREF(__pyx_t_7);
          #endif
        }
      } else {
        __pyx_t_7 = __pyx_t_6(__pyx_t_3);
        if (unlikely(!__pyx_t_7)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 650, __pyx_L9_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_7);
      }
      __Pyx_XDECREF_SET(__pyx_8genexpr7__pyx_v_n, __pyx_t_7);
      __pyx_t_7 = 0;
      __pyx_t_7 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_8genexpr7__pyx_v_n)), ((PyObject *)(&PyUnicode_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 650, __pyx_L9_error)
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 650, __pyx_L9_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (__pyx_t_4) {
        if (unlikely(PySet_Add(__pyx_t_1, (PyObject*)__pyx_8genexpr7__pyx_v_n))) __PYX_ERR(0, 650, __pyx_L9_error)
      }
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_n); __pyx_8genexpr7__pyx_v_n = 0;
    goto __pyx_L14_exit_scope;
    __pyx_L9_error:;
    __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_n); __pyx_8genexpr7__pyx_v_n = 0;
    goto __pyx_L1_error;
    __pyx_L14_exit_scope:;
  } /* exit inner scope */
  __pyx_v_names = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "ete4/core/tree.pyx":652
 *         names = {n for n in nodes if type(n) == str}
 * 
 *         if not names:             # <<<<<<<<<<<<<<
 *             return list(nodes)  # avoid traversing tree if no names to translate
 * 
 */
  __pyx_t_4 = (PySet_GET_SIZE(__pyx_v_names) != 0);
  __pyx_t_2 = (!__pyx_t_4);
  if (__pyx_t_2) {

    /* "ete4/core/tree.pyx":653
 * 
 *         if not names:
 *             return list(nodes)  # avoid traversing tree if no names to translate             # <<<<<<<<<<<<<<
 * 
 *         name2node = {}
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = PySequence_List(__pyx_v_nodes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 653, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "ete4/core/tree.pyx":652
 *         names = {n for n in nodes if type(n) == str}
 * 
 *         if not names:             # <<<<<<<<<<<<<<
 *             return list(nodes)  # avoid traversing tree if no names to translate
 * 
 */
  }

  /* "ete4/core/tree.pyx":655
 *             return list(nodes)  # avoid traversing tree if no names to translate
 * 
 *         name2node = {}             # <<<<<<<<<<<<<<
 *         for node in self.traverse():
 *             if node.name in names:
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 655, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_name2node = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "ete4/core/tree.pyx":656
 * 
 *         name2node = {}
 *         for node in self.traverse():             # <<<<<<<<<<<<<<
 *             if node.name in names:
 *                 assert node.name not in name2node, f'Ambiguous node name: {node.name}'
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_traverse); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 656, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = NULL;
  __pyx_t_8 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_8 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_8, 0+__pyx_t_8);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 656, __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_6 = NULL;
  } else {
    __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 656, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 656, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_6)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 656, __pyx_L1_error)
          #endif
          if (__pyx_t_5 >= __pyx_temp) 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, 656, __pyx_L1_error)
        #else
        __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 656, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 656, __pyx_L1_error)
          #endif
          if (__pyx_t_5 >= __pyx_temp) 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, 656, __pyx_L1_error)
        #else
        __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 656, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_6(__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, 656, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_node, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "ete4/core/tree.pyx":657
 *         name2node = {}
 *         for node in self.traverse():
 *             if node.name in names:             # <<<<<<<<<<<<<<
 *                 assert node.name not in name2node, f'Ambiguous node name: {node.name}'
 *                 name2node[node.name] = node
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_node, __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 657, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = (__Pyx_PySet_ContainsTF(__pyx_t_1, __pyx_v_names, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 657, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_2) {

      /* "ete4/core/tree.pyx":658
 *         for node in self.traverse():
 *             if node.name in names:
 *                 assert node.name not in name2node, f'Ambiguous node name: {node.name}'             # <<<<<<<<<<<<<<
 *                 name2node[node.name] = node
 * 
 */
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      if (unlikely(__pyx_assertions_enabled())) {
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_node, __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 658, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_t_1, __pyx_v_name2node, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 658, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (unlikely(!__pyx_t_2)) {
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_node, __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 658, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 658, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Ambiguous_node_name, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 658, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_t_1, 0, 0);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __PYX_ERR(0, 658, __pyx_L1_error)
        }
      }
      #else
      if ((1)); else __PYX_ERR(0, 658, __pyx_L1_error)
      #endif

      /* "ete4/core/tree.pyx":659
 *             if node.name in names:
 *                 assert node.name not in name2node, f'Ambiguous node name: {node.name}'
 *                 name2node[node.name] = node             # <<<<<<<<<<<<<<
 * 
 *         return [name2node[n] if type(n) == str else n for n in nodes]
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_node, __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 659, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (unlikely((PyDict_SetItem(__pyx_v_name2node, __pyx_t_1, __pyx_v_node) < 0))) __PYX_ERR(0, 659, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "ete4/core/tree.pyx":657
 *         name2node = {}
 *         for node in self.traverse():
 *             if node.name in names:             # <<<<<<<<<<<<<<
 *                 assert node.name not in name2node, f'Ambiguous node name: {node.name}'
 *                 name2node[node.name] = node
 */
    }

    /* "ete4/core/tree.pyx":656
 * 
 *         name2node = {}
 *         for node in self.traverse():             # <<<<<<<<<<<<<<
 *             if node.name in names:
 *                 assert node.name not in name2node, f'Ambiguous node name: {node.name}'
 */
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "ete4/core/tree.pyx":661
 *                 name2node[node.name] = node
 * 
 *         return [name2node[n] if type(n) == str else n for n in nodes]             # <<<<<<<<<<<<<<
 * 
 *     def describe(self):
 */
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 661, __pyx_L22_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (likely(PyList_CheckExact(__pyx_v_nodes)) || PyTuple_CheckExact(__pyx_v_nodes)) {
      __pyx_t_1 = __pyx_v_nodes; __Pyx_INCREF(__pyx_t_1);
      __pyx_t_5 = 0;
      __pyx_t_6 = NULL;
    } else {
      __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_nodes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 661, __pyx_L22_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 661, __pyx_L22_error)
    }
    for (;;) {
      if (likely(!__pyx_t_6)) {
        if (likely(PyList_CheckExact(__pyx_t_1))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 661, __pyx_L22_error)
            #endif
            if (__pyx_t_5 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_7 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 661, __pyx_L22_error)
          #else
          __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 661, __pyx_L22_error)
          __Pyx_GOTREF(__pyx_t_7);
          #endif
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 661, __pyx_L22_error)
            #endif
            if (__pyx_t_5 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 661, __pyx_L22_error)
          #else
          __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 661, __pyx_L22_error)
          __Pyx_GOTREF(__pyx_t_7);
          #endif
        }
      } else {
        __pyx_t_7 = __pyx_t_6(__pyx_t_1);
        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, 661, __pyx_L22_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_7);
      }
      __Pyx_XDECREF_SET(__pyx_8genexpr8__pyx_v_n, __pyx_t_7);
      __pyx_t_7 = 0;
      __pyx_t_9 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_8genexpr8__pyx_v_n)), ((PyObject *)(&PyUnicode_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 661, __pyx_L22_error)
      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 661, __pyx_L22_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (__pyx_t_2) {
        __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_v_name2node, __pyx_8genexpr8__pyx_v_n); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 661, __pyx_L22_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_7 = __pyx_t_9;
        __pyx_t_9 = 0;
      } else {
        __Pyx_INCREF(__pyx_8genexpr8__pyx_v_n);
        __pyx_t_7 = __pyx_8genexpr8__pyx_v_n;
      }
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 661, __pyx_L22_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_n); __pyx_8genexpr8__pyx_v_n = 0;
    goto __pyx_L26_exit_scope;
    __pyx_L22_error:;
    __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_n); __pyx_8genexpr8__pyx_v_n = 0;
    goto __pyx_L1_error;
    __pyx_L26_exit_scope:;
  } /* exit inner scope */
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "ete4/core/tree.pyx":645
 *         yield from self.ancestors(root, include_root)
 * 
 *     def _translate_nodes(self, nodes):             # <<<<<<<<<<<<<<
 *         """Return a list of nodes that correspond to the given names or nodes."""
 *         # ['A', self['B'], 'C'] -> [self['A'], self['B'], self['C']]
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("ete4.core.tree.Tree._translate_nodes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_names);
  __Pyx_XDECREF(__pyx_v_name2node);
  __Pyx_XDECREF(__pyx_v_node);
  __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_n);
  __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_n);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ete4/core/tree.pyx":663
 *         return [name2node[n] if type(n) == str else n for n in nodes]
 * 
 *     def describe(self):             # <<<<<<<<<<<<<<
 *         """Return a string with information on this node and its connections."""
 *         if len(self.root.children) == 2:
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_81describe(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_4ete4_4core_4tree_4Tree_80describe, "Tree.describe(self)\nReturn a string with information on this node and its connections.");
static PyMethodDef __pyx_mdef_4ete4_4core_4tree_4Tree_81describe = {"describe", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_81describe, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_80describe};
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_81describe(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("describe (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("describe", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "describe", 0))) return NULL;
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_80describe(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self));

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

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_80describe(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self) {
  PyObject *__pyx_v_rooting = NULL;
  PyObject *__pyx_v_max_node = NULL;
  PyObject *__pyx_v_max_dist = NULL;
  PyObject *__pyx_v_cached_content = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  unsigned int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *(*__pyx_t_8)(PyObject *);
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("describe", 1);

  /* "ete4/core/tree.pyx":665
 *     def describe(self):
 *         """Return a string with information on this node and its connections."""
 *         if len(self.root.children) == 2:             # <<<<<<<<<<<<<<
 *             rooting = 'Yes'
 *         elif len(self.root.children) > 2:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_root); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 665, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_children); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 665, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 665, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__pyx_t_3 == 2);
  if (__pyx_t_4) {

    /* "ete4/core/tree.pyx":666
 *         """Return a string with information on this node and its connections."""
 *         if len(self.root.children) == 2:
 *             rooting = 'Yes'             # <<<<<<<<<<<<<<
 *         elif len(self.root.children) > 2:
 *             rooting = 'No'
 */
    __Pyx_INCREF(__pyx_n_u_Yes);
    __pyx_v_rooting = __pyx_n_u_Yes;

    /* "ete4/core/tree.pyx":665
 *     def describe(self):
 *         """Return a string with information on this node and its connections."""
 *         if len(self.root.children) == 2:             # <<<<<<<<<<<<<<
 *             rooting = 'Yes'
 *         elif len(self.root.children) > 2:
 */
    goto __pyx_L3;
  }

  /* "ete4/core/tree.pyx":667
 *         if len(self.root.children) == 2:
 *             rooting = 'Yes'
 *         elif len(self.root.children) > 2:             # <<<<<<<<<<<<<<
 *             rooting = 'No'
 *         else:
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_root); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 667, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_children); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 667, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 667, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = (__pyx_t_3 > 2);
  if (__pyx_t_4) {

    /* "ete4/core/tree.pyx":668
 *             rooting = 'Yes'
 *         elif len(self.root.children) > 2:
 *             rooting = 'No'             # <<<<<<<<<<<<<<
 *         else:
 *             rooting = 'No children'
 */
    __Pyx_INCREF(__pyx_n_u_No);
    __pyx_v_rooting = __pyx_n_u_No;

    /* "ete4/core/tree.pyx":667
 *         if len(self.root.children) == 2:
 *             rooting = 'Yes'
 *         elif len(self.root.children) > 2:             # <<<<<<<<<<<<<<
 *             rooting = 'No'
 *         else:
 */
    goto __pyx_L3;
  }

  /* "ete4/core/tree.pyx":670
 *             rooting = 'No'
 *         else:
 *             rooting = 'No children'             # <<<<<<<<<<<<<<
 * 
 *         max_node, max_dist = self.get_farthest_leaf()
 */
  /*else*/ {
    __Pyx_INCREF(__pyx_kp_u_No_children);
    __pyx_v_rooting = __pyx_kp_u_No_children;
  }
  __pyx_L3:;

  /* "ete4/core/tree.pyx":672
 *             rooting = 'No children'
 * 
 *         max_node, max_dist = self.get_farthest_leaf()             # <<<<<<<<<<<<<<
 *         cached_content = self.get_cached_content()
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_farthest_leaf); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 672, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 672, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 672, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_5);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 672, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 672, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 672, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7);
    index = 0; __pyx_t_2 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 672, __pyx_L1_error)
    __pyx_t_8 = NULL;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_8 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 672, __pyx_L1_error)
    __pyx_L5_unpacking_done:;
  }
  __pyx_v_max_node = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_v_max_dist = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "ete4/core/tree.pyx":673
 * 
 *         max_node, max_dist = self.get_farthest_leaf()
 *         cached_content = self.get_cached_content()             # <<<<<<<<<<<<<<
 * 
 *         return '\n'.join([
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_cached_content); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 673, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 673, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __pyx_v_cached_content = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "ete4/core/tree.pyx":675
 *         cached_content = self.get_cached_content()
 * 
 *         return '\n'.join([             # <<<<<<<<<<<<<<
 *             'Number of leaf nodes: %d' % len(cached_content[self]),
 *             'Total number of nodes: %d' % len(cached_content),
 */
  __Pyx_XDECREF(__pyx_r);

  /* "ete4/core/tree.pyx":676
 * 
 *         return '\n'.join([
 *             'Number of leaf nodes: %d' % len(cached_content[self]),             # <<<<<<<<<<<<<<
 *             'Total number of nodes: %d' % len(cached_content),
 *             'Rooted: %s' % rooting,
 */
  __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_cached_content, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 676, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 676, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 676, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyUnicode_Format(__pyx_kp_u_Number_of_leaf_nodes_d, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 676, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ete4/core/tree.pyx":677
 *         return '\n'.join([
 *             'Number of leaf nodes: %d' % len(cached_content[self]),
 *             'Total number of nodes: %d' % len(cached_content),             # <<<<<<<<<<<<<<
 *             'Rooted: %s' % rooting,
 *             'Most distant node: %s' % (max_node.name or ''),
 */
  __pyx_t_3 = PyObject_Length(__pyx_v_cached_content); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 677, __pyx_L1_error)
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 677, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyUnicode_Format(__pyx_kp_u_Total_number_of_nodes_d, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 677, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ete4/core/tree.pyx":678
 *             'Number of leaf nodes: %d' % len(cached_content[self]),
 *             'Total number of nodes: %d' % len(cached_content),
 *             'Rooted: %s' % rooting,             # <<<<<<<<<<<<<<
 *             'Most distant node: %s' % (max_node.name or ''),
 *             'Max. distance: %g' % max_dist])
 */
  __pyx_t_1 = PyUnicode_Format(__pyx_kp_u_Rooted_s, __pyx_v_rooting); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 678, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "ete4/core/tree.pyx":679
 *             'Total number of nodes: %d' % len(cached_content),
 *             'Rooted: %s' % rooting,
 *             'Most distant node: %s' % (max_node.name or ''),             # <<<<<<<<<<<<<<
 *             'Max. distance: %g' % max_dist])
 * 
 */
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_max_node, __pyx_n_s_name); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 679, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 679, __pyx_L1_error)
  if (!__pyx_t_4) {
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  } else {
    __Pyx_INCREF(__pyx_t_9);
    __pyx_t_7 = __pyx_t_9;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    goto __pyx_L6_bool_binop_done;
  }
  __Pyx_INCREF(__pyx_kp_u__3);
  __pyx_t_7 = __pyx_kp_u__3;
  __pyx_L6_bool_binop_done:;
  __pyx_t_9 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_Most_distant_node_s, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 679, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "ete4/core/tree.pyx":680
 *             'Rooted: %s' % rooting,
 *             'Most distant node: %s' % (max_node.name or ''),
 *             'Max. distance: %g' % max_dist])             # <<<<<<<<<<<<<<
 * 
 *     def write(self, outfile=None, props=(), parser=None,
 */
  __pyx_t_7 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_Max_distance_g, __pyx_v_max_dist); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 680, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);

  /* "ete4/core/tree.pyx":675
 *         cached_content = self.get_cached_content()
 * 
 *         return '\n'.join([             # <<<<<<<<<<<<<<
 *             'Number of leaf nodes: %d' % len(cached_content[self]),
 *             'Total number of nodes: %d' % len(cached_content),
 */
  __pyx_t_10 = PyList_New(5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 675, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_10, 0, __pyx_t_5)) __PYX_ERR(0, 675, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_10, 1, __pyx_t_2)) __PYX_ERR(0, 675, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_10, 2, __pyx_t_1)) __PYX_ERR(0, 675, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_9);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_10, 3, __pyx_t_9)) __PYX_ERR(0, 675, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_10, 4, __pyx_t_7)) __PYX_ERR(0, 675, __pyx_L1_error);
  __pyx_t_5 = 0;
  __pyx_t_2 = 0;
  __pyx_t_1 = 0;
  __pyx_t_9 = 0;
  __pyx_t_7 = 0;
  __pyx_t_7 = PyUnicode_Join(__pyx_kp_u__15, __pyx_t_10); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 675, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "ete4/core/tree.pyx":663
 *         return [name2node[n] if type(n) == str else n for n in nodes]
 * 
 *     def describe(self):             # <<<<<<<<<<<<<<
 *         """Return a string with information on this node and its connections."""
 *         if len(self.root.children) == 2:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("ete4.core.tree.Tree.describe", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_rooting);
  __Pyx_XDECREF(__pyx_v_max_node);
  __Pyx_XDECREF(__pyx_v_max_dist);
  __Pyx_XDECREF(__pyx_v_cached_content);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ete4/core/tree.pyx":682
 *             'Max. distance: %g' % max_dist])
 * 
 *     def write(self, outfile=None, props=(), parser=None,             # <<<<<<<<<<<<<<
 *               format_root_node=False, is_leaf_fn=None):
 *         """Return or write to file the newick representation.
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_83write(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_4ete4_4core_4tree_4Tree_82write, "Tree.write(self, outfile=None, props=(), parser=None, format_root_node=False, is_leaf_fn=None)\nReturn or write to file the newick representation.\n\n        :param str outfile: Name of the output file. If present, it will write\n            the newick to that file instad of returning it as a string.\n        :param list props: Properties to write for all nodes using the Extended\n            Newick Format. If None, write all available properties.\n        :param parser: Parser used to encode the tree in newick format.\n        :param bool format_root_node: If True, write content of the root node\n            too. For compatibility reasons, this is False by default.\n\n        Example::\n\n          t.write(props=['species', 'sci_name'])\n        ");
static PyMethodDef __pyx_mdef_4ete4_4core_4tree_4Tree_83write = {"write", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_83write, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_82write};
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_83write(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_outfile = 0;
  PyObject *__pyx_v_props = 0;
  PyObject *__pyx_v_parser = 0;
  PyObject *__pyx_v_format_root_node = 0;
  PyObject *__pyx_v_is_leaf_fn = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[5] = {0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("write (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_outfile,&__pyx_n_s_props,&__pyx_n_s_parser,&__pyx_n_s_format_root_node,&__pyx_n_s_is_leaf_fn,0};
    values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_empty_tuple));
    values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));

    /* "ete4/core/tree.pyx":683
 * 
 *     def write(self, outfile=None, props=(), parser=None,
 *               format_root_node=False, is_leaf_fn=None):             # <<<<<<<<<<<<<<
 *         """Return or write to file the newick representation.
 * 
 */
    values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_False));
    values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_outfile);
          if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 682, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_props);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 682, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_parser);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 682, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_format_root_node);
          if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 682, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_is_leaf_fn);
          if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 682, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "write") < 0)) __PYX_ERR(0, 682, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_outfile = values[0];
    __pyx_v_props = values[1];
    __pyx_v_parser = values[2];
    __pyx_v_format_root_node = values[3];
    __pyx_v_is_leaf_fn = values[4];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("write", 0, 0, 5, __pyx_nargs); __PYX_ERR(0, 682, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("ete4.core.tree.Tree.write", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_82write(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self), __pyx_v_outfile, __pyx_v_props, __pyx_v_parser, __pyx_v_format_root_node, __pyx_v_is_leaf_fn);

  /* "ete4/core/tree.pyx":682
 *             'Max. distance: %g' % max_dist])
 * 
 *     def write(self, outfile=None, props=(), parser=None,             # <<<<<<<<<<<<<<
 *               format_root_node=False, is_leaf_fn=None):
 *         """Return or write to file the newick representation.
 */

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

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_82write(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_outfile, PyObject *__pyx_v_props, PyObject *__pyx_v_parser, PyObject *__pyx_v_format_root_node, PyObject *__pyx_v_is_leaf_fn) {
  PyObject *__pyx_v_fp = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  unsigned int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("write", 0);
  __Pyx_INCREF(__pyx_v_parser);

  /* "ete4/core/tree.pyx":698
 *           t.write(props=['species', 'sci_name'])
 *         """
 *         parser = parser if type(parser) is dict else newick.PARSERS[parser]             # <<<<<<<<<<<<<<
 * 
 *         if not outfile:
 */
  __pyx_t_2 = (((PyObject *)Py_TYPE(__pyx_v_parser)) == ((PyObject *)(&PyDict_Type)));
  if (__pyx_t_2) {
    __Pyx_INCREF(__pyx_v_parser);
    __pyx_t_1 = __pyx_v_parser;
  } else {
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_newick); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 698, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_PARSERS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 698, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_4, __pyx_v_parser); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 698, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
  }
  __Pyx_DECREF_SET(__pyx_v_parser, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "ete4/core/tree.pyx":700
 *         parser = parser if type(parser) is dict else newick.PARSERS[parser]
 * 
 *         if not outfile:             # <<<<<<<<<<<<<<
 *             return newick.dumps(self, props, parser, format_root_node, is_leaf_fn)
 *         else:
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_outfile); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 700, __pyx_L1_error)
  __pyx_t_5 = (!__pyx_t_2);
  if (__pyx_t_5) {

    /* "ete4/core/tree.pyx":701
 * 
 *         if not outfile:
 *             return newick.dumps(self, props, parser, format_root_node, is_leaf_fn)             # <<<<<<<<<<<<<<
 *         else:
 *             with open(outfile, 'w') as fp:
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_newick); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 701, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_dumps); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 701, __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
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[6] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_props, __pyx_v_parser, __pyx_v_format_root_node, __pyx_v_is_leaf_fn};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 5+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 701, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "ete4/core/tree.pyx":700
 *         parser = parser if type(parser) is dict else newick.PARSERS[parser]
 * 
 *         if not outfile:             # <<<<<<<<<<<<<<
 *             return newick.dumps(self, props, parser, format_root_node, is_leaf_fn)
 *         else:
 */
  }

  /* "ete4/core/tree.pyx":703
 *             return newick.dumps(self, props, parser, format_root_node, is_leaf_fn)
 *         else:
 *             with open(outfile, 'w') as fp:             # <<<<<<<<<<<<<<
 *                 newick.dump(self, fp, props, parser, format_root_node, is_leaf_fn)
 * 
 */
  /*else*/ {
    /*with:*/ {
      __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 703, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_v_outfile);
      __Pyx_GIVEREF(__pyx_v_outfile);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_outfile)) __PYX_ERR(0, 703, __pyx_L1_error);
      __Pyx_INCREF(__pyx_n_u_w);
      __Pyx_GIVEREF(__pyx_n_u_w);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_u_w)) __PYX_ERR(0, 703, __pyx_L1_error);
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 703, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_7 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_n_s_exit); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 703, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_n_s_enter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 703, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_8 = NULL;
      __pyx_t_6 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_6 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL};
        __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 703, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      }
      __pyx_t_3 = __pyx_t_1;
      __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      /*try:*/ {
        {
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
          __Pyx_XGOTREF(__pyx_t_9);
          __Pyx_XGOTREF(__pyx_t_10);
          __Pyx_XGOTREF(__pyx_t_11);
          /*try:*/ {
            __pyx_v_fp = __pyx_t_3;
            __pyx_t_3 = 0;

            /* "ete4/core/tree.pyx":704
 *         else:
 *             with open(outfile, 'w') as fp:
 *                 newick.dump(self, fp, props, parser, format_root_node, is_leaf_fn)             # <<<<<<<<<<<<<<
 * 
 *     def common_ancestor(self, *nodes):
 */
            __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_newick); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 704, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_dump); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 704, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __pyx_t_4 = NULL;
            __pyx_t_6 = 0;
            #if CYTHON_UNPACK_METHODS
            if (unlikely(PyMethod_Check(__pyx_t_1))) {
              __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
              if (likely(__pyx_t_4)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
                __Pyx_INCREF(__pyx_t_4);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_1, function);
                __pyx_t_6 = 1;
              }
            }
            #endif
            {
              PyObject *__pyx_callargs[7] = {__pyx_t_4, ((PyObject *)__pyx_v_self), __pyx_v_fp, __pyx_v_props, __pyx_v_parser, __pyx_v_format_root_node, __pyx_v_is_leaf_fn};
              __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 6+__pyx_t_6);
              __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
              if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 704, __pyx_L8_error)
              __Pyx_GOTREF(__pyx_t_3);
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            }
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

            /* "ete4/core/tree.pyx":703
 *             return newick.dumps(self, props, parser, format_root_node, is_leaf_fn)
 *         else:
 *             with open(outfile, 'w') as fp:             # <<<<<<<<<<<<<<
 *                 newick.dump(self, fp, props, parser, format_root_node, is_leaf_fn)
 * 
 */
          }
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          goto __pyx_L13_try_end;
          __pyx_L8_error:;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          /*except:*/ {
            __Pyx_AddTraceback("ete4.core.tree.Tree.write", __pyx_clineno, __pyx_lineno, __pyx_filename);
            if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_1, &__pyx_t_4) < 0) __PYX_ERR(0, 703, __pyx_L10_except_error)
            __Pyx_XGOTREF(__pyx_t_3);
            __Pyx_XGOTREF(__pyx_t_1);
            __Pyx_XGOTREF(__pyx_t_4);
            __pyx_t_8 = PyTuple_Pack(3, __pyx_t_3, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 703, __pyx_L10_except_error)
            __Pyx_GOTREF(__pyx_t_8);
            __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_8, NULL);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 703, __pyx_L10_except_error)
            __Pyx_GOTREF(__pyx_t_12);
            __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_12);
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            if (__pyx_t_5 < 0) __PYX_ERR(0, 703, __pyx_L10_except_error)
            __pyx_t_2 = (!__pyx_t_5);
            if (unlikely(__pyx_t_2)) {
              __Pyx_GIVEREF(__pyx_t_3);
              __Pyx_GIVEREF(__pyx_t_1);
              __Pyx_XGIVEREF(__pyx_t_4);
              __Pyx_ErrRestoreWithState(__pyx_t_3, __pyx_t_1, __pyx_t_4);
              __pyx_t_3 = 0; __pyx_t_1 = 0; __pyx_t_4 = 0; 
              __PYX_ERR(0, 703, __pyx_L10_except_error)
            }
            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            goto __pyx_L9_exception_handled;
          }
          __pyx_L10_except_error:;
          __Pyx_XGIVEREF(__pyx_t_9);
          __Pyx_XGIVEREF(__pyx_t_10);
          __Pyx_XGIVEREF(__pyx_t_11);
          __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
          goto __pyx_L1_error;
          __pyx_L9_exception_handled:;
          __Pyx_XGIVEREF(__pyx_t_9);
          __Pyx_XGIVEREF(__pyx_t_10);
          __Pyx_XGIVEREF(__pyx_t_11);
          __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
          __pyx_L13_try_end:;
        }
      }
      /*finally:*/ {
        /*normal exit:*/{
          if (__pyx_t_7) {
            __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__16, NULL);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 703, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_11);
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          }
          goto __pyx_L7;
        }
        __pyx_L7:;
      }
      goto __pyx_L17;
      __pyx_L4_error:;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L1_error;
      __pyx_L17:;
    }
  }

  /* "ete4/core/tree.pyx":682
 *             'Max. distance: %g' % max_dist])
 * 
 *     def write(self, outfile=None, props=(), parser=None,             # <<<<<<<<<<<<<<
 *               format_root_node=False, is_leaf_fn=None):
 *         """Return or write to file the newick representation.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("ete4.core.tree.Tree.write", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_fp);
  __Pyx_XDECREF(__pyx_v_parser);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ete4/core/tree.pyx":706
 *                 newick.dump(self, fp, props, parser, format_root_node, is_leaf_fn)
 * 
 *     def common_ancestor(self, *nodes):             # <<<<<<<<<<<<<<
 *         """Return the last node common to the lineages of the given nodes.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_85common_ancestor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
PyDoc_STRVAR(__pyx_doc_4ete4_4core_4tree_4Tree_84common_ancestor, "Tree.common_ancestor(self, *nodes)\nReturn the last node common to the lineages of the given nodes.\n\n        All the nodes should have self as an ancestor, or an error is raised.\n\n        :param nodes: It can be a single argument with a list of nodes, or\n            multiple arguments with the nodes. They can be just node names too.\n        ");
static PyMethodDef __pyx_mdef_4ete4_4core_4tree_4Tree_85common_ancestor = {"common_ancestor", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_85common_ancestor, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_84common_ancestor};
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_85common_ancestor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_nodes = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("common_ancestor (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "common_ancestor", 0))) return NULL;
  __Pyx_INCREF(__pyx_args);
  __pyx_v_nodes = __pyx_args;
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_84common_ancestor(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self), __pyx_v_nodes);

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

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_84common_ancestor(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_nodes) {
  PyObject *__pyx_v_root = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  unsigned int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("common_ancestor", 0);
  __Pyx_INCREF(__pyx_v_nodes);

  /* "ete4/core/tree.pyx":715
 *         """
 *         # Make "nodes" refer to the actual list(-like) of node objects.
 *         if len(nodes) == 1 and type(nodes[0]) in [list, tuple, set, frozenset]:             # <<<<<<<<<<<<<<
 *             nodes = nodes[0]
 * 
 */
  __pyx_t_2 = PyObject_Length(__pyx_v_nodes); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 715, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_2 == 1);
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nodes, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 715, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_t_4)));
  __pyx_t_5 = ((PyObject *)Py_TYPE(__pyx_t_4));
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_RichCompare(((PyObject *)__pyx_t_5), ((PyObject *)(&PyList_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 715, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 715, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (!__pyx_t_6) {
  } else {
    __pyx_t_3 = __pyx_t_6;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_4 = PyObject_RichCompare(((PyObject *)__pyx_t_5), ((PyObject *)(&PyTuple_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 715, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 715, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (!__pyx_t_6) {
  } else {
    __pyx_t_3 = __pyx_t_6;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_4 = PyObject_RichCompare(((PyObject *)__pyx_t_5), ((PyObject *)(&PySet_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 715, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 715, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (!__pyx_t_6) {
  } else {
    __pyx_t_3 = __pyx_t_6;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_4 = PyObject_RichCompare(((PyObject *)__pyx_t_5), ((PyObject *)(&PyFrozenSet_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 715, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 715, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_3 = __pyx_t_6;
  __pyx_L6_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_6 = __pyx_t_3;
  __pyx_t_1 = __pyx_t_6;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "ete4/core/tree.pyx":716
 *         # Make "nodes" refer to the actual list(-like) of node objects.
 *         if len(nodes) == 1 and type(nodes[0]) in [list, tuple, set, frozenset]:
 *             nodes = nodes[0]             # <<<<<<<<<<<<<<
 * 
 *         nodes = self._translate_nodes(nodes)  # in case anyone is given as name
 */
    __pyx_t_5 = __Pyx_GetItemInt_Tuple(__pyx_v_nodes, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 716, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF_SET(__pyx_v_nodes, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "ete4/core/tree.pyx":715
 *         """
 *         # Make "nodes" refer to the actual list(-like) of node objects.
 *         if len(nodes) == 1 and type(nodes[0]) in [list, tuple, set, frozenset]:             # <<<<<<<<<<<<<<
 *             nodes = nodes[0]
 * 
 */
  }

  /* "ete4/core/tree.pyx":718
 *             nodes = nodes[0]
 * 
 *         nodes = self._translate_nodes(nodes)  # in case anyone is given as name             # <<<<<<<<<<<<<<
 * 
 *         # Find their common root and return it.
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_translate_nodes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 718, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = NULL;
  __pyx_t_8 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_8 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_nodes};
    __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 718, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF_SET(__pyx_v_nodes, __pyx_t_5);
  __pyx_t_5 = 0;

  /* "ete4/core/tree.pyx":721
 * 
 *         # Find their common root and return it.
 *         root = ops.common_ancestor(nodes)             # <<<<<<<<<<<<<<
 * 
 *         if root is None or self not in root.lineage():
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ops); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 721, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_common_ancestor); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 721, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  __pyx_t_8 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_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_8 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_nodes};
    __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 721, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __pyx_v_root = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "ete4/core/tree.pyx":723
 *         root = ops.common_ancestor(nodes)
 * 
 *         if root is None or self not in root.lineage():             # <<<<<<<<<<<<<<
 *             raise TreeError(f'No common ancestor for nodes: {nodes}')
 * 
 */
  __pyx_t_6 = (__pyx_v_root == Py_None);
  if (!__pyx_t_6) {
  } else {
    __pyx_t_1 = __pyx_t_6;
    goto __pyx_L11_bool_binop_done;
  }
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_root, __pyx_n_s_lineage); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 723, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_4 = NULL;
  __pyx_t_8 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
      __pyx_t_8 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
    __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_8, 0+__pyx_t_8);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 723, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __pyx_t_6 = (__Pyx_PySequence_ContainsTF(((PyObject *)__pyx_v_self), __pyx_t_5, Py_NE)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 723, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_1 = __pyx_t_6;
  __pyx_L11_bool_binop_done:;
  if (unlikely(__pyx_t_1)) {

    /* "ete4/core/tree.pyx":724
 * 
 *         if root is None or self not in root.lineage():
 *             raise TreeError(f'No common ancestor for nodes: {nodes}')             # <<<<<<<<<<<<<<
 * 
 *         return root
 */
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_TreeError); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 724, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_v_nodes, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 724, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_9 = __Pyx_PyUnicode_Concat(__pyx_kp_u_No_common_ancestor_for_nodes, __pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 724, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    __pyx_t_8 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_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_8 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_9};
      __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 724, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __PYX_ERR(0, 724, __pyx_L1_error)

    /* "ete4/core/tree.pyx":723
 *         root = ops.common_ancestor(nodes)
 * 
 *         if root is None or self not in root.lineage():             # <<<<<<<<<<<<<<
 *             raise TreeError(f'No common ancestor for nodes: {nodes}')
 * 
 */
  }

  /* "ete4/core/tree.pyx":726
 *             raise TreeError(f'No common ancestor for nodes: {nodes}')
 * 
 *         return root             # <<<<<<<<<<<<<<
 * 
 *     def search_nodes(self, **conditions):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_root);
  __pyx_r = __pyx_v_root;
  goto __pyx_L0;

  /* "ete4/core/tree.pyx":706
 *                 newick.dump(self, fp, props, parser, format_root_node, is_leaf_fn)
 * 
 *     def common_ancestor(self, *nodes):             # <<<<<<<<<<<<<<
 *         """Return the last node common to the lineages of the given nodes.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("ete4.core.tree.Tree.common_ancestor", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_nodes);
  __Pyx_XDECREF(__pyx_v_root);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_4ete4_4core_4tree_4Tree_88generator8(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "ete4/core/tree.pyx":728
 *         return root
 * 
 *     def search_nodes(self, **conditions):             # <<<<<<<<<<<<<<
 *         """Yield nodes matching the given conditions.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_87search_nodes(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_4ete4_4core_4tree_4Tree_86search_nodes, "Tree.search_nodes(self, **conditions)\nYield nodes matching the given conditions.\n\n        Example::\n\n          for node in tree.search_nodes(dist=0.0, name='human'):\n              print(node.prop['support'])\n        ");
static PyMethodDef __pyx_mdef_4ete4_4core_4tree_4Tree_87search_nodes = {"search_nodes", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_87search_nodes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_86search_nodes};
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_87search_nodes(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_conditions = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("search_nodes (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("search_nodes", 1, 0, 0, __pyx_nargs); return NULL;}
  if (__pyx_kwds && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "search_nodes", 1))) return NULL;
  if (__pyx_kwds) {
    __pyx_v_conditions = __Pyx_KwargsAsDict_FASTCALL(__pyx_kwds, __pyx_kwvalues);
    if (unlikely(!__pyx_v_conditions)) return NULL;
    __Pyx_GOTREF(__pyx_v_conditions);
  } else {
    __pyx_v_conditions = PyDict_New();
    if (unlikely(!__pyx_v_conditions)) return NULL;
    __Pyx_GOTREF(__pyx_v_conditions);
  }
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_86search_nodes(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self), __pyx_v_conditions);

  /* function exit code */
  __Pyx_DECREF(__pyx_v_conditions);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_4ete4_4core_4tree_4Tree_12search_nodes_2generator17(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "ete4/core/tree.pyx":737
 *         """
 *         for node in self.traverse():
 *             if all(node.get_prop(k) == v for k, v in conditions.items()):             # <<<<<<<<<<<<<<
 *                 yield node
 * 
 */

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_12search_nodes_genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_17_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_17_genexpr *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_17_genexpr(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_17_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_17_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 737, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_16_search_nodes *) __pyx_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope);
  __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4ete4_4core_4tree_4Tree_12search_nodes_2generator17, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_search_nodes_locals_genexpr, __pyx_n_s_ete4_core_tree); if (unlikely(!gen)) __PYX_ERR(0, 737, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("ete4.core.tree.Tree.search_nodes.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_4ete4_4core_4tree_4Tree_12search_nodes_2generator17(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_17_genexpr *__pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_17_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  unsigned 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_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 737, __pyx_L1_error)
  __pyx_t_2 = 0;
  if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 737, __pyx_L1_error) }
  __pyx_t_5 = __Pyx_dict_iterator(__pyx_cur_scope->__pyx_genexpr_arg_0, 1, __pyx_n_s_items, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 737, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_1);
  __pyx_t_1 = __pyx_t_5;
  __pyx_t_5 = 0;
  while (1) {
    __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, &__pyx_t_5, &__pyx_t_6, NULL, __pyx_t_4);
    if (unlikely(__pyx_t_7 == 0)) break;
    if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 737, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_k);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_k, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_v);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_v, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    __pyx_t_6 = 0;
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_node)) { __Pyx_RaiseClosureNameError("node"); __PYX_ERR(0, 737, __pyx_L1_error) }
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_node, __pyx_n_s_get_prop); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 737, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_8 = NULL;
    __pyx_t_9 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_9 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_cur_scope->__pyx_v_k};
      __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 737, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __pyx_t_5 = PyObject_RichCompare(__pyx_t_6, __pyx_cur_scope->__pyx_v_v, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 737, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 737, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_11 = (!__pyx_t_10);
    if (__pyx_t_11) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_False);
      __pyx_r = Py_False;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
  }
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_True);
    __pyx_r = Py_True;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

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

/* "ete4/core/tree.pyx":728
 *         return root
 * 
 *     def search_nodes(self, **conditions):             # <<<<<<<<<<<<<<
 *         """Yield nodes matching the given conditions.
 * 
 */

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_86search_nodes(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_conditions) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_16_search_nodes *__pyx_cur_scope;
  PyObject *__pyx_gb_4ete4_4core_4tree_4Tree_12search_nodes_2generator17 = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("search_nodes", 0);
  __pyx_cur_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_16_search_nodes *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_16_search_nodes(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_16_search_nodes, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_16_search_nodes *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 728, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __pyx_cur_scope->__pyx_v_conditions = __pyx_v_conditions;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_conditions);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_conditions);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4ete4_4core_4tree_4Tree_88generator8, __pyx_codeobj__17, (PyObject *) __pyx_cur_scope, __pyx_n_s_search_nodes, __pyx_n_s_Tree_search_nodes, __pyx_n_s_ete4_core_tree); if (unlikely(!gen)) __PYX_ERR(0, 728, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("ete4.core.tree.Tree.search_nodes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XDECREF(__pyx_gb_4ete4_4core_4tree_4Tree_12search_nodes_2generator17);
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_4ete4_4core_4tree_4Tree_88generator8(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_16_search_nodes *__pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_16_search_nodes *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("search_nodes", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L7_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 728, __pyx_L1_error)

  /* "ete4/core/tree.pyx":736
 *               print(node.prop['support'])
 *         """
 *         for node in self.traverse():             # <<<<<<<<<<<<<<
 *             if all(node.get_prop(k) == v for k, v in conditions.items()):
 *                 yield node
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_traverse); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 736, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 736, __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_5 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 736, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 736, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_6)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 736, __pyx_L1_error)
          #endif
          if (__pyx_t_5 >= __pyx_temp) 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, 736, __pyx_L1_error)
        #else
        __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 736, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 736, __pyx_L1_error)
          #endif
          if (__pyx_t_5 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 736, __pyx_L1_error)
        #else
        __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 736, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_6(__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, 736, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_node);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_node, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;

    /* "ete4/core/tree.pyx":737
 *         """
 *         for node in self.traverse():
 *             if all(node.get_prop(k) == v for k, v in conditions.items()):             # <<<<<<<<<<<<<<
 *                 yield node
 * 
 */
    __pyx_t_1 = __pyx_pf_4ete4_4core_4tree_4Tree_12search_nodes_genexpr(((PyObject*)__pyx_cur_scope), __pyx_cur_scope->__pyx_v_conditions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 737, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_Generator_Next(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 737, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 737, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_7) {

      /* "ete4/core/tree.pyx":738
 *         for node in self.traverse():
 *             if all(node.get_prop(k) == v for k, v in conditions.items()):
 *                 yield node             # <<<<<<<<<<<<<<
 * 
 *     def search_descendants(self, **conditions):
 */
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_node);
      __pyx_r = __pyx_cur_scope->__pyx_v_node;
      __Pyx_XGIVEREF(__pyx_t_2);
      __pyx_cur_scope->__pyx_t_0 = __pyx_t_2;
      __pyx_cur_scope->__pyx_t_1 = __pyx_t_5;
      __pyx_cur_scope->__pyx_t_2 = __pyx_t_6;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
      /* return from generator, yielding value */
      __pyx_generator->resume_label = 1;
      return __pyx_r;
      __pyx_L7_resume_from_yield:;
      __pyx_t_2 = __pyx_cur_scope->__pyx_t_0;
      __pyx_cur_scope->__pyx_t_0 = 0;
      __Pyx_XGOTREF(__pyx_t_2);
      __pyx_t_5 = __pyx_cur_scope->__pyx_t_1;
      __pyx_t_6 = __pyx_cur_scope->__pyx_t_2;
      if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 738, __pyx_L1_error)

      /* "ete4/core/tree.pyx":737
 *         """
 *         for node in self.traverse():
 *             if all(node.get_prop(k) == v for k, v in conditions.items()):             # <<<<<<<<<<<<<<
 *                 yield node
 * 
 */
    }

    /* "ete4/core/tree.pyx":736
 *               print(node.prop['support'])
 *         """
 *         for node in self.traverse():             # <<<<<<<<<<<<<<
 *             if all(node.get_prop(k) == v for k, v in conditions.items()):
 *                 yield node
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "ete4/core/tree.pyx":728
 *         return root
 * 
 *     def search_nodes(self, **conditions):             # <<<<<<<<<<<<<<
 *         """Yield nodes matching the given conditions.
 * 
 */

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

/* "ete4/core/tree.pyx":740
 *                 yield node
 * 
 *     def search_descendants(self, **conditions):             # <<<<<<<<<<<<<<
 *         """Yield descendant nodes matching the given conditions."""
 *         for node in self.search_nodes(**conditions):
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_90search_descendants(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_4ete4_4core_4tree_4Tree_89search_descendants, "Tree.search_descendants(self, **conditions)\nYield descendant nodes matching the given conditions.");
static PyMethodDef __pyx_mdef_4ete4_4core_4tree_4Tree_90search_descendants = {"search_descendants", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_90search_descendants, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_89search_descendants};
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_90search_descendants(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_conditions = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("search_descendants (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("search_descendants", 1, 0, 0, __pyx_nargs); return NULL;}
  if (__pyx_kwds && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "search_descendants", 1))) return NULL;
  if (__pyx_kwds) {
    __pyx_v_conditions = __Pyx_KwargsAsDict_FASTCALL(__pyx_kwds, __pyx_kwvalues);
    if (unlikely(!__pyx_v_conditions)) return NULL;
    __Pyx_GOTREF(__pyx_v_conditions);
  } else {
    __pyx_v_conditions = PyDict_New();
    if (unlikely(!__pyx_v_conditions)) return NULL;
    __Pyx_GOTREF(__pyx_v_conditions);
  }
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_89search_descendants(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self), __pyx_v_conditions);

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

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_89search_descendants(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_conditions) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_18_search_descendants *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("search_descendants", 0);
  __pyx_cur_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_18_search_descendants *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_18_search_descendants(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_18_search_descendants, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_18_search_descendants *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 740, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __pyx_cur_scope->__pyx_v_conditions = __pyx_v_conditions;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_conditions);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_conditions);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4ete4_4core_4tree_4Tree_91generator9, __pyx_codeobj__18, (PyObject *) __pyx_cur_scope, __pyx_n_s_search_descendants, __pyx_n_s_Tree_search_descendants, __pyx_n_s_ete4_core_tree); if (unlikely(!gen)) __PYX_ERR(0, 740, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("ete4.core.tree.Tree.search_descendants", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_4ete4_4core_4tree_4Tree_91generator9(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_18_search_descendants *__pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_18_search_descendants *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("search_descendants", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L7_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 740, __pyx_L1_error)

  /* "ete4/core/tree.pyx":742
 *     def search_descendants(self, **conditions):
 *         """Yield descendant nodes matching the given conditions."""
 *         for node in self.search_nodes(**conditions):             # <<<<<<<<<<<<<<
 *             if node is not self:
 *                 yield node
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_search_nodes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 742, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyDict_Copy(__pyx_cur_scope->__pyx_v_conditions); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 742, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 742, __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;
  if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
    __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2);
    __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 742, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 742, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 742, __pyx_L1_error)
          #endif
          if (__pyx_t_4 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 742, __pyx_L1_error)
        #else
        __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 742, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 742, __pyx_L1_error)
          #endif
          if (__pyx_t_4 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 742, __pyx_L1_error)
        #else
        __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 742, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      }
    } else {
      __pyx_t_3 = __pyx_t_5(__pyx_t_2);
      if (unlikely(!__pyx_t_3)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 742, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_node);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_node, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;

    /* "ete4/core/tree.pyx":743
 *         """Yield descendant nodes matching the given conditions."""
 *         for node in self.search_nodes(**conditions):
 *             if node is not self:             # <<<<<<<<<<<<<<
 *                 yield node
 * 
 */
    __pyx_t_6 = (__pyx_cur_scope->__pyx_v_node != ((PyObject *)__pyx_cur_scope->__pyx_v_self));
    if (__pyx_t_6) {

      /* "ete4/core/tree.pyx":744
 *         for node in self.search_nodes(**conditions):
 *             if node is not self:
 *                 yield node             # <<<<<<<<<<<<<<
 * 
 *     def search_ancestors(self, **conditions):
 */
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_node);
      __pyx_r = __pyx_cur_scope->__pyx_v_node;
      __Pyx_XGIVEREF(__pyx_t_2);
      __pyx_cur_scope->__pyx_t_0 = __pyx_t_2;
      __pyx_cur_scope->__pyx_t_1 = __pyx_t_4;
      __pyx_cur_scope->__pyx_t_2 = __pyx_t_5;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
      /* return from generator, yielding value */
      __pyx_generator->resume_label = 1;
      return __pyx_r;
      __pyx_L7_resume_from_yield:;
      __pyx_t_2 = __pyx_cur_scope->__pyx_t_0;
      __pyx_cur_scope->__pyx_t_0 = 0;
      __Pyx_XGOTREF(__pyx_t_2);
      __pyx_t_4 = __pyx_cur_scope->__pyx_t_1;
      __pyx_t_5 = __pyx_cur_scope->__pyx_t_2;
      if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 744, __pyx_L1_error)

      /* "ete4/core/tree.pyx":743
 *         """Yield descendant nodes matching the given conditions."""
 *         for node in self.search_nodes(**conditions):
 *             if node is not self:             # <<<<<<<<<<<<<<
 *                 yield node
 * 
 */
    }

    /* "ete4/core/tree.pyx":742
 *     def search_descendants(self, **conditions):
 *         """Yield descendant nodes matching the given conditions."""
 *         for node in self.search_nodes(**conditions):             # <<<<<<<<<<<<<<
 *             if node is not self:
 *                 yield node
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "ete4/core/tree.pyx":740
 *                 yield node
 * 
 *     def search_descendants(self, **conditions):             # <<<<<<<<<<<<<<
 *         """Yield descendant nodes matching the given conditions."""
 *         for node in self.search_nodes(**conditions):
 */

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

/* "ete4/core/tree.pyx":746
 *                 yield node
 * 
 *     def search_ancestors(self, **conditions):             # <<<<<<<<<<<<<<
 *         """Yield ancestor nodes matching the given conditions."""
 *         for node in self.ancestors():
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_93search_ancestors(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_4ete4_4core_4tree_4Tree_92search_ancestors, "Tree.search_ancestors(self, **conditions)\nYield ancestor nodes matching the given conditions.");
static PyMethodDef __pyx_mdef_4ete4_4core_4tree_4Tree_93search_ancestors = {"search_ancestors", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_93search_ancestors, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_92search_ancestors};
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_93search_ancestors(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_conditions = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("search_ancestors (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("search_ancestors", 1, 0, 0, __pyx_nargs); return NULL;}
  if (__pyx_kwds && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "search_ancestors", 1))) return NULL;
  if (__pyx_kwds) {
    __pyx_v_conditions = __Pyx_KwargsAsDict_FASTCALL(__pyx_kwds, __pyx_kwvalues);
    if (unlikely(!__pyx_v_conditions)) return NULL;
    __Pyx_GOTREF(__pyx_v_conditions);
  } else {
    __pyx_v_conditions = PyDict_New();
    if (unlikely(!__pyx_v_conditions)) return NULL;
    __Pyx_GOTREF(__pyx_v_conditions);
  }
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_92search_ancestors(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self), __pyx_v_conditions);

  /* function exit code */
  __Pyx_DECREF(__pyx_v_conditions);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_4ete4_4core_4tree_4Tree_16search_ancestors_2generator18(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "ete4/core/tree.pyx":749
 *         """Yield ancestor nodes matching the given conditions."""
 *         for node in self.ancestors():
 *             if all(node.get_prop(k) == v for k, v in conditions.items()):             # <<<<<<<<<<<<<<
 *                 yield node
 * 
 */

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_16search_ancestors_genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_20_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_20_genexpr *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_20_genexpr(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_20_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_20_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 749, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_19_search_ancestors *) __pyx_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope);
  __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4ete4_4core_4tree_4Tree_16search_ancestors_2generator18, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_search_ancestors_locals_genexpr, __pyx_n_s_ete4_core_tree); if (unlikely(!gen)) __PYX_ERR(0, 749, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("ete4.core.tree.Tree.search_ancestors.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_4ete4_4core_4tree_4Tree_16search_ancestors_2generator18(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_20_genexpr *__pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_20_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  unsigned 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_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 749, __pyx_L1_error)
  __pyx_t_2 = 0;
  if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 749, __pyx_L1_error) }
  __pyx_t_5 = __Pyx_dict_iterator(__pyx_cur_scope->__pyx_genexpr_arg_0, 1, __pyx_n_s_items, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 749, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_1);
  __pyx_t_1 = __pyx_t_5;
  __pyx_t_5 = 0;
  while (1) {
    __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, &__pyx_t_5, &__pyx_t_6, NULL, __pyx_t_4);
    if (unlikely(__pyx_t_7 == 0)) break;
    if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 749, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_k);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_k, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_v);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_v, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    __pyx_t_6 = 0;
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_node)) { __Pyx_RaiseClosureNameError("node"); __PYX_ERR(0, 749, __pyx_L1_error) }
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_node, __pyx_n_s_get_prop); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 749, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_8 = NULL;
    __pyx_t_9 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_9 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_cur_scope->__pyx_v_k};
      __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 749, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __pyx_t_5 = PyObject_RichCompare(__pyx_t_6, __pyx_cur_scope->__pyx_v_v, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 749, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 749, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_11 = (!__pyx_t_10);
    if (__pyx_t_11) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_False);
      __pyx_r = Py_False;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
  }
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_True);
    __pyx_r = Py_True;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

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

/* "ete4/core/tree.pyx":746
 *                 yield node
 * 
 *     def search_ancestors(self, **conditions):             # <<<<<<<<<<<<<<
 *         """Yield ancestor nodes matching the given conditions."""
 *         for node in self.ancestors():
 */

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_92search_ancestors(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_conditions) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_19_search_ancestors *__pyx_cur_scope;
  PyObject *__pyx_gb_4ete4_4core_4tree_4Tree_16search_ancestors_2generator18 = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("search_ancestors", 0);
  __pyx_cur_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_19_search_ancestors *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_19_search_ancestors(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_19_search_ancestors, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_19_search_ancestors *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 746, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __pyx_cur_scope->__pyx_v_conditions = __pyx_v_conditions;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_conditions);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_conditions);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4ete4_4core_4tree_4Tree_94generator10, __pyx_codeobj__19, (PyObject *) __pyx_cur_scope, __pyx_n_s_search_ancestors, __pyx_n_s_Tree_search_ancestors, __pyx_n_s_ete4_core_tree); if (unlikely(!gen)) __PYX_ERR(0, 746, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("ete4.core.tree.Tree.search_ancestors", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XDECREF(__pyx_gb_4ete4_4core_4tree_4Tree_16search_ancestors_2generator18);
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_4ete4_4core_4tree_4Tree_94generator10(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_19_search_ancestors *__pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_19_search_ancestors *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("search_ancestors", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L7_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 746, __pyx_L1_error)

  /* "ete4/core/tree.pyx":748
 *     def search_ancestors(self, **conditions):
 *         """Yield ancestor nodes matching the given conditions."""
 *         for node in self.ancestors():             # <<<<<<<<<<<<<<
 *             if all(node.get_prop(k) == v for k, v in conditions.items()):
 *                 yield node
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_ancestors); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 748, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 748, __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_5 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 748, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 748, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_6)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 748, __pyx_L1_error)
          #endif
          if (__pyx_t_5 >= __pyx_temp) 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, 748, __pyx_L1_error)
        #else
        __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 748, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 748, __pyx_L1_error)
          #endif
          if (__pyx_t_5 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 748, __pyx_L1_error)
        #else
        __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 748, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_6(__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, 748, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_node);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_node, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;

    /* "ete4/core/tree.pyx":749
 *         """Yield ancestor nodes matching the given conditions."""
 *         for node in self.ancestors():
 *             if all(node.get_prop(k) == v for k, v in conditions.items()):             # <<<<<<<<<<<<<<
 *                 yield node
 * 
 */
    __pyx_t_1 = __pyx_pf_4ete4_4core_4tree_4Tree_16search_ancestors_genexpr(((PyObject*)__pyx_cur_scope), __pyx_cur_scope->__pyx_v_conditions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 749, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_Generator_Next(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 749, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 749, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_7) {

      /* "ete4/core/tree.pyx":750
 *         for node in self.ancestors():
 *             if all(node.get_prop(k) == v for k, v in conditions.items()):
 *                 yield node             # <<<<<<<<<<<<<<
 * 
 *     def search_leaves_by_name(self, name):
 */
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_node);
      __pyx_r = __pyx_cur_scope->__pyx_v_node;
      __Pyx_XGIVEREF(__pyx_t_2);
      __pyx_cur_scope->__pyx_t_0 = __pyx_t_2;
      __pyx_cur_scope->__pyx_t_1 = __pyx_t_5;
      __pyx_cur_scope->__pyx_t_2 = __pyx_t_6;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
      /* return from generator, yielding value */
      __pyx_generator->resume_label = 1;
      return __pyx_r;
      __pyx_L7_resume_from_yield:;
      __pyx_t_2 = __pyx_cur_scope->__pyx_t_0;
      __pyx_cur_scope->__pyx_t_0 = 0;
      __Pyx_XGOTREF(__pyx_t_2);
      __pyx_t_5 = __pyx_cur_scope->__pyx_t_1;
      __pyx_t_6 = __pyx_cur_scope->__pyx_t_2;
      if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 750, __pyx_L1_error)

      /* "ete4/core/tree.pyx":749
 *         """Yield ancestor nodes matching the given conditions."""
 *         for node in self.ancestors():
 *             if all(node.get_prop(k) == v for k, v in conditions.items()):             # <<<<<<<<<<<<<<
 *                 yield node
 * 
 */
    }

    /* "ete4/core/tree.pyx":748
 *     def search_ancestors(self, **conditions):
 *         """Yield ancestor nodes matching the given conditions."""
 *         for node in self.ancestors():             # <<<<<<<<<<<<<<
 *             if all(node.get_prop(k) == v for k, v in conditions.items()):
 *                 yield node
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "ete4/core/tree.pyx":746
 *                 yield node
 * 
 *     def search_ancestors(self, **conditions):             # <<<<<<<<<<<<<<
 *         """Yield ancestor nodes matching the given conditions."""
 *         for node in self.ancestors():
 */

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

/* "ete4/core/tree.pyx":752
 *                 yield node
 * 
 *     def search_leaves_by_name(self, name):             # <<<<<<<<<<<<<<
 *         """Yield leaf nodes matching the given name."""
 *         return self.search_nodes(name=name, children=[])
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_96search_leaves_by_name(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_4ete4_4core_4tree_4Tree_95search_leaves_by_name, "Tree.search_leaves_by_name(self, name)\nYield leaf nodes matching the given name.");
static PyMethodDef __pyx_mdef_4ete4_4core_4tree_4Tree_96search_leaves_by_name = {"search_leaves_by_name", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_96search_leaves_by_name, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_95search_leaves_by_name};
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_96search_leaves_by_name(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_name = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("search_leaves_by_name (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 752, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "search_leaves_by_name") < 0)) __PYX_ERR(0, 752, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_name = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("search_leaves_by_name", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 752, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("ete4.core.tree.Tree.search_leaves_by_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_95search_leaves_by_name(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self), __pyx_v_name);

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

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_95search_leaves_by_name(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_name) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("search_leaves_by_name", 1);

  /* "ete4/core/tree.pyx":754
 *     def search_leaves_by_name(self, name):
 *         """Yield leaf nodes matching the given name."""
 *         return self.search_nodes(name=name, children=[])             # <<<<<<<<<<<<<<
 * 
 *     # ###########################
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_search_nodes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 754, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 754, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_name, __pyx_v_name) < 0) __PYX_ERR(0, 754, __pyx_L1_error)
  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 754, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_children, __pyx_t_3) < 0) __PYX_ERR(0, 754, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 754, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "ete4/core/tree.pyx":752
 *                 yield node
 * 
 *     def search_leaves_by_name(self, name):             # <<<<<<<<<<<<<<
 *         """Yield leaf nodes matching the given name."""
 *         return self.search_nodes(name=name, children=[])
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("ete4.core.tree.Tree.search_leaves_by_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ete4/core/tree.pyx":760
 *     # ###########################
 * 
 *     def get_distance(self, node1, node2, topological=False):             # <<<<<<<<<<<<<<
 *         """Return the distance between the given nodes.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_98get_distance(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_4ete4_4core_4tree_4Tree_97get_distance, "Tree.get_distance(self, node1, node2, topological=False)\nReturn the distance between the given nodes.\n\n        :param node1: A node within the same tree structure.\n        :param node2: Another node within the same tree structure.\n        :param topological: If True, distance will refer to the number of\n            nodes between node1 and node2.\n        ");
static PyMethodDef __pyx_mdef_4ete4_4core_4tree_4Tree_98get_distance = {"get_distance", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_98get_distance, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_97get_distance};
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_98get_distance(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_node1 = 0;
  PyObject *__pyx_v_node2 = 0;
  PyObject *__pyx_v_topological = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_distance (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_node1,&__pyx_n_s_node2,&__pyx_n_s_topological,0};
    values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_False));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_node1)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 760, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_node2)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 760, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("get_distance", 0, 2, 3, 1); __PYX_ERR(0, 760, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_topological);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 760, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_distance") < 0)) __PYX_ERR(0, 760, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_node1 = values[0];
    __pyx_v_node2 = values[1];
    __pyx_v_topological = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_distance", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 760, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("ete4.core.tree.Tree.get_distance", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_97get_distance(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self), __pyx_v_node1, __pyx_v_node2, __pyx_v_topological);

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

/* "ete4/core/tree.pyx":774
 *         root = self.root.common_ancestor([node1, node2])  # common root
 * 
 *         return (sum(d(n) for n in node1.lineage(root, include_root=False)) +             # <<<<<<<<<<<<<<
 *                 sum(d(n) for n in node2.lineage(root, include_root=False)))
 * 
 */

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_12get_distance_genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_22_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_22_genexpr *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_22_genexpr(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_22_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_22_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 774, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_21_get_distance *) __pyx_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope);
  __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4ete4_4core_4tree_4Tree_12get_distance_2generator19, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_get_distance_locals_genexpr, __pyx_n_s_ete4_core_tree); if (unlikely(!gen)) __PYX_ERR(0, 774, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("ete4.core.tree.Tree.get_distance.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_4ete4_4core_4tree_4Tree_12get_distance_2generator19(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_22_genexpr *__pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_22_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  unsigned int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 774, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 774, __pyx_L1_error) }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1);
    __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 774, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 774, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 774, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 774, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 774, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 774, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 774, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 774, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 774, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_n);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_n, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_d)) { __Pyx_RaiseClosureNameError("d"); __PYX_ERR(0, 774, __pyx_L1_error) }
    __Pyx_INCREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_d);
    __pyx_t_5 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_d; __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_cur_scope->__pyx_v_n};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 774, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    __Pyx_XGIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 774, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

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

/* "ete4/core/tree.pyx":775
 * 
 *         return (sum(d(n) for n in node1.lineage(root, include_root=False)) +
 *                 sum(d(n) for n in node2.lineage(root, include_root=False)))             # <<<<<<<<<<<<<<
 * 
 *     def get_farthest_node(self, topological=False):
 */

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_12get_distance_3genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_23_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_23_genexpr *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_23_genexpr(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_23_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_23_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 775, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_21_get_distance *) __pyx_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope);
  __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4ete4_4core_4tree_4Tree_12get_distance_5generator20, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_get_distance_locals_genexpr, __pyx_n_s_ete4_core_tree); if (unlikely(!gen)) __PYX_ERR(0, 775, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("ete4.core.tree.Tree.get_distance.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_4ete4_4core_4tree_4Tree_12get_distance_5generator20(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_23_genexpr *__pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_23_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  unsigned int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 775, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 775, __pyx_L1_error) }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1);
    __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 775, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 775, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 775, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 775, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 775, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 775, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 775, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 775, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 775, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_n);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_n, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_d)) { __Pyx_RaiseClosureNameError("d"); __PYX_ERR(0, 775, __pyx_L1_error) }
    __Pyx_INCREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_d);
    __pyx_t_5 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_d; __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_cur_scope->__pyx_v_n};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 775, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    __Pyx_XGIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 775, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

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

/* "ete4/core/tree.pyx":760
 *     # ###########################
 * 
 *     def get_distance(self, node1, node2, topological=False):             # <<<<<<<<<<<<<<
 *         """Return the distance between the given nodes.
 * 
 */

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_97get_distance(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_node1, PyObject *__pyx_v_node2, PyObject *__pyx_v_topological) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_21_get_distance *__pyx_cur_scope;
  PyObject *__pyx_v_root = NULL;
  PyObject *__pyx_gb_4ete4_4core_4tree_4Tree_12get_distance_2generator19 = 0;
  PyObject *__pyx_gb_4ete4_4core_4tree_4Tree_12get_distance_5generator20 = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *(*__pyx_t_6)(PyObject *);
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_distance", 0);
  __pyx_cur_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_21_get_distance *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_21_get_distance(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_21_get_distance, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_21_get_distance *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 760, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __Pyx_INCREF(__pyx_v_node1);
  __Pyx_INCREF(__pyx_v_node2);

  /* "ete4/core/tree.pyx":768
 *             nodes between node1 and node2.
 *         """
 *         d = ops.get_distance_fn(topological)             # <<<<<<<<<<<<<<
 * 
 *         node1, node2 = self._translate_nodes([node1, node2])
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ops); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 768, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_get_distance_fn); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 768, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_topological};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 768, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_d = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "ete4/core/tree.pyx":770
 *         d = ops.get_distance_fn(topological)
 * 
 *         node1, node2 = self._translate_nodes([node1, node2])             # <<<<<<<<<<<<<<
 * 
 *         root = self.root.common_ancestor([node1, node2])  # common root
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_translate_nodes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 770, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 770, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_node1);
  __Pyx_GIVEREF(__pyx_v_node1);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_v_node1)) __PYX_ERR(0, 770, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_node2);
  __Pyx_GIVEREF(__pyx_v_node2);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_v_node2)) __PYX_ERR(0, 770, __pyx_L1_error);
  __pyx_t_5 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_2};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 770, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 770, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    #else
    __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 770, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 770, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 770, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5);
    index = 0; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 1; __pyx_t_2 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) __PYX_ERR(0, 770, __pyx_L1_error)
    __pyx_t_6 = NULL;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_6 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 770, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __Pyx_DECREF_SET(__pyx_v_node1, __pyx_t_3);
  __pyx_t_3 = 0;
  __Pyx_DECREF_SET(__pyx_v_node2, __pyx_t_2);
  __pyx_t_2 = 0;

  /* "ete4/core/tree.pyx":772
 *         node1, node2 = self._translate_nodes([node1, node2])
 * 
 *         root = self.root.common_ancestor([node1, node2])  # common root             # <<<<<<<<<<<<<<
 * 
 *         return (sum(d(n) for n in node1.lineage(root, include_root=False)) +
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_root); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 772, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_common_ancestor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 772, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 772, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_node1);
  __Pyx_GIVEREF(__pyx_v_node1);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_v_node1)) __PYX_ERR(0, 772, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_node2);
  __Pyx_GIVEREF(__pyx_v_node2);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_v_node2)) __PYX_ERR(0, 772, __pyx_L1_error);
  __pyx_t_5 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_2};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 772, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_v_root = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "ete4/core/tree.pyx":774
 *         root = self.root.common_ancestor([node1, node2])  # common root
 * 
 *         return (sum(d(n) for n in node1.lineage(root, include_root=False)) +             # <<<<<<<<<<<<<<
 *                 sum(d(n) for n in node2.lineage(root, include_root=False)))
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_node1, __pyx_n_s_lineage); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 774, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 774, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_root);
  __Pyx_GIVEREF(__pyx_v_root);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_root)) __PYX_ERR(0, 774, __pyx_L1_error);
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 774, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_include_root, Py_False) < 0) __PYX_ERR(0, 774, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 774, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __pyx_pf_4ete4_4core_4tree_4Tree_12get_distance_genexpr(((PyObject*)__pyx_cur_scope), __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 774, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 774, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ete4/core/tree.pyx":775
 * 
 *         return (sum(d(n) for n in node1.lineage(root, include_root=False)) +
 *                 sum(d(n) for n in node2.lineage(root, include_root=False)))             # <<<<<<<<<<<<<<
 * 
 *     def get_farthest_node(self, topological=False):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_node2, __pyx_n_s_lineage); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 775, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 775, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_root);
  __Pyx_GIVEREF(__pyx_v_root);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_root)) __PYX_ERR(0, 775, __pyx_L1_error);
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 775, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_include_root, Py_False) < 0) __PYX_ERR(0, 775, __pyx_L1_error)
  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 775, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __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;
  __pyx_t_1 = __pyx_pf_4ete4_4core_4tree_4Tree_12get_distance_3genexpr(((PyObject*)__pyx_cur_scope), __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 775, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 775, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ete4/core/tree.pyx":774
 *         root = self.root.common_ancestor([node1, node2])  # common root
 * 
 *         return (sum(d(n) for n in node1.lineage(root, include_root=False)) +             # <<<<<<<<<<<<<<
 *                 sum(d(n) for n in node2.lineage(root, include_root=False)))
 * 
 */
  __pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 774, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "ete4/core/tree.pyx":760
 *     # ###########################
 * 
 *     def get_distance(self, node1, node2, topological=False):             # <<<<<<<<<<<<<<
 *         """Return the distance between the given nodes.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("ete4.core.tree.Tree.get_distance", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_root);
  __Pyx_XDECREF(__pyx_gb_4ete4_4core_4tree_4Tree_12get_distance_2generator19);
  __Pyx_XDECREF(__pyx_gb_4ete4_4core_4tree_4Tree_12get_distance_5generator20);
  __Pyx_XDECREF(__pyx_v_node1);
  __Pyx_XDECREF(__pyx_v_node2);
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ete4/core/tree.pyx":777
 *                 sum(d(n) for n in node2.lineage(root, include_root=False)))
 * 
 *     def get_farthest_node(self, topological=False):             # <<<<<<<<<<<<<<
 *         """Returns the farthest descendant or ancestor node, and its distance.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_100get_farthest_node(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_4ete4_4core_4tree_4Tree_99get_farthest_node, "Tree.get_farthest_node(self, topological=False)\nReturns the farthest descendant or ancestor node, and its distance.\n\n        :param topological: If True, the distance between nodes will be the\n            number of nodes between them (instead of the sum of branch lenghts).\n        ");
static PyMethodDef __pyx_mdef_4ete4_4core_4tree_4Tree_100get_farthest_node = {"get_farthest_node", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_100get_farthest_node, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_99get_farthest_node};
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_100get_farthest_node(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_topological = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_farthest_node (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_topological,0};
    values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_False));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_topological);
          if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 777, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_farthest_node") < 0)) __PYX_ERR(0, 777, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_topological = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_farthest_node", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 777, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("ete4.core.tree.Tree.get_farthest_node", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_99get_farthest_node(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self), __pyx_v_topological);

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

/* "ete4/core/tree.pyx":786
 *         farthest_node, farthest_dist = self.get_farthest_leaf(topological=topological)
 * 
 *         dist = lambda node: node.dist if 'dist' in node.props else (0 if node.is_root else 1)             # <<<<<<<<<<<<<<
 * 
 *         prev = self
 */

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

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

static PyObject *__pyx_lambda_funcdef_lambda9(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_node) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("lambda9", 1);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_node, __pyx_n_s_props); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 786, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_n_u_dist, __pyx_t_2, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 786, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_node, __pyx_n_s_dist); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 786, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
  } else {
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_node, __pyx_n_s_is_root); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 786, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 786, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_5) {
      __Pyx_INCREF(__pyx_int_0);
      __pyx_t_2 = __pyx_int_0;
    } else {
      __Pyx_INCREF(__pyx_int_1);
      __pyx_t_2 = __pyx_int_1;
    }
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("ete4.core.tree.Tree.get_farthest_node.lambda9", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ete4/core/tree.pyx":777
 *                 sum(d(n) for n in node2.lineage(root, include_root=False)))
 * 
 *     def get_farthest_node(self, topological=False):             # <<<<<<<<<<<<<<
 *         """Returns the farthest descendant or ancestor node, and its distance.
 * 
 */

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_99get_farthest_node(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_topological) {
  PyObject *__pyx_v_farthest_node = NULL;
  PyObject *__pyx_v_farthest_dist = NULL;
  PyObject *__pyx_v_dist = NULL;
  struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_prev = NULL;
  PyObject *__pyx_v_cdist = NULL;
  struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_current = NULL;
  PyObject *__pyx_v_ch = NULL;
  PyObject *__pyx_v_fnode = NULL;
  PyObject *__pyx_v_fdist = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *(*__pyx_t_5)(PyObject *);
  int __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_farthest_node", 1);

  /* "ete4/core/tree.pyx":784
 *         """
 *         # Init farthest node to current farthest leaf
 *         farthest_node, farthest_dist = self.get_farthest_leaf(topological=topological)             # <<<<<<<<<<<<<<
 * 
 *         dist = lambda node: node.dist if 'dist' in node.props else (0 if node.is_root else 1)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_farthest_leaf); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 784, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 784, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_topological, __pyx_v_topological) < 0) __PYX_ERR(0, 784, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 784, __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;
  if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
    PyObject* sequence = __pyx_t_3;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 784, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_1);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 784, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 784, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    #endif
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 784, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4);
    index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) __PYX_ERR(0, 784, __pyx_L1_error)
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 784, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_farthest_node = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_v_farthest_dist = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "ete4/core/tree.pyx":786
 *         farthest_node, farthest_dist = self.get_farthest_leaf(topological=topological)
 * 
 *         dist = lambda node: node.dist if 'dist' in node.props else (0 if node.is_root else 1)             # <<<<<<<<<<<<<<
 * 
 *         prev = self
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_17get_farthest_node_lambda9, 0, __pyx_n_s_get_farthest_node_locals_lambda, NULL, __pyx_n_s_ete4_core_tree, __pyx_d, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 786, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_dist = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "ete4/core/tree.pyx":788
 *         dist = lambda node: node.dist if 'dist' in node.props else (0 if node.is_root else 1)
 * 
 *         prev = self             # <<<<<<<<<<<<<<
 *         cdist = 0.0 if topological else dist(prev)
 *         current = prev.up
 */
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_v_prev = __pyx_v_self;

  /* "ete4/core/tree.pyx":789
 * 
 *         prev = self
 *         cdist = 0.0 if topological else dist(prev)             # <<<<<<<<<<<<<<
 *         current = prev.up
 *         while current is not None:
 */
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_topological); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 789, __pyx_L1_error)
  if (__pyx_t_6) {
    __Pyx_INCREF(__pyx_float_0_0);
    __pyx_t_3 = __pyx_float_0_0;
  } else {
    __pyx_t_1 = __pyx_lambda_funcdef_lambda9(__pyx_v_dist, ((PyObject *)__pyx_v_prev)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 789, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __pyx_t_1;
    __pyx_t_1 = 0;
  }
  __pyx_v_cdist = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "ete4/core/tree.pyx":790
 *         prev = self
 *         cdist = 0.0 if topological else dist(prev)
 *         current = prev.up             # <<<<<<<<<<<<<<
 *         while current is not None:
 *             for ch in current.children:
 */
  __pyx_t_3 = ((PyObject *)__pyx_v_prev->up);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_v_current = ((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "ete4/core/tree.pyx":791
 *         cdist = 0.0 if topological else dist(prev)
 *         current = prev.up
 *         while current is not None:             # <<<<<<<<<<<<<<
 *             for ch in current.children:
 *                 if ch != prev:
 */
  while (1) {
    __pyx_t_6 = (((PyObject *)__pyx_v_current) != Py_None);
    if (!__pyx_t_6) break;

    /* "ete4/core/tree.pyx":792
 *         current = prev.up
 *         while current is not None:
 *             for ch in current.children:             # <<<<<<<<<<<<<<
 *                 if ch != prev:
 *                     if not ch.is_leaf:
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_current), __pyx_n_s_children); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 792, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
      __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1);
      __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
    } else {
      __pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 792, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 792, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    for (;;) {
      if (likely(!__pyx_t_8)) {
        if (likely(PyList_CheckExact(__pyx_t_1))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 792, __pyx_L1_error)
            #endif
            if (__pyx_t_7 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 792, __pyx_L1_error)
          #else
          __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 792, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 792, __pyx_L1_error)
            #endif
            if (__pyx_t_7 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 792, __pyx_L1_error)
          #else
          __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 792, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        }
      } else {
        __pyx_t_3 = __pyx_t_8(__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, 792, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_XDECREF_SET(__pyx_v_ch, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "ete4/core/tree.pyx":793
 *         while current is not None:
 *             for ch in current.children:
 *                 if ch != prev:             # <<<<<<<<<<<<<<
 *                     if not ch.is_leaf:
 *                         fnode, fdist = ch.get_farthest_leaf(topological=topological)
 */
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_ch, ((PyObject *)__pyx_v_prev), Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 793, __pyx_L1_error)
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 793, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {

        /* "ete4/core/tree.pyx":794
 *             for ch in current.children:
 *                 if ch != prev:
 *                     if not ch.is_leaf:             # <<<<<<<<<<<<<<
 *                         fnode, fdist = ch.get_farthest_leaf(topological=topological)
 *                     else:
 */
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_ch, __pyx_n_s_is_leaf); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 794, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 794, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_9 = (!__pyx_t_6);
        if (__pyx_t_9) {

          /* "ete4/core/tree.pyx":795
 *                 if ch != prev:
 *                     if not ch.is_leaf:
 *                         fnode, fdist = ch.get_farthest_leaf(topological=topological)             # <<<<<<<<<<<<<<
 *                     else:
 *                         fnode = ch
 */
          __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_ch, __pyx_n_s_get_farthest_leaf); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 795, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 795, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_topological, __pyx_v_topological) < 0) __PYX_ERR(0, 795, __pyx_L1_error)
          __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 795, __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;
          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 != 2)) {
              if (size > 2) __Pyx_RaiseTooManyValuesError(2);
              else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
              __PYX_ERR(0, 795, __pyx_L1_error)
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            if (likely(PyTuple_CheckExact(sequence))) {
              __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
              __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
            } else {
              __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
              __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
            }
            __Pyx_INCREF(__pyx_t_2);
            __Pyx_INCREF(__pyx_t_3);
            #else
            __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 795, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 795, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            #endif
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          } else {
            Py_ssize_t index = -1;
            __pyx_t_10 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 795, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_10);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_10);
            index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_10); if (unlikely(!__pyx_t_2)) goto __pyx_L11_unpacking_failed;
            __Pyx_GOTREF(__pyx_t_2);
            index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_10); if (unlikely(!__pyx_t_3)) goto __pyx_L11_unpacking_failed;
            __Pyx_GOTREF(__pyx_t_3);
            if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_10), 2) < 0) __PYX_ERR(0, 795, __pyx_L1_error)
            __pyx_t_5 = NULL;
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            goto __pyx_L12_unpacking_done;
            __pyx_L11_unpacking_failed:;
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __pyx_t_5 = NULL;
            if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
            __PYX_ERR(0, 795, __pyx_L1_error)
            __pyx_L12_unpacking_done:;
          }
          __Pyx_XDECREF_SET(__pyx_v_fnode, __pyx_t_2);
          __pyx_t_2 = 0;
          __Pyx_XDECREF_SET(__pyx_v_fdist, __pyx_t_3);
          __pyx_t_3 = 0;

          /* "ete4/core/tree.pyx":794
 *             for ch in current.children:
 *                 if ch != prev:
 *                     if not ch.is_leaf:             # <<<<<<<<<<<<<<
 *                         fnode, fdist = ch.get_farthest_leaf(topological=topological)
 *                     else:
 */
          goto __pyx_L10;
        }

        /* "ete4/core/tree.pyx":797
 *                         fnode, fdist = ch.get_farthest_leaf(topological=topological)
 *                     else:
 *                         fnode = ch             # <<<<<<<<<<<<<<
 *                         fdist = 0
 *                     if topological:
 */
        /*else*/ {
          __Pyx_INCREF(__pyx_v_ch);
          __Pyx_XDECREF_SET(__pyx_v_fnode, __pyx_v_ch);

          /* "ete4/core/tree.pyx":798
 *                     else:
 *                         fnode = ch
 *                         fdist = 0             # <<<<<<<<<<<<<<
 *                     if topological:
 *                         fdist += 1.0
 */
          __Pyx_INCREF(__pyx_int_0);
          __Pyx_XDECREF_SET(__pyx_v_fdist, __pyx_int_0);
        }
        __pyx_L10:;

        /* "ete4/core/tree.pyx":799
 *                         fnode = ch
 *                         fdist = 0
 *                     if topological:             # <<<<<<<<<<<<<<
 *                         fdist += 1.0
 *                     else:
 */
        __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_topological); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 799, __pyx_L1_error)
        if (__pyx_t_9) {

          /* "ete4/core/tree.pyx":800
 *                         fdist = 0
 *                     if topological:
 *                         fdist += 1.0             # <<<<<<<<<<<<<<
 *                     else:
 *                         fdist += dist(ch)
 */
          __pyx_t_4 = __Pyx_PyFloat_AddObjC(__pyx_v_fdist, __pyx_float_1_0, 1.0, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 800, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF_SET(__pyx_v_fdist, __pyx_t_4);
          __pyx_t_4 = 0;

          /* "ete4/core/tree.pyx":799
 *                         fnode = ch
 *                         fdist = 0
 *                     if topological:             # <<<<<<<<<<<<<<
 *                         fdist += 1.0
 *                     else:
 */
          goto __pyx_L13;
        }

        /* "ete4/core/tree.pyx":802
 *                         fdist += 1.0
 *                     else:
 *                         fdist += dist(ch)             # <<<<<<<<<<<<<<
 *                     if cdist+fdist > farthest_dist:
 *                         farthest_dist = cdist + fdist
 */
        /*else*/ {
          __pyx_t_4 = __pyx_lambda_funcdef_lambda9(__pyx_v_dist, __pyx_v_ch); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 802, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_fdist, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 802, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF_SET(__pyx_v_fdist, __pyx_t_3);
          __pyx_t_3 = 0;
        }
        __pyx_L13:;

        /* "ete4/core/tree.pyx":803
 *                     else:
 *                         fdist += dist(ch)
 *                     if cdist+fdist > farthest_dist:             # <<<<<<<<<<<<<<
 *                         farthest_dist = cdist + fdist
 *                         farthest_node = fnode
 */
        __pyx_t_3 = PyNumber_Add(__pyx_v_cdist, __pyx_v_fdist); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 803, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_farthest_dist, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 803, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 803, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (__pyx_t_9) {

          /* "ete4/core/tree.pyx":804
 *                         fdist += dist(ch)
 *                     if cdist+fdist > farthest_dist:
 *                         farthest_dist = cdist + fdist             # <<<<<<<<<<<<<<
 *                         farthest_node = fnode
 *             prev = current
 */
          __pyx_t_4 = PyNumber_Add(__pyx_v_cdist, __pyx_v_fdist); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 804, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF_SET(__pyx_v_farthest_dist, __pyx_t_4);
          __pyx_t_4 = 0;

          /* "ete4/core/tree.pyx":805
 *                     if cdist+fdist > farthest_dist:
 *                         farthest_dist = cdist + fdist
 *                         farthest_node = fnode             # <<<<<<<<<<<<<<
 *             prev = current
 *             if topological:
 */
          __Pyx_INCREF(__pyx_v_fnode);
          __Pyx_DECREF_SET(__pyx_v_farthest_node, __pyx_v_fnode);

          /* "ete4/core/tree.pyx":803
 *                     else:
 *                         fdist += dist(ch)
 *                     if cdist+fdist > farthest_dist:             # <<<<<<<<<<<<<<
 *                         farthest_dist = cdist + fdist
 *                         farthest_node = fnode
 */
        }

        /* "ete4/core/tree.pyx":793
 *         while current is not None:
 *             for ch in current.children:
 *                 if ch != prev:             # <<<<<<<<<<<<<<
 *                     if not ch.is_leaf:
 *                         fnode, fdist = ch.get_farthest_leaf(topological=topological)
 */
      }

      /* "ete4/core/tree.pyx":792
 *         current = prev.up
 *         while current is not None:
 *             for ch in current.children:             # <<<<<<<<<<<<<<
 *                 if ch != prev:
 *                     if not ch.is_leaf:
 */
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "ete4/core/tree.pyx":806
 *                         farthest_dist = cdist + fdist
 *                         farthest_node = fnode
 *             prev = current             # <<<<<<<<<<<<<<
 *             if topological:
 *                 cdist += 1
 */
    __Pyx_INCREF((PyObject *)__pyx_v_current);
    __Pyx_DECREF_SET(__pyx_v_prev, __pyx_v_current);

    /* "ete4/core/tree.pyx":807
 *                         farthest_node = fnode
 *             prev = current
 *             if topological:             # <<<<<<<<<<<<<<
 *                 cdist += 1
 *             else:
 */
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_topological); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 807, __pyx_L1_error)
    if (__pyx_t_9) {

      /* "ete4/core/tree.pyx":808
 *             prev = current
 *             if topological:
 *                 cdist += 1             # <<<<<<<<<<<<<<
 *             else:
 *                 cdist  += dist(prev)
 */
      __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_cdist, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 808, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF_SET(__pyx_v_cdist, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "ete4/core/tree.pyx":807
 *                         farthest_node = fnode
 *             prev = current
 *             if topological:             # <<<<<<<<<<<<<<
 *                 cdist += 1
 *             else:
 */
      goto __pyx_L16;
    }

    /* "ete4/core/tree.pyx":810
 *                 cdist += 1
 *             else:
 *                 cdist  += dist(prev)             # <<<<<<<<<<<<<<
 *             current = prev.up
 *         return farthest_node, farthest_dist
 */
    /*else*/ {
      __pyx_t_1 = __pyx_lambda_funcdef_lambda9(__pyx_v_dist, ((PyObject *)__pyx_v_prev)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 810, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_cdist, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 810, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF_SET(__pyx_v_cdist, __pyx_t_4);
      __pyx_t_4 = 0;
    }
    __pyx_L16:;

    /* "ete4/core/tree.pyx":811
 *             else:
 *                 cdist  += dist(prev)
 *             current = prev.up             # <<<<<<<<<<<<<<
 *         return farthest_node, farthest_dist
 * 
 */
    __pyx_t_4 = ((PyObject *)__pyx_v_prev->up);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_DECREF_SET(__pyx_v_current, ((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_t_4));
    __pyx_t_4 = 0;
  }

  /* "ete4/core/tree.pyx":812
 *                 cdist  += dist(prev)
 *             current = prev.up
 *         return farthest_node, farthest_dist             # <<<<<<<<<<<<<<
 * 
 *     def _get_farthest_and_closest_leaves(self, topological=False, is_leaf_fn=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 812, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_farthest_node);
  __Pyx_GIVEREF(__pyx_v_farthest_node);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_farthest_node)) __PYX_ERR(0, 812, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_farthest_dist);
  __Pyx_GIVEREF(__pyx_v_farthest_dist);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_farthest_dist)) __PYX_ERR(0, 812, __pyx_L1_error);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "ete4/core/tree.pyx":777
 *                 sum(d(n) for n in node2.lineage(root, include_root=False)))
 * 
 *     def get_farthest_node(self, topological=False):             # <<<<<<<<<<<<<<
 *         """Returns the farthest descendant or ancestor node, and its distance.
 * 
 */

  /* 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_AddTraceback("ete4.core.tree.Tree.get_farthest_node", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_farthest_node);
  __Pyx_XDECREF(__pyx_v_farthest_dist);
  __Pyx_XDECREF(__pyx_v_dist);
  __Pyx_XDECREF((PyObject *)__pyx_v_prev);
  __Pyx_XDECREF(__pyx_v_cdist);
  __Pyx_XDECREF((PyObject *)__pyx_v_current);
  __Pyx_XDECREF(__pyx_v_ch);
  __Pyx_XDECREF(__pyx_v_fnode);
  __Pyx_XDECREF(__pyx_v_fdist);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ete4/core/tree.pyx":814
 *         return farthest_node, farthest_dist
 * 
 *     def _get_farthest_and_closest_leaves(self, topological=False, is_leaf_fn=None):             # <<<<<<<<<<<<<<
 *         # if called from a leaf node, no necessary to compute
 *         if (is_leaf_fn and is_leaf_fn(self)) or self.is_leaf:
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_102_get_farthest_and_closest_leaves(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_4ete4_4core_4tree_4Tree_101_get_farthest_and_closest_leaves, "Tree._get_farthest_and_closest_leaves(self, topological=False, is_leaf_fn=None)");
static PyMethodDef __pyx_mdef_4ete4_4core_4tree_4Tree_102_get_farthest_and_closest_leaves = {"_get_farthest_and_closest_leaves", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_102_get_farthest_and_closest_leaves, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_101_get_farthest_and_closest_leaves};
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_102_get_farthest_and_closest_leaves(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_topological = 0;
  PyObject *__pyx_v_is_leaf_fn = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_farthest_and_closest_leaves (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_topological,&__pyx_n_s_is_leaf_fn,0};
    values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_False));
    values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_topological);
          if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 814, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_is_leaf_fn);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 814, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_get_farthest_and_closest_leaves") < 0)) __PYX_ERR(0, 814, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_topological = values[0];
    __pyx_v_is_leaf_fn = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_get_farthest_and_closest_leaves", 0, 0, 2, __pyx_nargs); __PYX_ERR(0, 814, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("ete4.core.tree.Tree._get_farthest_and_closest_leaves", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_101_get_farthest_and_closest_leaves(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self), __pyx_v_topological, __pyx_v_is_leaf_fn);

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

/* "ete4/core/tree.pyx":819
 *             return self, 0.0, self, 0.0
 * 
 *         dist = lambda node: node.dist if 'dist' in node.props else 1             # <<<<<<<<<<<<<<
 * 
 *         min_dist = None
 */

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

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

static PyObject *__pyx_lambda_funcdef_lambda10(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_node) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("lambda10", 1);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_node, __pyx_n_s_props); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 819, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_n_u_dist, __pyx_t_2, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 819, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_node, __pyx_n_s_dist); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 819, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(__pyx_int_1);
    __pyx_t_1 = __pyx_int_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_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("ete4.core.tree.Tree._get_farthest_and_closest_leaves.lambda10", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ete4/core/tree.pyx":814
 *         return farthest_node, farthest_dist
 * 
 *     def _get_farthest_and_closest_leaves(self, topological=False, is_leaf_fn=None):             # <<<<<<<<<<<<<<
 *         # if called from a leaf node, no necessary to compute
 *         if (is_leaf_fn and is_leaf_fn(self)) or self.is_leaf:
 */

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_101_get_farthest_and_closest_leaves(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_topological, PyObject *__pyx_v_is_leaf_fn) {
  PyObject *__pyx_v_dist = NULL;
  PyObject *__pyx_v_min_dist = NULL;
  PyObject *__pyx_v_min_node = NULL;
  PyObject *__pyx_v_max_dist = NULL;
  PyObject *__pyx_v_max_node = NULL;
  PyObject *__pyx_v_d = NULL;
  PyObject *__pyx_v_post = NULL;
  PyObject *__pyx_v_n = NULL;
  PyObject *__pyx_v_total_d = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  unsigned int __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *(*__pyx_t_11)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_farthest_and_closest_leaves", 1);

  /* "ete4/core/tree.pyx":816
 *     def _get_farthest_and_closest_leaves(self, topological=False, is_leaf_fn=None):
 *         # if called from a leaf node, no necessary to compute
 *         if (is_leaf_fn and is_leaf_fn(self)) or self.is_leaf:             # <<<<<<<<<<<<<<
 *             return self, 0.0, self, 0.0
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_is_leaf_fn); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 816, __pyx_L1_error)
  if (!__pyx_t_2) {
    goto __pyx_L5_next_or;
  } else {
  }
  __Pyx_INCREF(__pyx_v_is_leaf_fn);
  __pyx_t_4 = __pyx_v_is_leaf_fn; __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (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;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, ((PyObject *)__pyx_v_self)};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 816, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 816, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_L5_next_or:;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_leaf); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 816, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 816, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "ete4/core/tree.pyx":817
 *         # if called from a leaf node, no necessary to compute
 *         if (is_leaf_fn and is_leaf_fn(self)) or self.is_leaf:
 *             return self, 0.0, self, 0.0             # <<<<<<<<<<<<<<
 * 
 *         dist = lambda node: node.dist if 'dist' in node.props else 1
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 817, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF((PyObject *)__pyx_v_self);
    __Pyx_GIVEREF((PyObject *)__pyx_v_self);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self))) __PYX_ERR(0, 817, __pyx_L1_error);
    __Pyx_INCREF(__pyx_float_0_0);
    __Pyx_GIVEREF(__pyx_float_0_0);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_float_0_0)) __PYX_ERR(0, 817, __pyx_L1_error);
    __Pyx_INCREF((PyObject *)__pyx_v_self);
    __Pyx_GIVEREF((PyObject *)__pyx_v_self);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_v_self))) __PYX_ERR(0, 817, __pyx_L1_error);
    __Pyx_INCREF(__pyx_float_0_0);
    __Pyx_GIVEREF(__pyx_float_0_0);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_float_0_0)) __PYX_ERR(0, 817, __pyx_L1_error);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "ete4/core/tree.pyx":816
 *     def _get_farthest_and_closest_leaves(self, topological=False, is_leaf_fn=None):
 *         # if called from a leaf node, no necessary to compute
 *         if (is_leaf_fn and is_leaf_fn(self)) or self.is_leaf:             # <<<<<<<<<<<<<<
 *             return self, 0.0, self, 0.0
 * 
 */
  }

  /* "ete4/core/tree.pyx":819
 *             return self, 0.0, self, 0.0
 * 
 *         dist = lambda node: node.dist if 'dist' in node.props else 1             # <<<<<<<<<<<<<<
 * 
 *         min_dist = None
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_32_get_farthest_and_closest_leaves_lambda10, 0, __pyx_n_s_get_farthest_and_closest_leaves, NULL, __pyx_n_s_ete4_core_tree, __pyx_d, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 819, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_dist = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "ete4/core/tree.pyx":821
 *         dist = lambda node: node.dist if 'dist' in node.props else 1
 * 
 *         min_dist = None             # <<<<<<<<<<<<<<
 *         min_node = None
 *         max_dist = None
 */
  __Pyx_INCREF(Py_None);
  __pyx_v_min_dist = Py_None;

  /* "ete4/core/tree.pyx":822
 * 
 *         min_dist = None
 *         min_node = None             # <<<<<<<<<<<<<<
 *         max_dist = None
 *         max_node = None
 */
  __Pyx_INCREF(Py_None);
  __pyx_v_min_node = Py_None;

  /* "ete4/core/tree.pyx":823
 *         min_dist = None
 *         min_node = None
 *         max_dist = None             # <<<<<<<<<<<<<<
 *         max_node = None
 *         d = 0.0
 */
  __Pyx_INCREF(Py_None);
  __pyx_v_max_dist = Py_None;

  /* "ete4/core/tree.pyx":824
 *         min_node = None
 *         max_dist = None
 *         max_node = None             # <<<<<<<<<<<<<<
 *         d = 0.0
 *         for post, n in self.iter_prepostorder(is_leaf_fn=is_leaf_fn):
 */
  __Pyx_INCREF(Py_None);
  __pyx_v_max_node = Py_None;

  /* "ete4/core/tree.pyx":825
 *         max_dist = None
 *         max_node = None
 *         d = 0.0             # <<<<<<<<<<<<<<
 *         for post, n in self.iter_prepostorder(is_leaf_fn=is_leaf_fn):
 *             if n is self:
 */
  __Pyx_INCREF(__pyx_float_0_0);
  __pyx_v_d = __pyx_float_0_0;

  /* "ete4/core/tree.pyx":826
 *         max_node = None
 *         d = 0.0
 *         for post, n in self.iter_prepostorder(is_leaf_fn=is_leaf_fn):             # <<<<<<<<<<<<<<
 *             if n is self:
 *                 continue
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_iter_prepostorder); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 826, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 826, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_is_leaf_fn, __pyx_v_is_leaf_fn) < 0) __PYX_ERR(0, 826, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 826, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
    __pyx_t_4 = __pyx_t_5; __Pyx_INCREF(__pyx_t_4);
    __pyx_t_7 = 0;
    __pyx_t_8 = NULL;
  } else {
    __pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 826, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 826, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  for (;;) {
    if (likely(!__pyx_t_8)) {
      if (likely(PyList_CheckExact(__pyx_t_4))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 826, __pyx_L1_error)
          #endif
          if (__pyx_t_7 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 826, __pyx_L1_error)
        #else
        __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 826, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 826, __pyx_L1_error)
          #endif
          if (__pyx_t_7 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 826, __pyx_L1_error)
        #else
        __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 826, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      }
    } else {
      __pyx_t_5 = __pyx_t_8(__pyx_t_4);
      if (unlikely(!__pyx_t_5)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 826, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
      PyObject* sequence = __pyx_t_5;
      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, 826, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_9 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_9);
      #else
      __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 826, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 826, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      #endif
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_10 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 826, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_10);
      index = 0; __pyx_t_3 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_3)) goto __pyx_L9_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_3);
      index = 1; __pyx_t_9 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_9)) goto __pyx_L9_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_9);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < 0) __PYX_ERR(0, 826, __pyx_L1_error)
      __pyx_t_11 = NULL;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L10_unpacking_done;
      __pyx_L9_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_11 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 826, __pyx_L1_error)
      __pyx_L10_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_post, __pyx_t_3);
    __pyx_t_3 = 0;
    __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_9);
    __pyx_t_9 = 0;

    /* "ete4/core/tree.pyx":827
 *         d = 0.0
 *         for post, n in self.iter_prepostorder(is_leaf_fn=is_leaf_fn):
 *             if n is self:             # <<<<<<<<<<<<<<
 *                 continue
 *             if post:
 */
    __pyx_t_1 = (__pyx_v_n == ((PyObject *)__pyx_v_self));
    if (__pyx_t_1) {

      /* "ete4/core/tree.pyx":828
 *         for post, n in self.iter_prepostorder(is_leaf_fn=is_leaf_fn):
 *             if n is self:
 *                 continue             # <<<<<<<<<<<<<<
 *             if post:
 *                 d -= dist(n) if not topological else 1.0
 */
      goto __pyx_L7_continue;

      /* "ete4/core/tree.pyx":827
 *         d = 0.0
 *         for post, n in self.iter_prepostorder(is_leaf_fn=is_leaf_fn):
 *             if n is self:             # <<<<<<<<<<<<<<
 *                 continue
 *             if post:
 */
    }

    /* "ete4/core/tree.pyx":829
 *             if n is self:
 *                 continue
 *             if post:             # <<<<<<<<<<<<<<
 *                 d -= dist(n) if not topological else 1.0
 *             else:
 */
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_post); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 829, __pyx_L1_error)
    if (__pyx_t_1) {

      /* "ete4/core/tree.pyx":830
 *                 continue
 *             if post:
 *                 d -= dist(n) if not topological else 1.0             # <<<<<<<<<<<<<<
 *             else:
 *                 if (is_leaf_fn and is_leaf_fn(n)) or n.is_leaf:
 */
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_topological); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 830, __pyx_L1_error)
      __pyx_t_2 = (!__pyx_t_1);
      if (__pyx_t_2) {
        __pyx_t_9 = __pyx_lambda_funcdef_lambda10(__pyx_v_dist, __pyx_v_n); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 830, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_5 = __pyx_t_9;
        __pyx_t_9 = 0;
      } else {
        __Pyx_INCREF(__pyx_float_1_0);
        __pyx_t_5 = __pyx_float_1_0;
      }
      __pyx_t_9 = PyNumber_InPlaceSubtract(__pyx_v_d, __pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 830, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF_SET(__pyx_v_d, __pyx_t_9);
      __pyx_t_9 = 0;

      /* "ete4/core/tree.pyx":829
 *             if n is self:
 *                 continue
 *             if post:             # <<<<<<<<<<<<<<
 *                 d -= dist(n) if not topological else 1.0
 *             else:
 */
      goto __pyx_L12;
    }

    /* "ete4/core/tree.pyx":832
 *                 d -= dist(n) if not topological else 1.0
 *             else:
 *                 if (is_leaf_fn and is_leaf_fn(n)) or n.is_leaf:             # <<<<<<<<<<<<<<
 *                     total_d = d + dist(n) if not topological else d
 *                     if min_dist is None or total_d < min_dist:
 */
    /*else*/ {
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_is_leaf_fn); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 832, __pyx_L1_error)
      if (!__pyx_t_1) {
        goto __pyx_L15_next_or;
      } else {
      }
      __Pyx_INCREF(__pyx_v_is_leaf_fn);
      __pyx_t_5 = __pyx_v_is_leaf_fn; __pyx_t_3 = NULL;
      __pyx_t_6 = 0;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
          __pyx_t_6 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_n};
        __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 832, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 832, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (!__pyx_t_1) {
      } else {
        __pyx_t_2 = __pyx_t_1;
        goto __pyx_L14_bool_binop_done;
      }
      __pyx_L15_next_or:;
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_n, __pyx_n_s_is_leaf); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 832, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 832, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_2 = __pyx_t_1;
      __pyx_L14_bool_binop_done:;
      if (__pyx_t_2) {

        /* "ete4/core/tree.pyx":833
 *             else:
 *                 if (is_leaf_fn and is_leaf_fn(n)) or n.is_leaf:
 *                     total_d = d + dist(n) if not topological else d             # <<<<<<<<<<<<<<
 *                     if min_dist is None or total_d < min_dist:
 *                         min_dist = total_d
 */
        __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_topological); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 833, __pyx_L1_error)
        __pyx_t_1 = (!__pyx_t_2);
        if (__pyx_t_1) {
          __pyx_t_5 = __pyx_lambda_funcdef_lambda10(__pyx_v_dist, __pyx_v_n); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 833, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_3 = PyNumber_Add(__pyx_v_d, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 833, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_t_9 = __pyx_t_3;
          __pyx_t_3 = 0;
        } else {
          __Pyx_INCREF(__pyx_v_d);
          __pyx_t_9 = __pyx_v_d;
        }
        __Pyx_XDECREF_SET(__pyx_v_total_d, __pyx_t_9);
        __pyx_t_9 = 0;

        /* "ete4/core/tree.pyx":834
 *                 if (is_leaf_fn and is_leaf_fn(n)) or n.is_leaf:
 *                     total_d = d + dist(n) if not topological else d
 *                     if min_dist is None or total_d < min_dist:             # <<<<<<<<<<<<<<
 *                         min_dist = total_d
 *                         min_node = n
 */
        __pyx_t_2 = (__pyx_v_min_dist == Py_None);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_1 = __pyx_t_2;
          goto __pyx_L18_bool_binop_done;
        }
        __pyx_t_9 = PyObject_RichCompare(__pyx_v_total_d, __pyx_v_min_dist, Py_LT); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 834, __pyx_L1_error)
        __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 834, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_1 = __pyx_t_2;
        __pyx_L18_bool_binop_done:;
        if (__pyx_t_1) {

          /* "ete4/core/tree.pyx":835
 *                     total_d = d + dist(n) if not topological else d
 *                     if min_dist is None or total_d < min_dist:
 *                         min_dist = total_d             # <<<<<<<<<<<<<<
 *                         min_node = n
 *                     if max_dist is None or total_d > max_dist:
 */
          __Pyx_INCREF(__pyx_v_total_d);
          __Pyx_DECREF_SET(__pyx_v_min_dist, __pyx_v_total_d);

          /* "ete4/core/tree.pyx":836
 *                     if min_dist is None or total_d < min_dist:
 *                         min_dist = total_d
 *                         min_node = n             # <<<<<<<<<<<<<<
 *                     if max_dist is None or total_d > max_dist:
 *                         max_dist = total_d
 */
          __Pyx_INCREF(__pyx_v_n);
          __Pyx_DECREF_SET(__pyx_v_min_node, __pyx_v_n);

          /* "ete4/core/tree.pyx":834
 *                 if (is_leaf_fn and is_leaf_fn(n)) or n.is_leaf:
 *                     total_d = d + dist(n) if not topological else d
 *                     if min_dist is None or total_d < min_dist:             # <<<<<<<<<<<<<<
 *                         min_dist = total_d
 *                         min_node = n
 */
        }

        /* "ete4/core/tree.pyx":837
 *                         min_dist = total_d
 *                         min_node = n
 *                     if max_dist is None or total_d > max_dist:             # <<<<<<<<<<<<<<
 *                         max_dist = total_d
 *                         max_node = n
 */
        __pyx_t_2 = (__pyx_v_max_dist == Py_None);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_1 = __pyx_t_2;
          goto __pyx_L21_bool_binop_done;
        }
        __pyx_t_9 = PyObject_RichCompare(__pyx_v_total_d, __pyx_v_max_dist, Py_GT); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 837, __pyx_L1_error)
        __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 837, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_1 = __pyx_t_2;
        __pyx_L21_bool_binop_done:;
        if (__pyx_t_1) {

          /* "ete4/core/tree.pyx":838
 *                         min_node = n
 *                     if max_dist is None or total_d > max_dist:
 *                         max_dist = total_d             # <<<<<<<<<<<<<<
 *                         max_node = n
 *                 else:
 */
          __Pyx_INCREF(__pyx_v_total_d);
          __Pyx_DECREF_SET(__pyx_v_max_dist, __pyx_v_total_d);

          /* "ete4/core/tree.pyx":839
 *                     if max_dist is None or total_d > max_dist:
 *                         max_dist = total_d
 *                         max_node = n             # <<<<<<<<<<<<<<
 *                 else:
 *                     d += dist(n) if not topological else 1.0
 */
          __Pyx_INCREF(__pyx_v_n);
          __Pyx_DECREF_SET(__pyx_v_max_node, __pyx_v_n);

          /* "ete4/core/tree.pyx":837
 *                         min_dist = total_d
 *                         min_node = n
 *                     if max_dist is None or total_d > max_dist:             # <<<<<<<<<<<<<<
 *                         max_dist = total_d
 *                         max_node = n
 */
        }

        /* "ete4/core/tree.pyx":832
 *                 d -= dist(n) if not topological else 1.0
 *             else:
 *                 if (is_leaf_fn and is_leaf_fn(n)) or n.is_leaf:             # <<<<<<<<<<<<<<
 *                     total_d = d + dist(n) if not topological else d
 *                     if min_dist is None or total_d < min_dist:
 */
        goto __pyx_L13;
      }

      /* "ete4/core/tree.pyx":841
 *                         max_node = n
 *                 else:
 *                     d += dist(n) if not topological else 1.0             # <<<<<<<<<<<<<<
 *         return min_node, min_dist, max_node, max_dist
 * 
 */
      /*else*/ {
        __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_topological); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 841, __pyx_L1_error)
        __pyx_t_2 = (!__pyx_t_1);
        if (__pyx_t_2) {
          __pyx_t_3 = __pyx_lambda_funcdef_lambda10(__pyx_v_dist, __pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 841, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_9 = __pyx_t_3;
          __pyx_t_3 = 0;
        } else {
          __Pyx_INCREF(__pyx_float_1_0);
          __pyx_t_9 = __pyx_float_1_0;
        }
        __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_d, __pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 841, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF_SET(__pyx_v_d, __pyx_t_3);
        __pyx_t_3 = 0;
      }
      __pyx_L13:;
    }
    __pyx_L12:;

    /* "ete4/core/tree.pyx":826
 *         max_node = None
 *         d = 0.0
 *         for post, n in self.iter_prepostorder(is_leaf_fn=is_leaf_fn):             # <<<<<<<<<<<<<<
 *             if n is self:
 *                 continue
 */
    __pyx_L7_continue:;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ete4/core/tree.pyx":842
 *                 else:
 *                     d += dist(n) if not topological else 1.0
 *         return min_node, min_dist, max_node, max_dist             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 842, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_min_node);
  __Pyx_GIVEREF(__pyx_v_min_node);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_min_node)) __PYX_ERR(0, 842, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_min_dist);
  __Pyx_GIVEREF(__pyx_v_min_dist);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_min_dist)) __PYX_ERR(0, 842, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_max_node);
  __Pyx_GIVEREF(__pyx_v_max_node);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_max_node)) __PYX_ERR(0, 842, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_max_dist);
  __Pyx_GIVEREF(__pyx_v_max_dist);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_v_max_dist)) __PYX_ERR(0, 842, __pyx_L1_error);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "ete4/core/tree.pyx":814
 *         return farthest_node, farthest_dist
 * 
 *     def _get_farthest_and_closest_leaves(self, topological=False, is_leaf_fn=None):             # <<<<<<<<<<<<<<
 *         # if called from a leaf node, no necessary to compute
 *         if (is_leaf_fn and is_leaf_fn(self)) or self.is_leaf:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("ete4.core.tree.Tree._get_farthest_and_closest_leaves", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dist);
  __Pyx_XDECREF(__pyx_v_min_dist);
  __Pyx_XDECREF(__pyx_v_min_node);
  __Pyx_XDECREF(__pyx_v_max_dist);
  __Pyx_XDECREF(__pyx_v_max_node);
  __Pyx_XDECREF(__pyx_v_d);
  __Pyx_XDECREF(__pyx_v_post);
  __Pyx_XDECREF(__pyx_v_n);
  __Pyx_XDECREF(__pyx_v_total_d);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ete4/core/tree.pyx":845
 * 
 * 
 *     def get_farthest_leaf(self, topological=False, is_leaf_fn=None):             # <<<<<<<<<<<<<<
 *         """Return the node's farthest descendant (a leaf), and its distance.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_104get_farthest_leaf(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_4ete4_4core_4tree_4Tree_103get_farthest_leaf, "Tree.get_farthest_leaf(self, topological=False, is_leaf_fn=None)\nReturn the node's farthest descendant (a leaf), and its distance.\n\n        :param topological: If True, the distance between nodes will be the\n            number of nodes between them (instead of the sum of branch lenghts).\n        ");
static PyMethodDef __pyx_mdef_4ete4_4core_4tree_4Tree_104get_farthest_leaf = {"get_farthest_leaf", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_104get_farthest_leaf, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_103get_farthest_leaf};
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_104get_farthest_leaf(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_topological = 0;
  PyObject *__pyx_v_is_leaf_fn = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_farthest_leaf (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_topological,&__pyx_n_s_is_leaf_fn,0};
    values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_False));
    values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_topological);
          if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 845, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_is_leaf_fn);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 845, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_farthest_leaf") < 0)) __PYX_ERR(0, 845, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_topological = values[0];
    __pyx_v_is_leaf_fn = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_farthest_leaf", 0, 0, 2, __pyx_nargs); __PYX_ERR(0, 845, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("ete4.core.tree.Tree.get_farthest_leaf", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_103get_farthest_leaf(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self), __pyx_v_topological, __pyx_v_is_leaf_fn);

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

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_103get_farthest_leaf(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_topological, PyObject *__pyx_v_is_leaf_fn) {
  CYTHON_UNUSED PyObject *__pyx_v_min_node = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_min_dist = NULL;
  PyObject *__pyx_v_max_node = NULL;
  PyObject *__pyx_v_max_dist = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *(*__pyx_t_7)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_farthest_leaf", 1);

  /* "ete4/core/tree.pyx":852
 *         """
 *         min_node, min_dist, max_node, max_dist = \
 *             self._get_farthest_and_closest_leaves(topological=topological,             # <<<<<<<<<<<<<<
 *                                                   is_leaf_fn=is_leaf_fn)
 *         return max_node, max_dist
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_farthest_and_closest_leaves_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 852, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 852, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_topological, __pyx_v_topological) < 0) __PYX_ERR(0, 852, __pyx_L1_error)

  /* "ete4/core/tree.pyx":853
 *         min_node, min_dist, max_node, max_dist = \
 *             self._get_farthest_and_closest_leaves(topological=topological,
 *                                                   is_leaf_fn=is_leaf_fn)             # <<<<<<<<<<<<<<
 *         return max_node, max_dist
 * 
 */
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_is_leaf_fn, __pyx_v_is_leaf_fn) < 0) __PYX_ERR(0, 852, __pyx_L1_error)

  /* "ete4/core/tree.pyx":852
 *         """
 *         min_node, min_dist, max_node, max_dist = \
 *             self._get_farthest_and_closest_leaves(topological=topological,             # <<<<<<<<<<<<<<
 *                                                   is_leaf_fn=is_leaf_fn)
 *         return max_node, max_dist
 */
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 852, __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;
  if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
    PyObject* sequence = __pyx_t_3;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 4)) {
      if (size > 4) __Pyx_RaiseTooManyValuesError(4);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 851, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); 
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 3); 
    } else {
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyList_GET_ITEM(sequence, 1); 
      __pyx_t_4 = PyList_GET_ITEM(sequence, 2); 
      __pyx_t_5 = PyList_GET_ITEM(sequence, 3); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_5);
    #else
    {
      Py_ssize_t i;
      PyObject** temps[4] = {&__pyx_t_2,&__pyx_t_1,&__pyx_t_4,&__pyx_t_5};
      for (i=0; i < 4; i++) {
        PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 851, __pyx_L1_error)
        __Pyx_GOTREF(item);
        *(temps[i]) = item;
      }
    }
    #endif
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    Py_ssize_t index = -1;
    PyObject** temps[4] = {&__pyx_t_2,&__pyx_t_1,&__pyx_t_4,&__pyx_t_5};
    __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 851, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6);
    for (index=0; index < 4; index++) {
      PyObject* item = __pyx_t_7(__pyx_t_6); if (unlikely(!item)) goto __pyx_L3_unpacking_failed;
      __Pyx_GOTREF(item);
      *(temps[index]) = item;
    }
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 4) < 0) __PYX_ERR(0, 851, __pyx_L1_error)
    __pyx_t_7 = NULL;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_7 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 851, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }

  /* "ete4/core/tree.pyx":851
 *             number of nodes between them (instead of the sum of branch lenghts).
 *         """
 *         min_node, min_dist, max_node, max_dist = \             # <<<<<<<<<<<<<<
 *             self._get_farthest_and_closest_leaves(topological=topological,
 *                                                   is_leaf_fn=is_leaf_fn)
 */
  __pyx_v_min_node = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_v_min_dist = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_max_node = __pyx_t_4;
  __pyx_t_4 = 0;
  __pyx_v_max_dist = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "ete4/core/tree.pyx":854
 *             self._get_farthest_and_closest_leaves(topological=topological,
 *                                                   is_leaf_fn=is_leaf_fn)
 *         return max_node, max_dist             # <<<<<<<<<<<<<<
 * 
 *     def get_closest_leaf(self, topological=False, is_leaf_fn=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 854, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_max_node);
  __Pyx_GIVEREF(__pyx_v_max_node);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_max_node)) __PYX_ERR(0, 854, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_max_dist);
  __Pyx_GIVEREF(__pyx_v_max_dist);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_max_dist)) __PYX_ERR(0, 854, __pyx_L1_error);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "ete4/core/tree.pyx":845
 * 
 * 
 *     def get_farthest_leaf(self, topological=False, is_leaf_fn=None):             # <<<<<<<<<<<<<<
 *         """Return the node's farthest descendant (a leaf), and its distance.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("ete4.core.tree.Tree.get_farthest_leaf", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_min_node);
  __Pyx_XDECREF(__pyx_v_min_dist);
  __Pyx_XDECREF(__pyx_v_max_node);
  __Pyx_XDECREF(__pyx_v_max_dist);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ete4/core/tree.pyx":856
 *         return max_node, max_dist
 * 
 *     def get_closest_leaf(self, topological=False, is_leaf_fn=None):             # <<<<<<<<<<<<<<
 *         """Return the node's closest descendant leaf, and its distance.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_106get_closest_leaf(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_4ete4_4core_4tree_4Tree_105get_closest_leaf, "Tree.get_closest_leaf(self, topological=False, is_leaf_fn=None)\nReturn the node's closest descendant leaf, and its distance.\n\n        :param topological: If True, the distance between nodes will be the\n            number of nodes between them (instead of the sum of branch lenghts).\n        ");
static PyMethodDef __pyx_mdef_4ete4_4core_4tree_4Tree_106get_closest_leaf = {"get_closest_leaf", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_106get_closest_leaf, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_105get_closest_leaf};
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_106get_closest_leaf(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_topological = 0;
  PyObject *__pyx_v_is_leaf_fn = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_closest_leaf (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_topological,&__pyx_n_s_is_leaf_fn,0};
    values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_False));
    values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_topological);
          if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 856, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_is_leaf_fn);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 856, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_closest_leaf") < 0)) __PYX_ERR(0, 856, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_topological = values[0];
    __pyx_v_is_leaf_fn = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_closest_leaf", 0, 0, 2, __pyx_nargs); __PYX_ERR(0, 856, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("ete4.core.tree.Tree.get_closest_leaf", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_105get_closest_leaf(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self), __pyx_v_topological, __pyx_v_is_leaf_fn);

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

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_105get_closest_leaf(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_topological, PyObject *__pyx_v_is_leaf_fn) {
  PyObject *__pyx_v_min_node = NULL;
  PyObject *__pyx_v_min_dist = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_max_node = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_max_dist = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *(*__pyx_t_7)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_closest_leaf", 1);

  /* "ete4/core/tree.pyx":863
 *         """
 *         min_node, min_dist, max_node, max_dist = \
 *             self._get_farthest_and_closest_leaves(topological=topological,             # <<<<<<<<<<<<<<
 *                                                   is_leaf_fn=is_leaf_fn)
 *         return min_node, min_dist
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_farthest_and_closest_leaves_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 863, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 863, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_topological, __pyx_v_topological) < 0) __PYX_ERR(0, 863, __pyx_L1_error)

  /* "ete4/core/tree.pyx":864
 *         min_node, min_dist, max_node, max_dist = \
 *             self._get_farthest_and_closest_leaves(topological=topological,
 *                                                   is_leaf_fn=is_leaf_fn)             # <<<<<<<<<<<<<<
 *         return min_node, min_dist
 * 
 */
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_is_leaf_fn, __pyx_v_is_leaf_fn) < 0) __PYX_ERR(0, 863, __pyx_L1_error)

  /* "ete4/core/tree.pyx":863
 *         """
 *         min_node, min_dist, max_node, max_dist = \
 *             self._get_farthest_and_closest_leaves(topological=topological,             # <<<<<<<<<<<<<<
 *                                                   is_leaf_fn=is_leaf_fn)
 *         return min_node, min_dist
 */
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 863, __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;
  if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
    PyObject* sequence = __pyx_t_3;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 4)) {
      if (size > 4) __Pyx_RaiseTooManyValuesError(4);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 862, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); 
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 3); 
    } else {
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyList_GET_ITEM(sequence, 1); 
      __pyx_t_4 = PyList_GET_ITEM(sequence, 2); 
      __pyx_t_5 = PyList_GET_ITEM(sequence, 3); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_5);
    #else
    {
      Py_ssize_t i;
      PyObject** temps[4] = {&__pyx_t_2,&__pyx_t_1,&__pyx_t_4,&__pyx_t_5};
      for (i=0; i < 4; i++) {
        PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 862, __pyx_L1_error)
        __Pyx_GOTREF(item);
        *(temps[i]) = item;
      }
    }
    #endif
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    Py_ssize_t index = -1;
    PyObject** temps[4] = {&__pyx_t_2,&__pyx_t_1,&__pyx_t_4,&__pyx_t_5};
    __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 862, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6);
    for (index=0; index < 4; index++) {
      PyObject* item = __pyx_t_7(__pyx_t_6); if (unlikely(!item)) goto __pyx_L3_unpacking_failed;
      __Pyx_GOTREF(item);
      *(temps[index]) = item;
    }
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 4) < 0) __PYX_ERR(0, 862, __pyx_L1_error)
    __pyx_t_7 = NULL;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_7 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 862, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }

  /* "ete4/core/tree.pyx":862
 *             number of nodes between them (instead of the sum of branch lenghts).
 *         """
 *         min_node, min_dist, max_node, max_dist = \             # <<<<<<<<<<<<<<
 *             self._get_farthest_and_closest_leaves(topological=topological,
 *                                                   is_leaf_fn=is_leaf_fn)
 */
  __pyx_v_min_node = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_v_min_dist = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_max_node = __pyx_t_4;
  __pyx_t_4 = 0;
  __pyx_v_max_dist = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "ete4/core/tree.pyx":865
 *             self._get_farthest_and_closest_leaves(topological=topological,
 *                                                   is_leaf_fn=is_leaf_fn)
 *         return min_node, min_dist             # <<<<<<<<<<<<<<
 * 
 *     def get_midpoint_outgroup(self, topological=False):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 865, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_min_node);
  __Pyx_GIVEREF(__pyx_v_min_node);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_min_node)) __PYX_ERR(0, 865, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_min_dist);
  __Pyx_GIVEREF(__pyx_v_min_dist);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_min_dist)) __PYX_ERR(0, 865, __pyx_L1_error);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "ete4/core/tree.pyx":856
 *         return max_node, max_dist
 * 
 *     def get_closest_leaf(self, topological=False, is_leaf_fn=None):             # <<<<<<<<<<<<<<
 *         """Return the node's closest descendant leaf, and its distance.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("ete4.core.tree.Tree.get_closest_leaf", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_min_node);
  __Pyx_XDECREF(__pyx_v_min_dist);
  __Pyx_XDECREF(__pyx_v_max_node);
  __Pyx_XDECREF(__pyx_v_max_dist);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ete4/core/tree.pyx":867
 *         return min_node, min_dist
 * 
 *     def get_midpoint_outgroup(self, topological=False):             # <<<<<<<<<<<<<<
 *         """Return the node dividing into two distance-balanced partitions.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_108get_midpoint_outgroup(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_4ete4_4core_4tree_4Tree_107get_midpoint_outgroup, "Tree.get_midpoint_outgroup(self, topological=False)\nReturn the node dividing into two distance-balanced partitions.\n\n        :param topological: If True, the distance between nodes will be the\n            number of nodes between them (instead of the sum of branch lenghts).\n        ");
static PyMethodDef __pyx_mdef_4ete4_4core_4tree_4Tree_108get_midpoint_outgroup = {"get_midpoint_outgroup", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_108get_midpoint_outgroup, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_107get_midpoint_outgroup};
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_108get_midpoint_outgroup(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_topological = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_midpoint_outgroup (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_topological,0};
    values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_False));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_topological);
          if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 867, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_midpoint_outgroup") < 0)) __PYX_ERR(0, 867, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_topological = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_midpoint_outgroup", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 867, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("ete4.core.tree.Tree.get_midpoint_outgroup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_107get_midpoint_outgroup(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self), __pyx_v_topological);

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

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_107get_midpoint_outgroup(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_topological) {
  PyObject *__pyx_v_current = NULL;
  CYTHON_UNUSED PyObject *__pyx_v__ = NULL;
  PyObject *__pyx_v_diameter = NULL;
  PyObject *__pyx_v_dist = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *(*__pyx_t_5)(PyObject *);
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_midpoint_outgroup", 1);

  /* "ete4/core/tree.pyx":874
 *         """
 *         # Start at the farthest leaf from the root.
 *         current, _ = self.root.get_farthest_leaf(topological=topological)             # <<<<<<<<<<<<<<
 *         _, diameter = current.get_farthest_node(topological=topological)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_root); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 874, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_get_farthest_leaf); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 874, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 874, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_topological, __pyx_v_topological) < 0) __PYX_ERR(0, 874, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 874, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
    PyObject* sequence = __pyx_t_3;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 874, __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); 
    } else {
      __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_2);
    #else
    __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 874, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 874, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 874, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4);
    index = 0; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 1; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) __PYX_ERR(0, 874, __pyx_L1_error)
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 874, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_current = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v__ = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "ete4/core/tree.pyx":875
 *         # Start at the farthest leaf from the root.
 *         current, _ = self.root.get_farthest_leaf(topological=topological)
 *         _, diameter = current.get_farthest_node(topological=topological)             # <<<<<<<<<<<<<<
 * 
 *         dist = 0
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_current, __pyx_n_s_get_farthest_node); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 875, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 875, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_topological, __pyx_v_topological) < 0) __PYX_ERR(0, 875, __pyx_L1_error)
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 875, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 875, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_3);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 875, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 875, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 875, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4);
    index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) __PYX_ERR(0, 875, __pyx_L1_error)
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L6_unpacking_done;
    __pyx_L5_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 875, __pyx_L1_error)
    __pyx_L6_unpacking_done:;
  }
  __Pyx_DECREF_SET(__pyx_v__, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_v_diameter = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "ete4/core/tree.pyx":877
 *         _, diameter = current.get_farthest_node(topological=topological)
 * 
 *         dist = 0             # <<<<<<<<<<<<<<
 *         while current.up is not None:
 *             dist += 1 if topological else current.dist
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_v_dist = __pyx_int_0;

  /* "ete4/core/tree.pyx":878
 * 
 *         dist = 0
 *         while current.up is not None:             # <<<<<<<<<<<<<<
 *             dist += 1 if topological else current.dist
 * 
 */
  while (1) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_current, __pyx_n_s_up); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 878, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = (__pyx_t_1 != Py_None);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (!__pyx_t_6) break;

    /* "ete4/core/tree.pyx":879
 *         dist = 0
 *         while current.up is not None:
 *             dist += 1 if topological else current.dist             # <<<<<<<<<<<<<<
 * 
 *             if dist > diameter / 2:
 */
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_topological); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 879, __pyx_L1_error)
    if (__pyx_t_6) {
      __Pyx_INCREF(__pyx_int_1);
      __pyx_t_1 = __pyx_int_1;
    } else {
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_current, __pyx_n_s_dist); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 879, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = __pyx_t_3;
      __pyx_t_3 = 0;
    }
    __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_dist, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 879, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_dist, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "ete4/core/tree.pyx":881
 *             dist += 1 if topological else current.dist
 * 
 *             if dist > diameter / 2:             # <<<<<<<<<<<<<<
 *                 return current
 * 
 */
    __pyx_t_3 = __Pyx_PyInt_TrueDivideObjC(__pyx_v_diameter, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 881, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyObject_RichCompare(__pyx_v_dist, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 881, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 881, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_6) {

      /* "ete4/core/tree.pyx":882
 * 
 *             if dist > diameter / 2:
 *                 return current             # <<<<<<<<<<<<<<
 * 
 *             current = current.up
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_current);
      __pyx_r = __pyx_v_current;
      goto __pyx_L0;

      /* "ete4/core/tree.pyx":881
 *             dist += 1 if topological else current.dist
 * 
 *             if dist > diameter / 2:             # <<<<<<<<<<<<<<
 *                 return current
 * 
 */
    }

    /* "ete4/core/tree.pyx":884
 *                 return current
 * 
 *             current = current.up             # <<<<<<<<<<<<<<
 * 
 *         return current  # the midpoint was the root (we went back to it)
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_current, __pyx_n_s_up); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 884, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_current, __pyx_t_1);
    __pyx_t_1 = 0;
  }

  /* "ete4/core/tree.pyx":886
 *             current = current.up
 * 
 *         return current  # the midpoint was the root (we went back to it)             # <<<<<<<<<<<<<<
 * 
 *     def mean_distance(self, weight_fn=None, leaf=None, topological=False):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_current);
  __pyx_r = __pyx_v_current;
  goto __pyx_L0;

  /* "ete4/core/tree.pyx":867
 *         return min_node, min_dist
 * 
 *     def get_midpoint_outgroup(self, topological=False):             # <<<<<<<<<<<<<<
 *         """Return the node dividing into two distance-balanced partitions.
 * 
 */

  /* 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("ete4.core.tree.Tree.get_midpoint_outgroup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_current);
  __Pyx_XDECREF(__pyx_v__);
  __Pyx_XDECREF(__pyx_v_diameter);
  __Pyx_XDECREF(__pyx_v_dist);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ete4/core/tree.pyx":888
 *         return current  # the midpoint was the root (we went back to it)
 * 
 *     def mean_distance(self, weight_fn=None, leaf=None, topological=False):             # <<<<<<<<<<<<<<
 *         """Return the weighted mean distance between leaves, or from leaf.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_110mean_distance(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_4ete4_4core_4tree_4Tree_109mean_distance, "Tree.mean_distance(self, weight_fn=None, leaf=None, topological=False)\nReturn the weighted mean distance between leaves, or from leaf.\n\n        This is also called the \"Mean Phylogenetic Distance\" (MPD) for\n        phylogenetic trees.\n\n        To \"select\" certain leaves, weight_fn can be used for example like::\n\n          weight_fn=lambda node: 1 if node.name in names else 0\n\n        But it can be used generally as relative leaf importance for averaging.\n\n        The algorithm is quite fast: for n leaves, it runs in O(n * log(n)).\n\n        :param weight_fn: Function that returns the weight of each leaf.\n            If None, all leaves will have weight 1.\n        :param leaf: Leaf for which to compute the weighted mean distance to\n            leaves. If None, a weighted mean for all leaves is made.\n        :param topological: If True, the distance between nodes will be the\n            number of nodes between them (instead of the sum of branch lenghts).\n        ");
static PyMethodDef __pyx_mdef_4ete4_4core_4tree_4Tree_110mean_distance = {"mean_distance", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_110mean_distance, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_109mean_distance};
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_110mean_distance(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_weight_fn = 0;
  PyObject *__pyx_v_leaf = 0;
  PyObject *__pyx_v_topological = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mean_distance (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_weight_fn,&__pyx_n_s_leaf,&__pyx_n_s_topological,0};
    values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_False));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_weight_fn);
          if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 888, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_leaf);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 888, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_topological);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 888, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mean_distance") < 0)) __PYX_ERR(0, 888, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_weight_fn = values[0];
    __pyx_v_leaf = values[1];
    __pyx_v_topological = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("mean_distance", 0, 0, 3, __pyx_nargs); __PYX_ERR(0, 888, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("ete4.core.tree.Tree.mean_distance", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_109mean_distance(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self), __pyx_v_weight_fn, __pyx_v_leaf, __pyx_v_topological);

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

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_109mean_distance(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_weight_fn, PyObject *__pyx_v_leaf, PyObject *__pyx_v_topological) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("mean_distance", 1);

  /* "ete4/core/tree.pyx":909
 *             number of nodes between them (instead of the sum of branch lenghts).
 *         """
 *         return ops.mean_distance(self, weight_fn, leaf, topological)             # <<<<<<<<<<<<<<
 * 
 *     def populate(self, size, names=None, model='yule',
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ops); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 909, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_mean_distance); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 909, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[5] = {__pyx_t_2, ((PyObject *)__pyx_v_self), __pyx_v_weight_fn, __pyx_v_leaf, __pyx_v_topological};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 4+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 909, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "ete4/core/tree.pyx":888
 *         return current  # the midpoint was the root (we went back to it)
 * 
 *     def mean_distance(self, weight_fn=None, leaf=None, topological=False):             # <<<<<<<<<<<<<<
 *         """Return the weighted mean distance between leaves, or from leaf.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("ete4.core.tree.Tree.mean_distance", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ete4/core/tree.pyx":911
 *         return ops.mean_distance(self, weight_fn, leaf, topological)
 * 
 *     def populate(self, size, names=None, model='yule',             # <<<<<<<<<<<<<<
 *                  dist_fn=None, support_fn=None):
 *         """Populate current node with a dichotomic random topology.
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_112populate(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_4ete4_4core_4tree_4Tree_111populate, "Tree.populate(self, size, names=None, model=u'yule', dist_fn=None, support_fn=None)\nPopulate current node with a dichotomic random topology.\n\n        :param size: Number of leaves to add. The necessary\n            intermediate nodes will be created too.\n        :param names: Collection (list or set) of names to name the leaves.\n            If None, leaves will be named using short letter sequences.\n        :param model: Model used to generate the topology. It can be:\n\n            - \"yule\" or \"yule-harding\": Every step a randomly selected leaf\n              grows two new children.\n            - \"uniform\" or \"pda\": Every step a randomly selected node (leaf\n              or interior) grows a new sister leaf.\n\n        :param dist_fn: Function to produce values to set as distance\n            in newly created branches, or None for no distances.\n        :param support_fn: Function to produce values to set as support\n            in newly created internal branches, or None for no supports.\n\n        Example to create a tree with 100 leaves, uniformly random\n        distances between 0 and 1, and all valid supports set to 1::\n\n          t = Tree()\n          random.seed(42)  # set seed if we want a reproducible result\n          t.populate(100, dist_fn=random.random, support_fn=lambda: 1)\n        ");
static PyMethodDef __pyx_mdef_4ete4_4core_4tree_4Tree_112populate = {"populate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_112populate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_111populate};
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_112populate(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_size = 0;
  PyObject *__pyx_v_names = 0;
  PyObject *__pyx_v_model = 0;
  PyObject *__pyx_v_dist_fn = 0;
  PyObject *__pyx_v_support_fn = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[5] = {0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("populate (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,&__pyx_n_s_names,&__pyx_n_s_model,&__pyx_n_s_dist_fn,&__pyx_n_s_support_fn,0};
    values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_n_u_yule));

    /* "ete4/core/tree.pyx":912
 * 
 *     def populate(self, size, names=None, model='yule',
 *                  dist_fn=None, support_fn=None):             # <<<<<<<<<<<<<<
 *         """Populate current node with a dichotomic random topology.
 * 
 */
    values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 911, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_names);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 911, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_model);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 911, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dist_fn);
          if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 911, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_support_fn);
          if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 911, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "populate") < 0)) __PYX_ERR(0, 911, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_size = values[0];
    __pyx_v_names = values[1];
    __pyx_v_model = values[2];
    __pyx_v_dist_fn = values[3];
    __pyx_v_support_fn = values[4];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("populate", 0, 1, 5, __pyx_nargs); __PYX_ERR(0, 911, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("ete4.core.tree.Tree.populate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_111populate(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self), __pyx_v_size, __pyx_v_names, __pyx_v_model, __pyx_v_dist_fn, __pyx_v_support_fn);

  /* "ete4/core/tree.pyx":911
 *         return ops.mean_distance(self, weight_fn, leaf, topological)
 * 
 *     def populate(self, size, names=None, model='yule',             # <<<<<<<<<<<<<<
 *                  dist_fn=None, support_fn=None):
 *         """Populate current node with a dichotomic random topology.
 */

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

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_111populate(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_names, PyObject *__pyx_v_model, PyObject *__pyx_v_dist_fn, PyObject *__pyx_v_support_fn) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("populate", 1);

  /* "ete4/core/tree.pyx":938
 *           t.populate(100, dist_fn=random.random, support_fn=lambda: 1)
 *         """
 *         ops.populate(self, size, names, model, dist_fn, support_fn)             # <<<<<<<<<<<<<<
 * 
 *     def set_outgroup(self, node, bprops=None, dist=None):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ops); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 938, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_populate); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 938, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[7] = {__pyx_t_2, ((PyObject *)__pyx_v_self), __pyx_v_size, __pyx_v_names, __pyx_v_model, __pyx_v_dist_fn, __pyx_v_support_fn};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 6+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 938, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ete4/core/tree.pyx":911
 *         return ops.mean_distance(self, weight_fn, leaf, topological)
 * 
 *     def populate(self, size, names=None, model='yule',             # <<<<<<<<<<<<<<
 *                  dist_fn=None, support_fn=None):
 *         """Populate current node with a dichotomic random topology.
 */

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

/* "ete4/core/tree.pyx":940
 *         ops.populate(self, size, names, model, dist_fn, support_fn)
 * 
 *     def set_outgroup(self, node, bprops=None, dist=None):             # <<<<<<<<<<<<<<
 *         """Change tree so the given node is set as outgroup.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_114set_outgroup(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_4ete4_4core_4tree_4Tree_113set_outgroup, "Tree.set_outgroup(self, node, bprops=None, dist=None)\nChange tree so the given node is set as outgroup.\n\n        The original root node will be used as the new root node, so any\n        reference to it in the code will still be valid.\n\n        :param node: Node to set as outgroup (future first child of the root).\n        :param bprops: List of branch properties (other than \"dist\" and \"support\").\n        :param dist: Distance from the node, where we put the new root of the tree.\n        ");
static PyMethodDef __pyx_mdef_4ete4_4core_4tree_4Tree_114set_outgroup = {"set_outgroup", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_114set_outgroup, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_113set_outgroup};
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_114set_outgroup(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_node = 0;
  PyObject *__pyx_v_bprops = 0;
  PyObject *__pyx_v_dist = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_outgroup (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_node,&__pyx_n_s_bprops,&__pyx_n_s_dist,0};
    values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_node)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 940, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_bprops);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 940, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dist);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 940, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_outgroup") < 0)) __PYX_ERR(0, 940, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_node = values[0];
    __pyx_v_bprops = values[1];
    __pyx_v_dist = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_outgroup", 0, 1, 3, __pyx_nargs); __PYX_ERR(0, 940, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("ete4.core.tree.Tree.set_outgroup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_113set_outgroup(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self), __pyx_v_node, __pyx_v_bprops, __pyx_v_dist);

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

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_113set_outgroup(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_node, PyObject *__pyx_v_bprops, PyObject *__pyx_v_dist) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  unsigned int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_outgroup", 0);
  __Pyx_INCREF(__pyx_v_node);

  /* "ete4/core/tree.pyx":950
 *         :param dist: Distance from the node, where we put the new root of the tree.
 *         """
 *         node = self[node] if type(node) == str else node  # translates if needed             # <<<<<<<<<<<<<<
 *         ops.set_outgroup(node, bprops, dist)
 * 
 */
  __pyx_t_2 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_node)), ((PyObject *)(&PyUnicode_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 950, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 950, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {
    __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_node); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 950, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(__pyx_v_node);
    __pyx_t_1 = __pyx_v_node;
  }
  __Pyx_DECREF_SET(__pyx_v_node, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "ete4/core/tree.pyx":951
 *         """
 *         node = self[node] if type(node) == str else node  # translates if needed
 *         ops.set_outgroup(node, bprops, dist)             # <<<<<<<<<<<<<<
 * 
 *     def unroot(self, bprops=None):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ops); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 951, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_set_outgroup); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 951, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_v_node, __pyx_v_bprops, __pyx_v_dist};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 951, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ete4/core/tree.pyx":940
 *         ops.populate(self, size, names, model, dist_fn, support_fn)
 * 
 *     def set_outgroup(self, node, bprops=None, dist=None):             # <<<<<<<<<<<<<<
 *         """Change tree so the given node is set as outgroup.
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("ete4.core.tree.Tree.set_outgroup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_node);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ete4/core/tree.pyx":953
 *         ops.set_outgroup(node, bprops, dist)
 * 
 *     def unroot(self, bprops=None):             # <<<<<<<<<<<<<<
 *         """Unroot the tree, that is, make the root not have 2 children.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_116unroot(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_4ete4_4core_4tree_4Tree_115unroot, "Tree.unroot(self, bprops=None)\nUnroot the tree, that is, make the root not have 2 children.\n\n        The convention in phylogenetic trees is that if the root has 2\n        children, it is a \"rooted\" tree (the root is a real ancestor).\n        Otherwise (typically a root with 3 children), the root is just\n        an arbitrary place to hang the tree.\n        ");
static PyMethodDef __pyx_mdef_4ete4_4core_4tree_4Tree_116unroot = {"unroot", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_116unroot, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_115unroot};
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_116unroot(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_bprops = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("unroot (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_bprops,0};
    values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_bprops);
          if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 953, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "unroot") < 0)) __PYX_ERR(0, 953, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_bprops = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("unroot", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 953, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("ete4.core.tree.Tree.unroot", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_115unroot(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self), __pyx_v_bprops);

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

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_115unroot(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_bprops) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("unroot", 1);

  /* "ete4/core/tree.pyx":961
 *         an arbitrary place to hang the tree.
 *         """
 *         ops.unroot(self, bprops)             # <<<<<<<<<<<<<<
 * 
 *     def show(self, layout=None, tree_style=None, name="ETE"):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ops); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 961, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_unroot); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 961, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_2, ((PyObject *)__pyx_v_self), __pyx_v_bprops};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 961, __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;

  /* "ete4/core/tree.pyx":953
 *         ops.set_outgroup(node, bprops, dist)
 * 
 *     def unroot(self, bprops=None):             # <<<<<<<<<<<<<<
 *         """Unroot the tree, that is, make the root not have 2 children.
 * 
 */

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

/* "ete4/core/tree.pyx":963
 *         ops.unroot(self, bprops)
 * 
 *     def show(self, layout=None, tree_style=None, name="ETE"):             # <<<<<<<<<<<<<<
 *         """Start an interactive session to visualize the current node."""
 *         from ..treeview import drawer
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_118show(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_4ete4_4core_4tree_4Tree_117show, "Tree.show(self, layout=None, tree_style=None, name=u'ETE')\nStart an interactive session to visualize the current node.");
static PyMethodDef __pyx_mdef_4ete4_4core_4tree_4Tree_118show = {"show", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_118show, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_117show};
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_118show(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_layout = 0;
  PyObject *__pyx_v_tree_style = 0;
  PyObject *__pyx_v_name = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("show (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_layout,&__pyx_n_s_tree_style,&__pyx_n_s_name,0};
    values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_n_u_ETE));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_layout);
          if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 963, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_tree_style);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 963, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 963, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "show") < 0)) __PYX_ERR(0, 963, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_layout = values[0];
    __pyx_v_tree_style = values[1];
    __pyx_v_name = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("show", 0, 0, 3, __pyx_nargs); __PYX_ERR(0, 963, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("ete4.core.tree.Tree.show", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_117show(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self), __pyx_v_layout, __pyx_v_tree_style, __pyx_v_name);

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

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_117show(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_layout, PyObject *__pyx_v_tree_style, PyObject *__pyx_v_name) {
  PyObject *__pyx_v_drawer = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("show", 1);

  /* "ete4/core/tree.pyx":965
 *     def show(self, layout=None, tree_style=None, name="ETE"):
 *         """Start an interactive session to visualize the current node."""
 *         from ..treeview import drawer             # <<<<<<<<<<<<<<
 *         drawer.show_tree(self, layout=layout,
 *                          tree_style=tree_style, win_name=name)
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 965, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_drawer);
  __Pyx_GIVEREF(__pyx_n_s_drawer);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_drawer)) __PYX_ERR(0, 965, __pyx_L1_error);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_treeview, __pyx_t_1, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 965, __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_drawer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 965, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_drawer = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ete4/core/tree.pyx":966
 *         """Start an interactive session to visualize the current node."""
 *         from ..treeview import drawer
 *         drawer.show_tree(self, layout=layout,             # <<<<<<<<<<<<<<
 *                          tree_style=tree_style, win_name=name)
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_drawer, __pyx_n_s_show_tree); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 966, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 966, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self))) __PYX_ERR(0, 966, __pyx_L1_error);
  __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 966, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_layout, __pyx_v_layout) < 0) __PYX_ERR(0, 966, __pyx_L1_error)

  /* "ete4/core/tree.pyx":967
 *         from ..treeview import drawer
 *         drawer.show_tree(self, layout=layout,
 *                          tree_style=tree_style, win_name=name)             # <<<<<<<<<<<<<<
 * 
 *     def render(self, file_name, layout=None, w=None, h=None,
 */
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_tree_style, __pyx_v_tree_style) < 0) __PYX_ERR(0, 966, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_win_name, __pyx_v_name) < 0) __PYX_ERR(0, 966, __pyx_L1_error)

  /* "ete4/core/tree.pyx":966
 *         """Start an interactive session to visualize the current node."""
 *         from ..treeview import drawer
 *         drawer.show_tree(self, layout=layout,             # <<<<<<<<<<<<<<
 *                          tree_style=tree_style, win_name=name)
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 966, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ete4/core/tree.pyx":963
 *         ops.unroot(self, bprops)
 * 
 *     def show(self, layout=None, tree_style=None, name="ETE"):             # <<<<<<<<<<<<<<
 *         """Start an interactive session to visualize the current node."""
 *         from ..treeview import drawer
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("ete4.core.tree.Tree.show", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_drawer);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ete4/core/tree.pyx":969
 *                          tree_style=tree_style, win_name=name)
 * 
 *     def render(self, file_name, layout=None, w=None, h=None,             # <<<<<<<<<<<<<<
 *                tree_style=None, units='px', dpi=90):
 *         """Render the tree as an image.
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_120render(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_4ete4_4core_4tree_4Tree_119render, "Tree.render(self, file_name, layout=None, w=None, h=None, tree_style=None, units=u'px', dpi=90)\nRender the tree as an image.\n\n        :param file_name: Name of the output image. Valid extensions\n            are \"svg\", \"pdf\", and \"png\".\n        :param layout: Layout function or layout function name to use.\n        :param tree_style: A `TreeStyle` instance containing the image\n            properties.\n        :param units: Units for height (h) or width (w). They can be\n            \"px\" for pixels, \"mm\" for millimeters, \"in\" for inches.\n        :param h: Height of the image in :attr:`units`.\n        :param w: Width of the image in :attr:`units`.\n        :param dpi: Resolution in dots per inch.\n        ");
static PyMethodDef __pyx_mdef_4ete4_4core_4tree_4Tree_120render = {"render", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_120render, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_119render};
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_120render(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_file_name = 0;
  PyObject *__pyx_v_layout = 0;
  PyObject *__pyx_v_w = 0;
  PyObject *__pyx_v_h = 0;
  PyObject *__pyx_v_tree_style = 0;
  PyObject *__pyx_v_units = 0;
  PyObject *__pyx_v_dpi = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[7] = {0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("render (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_file_name,&__pyx_n_s_layout,&__pyx_n_s_w,&__pyx_n_s_h,&__pyx_n_s_tree_style,&__pyx_n_s_units,&__pyx_n_s_dpi,0};
    values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));

    /* "ete4/core/tree.pyx":970
 * 
 *     def render(self, file_name, layout=None, w=None, h=None,
 *                tree_style=None, units='px', dpi=90):             # <<<<<<<<<<<<<<
 *         """Render the tree as an image.
 * 
 */
    values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    values[5] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_n_u_px));
    values[6] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_90));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_file_name)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 969, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_layout);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 969, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_w);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 969, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_h);
          if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 969, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_tree_style);
          if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 969, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_units);
          if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 969, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dpi);
          if (value) { values[6] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 969, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "render") < 0)) __PYX_ERR(0, 969, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_file_name = values[0];
    __pyx_v_layout = values[1];
    __pyx_v_w = values[2];
    __pyx_v_h = values[3];
    __pyx_v_tree_style = values[4];
    __pyx_v_units = values[5];
    __pyx_v_dpi = values[6];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("render", 0, 1, 7, __pyx_nargs); __PYX_ERR(0, 969, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("ete4.core.tree.Tree.render", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_119render(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self), __pyx_v_file_name, __pyx_v_layout, __pyx_v_w, __pyx_v_h, __pyx_v_tree_style, __pyx_v_units, __pyx_v_dpi);

  /* "ete4/core/tree.pyx":969
 *                          tree_style=tree_style, win_name=name)
 * 
 *     def render(self, file_name, layout=None, w=None, h=None,             # <<<<<<<<<<<<<<
 *                tree_style=None, units='px', dpi=90):
 *         """Render the tree as an image.
 */

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

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_119render(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_file_name, PyObject *__pyx_v_layout, PyObject *__pyx_v_w, PyObject *__pyx_v_h, PyObject *__pyx_v_tree_style, PyObject *__pyx_v_units, PyObject *__pyx_v_dpi) {
  PyObject *__pyx_v_drawer = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("render", 1);

  /* "ete4/core/tree.pyx":984
 *         :param dpi: Resolution in dots per inch.
 *         """
 *         from ..treeview import drawer             # <<<<<<<<<<<<<<
 * 
 *         if file_name.startswith('%%return'):  # generate img_map (for webplugin)
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 984, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_drawer);
  __Pyx_GIVEREF(__pyx_n_s_drawer);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_drawer)) __PYX_ERR(0, 984, __pyx_L1_error);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_treeview, __pyx_t_1, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 984, __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_drawer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 984, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_drawer = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ete4/core/tree.pyx":986
 *         from ..treeview import drawer
 * 
 *         if file_name.startswith('%%return'):  # generate img_map (for webplugin)             # <<<<<<<<<<<<<<
 *             return drawer.get_img(self, w=w, h=h,
 *                                   layout=layout, tree_style=tree_style,
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_file_name, __pyx_n_s_startswith); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 986, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_u_return};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 986, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 986, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_5) {

    /* "ete4/core/tree.pyx":987
 * 
 *         if file_name.startswith('%%return'):  # generate img_map (for webplugin)
 *             return drawer.get_img(self, w=w, h=h,             # <<<<<<<<<<<<<<
 *                                   layout=layout, tree_style=tree_style,
 *                                   units=units, dpi=dpi, return_format=file_name)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_drawer, __pyx_n_s_get_img); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 987, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 987, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF((PyObject *)__pyx_v_self);
    __Pyx_GIVEREF((PyObject *)__pyx_v_self);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self))) __PYX_ERR(0, 987, __pyx_L1_error);
    __pyx_t_3 = __Pyx_PyDict_NewPresized(7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 987, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_w, __pyx_v_w) < 0) __PYX_ERR(0, 987, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_h, __pyx_v_h) < 0) __PYX_ERR(0, 987, __pyx_L1_error)

    /* "ete4/core/tree.pyx":988
 *         if file_name.startswith('%%return'):  # generate img_map (for webplugin)
 *             return drawer.get_img(self, w=w, h=h,
 *                                   layout=layout, tree_style=tree_style,             # <<<<<<<<<<<<<<
 *                                   units=units, dpi=dpi, return_format=file_name)
 *         elif file_name.startswith('%%inline'):  # also return data (for jupyter)
 */
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_layout, __pyx_v_layout) < 0) __PYX_ERR(0, 987, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_tree_style, __pyx_v_tree_style) < 0) __PYX_ERR(0, 987, __pyx_L1_error)

    /* "ete4/core/tree.pyx":989
 *             return drawer.get_img(self, w=w, h=h,
 *                                   layout=layout, tree_style=tree_style,
 *                                   units=units, dpi=dpi, return_format=file_name)             # <<<<<<<<<<<<<<
 *         elif file_name.startswith('%%inline'):  # also return data (for jupyter)
 *             return drawer.render_tree(self, file_name, w=w, h=h,
 */
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_units, __pyx_v_units) < 0) __PYX_ERR(0, 987, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dpi, __pyx_v_dpi) < 0) __PYX_ERR(0, 987, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return_format, __pyx_v_file_name) < 0) __PYX_ERR(0, 987, __pyx_L1_error)

    /* "ete4/core/tree.pyx":987
 * 
 *         if file_name.startswith('%%return'):  # generate img_map (for webplugin)
 *             return drawer.get_img(self, w=w, h=h,             # <<<<<<<<<<<<<<
 *                                   layout=layout, tree_style=tree_style,
 *                                   units=units, dpi=dpi, return_format=file_name)
 */
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 987, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    goto __pyx_L0;

    /* "ete4/core/tree.pyx":986
 *         from ..treeview import drawer
 * 
 *         if file_name.startswith('%%return'):  # generate img_map (for webplugin)             # <<<<<<<<<<<<<<
 *             return drawer.get_img(self, w=w, h=h,
 *                                   layout=layout, tree_style=tree_style,
 */
  }

  /* "ete4/core/tree.pyx":990
 *                                   layout=layout, tree_style=tree_style,
 *                                   units=units, dpi=dpi, return_format=file_name)
 *         elif file_name.startswith('%%inline'):  # also return data (for jupyter)             # <<<<<<<<<<<<<<
 *             return drawer.render_tree(self, file_name, w=w, h=h,
 *                                       layout=layout, tree_style=tree_style,
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_file_name, __pyx_n_s_startswith); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 990, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_kp_u_inline};
    __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 990, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 990, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__pyx_t_5) {

    /* "ete4/core/tree.pyx":991
 *                                   units=units, dpi=dpi, return_format=file_name)
 *         elif file_name.startswith('%%inline'):  # also return data (for jupyter)
 *             return drawer.render_tree(self, file_name, w=w, h=h,             # <<<<<<<<<<<<<<
 *                                       layout=layout, tree_style=tree_style,
 *                                       units=units, dpi=dpi)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_drawer, __pyx_n_s_render_tree); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 991, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 991, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF((PyObject *)__pyx_v_self);
    __Pyx_GIVEREF((PyObject *)__pyx_v_self);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self))) __PYX_ERR(0, 991, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_file_name);
    __Pyx_GIVEREF(__pyx_v_file_name);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_file_name)) __PYX_ERR(0, 991, __pyx_L1_error);
    __pyx_t_1 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 991, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_w, __pyx_v_w) < 0) __PYX_ERR(0, 991, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_h, __pyx_v_h) < 0) __PYX_ERR(0, 991, __pyx_L1_error)

    /* "ete4/core/tree.pyx":992
 *         elif file_name.startswith('%%inline'):  # also return data (for jupyter)
 *             return drawer.render_tree(self, file_name, w=w, h=h,
 *                                       layout=layout, tree_style=tree_style,             # <<<<<<<<<<<<<<
 *                                       units=units, dpi=dpi)
 *         else:  # just generate the file
 */
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_layout, __pyx_v_layout) < 0) __PYX_ERR(0, 991, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_tree_style, __pyx_v_tree_style) < 0) __PYX_ERR(0, 991, __pyx_L1_error)

    /* "ete4/core/tree.pyx":993
 *             return drawer.render_tree(self, file_name, w=w, h=h,
 *                                       layout=layout, tree_style=tree_style,
 *                                       units=units, dpi=dpi)             # <<<<<<<<<<<<<<
 *         else:  # just generate the file
 *             drawer.render_tree(self, file_name, w=w, h=h,
 */
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_units, __pyx_v_units) < 0) __PYX_ERR(0, 991, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dpi, __pyx_v_dpi) < 0) __PYX_ERR(0, 991, __pyx_L1_error)

    /* "ete4/core/tree.pyx":991
 *                                   units=units, dpi=dpi, return_format=file_name)
 *         elif file_name.startswith('%%inline'):  # also return data (for jupyter)
 *             return drawer.render_tree(self, file_name, w=w, h=h,             # <<<<<<<<<<<<<<
 *                                       layout=layout, tree_style=tree_style,
 *                                       units=units, dpi=dpi)
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 991, __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_1); __pyx_t_1 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "ete4/core/tree.pyx":990
 *                                   layout=layout, tree_style=tree_style,
 *                                   units=units, dpi=dpi, return_format=file_name)
 *         elif file_name.startswith('%%inline'):  # also return data (for jupyter)             # <<<<<<<<<<<<<<
 *             return drawer.render_tree(self, file_name, w=w, h=h,
 *                                       layout=layout, tree_style=tree_style,
 */
  }

  /* "ete4/core/tree.pyx":995
 *                                       units=units, dpi=dpi)
 *         else:  # just generate the file
 *             drawer.render_tree(self, file_name, w=w, h=h,             # <<<<<<<<<<<<<<
 *                                layout=layout, tree_style=tree_style,
 *                                units=units, dpi=dpi)
 */
  /*else*/ {
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_drawer, __pyx_n_s_render_tree); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 995, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 995, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF((PyObject *)__pyx_v_self);
    __Pyx_GIVEREF((PyObject *)__pyx_v_self);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self))) __PYX_ERR(0, 995, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_file_name);
    __Pyx_GIVEREF(__pyx_v_file_name);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_file_name)) __PYX_ERR(0, 995, __pyx_L1_error);
    __pyx_t_3 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 995, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_w, __pyx_v_w) < 0) __PYX_ERR(0, 995, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_h, __pyx_v_h) < 0) __PYX_ERR(0, 995, __pyx_L1_error)

    /* "ete4/core/tree.pyx":996
 *         else:  # just generate the file
 *             drawer.render_tree(self, file_name, w=w, h=h,
 *                                layout=layout, tree_style=tree_style,             # <<<<<<<<<<<<<<
 *                                units=units, dpi=dpi)
 *             print('Wrote file:', file_name)
 */
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_layout, __pyx_v_layout) < 0) __PYX_ERR(0, 995, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_tree_style, __pyx_v_tree_style) < 0) __PYX_ERR(0, 995, __pyx_L1_error)

    /* "ete4/core/tree.pyx":997
 *             drawer.render_tree(self, file_name, w=w, h=h,
 *                                layout=layout, tree_style=tree_style,
 *                                units=units, dpi=dpi)             # <<<<<<<<<<<<<<
 *             print('Wrote file:', file_name)
 * 
 */
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_units, __pyx_v_units) < 0) __PYX_ERR(0, 995, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dpi, __pyx_v_dpi) < 0) __PYX_ERR(0, 995, __pyx_L1_error)

    /* "ete4/core/tree.pyx":995
 *                                       units=units, dpi=dpi)
 *         else:  # just generate the file
 *             drawer.render_tree(self, file_name, w=w, h=h,             # <<<<<<<<<<<<<<
 *                                layout=layout, tree_style=tree_style,
 *                                units=units, dpi=dpi)
 */
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 995, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "ete4/core/tree.pyx":998
 *                                layout=layout, tree_style=tree_style,
 *                                units=units, dpi=dpi)
 *             print('Wrote file:', file_name)             # <<<<<<<<<<<<<<
 * 
 *     def explore(self, name=None, layouts=None,
 */
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 998, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_kp_u_Wrote_file);
    __Pyx_GIVEREF(__pyx_kp_u_Wrote_file);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_kp_u_Wrote_file)) __PYX_ERR(0, 998, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_file_name);
    __Pyx_GIVEREF(__pyx_v_file_name);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_file_name)) __PYX_ERR(0, 998, __pyx_L1_error);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 998, __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;
  }

  /* "ete4/core/tree.pyx":969
 *                          tree_style=tree_style, win_name=name)
 * 
 *     def render(self, file_name, layout=None, w=None, h=None,             # <<<<<<<<<<<<<<
 *                tree_style=None, units='px', dpi=90):
 *         """Render the tree as an image.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("ete4.core.tree.Tree.render", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_drawer);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ete4/core/tree.pyx":1000
 *             print('Wrote file:', file_name)
 * 
 *     def explore(self, name=None, layouts=None,             # <<<<<<<<<<<<<<
 *                 host='127.0.0.1', port=None, verbose=False,
 *                 compress=False, keep_server=False, open_browser=True,
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_122explore(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_4ete4_4core_4tree_4Tree_121explore, "Tree.explore(self, name=None, layouts=None, host=u'127.0.0.1', port=None, verbose=False, compress=False, keep_server=False, open_browser=True, **kwargs)\nLaunch an interactive session to visualize the tree.\n\n        :param str name: Name used to store and refer to the tree.\n        :param list layouts: Layouts that specify how to visualize.\n        :param port: Server listening port. If None, use next\n            available port >= 5000.\n        ");
static PyMethodDef __pyx_mdef_4ete4_4core_4tree_4Tree_122explore = {"explore", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_122explore, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_121explore};
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_122explore(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_layouts = 0;
  PyObject *__pyx_v_host = 0;
  PyObject *__pyx_v_port = 0;
  PyObject *__pyx_v_verbose = 0;
  PyObject *__pyx_v_compress = 0;
  PyObject *__pyx_v_keep_server = 0;
  PyObject *__pyx_v_open_browser = 0;
  PyObject *__pyx_v_kwargs = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[8] = {0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("explore (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_layouts,&__pyx_n_s_host,&__pyx_n_s_port,&__pyx_n_s_verbose,&__pyx_n_s_compress,&__pyx_n_s_keep_server,&__pyx_n_s_open_browser,0};
    values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_kp_u_127_0_0_1));

    /* "ete4/core/tree.pyx":1001
 * 
 *     def explore(self, name=None, layouts=None,
 *                 host='127.0.0.1', port=None, verbose=False,             # <<<<<<<<<<<<<<
 *                 compress=False, keep_server=False, open_browser=True,
 *                 **kwargs):
 */
    values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_False));

    /* "ete4/core/tree.pyx":1002
 *     def explore(self, name=None, layouts=None,
 *                 host='127.0.0.1', port=None, verbose=False,
 *                 compress=False, keep_server=False, open_browser=True,             # <<<<<<<<<<<<<<
 *                 **kwargs):
 *         """Launch an interactive session to visualize the tree.
 */
    values[5] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_False));
    values[6] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_False));
    values[7] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_True));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name);
          if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1000, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_layouts);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1000, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_host);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1000, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_port);
          if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1000, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_verbose);
          if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1000, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_compress);
          if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1000, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_keep_server);
          if (value) { values[6] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1000, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_open_browser);
          if (value) { values[7] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1000, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, __pyx_v_kwargs, values + 0, kwd_pos_args, "explore") < 0)) __PYX_ERR(0, 1000, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_name = values[0];
    __pyx_v_layouts = values[1];
    __pyx_v_host = values[2];
    __pyx_v_port = values[3];
    __pyx_v_verbose = values[4];
    __pyx_v_compress = values[5];
    __pyx_v_keep_server = values[6];
    __pyx_v_open_browser = values[7];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("explore", 0, 0, 8, __pyx_nargs); __PYX_ERR(0, 1000, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("ete4.core.tree.Tree.explore", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_121explore(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self), __pyx_v_name, __pyx_v_layouts, __pyx_v_host, __pyx_v_port, __pyx_v_verbose, __pyx_v_compress, __pyx_v_keep_server, __pyx_v_open_browser, __pyx_v_kwargs);

  /* "ete4/core/tree.pyx":1000
 *             print('Wrote file:', file_name)
 * 
 *     def explore(self, name=None, layouts=None,             # <<<<<<<<<<<<<<
 *                 host='127.0.0.1', port=None, verbose=False,
 *                 compress=False, keep_server=False, open_browser=True,
 */

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

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_121explore(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_layouts, PyObject *__pyx_v_host, PyObject *__pyx_v_port, PyObject *__pyx_v_verbose, PyObject *__pyx_v_compress, PyObject *__pyx_v_keep_server, PyObject *__pyx_v_open_browser, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_v_explorer = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("explore", 1);

  /* "ete4/core/tree.pyx":1011
 *             available port >= 5000.
 *         """
 *         from ..smartview import explorer             # <<<<<<<<<<<<<<
 * 
 *         explorer.explore(self, name, layouts,
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1011, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_explorer);
  __Pyx_GIVEREF(__pyx_n_s_explorer);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_explorer)) __PYX_ERR(0, 1011, __pyx_L1_error);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_smartview, __pyx_t_1, 2); 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_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_explorer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1011, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_explorer = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ete4/core/tree.pyx":1013
 *         from ..smartview import explorer
 * 
 *         explorer.explore(self, name, layouts,             # <<<<<<<<<<<<<<
 *                          host, port, verbose,
 *                          compress, keep_server, open_browser,
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_explorer, __pyx_n_s_explore); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1013, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "ete4/core/tree.pyx":1015
 *         explorer.explore(self, name, layouts,
 *                          host, port, verbose,
 *                          compress, keep_server, open_browser,             # <<<<<<<<<<<<<<
 *                          **kwargs)
 * 
 */
  __pyx_t_1 = PyTuple_New(9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1013, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self))) __PYX_ERR(0, 1013, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_name);
  __Pyx_GIVEREF(__pyx_v_name);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_name)) __PYX_ERR(0, 1013, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_layouts);
  __Pyx_GIVEREF(__pyx_v_layouts);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_layouts)) __PYX_ERR(0, 1013, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_host);
  __Pyx_GIVEREF(__pyx_v_host);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_host)) __PYX_ERR(0, 1013, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_port);
  __Pyx_GIVEREF(__pyx_v_port);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_v_port)) __PYX_ERR(0, 1013, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_verbose);
  __Pyx_GIVEREF(__pyx_v_verbose);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_v_verbose)) __PYX_ERR(0, 1013, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_compress);
  __Pyx_GIVEREF(__pyx_v_compress);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_v_compress)) __PYX_ERR(0, 1013, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_keep_server);
  __Pyx_GIVEREF(__pyx_v_keep_server);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 7, __pyx_v_keep_server)) __PYX_ERR(0, 1013, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_open_browser);
  __Pyx_GIVEREF(__pyx_v_open_browser);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 8, __pyx_v_open_browser)) __PYX_ERR(0, 1013, __pyx_L1_error);

  /* "ete4/core/tree.pyx":1016
 *                          host, port, verbose,
 *                          compress, keep_server, open_browser,
 *                          **kwargs)             # <<<<<<<<<<<<<<
 * 
 *     def render_sm(self, file_name, layouts=None, w=None, h=None):
 */
  __pyx_t_3 = PyDict_Copy(__pyx_v_kwargs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1016, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "ete4/core/tree.pyx":1013
 *         from ..smartview import explorer
 * 
 *         explorer.explore(self, name, layouts,             # <<<<<<<<<<<<<<
 *                          host, port, verbose,
 *                          compress, keep_server, open_browser,
 */
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1013, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ete4/core/tree.pyx":1000
 *             print('Wrote file:', file_name)
 * 
 *     def explore(self, name=None, layouts=None,             # <<<<<<<<<<<<<<
 *                 host='127.0.0.1', port=None, verbose=False,
 *                 compress=False, keep_server=False, open_browser=True,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("ete4.core.tree.Tree.explore", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_explorer);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ete4/core/tree.pyx":1018
 *                          **kwargs)
 * 
 *     def render_sm(self, file_name, layouts=None, w=None, h=None):             # <<<<<<<<<<<<<<
 *         """Save an image with the contents of the tree."""
 *         import time
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_124render_sm(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_4ete4_4core_4tree_4Tree_123render_sm, "Tree.render_sm(self, file_name, layouts=None, w=None, h=None)\nSave an image with the contents of the tree.");
static PyMethodDef __pyx_mdef_4ete4_4core_4tree_4Tree_124render_sm = {"render_sm", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_124render_sm, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_123render_sm};
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_124render_sm(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_file_name = 0;
  PyObject *__pyx_v_layouts = 0;
  PyObject *__pyx_v_w = 0;
  PyObject *__pyx_v_h = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("render_sm (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_file_name,&__pyx_n_s_layouts,&__pyx_n_s_w,&__pyx_n_s_h,0};
    values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_file_name)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1018, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_layouts);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1018, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_w);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1018, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_h);
          if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1018, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "render_sm") < 0)) __PYX_ERR(0, 1018, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_file_name = values[0];
    __pyx_v_layouts = values[1];
    __pyx_v_w = values[2];
    __pyx_v_h = values[3];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("render_sm", 0, 1, 4, __pyx_nargs); __PYX_ERR(0, 1018, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("ete4.core.tree.Tree.render_sm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_123render_sm(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self), __pyx_v_file_name, __pyx_v_layouts, __pyx_v_w, __pyx_v_h);

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

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_123render_sm(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_file_name, PyObject *__pyx_v_layouts, PyObject *__pyx_v_w, PyObject *__pyx_v_h) {
  PyObject *__pyx_v_time = NULL;
  PyObject *__pyx_v_explorer = NULL;
  PyObject *__pyx_v_webdriver = NULL;
  PyObject *__pyx_v_Options = NULL;
  PyObject *__pyx_v_warn = NULL;
  PyObject *__pyx_v_name = NULL;
  PyObject *__pyx_v_thread = NULL;
  PyObject *__pyx_v_server = NULL;
  PyObject *__pyx_v_options = NULL;
  PyObject *__pyx_v_driver = NULL;
  PyObject *__pyx_v_host = NULL;
  PyObject *__pyx_v_port = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  unsigned int __pyx_t_11;
  PyObject *(*__pyx_t_12)(PyObject *);
  int __pyx_t_13;
  double __pyx_t_14;
  long __pyx_t_15;
  double __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_UCS4 __pyx_t_18;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("render_sm", 0);
  __Pyx_INCREF(__pyx_v_w);
  __Pyx_INCREF(__pyx_v_h);

  /* "ete4/core/tree.pyx":1020
 *     def render_sm(self, file_name, layouts=None, w=None, h=None):
 *         """Save an image with the contents of the tree."""
 *         import time             # <<<<<<<<<<<<<<
 *         from ..smartview import explorer
 *         try:
 */
  __pyx_t_1 = __Pyx_ImportDottedModule(__pyx_n_s_time, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1020, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_time = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "ete4/core/tree.pyx":1021
 *         """Save an image with the contents of the tree."""
 *         import time
 *         from ..smartview import explorer             # <<<<<<<<<<<<<<
 *         try:
 *             from selenium import webdriver
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1021, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_explorer);
  __Pyx_GIVEREF(__pyx_n_s_explorer);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_explorer)) __PYX_ERR(0, 1021, __pyx_L1_error);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_smartview, __pyx_t_1, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1021, __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_explorer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1021, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_explorer = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ete4/core/tree.pyx":1022
 *         import time
 *         from ..smartview import explorer
 *         try:             # <<<<<<<<<<<<<<
 *             from selenium import webdriver
 *             from selenium.webdriver.chrome.options import Options
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "ete4/core/tree.pyx":1023
 *         from ..smartview import explorer
 *         try:
 *             from selenium import webdriver             # <<<<<<<<<<<<<<
 *             from selenium.webdriver.chrome.options import Options
 *         except ModuleNotFoundError:
 */
      __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1023, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_n_s_webdriver);
      __Pyx_GIVEREF(__pyx_n_s_webdriver);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_webdriver)) __PYX_ERR(0, 1023, __pyx_L3_error);
      __pyx_t_1 = __Pyx_Import(__pyx_n_s_selenium, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1023, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_webdriver); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1023, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_2);
      __pyx_v_webdriver = __pyx_t_2;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "ete4/core/tree.pyx":1024
 *         try:
 *             from selenium import webdriver
 *             from selenium.webdriver.chrome.options import Options             # <<<<<<<<<<<<<<
 *         except ModuleNotFoundError:
 *             from warnings import warn
 */
      __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1024, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_n_s_Options);
      __Pyx_GIVEREF(__pyx_n_s_Options);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Options)) __PYX_ERR(0, 1024, __pyx_L3_error);
      __pyx_t_2 = __Pyx_Import(__pyx_n_s_selenium_webdriver_chrome_option, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1024, __pyx_L3_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_Options); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1024, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_v_Options = __pyx_t_1;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "ete4/core/tree.pyx":1022
 *         import time
 *         from ..smartview import explorer
 *         try:             # <<<<<<<<<<<<<<
 *             from selenium import webdriver
 *             from selenium.webdriver.chrome.options import Options
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "ete4/core/tree.pyx":1025
 *             from selenium import webdriver
 *             from selenium.webdriver.chrome.options import Options
 *         except ModuleNotFoundError:             # <<<<<<<<<<<<<<
 *             from warnings import warn
 *             warn('Cannot render image - missing module "selenium"')
 */
    __Pyx_ErrFetch(&__pyx_t_2, &__pyx_t_1, &__pyx_t_6);
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_ModuleNotFoundError); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1025, __pyx_L5_except_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_2, __pyx_t_7);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_ErrRestore(__pyx_t_2, __pyx_t_1, __pyx_t_6);
    __pyx_t_2 = 0; __pyx_t_1 = 0; __pyx_t_6 = 0;
    if (__pyx_t_8) {
      __Pyx_AddTraceback("ete4.core.tree.Tree.render_sm", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_1, &__pyx_t_2) < 0) __PYX_ERR(0, 1025, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_1);
      __Pyx_XGOTREF(__pyx_t_2);

      /* "ete4/core/tree.pyx":1026
 *             from selenium.webdriver.chrome.options import Options
 *         except ModuleNotFoundError:
 *             from warnings import warn             # <<<<<<<<<<<<<<
 *             warn('Cannot render image - missing module "selenium"')
 *             return
 */
      __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1026, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_n_s_warn);
      __Pyx_GIVEREF(__pyx_n_s_warn);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 0, __pyx_n_s_warn)) __PYX_ERR(0, 1026, __pyx_L5_except_error);
      __pyx_t_9 = __Pyx_Import(__pyx_n_s_warnings, __pyx_t_7, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1026, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_ImportFrom(__pyx_t_9, __pyx_n_s_warn); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1026, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_7);
      __pyx_v_warn = __pyx_t_7;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

      /* "ete4/core/tree.pyx":1027
 *         except ModuleNotFoundError:
 *             from warnings import warn
 *             warn('Cannot render image - missing module "selenium"')             # <<<<<<<<<<<<<<
 *             return
 * 
 */
      __Pyx_INCREF(__pyx_v_warn);
      __pyx_t_7 = __pyx_v_warn; __pyx_t_10 = NULL;
      __pyx_t_11 = 0;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_10)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_11 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_kp_u_Cannot_render_image_missing_modu};
        __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_11, 1+__pyx_t_11);
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1027, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

      /* "ete4/core/tree.pyx":1028
 *             from warnings import warn
 *             warn('Cannot render image - missing module "selenium"')
 *             return             # <<<<<<<<<<<<<<
 * 
 *         # Add tree and start a server.
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L6_except_return;
    }
    goto __pyx_L5_except_error;

    /* "ete4/core/tree.pyx":1022
 *         import time
 *         from ..smartview import explorer
 *         try:             # <<<<<<<<<<<<<<
 *             from selenium import webdriver
 *             from selenium.webdriver.chrome.options import Options
 */
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L0;
    __pyx_L8_try_end:;
  }

  /* "ete4/core/tree.pyx":1031
 * 
 *         # Add tree and start a server.
 *         name = explorer.add_tree(self, layouts=layouts)             # <<<<<<<<<<<<<<
 *         thread, server = explorer.start_server()
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_explorer, __pyx_n_s_add_tree); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1031, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1031, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self))) __PYX_ERR(0, 1031, __pyx_L1_error);
  __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1031, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_layouts, __pyx_v_layouts) < 0) __PYX_ERR(0, 1031, __pyx_L1_error)
  __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1031, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_name = __pyx_t_9;
  __pyx_t_9 = 0;

  /* "ete4/core/tree.pyx":1032
 *         # Add tree and start a server.
 *         name = explorer.add_tree(self, layouts=layouts)
 *         thread, server = explorer.start_server()             # <<<<<<<<<<<<<<
 * 
 *         # Use selenium to make a screenshot.
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_explorer, __pyx_n_s_start_server); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1032, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = NULL;
  __pyx_t_11 = 0;
  #if CYTHON_UNPACK_METHODS
  if (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_11 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
    __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_11, 0+__pyx_t_11);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1032, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  if ((likely(PyTuple_CheckExact(__pyx_t_9))) || (PyList_CheckExact(__pyx_t_9))) {
    PyObject* sequence = __pyx_t_9;
    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, 1032, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_6 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_t_1);
    #else
    __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1032, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1032, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    #endif
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_2 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1032, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_12 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2);
    index = 0; __pyx_t_6 = __pyx_t_12(__pyx_t_2); if (unlikely(!__pyx_t_6)) goto __pyx_L11_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_6);
    index = 1; __pyx_t_1 = __pyx_t_12(__pyx_t_2); if (unlikely(!__pyx_t_1)) goto __pyx_L11_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_2), 2) < 0) __PYX_ERR(0, 1032, __pyx_L1_error)
    __pyx_t_12 = NULL;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L12_unpacking_done;
    __pyx_L11_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_12 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 1032, __pyx_L1_error)
    __pyx_L12_unpacking_done:;
  }
  __pyx_v_thread = __pyx_t_6;
  __pyx_t_6 = 0;
  __pyx_v_server = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "ete4/core/tree.pyx":1035
 * 
 *         # Use selenium to make a screenshot.
 *         w = w or 2560  # width             # <<<<<<<<<<<<<<
 *         if h is None:
 *             h = max(200, 10 * self.size[1])  # 10 pixels per leaf
 */
  __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_v_w); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 1035, __pyx_L1_error)
  if (!__pyx_t_13) {
  } else {
    __Pyx_INCREF(__pyx_v_w);
    __pyx_t_9 = __pyx_v_w;
    goto __pyx_L13_bool_binop_done;
  }
  __pyx_t_1 = __Pyx_PyInt_From_long(0xA00); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1035, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_9 = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_L13_bool_binop_done:;
  __Pyx_DECREF_SET(__pyx_v_w, __pyx_t_9);
  __pyx_t_9 = 0;

  /* "ete4/core/tree.pyx":1036
 *         # Use selenium to make a screenshot.
 *         w = w or 2560  # width
 *         if h is None:             # <<<<<<<<<<<<<<
 *             h = max(200, 10 * self.size[1])  # 10 pixels per leaf
 * 
 */
  __pyx_t_13 = (__pyx_v_h == Py_None);
  if (__pyx_t_13) {

    /* "ete4/core/tree.pyx":1037
 *         w = w or 2560  # width
 *         if h is None:
 *             h = max(200, 10 * self.size[1])  # 10 pixels per leaf             # <<<<<<<<<<<<<<
 * 
 *         options = Options()
 */
    __pyx_t_14 = (10.0 * __pyx_v_self->size.f1);
    __pyx_t_15 = 0xC8;
    __pyx_t_13 = (__pyx_t_14 > __pyx_t_15);
    if (__pyx_t_13) {
      __pyx_t_16 = __pyx_t_14;
    } else {
      __pyx_t_16 = __pyx_t_15;
    }
    __pyx_t_9 = PyFloat_FromDouble(__pyx_t_16); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1037, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF_SET(__pyx_v_h, __pyx_t_9);
    __pyx_t_9 = 0;

    /* "ete4/core/tree.pyx":1036
 *         # Use selenium to make a screenshot.
 *         w = w or 2560  # width
 *         if h is None:             # <<<<<<<<<<<<<<
 *             h = max(200, 10 * self.size[1])  # 10 pixels per leaf
 * 
 */
  }

  /* "ete4/core/tree.pyx":1039
 *             h = max(200, 10 * self.size[1])  # 10 pixels per leaf
 * 
 *         options = Options()             # <<<<<<<<<<<<<<
 *         options.add_argument('--headless')  # do not display anything
 *         options.add_argument(f'--window-size={w},{h}')  # set window size
 */
  __Pyx_INCREF(__pyx_v_Options);
  __pyx_t_1 = __pyx_v_Options; __pyx_t_6 = NULL;
  __pyx_t_11 = 0;
  #if CYTHON_UNPACK_METHODS
  if (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_11 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
    __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_11, 0+__pyx_t_11);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1039, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_v_options = __pyx_t_9;
  __pyx_t_9 = 0;

  /* "ete4/core/tree.pyx":1040
 * 
 *         options = Options()
 *         options.add_argument('--headless')  # do not display anything             # <<<<<<<<<<<<<<
 *         options.add_argument(f'--window-size={w},{h}')  # set window size
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_options, __pyx_n_s_add_argument); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1040, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = NULL;
  __pyx_t_11 = 0;
  #if CYTHON_UNPACK_METHODS
  if (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_11 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_kp_u_headless};
    __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_11, 1+__pyx_t_11);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1040, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

  /* "ete4/core/tree.pyx":1041
 *         options = Options()
 *         options.add_argument('--headless')  # do not display anything
 *         options.add_argument(f'--window-size={w},{h}')  # set window size             # <<<<<<<<<<<<<<
 * 
 *         options.add_argument('--disable-logging')         # try not to send
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_options, __pyx_n_s_add_argument); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1041, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1041, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_17 = 0;
  __pyx_t_18 = 127;
  __Pyx_INCREF(__pyx_kp_u_window_size);
  __pyx_t_17 += 14;
  __Pyx_GIVEREF(__pyx_kp_u_window_size);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_kp_u_window_size);
  __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_w, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1041, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_18 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_18) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_18;
  __pyx_t_17 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2);
  __pyx_t_2 = 0;
  __Pyx_INCREF(__pyx_kp_u__22);
  __pyx_t_17 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__22);
  PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_kp_u__22);
  __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_h, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1041, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_18 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_18) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_18;
  __pyx_t_17 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_6, 4, __pyx_t_17, __pyx_t_18); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1041, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  __pyx_t_11 = 0;
  #if CYTHON_UNPACK_METHODS
  if (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_11 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_2};
    __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_11, 1+__pyx_t_11);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1041, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

  /* "ete4/core/tree.pyx":1043
 *         options.add_argument(f'--window-size={w},{h}')  # set window size
 * 
 *         options.add_argument('--disable-logging')         # try not to send             # <<<<<<<<<<<<<<
 *         options.add_argument('--disable-breakpad')        # any report to the
 *         options.add_argument('--metrics-recording-only')  # chrome website
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_options, __pyx_n_s_add_argument); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1043, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = NULL;
  __pyx_t_11 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
      __pyx_t_11 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_kp_u_disable_logging};
    __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_11, 1+__pyx_t_11);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1043, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

  /* "ete4/core/tree.pyx":1044
 * 
 *         options.add_argument('--disable-logging')         # try not to send
 *         options.add_argument('--disable-breakpad')        # any report to the             # <<<<<<<<<<<<<<
 *         options.add_argument('--metrics-recording-only')  # chrome website
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_options, __pyx_n_s_add_argument); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1044, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = NULL;
  __pyx_t_11 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
      __pyx_t_11 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_kp_u_disable_breakpad};
    __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_11, 1+__pyx_t_11);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1044, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

  /* "ete4/core/tree.pyx":1045
 *         options.add_argument('--disable-logging')         # try not to send
 *         options.add_argument('--disable-breakpad')        # any report to the
 *         options.add_argument('--metrics-recording-only')  # chrome website             # <<<<<<<<<<<<<<
 * 
 *         driver = webdriver.Chrome(options=options)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_options, __pyx_n_s_add_argument); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1045, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = NULL;
  __pyx_t_11 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
      __pyx_t_11 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_kp_u_metrics_recording_only};
    __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_11, 1+__pyx_t_11);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1045, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

  /* "ete4/core/tree.pyx":1047
 *         options.add_argument('--metrics-recording-only')  # chrome website
 * 
 *         driver = webdriver.Chrome(options=options)             # <<<<<<<<<<<<<<
 * 
 *         host, port = server.server_address
 */
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_webdriver, __pyx_n_s_Chrome); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1047, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1047, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_options, __pyx_v_options) < 0) __PYX_ERR(0, 1047, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1047, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_driver = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "ete4/core/tree.pyx":1049
 *         driver = webdriver.Chrome(options=options)
 * 
 *         host, port = server.server_address             # <<<<<<<<<<<<<<
 *         driver.get(f'http://{host}:{port}/static/gui.html?tree={name}')
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_server, __pyx_n_s_server_address); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1049, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
    PyObject* sequence = __pyx_t_2;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 1049, __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_9 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_9 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_9);
    #else
    __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1049, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1049, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    #endif
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_6 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1049, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_12 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6);
    index = 0; __pyx_t_1 = __pyx_t_12(__pyx_t_6); if (unlikely(!__pyx_t_1)) goto __pyx_L16_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 1; __pyx_t_9 = __pyx_t_12(__pyx_t_6); if (unlikely(!__pyx_t_9)) goto __pyx_L16_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_9);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_6), 2) < 0) __PYX_ERR(0, 1049, __pyx_L1_error)
    __pyx_t_12 = NULL;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    goto __pyx_L17_unpacking_done;
    __pyx_L16_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_12 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 1049, __pyx_L1_error)
    __pyx_L17_unpacking_done:;
  }
  __pyx_v_host = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_port = __pyx_t_9;
  __pyx_t_9 = 0;

  /* "ete4/core/tree.pyx":1050
 * 
 *         host, port = server.server_address
 *         driver.get(f'http://{host}:{port}/static/gui.html?tree={name}')             # <<<<<<<<<<<<<<
 * 
 *         time.sleep(2)  # wait, kind of a hack
 */
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_driver, __pyx_n_s_get); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1050, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_1 = PyTuple_New(6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1050, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_17 = 0;
  __pyx_t_18 = 127;
  __Pyx_INCREF(__pyx_kp_u_http);
  __pyx_t_17 += 7;
  __Pyx_GIVEREF(__pyx_kp_u_http);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_http);
  __pyx_t_6 = __Pyx_PyObject_FormatSimple(__pyx_v_host, __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1050, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_18 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_18) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_18;
  __pyx_t_17 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_6);
  __pyx_t_6 = 0;
  __Pyx_INCREF(__pyx_kp_u__23);
  __pyx_t_17 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__23);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u__23);
  __pyx_t_6 = __Pyx_PyObject_FormatSimple(__pyx_v_port, __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1050, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_18 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_18) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_18;
  __pyx_t_17 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_6);
  __pyx_t_6 = 0;
  __Pyx_INCREF(__pyx_kp_u_static_gui_html_tree);
  __pyx_t_17 += 22;
  __Pyx_GIVEREF(__pyx_kp_u_static_gui_html_tree);
  PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u_static_gui_html_tree);
  __pyx_t_6 = __Pyx_PyObject_FormatSimple(__pyx_v_name, __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1050, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_18 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_18) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_18;
  __pyx_t_17 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_t_6);
  __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_1, 6, __pyx_t_17, __pyx_t_18); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1050, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = NULL;
  __pyx_t_11 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_9))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_9);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_9, function);
      __pyx_t_11 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_6};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_11, 1+__pyx_t_11);
    __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, 1050, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ete4/core/tree.pyx":1052
 *         driver.get(f'http://{host}:{port}/static/gui.html?tree={name}')
 * 
 *         time.sleep(2)  # wait, kind of a hack             # <<<<<<<<<<<<<<
 * 
 *         driver.save_screenshot(file_name)
 */
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_time, __pyx_n_s_sleep); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1052, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_6 = NULL;
  __pyx_t_11 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_9))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_9);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_9, function);
      __pyx_t_11 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_int_2};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_11, 1+__pyx_t_11);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1052, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ete4/core/tree.pyx":1054
 *         time.sleep(2)  # wait, kind of a hack
 * 
 *         driver.save_screenshot(file_name)             # <<<<<<<<<<<<<<
 * 
 *         driver.quit()
 */
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_driver, __pyx_n_s_save_screenshot); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1054, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_6 = NULL;
  __pyx_t_11 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_9))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_9);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_9, function);
      __pyx_t_11 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_file_name};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_11, 1+__pyx_t_11);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1054, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ete4/core/tree.pyx":1056
 *         driver.save_screenshot(file_name)
 * 
 *         driver.quit()             # <<<<<<<<<<<<<<
 * 
 *         # Stop the server, close its thread, and remove the tree.
 */
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_driver, __pyx_n_s_quit); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1056, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_6 = NULL;
  __pyx_t_11 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_9))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_9);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_9, function);
      __pyx_t_11 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_11, 0+__pyx_t_11);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1056, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ete4/core/tree.pyx":1059
 * 
 *         # Stop the server, close its thread, and remove the tree.
 *         server.server_close()             # <<<<<<<<<<<<<<
 *         server.shutdown()
 *         thread.join()
 */
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_server, __pyx_n_s_server_close); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1059, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_6 = NULL;
  __pyx_t_11 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_9))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_9);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_9, function);
      __pyx_t_11 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_11, 0+__pyx_t_11);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1059, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ete4/core/tree.pyx":1060
 *         # Stop the server, close its thread, and remove the tree.
 *         server.server_close()
 *         server.shutdown()             # <<<<<<<<<<<<<<
 *         thread.join()
 * 
 */
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_server, __pyx_n_s_shutdown); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1060, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_6 = NULL;
  __pyx_t_11 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_9))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_9);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_9, function);
      __pyx_t_11 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_11, 0+__pyx_t_11);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1060, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ete4/core/tree.pyx":1061
 *         server.server_close()
 *         server.shutdown()
 *         thread.join()             # <<<<<<<<<<<<<<
 * 
 *         explorer.remove_tree(name)
 */
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_thread, __pyx_n_s_join); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1061, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_6 = NULL;
  __pyx_t_11 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_9))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_9);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_9, function);
      __pyx_t_11 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_11, 0+__pyx_t_11);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1061, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ete4/core/tree.pyx":1063
 *         thread.join()
 * 
 *         explorer.remove_tree(name)             # <<<<<<<<<<<<<<
 * 
 *     def copy(self, method="cpickle"):
 */
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_explorer, __pyx_n_s_remove_tree); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1063, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_6 = NULL;
  __pyx_t_11 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_9))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_9);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_9, function);
      __pyx_t_11 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_name};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_11, 1+__pyx_t_11);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1063, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ete4/core/tree.pyx":1018
 *                          **kwargs)
 * 
 *     def render_sm(self, file_name, layouts=None, w=None, h=None):             # <<<<<<<<<<<<<<
 *         """Save an image with the contents of the tree."""
 *         import time
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("ete4.core.tree.Tree.render_sm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_time);
  __Pyx_XDECREF(__pyx_v_explorer);
  __Pyx_XDECREF(__pyx_v_webdriver);
  __Pyx_XDECREF(__pyx_v_Options);
  __Pyx_XDECREF(__pyx_v_warn);
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XDECREF(__pyx_v_thread);
  __Pyx_XDECREF(__pyx_v_server);
  __Pyx_XDECREF(__pyx_v_options);
  __Pyx_XDECREF(__pyx_v_driver);
  __Pyx_XDECREF(__pyx_v_host);
  __Pyx_XDECREF(__pyx_v_port);
  __Pyx_XDECREF(__pyx_v_w);
  __Pyx_XDECREF(__pyx_v_h);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ete4/core/tree.pyx":1065
 *         explorer.remove_tree(name)
 * 
 *     def copy(self, method="cpickle"):             # <<<<<<<<<<<<<<
 *         """Return a copy of the current node.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_126copy(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_4ete4_4core_4tree_4Tree_125copy, "Tree.copy(self, method=u'cpickle')\nReturn a copy of the current node.\n\n        :param method: Protocol used to copy the node structure.\n\n        The following values are accepted for the method:\n\n        - \"newick\": Tree topology, node names, branch lengths and\n           branch support values will be copied by as represented in\n           the newick string (copy by newick string serialisation).\n        - \"newick-extended\": Tree topology and all node properties\n           will be copied based on the extended newick format\n           representation. Only node properties will be copied, thus\n           excluding other node attributes. As this method is also\n           based on newick serialisation, properties will be converted\n           into text strings when making the copy.\n        - \"cpickle\": The whole node structure and its content is\n           cloned based on cPickle object serialisation (slower, but\n           recommended for full tree copying)\n        - \"deepcopy\": The whole node structure and its content is\n           copied based on the standard \"copy\" Python functionality\n           (this is the slowest method but it allows to copy complex\n           objects even if attributes point to lambda functions, etc.)\n        ");
static PyMethodDef __pyx_mdef_4ete4_4core_4tree_4Tree_126copy = {"copy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_126copy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_125copy};
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_126copy(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_method = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("copy (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_method,0};
    values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_n_u_cpickle));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_method);
          if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1065, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "copy") < 0)) __PYX_ERR(0, 1065, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_method = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("copy", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 1065, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("ete4.core.tree.Tree.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_125copy(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self), __pyx_v_method);

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

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_125copy(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_method) {
  PyObject *__pyx_v_new_node = NULL;
  struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_parent = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("copy", 0);
  __Pyx_INCREF(__pyx_v_method);

  /* "ete4/core/tree.pyx":1089
 *            objects even if attributes point to lambda functions, etc.)
 *         """
 *         method = method.lower()             # <<<<<<<<<<<<<<
 *         if method=="newick":
 *             new_node = self.__class__(self.write(format_root_node=True,
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_method, __pyx_n_s_lower); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1089, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1089, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF_SET(__pyx_v_method, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "ete4/core/tree.pyx":1090
 *         """
 *         method = method.lower()
 *         if method=="newick":             # <<<<<<<<<<<<<<
 *             new_node = self.__class__(self.write(format_root_node=True,
 *                                                  parser=1), parser=1)
 */
  __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_v_method, __pyx_n_u_newick, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1090, __pyx_L1_error)
  if (__pyx_t_5) {

    /* "ete4/core/tree.pyx":1091
 *         method = method.lower()
 *         if method=="newick":
 *             new_node = self.__class__(self.write(format_root_node=True,             # <<<<<<<<<<<<<<
 *                                                  parser=1), parser=1)
 *         elif method=="newick-extended":
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1091, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_write); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1091, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1091, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_format_root_node, Py_True) < 0) __PYX_ERR(0, 1091, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_parser, __pyx_int_1) < 0) __PYX_ERR(0, 1091, __pyx_L1_error)
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1091, __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_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1091, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_6);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6)) __PYX_ERR(0, 1091, __pyx_L1_error);
    __pyx_t_6 = 0;

    /* "ete4/core/tree.pyx":1092
 *         if method=="newick":
 *             new_node = self.__class__(self.write(format_root_node=True,
 *                                                  parser=1), parser=1)             # <<<<<<<<<<<<<<
 *         elif method=="newick-extended":
 *             new_node = self.__class__(self.write(props=None))
 */
    __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1092, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_parser, __pyx_int_1) < 0) __PYX_ERR(0, 1092, __pyx_L1_error)

    /* "ete4/core/tree.pyx":1091
 *         method = method.lower()
 *         if method=="newick":
 *             new_node = self.__class__(self.write(format_root_node=True,             # <<<<<<<<<<<<<<
 *                                                  parser=1), parser=1)
 *         elif method=="newick-extended":
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1091, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_new_node = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "ete4/core/tree.pyx":1090
 *         """
 *         method = method.lower()
 *         if method=="newick":             # <<<<<<<<<<<<<<
 *             new_node = self.__class__(self.write(format_root_node=True,
 *                                                  parser=1), parser=1)
 */
    goto __pyx_L3;
  }

  /* "ete4/core/tree.pyx":1093
 *             new_node = self.__class__(self.write(format_root_node=True,
 *                                                  parser=1), parser=1)
 *         elif method=="newick-extended":             # <<<<<<<<<<<<<<
 *             new_node = self.__class__(self.write(props=None))
 *         elif method == "deepcopy":
 */
  __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_v_method, __pyx_kp_u_newick_extended, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1093, __pyx_L1_error)
  if (__pyx_t_5) {

    /* "ete4/core/tree.pyx":1094
 *                                                  parser=1), parser=1)
 *         elif method=="newick-extended":
 *             new_node = self.__class__(self.write(props=None))             # <<<<<<<<<<<<<<
 *         elif method == "deepcopy":
 *             parent = self.up
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1094, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_write); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1094, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1094, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_props, Py_None) < 0) __PYX_ERR(0, 1094, __pyx_L1_error)
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1094, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = NULL;
    __pyx_t_4 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_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_4 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_7};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1094, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __pyx_v_new_node = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "ete4/core/tree.pyx":1093
 *             new_node = self.__class__(self.write(format_root_node=True,
 *                                                  parser=1), parser=1)
 *         elif method=="newick-extended":             # <<<<<<<<<<<<<<
 *             new_node = self.__class__(self.write(props=None))
 *         elif method == "deepcopy":
 */
    goto __pyx_L3;
  }

  /* "ete4/core/tree.pyx":1095
 *         elif method=="newick-extended":
 *             new_node = self.__class__(self.write(props=None))
 *         elif method == "deepcopy":             # <<<<<<<<<<<<<<
 *             parent = self.up
 *             self.up = None
 */
  __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_v_method, __pyx_n_u_deepcopy, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1095, __pyx_L1_error)
  if (__pyx_t_5) {

    /* "ete4/core/tree.pyx":1096
 *             new_node = self.__class__(self.write(props=None))
 *         elif method == "deepcopy":
 *             parent = self.up             # <<<<<<<<<<<<<<
 *             self.up = None
 *             new_node = copy.deepcopy(self)
 */
    __pyx_t_2 = ((PyObject *)__pyx_v_self->up);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_v_parent = ((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "ete4/core/tree.pyx":1097
 *         elif method == "deepcopy":
 *             parent = self.up
 *             self.up = None             # <<<<<<<<<<<<<<
 *             new_node = copy.deepcopy(self)
 *             self.up = parent
 */
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    __Pyx_GOTREF((PyObject *)__pyx_v_self->up);
    __Pyx_DECREF((PyObject *)__pyx_v_self->up);
    __pyx_v_self->up = ((struct __pyx_obj_4ete4_4core_4tree_Tree *)Py_None);

    /* "ete4/core/tree.pyx":1098
 *             parent = self.up
 *             self.up = None
 *             new_node = copy.deepcopy(self)             # <<<<<<<<<<<<<<
 *             self.up = parent
 *         elif method == "cpickle":
 */
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_copy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1098, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_deepcopy); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1098, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    __pyx_t_4 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_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_4 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, ((PyObject *)__pyx_v_self)};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1098, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __pyx_v_new_node = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "ete4/core/tree.pyx":1099
 *             self.up = None
 *             new_node = copy.deepcopy(self)
 *             self.up = parent             # <<<<<<<<<<<<<<
 *         elif method == "cpickle":
 *             parent = self.up
 */
    __Pyx_INCREF((PyObject *)__pyx_v_parent);
    __Pyx_GIVEREF((PyObject *)__pyx_v_parent);
    __Pyx_GOTREF((PyObject *)__pyx_v_self->up);
    __Pyx_DECREF((PyObject *)__pyx_v_self->up);
    __pyx_v_self->up = __pyx_v_parent;

    /* "ete4/core/tree.pyx":1095
 *         elif method=="newick-extended":
 *             new_node = self.__class__(self.write(props=None))
 *         elif method == "deepcopy":             # <<<<<<<<<<<<<<
 *             parent = self.up
 *             self.up = None
 */
    goto __pyx_L3;
  }

  /* "ete4/core/tree.pyx":1100
 *             new_node = copy.deepcopy(self)
 *             self.up = parent
 *         elif method == "cpickle":             # <<<<<<<<<<<<<<
 *             parent = self.up
 *             self.up = None
 */
  __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_v_method, __pyx_n_u_cpickle, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1100, __pyx_L1_error)
  if (likely(__pyx_t_5)) {

    /* "ete4/core/tree.pyx":1101
 *             self.up = parent
 *         elif method == "cpickle":
 *             parent = self.up             # <<<<<<<<<<<<<<
 *             self.up = None
 *             new_node = pickle.loads(pickle.dumps(self, 2))
 */
    __pyx_t_2 = ((PyObject *)__pyx_v_self->up);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_v_parent = ((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "ete4/core/tree.pyx":1102
 *         elif method == "cpickle":
 *             parent = self.up
 *             self.up = None             # <<<<<<<<<<<<<<
 *             new_node = pickle.loads(pickle.dumps(self, 2))
 *             self.up = parent
 */
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    __Pyx_GOTREF((PyObject *)__pyx_v_self->up);
    __Pyx_DECREF((PyObject *)__pyx_v_self->up);
    __pyx_v_self->up = ((struct __pyx_obj_4ete4_4core_4tree_Tree *)Py_None);

    /* "ete4/core/tree.pyx":1103
 *             parent = self.up
 *             self.up = None
 *             new_node = pickle.loads(pickle.dumps(self, 2))             # <<<<<<<<<<<<<<
 *             self.up = parent
 *         else:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_pickle); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1103, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_loads); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1103, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_pickle); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1103, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_dumps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1103, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = NULL;
    __pyx_t_4 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_4 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_1, ((PyObject *)__pyx_v_self), __pyx_int_2};
      __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1103, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __pyx_t_3 = NULL;
    __pyx_t_4 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_4 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_7};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1103, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __pyx_v_new_node = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "ete4/core/tree.pyx":1104
 *             self.up = None
 *             new_node = pickle.loads(pickle.dumps(self, 2))
 *             self.up = parent             # <<<<<<<<<<<<<<
 *         else:
 *             raise TreeError("Invalid copy method")
 */
    __Pyx_INCREF((PyObject *)__pyx_v_parent);
    __Pyx_GIVEREF((PyObject *)__pyx_v_parent);
    __Pyx_GOTREF((PyObject *)__pyx_v_self->up);
    __Pyx_DECREF((PyObject *)__pyx_v_self->up);
    __pyx_v_self->up = __pyx_v_parent;

    /* "ete4/core/tree.pyx":1100
 *             new_node = copy.deepcopy(self)
 *             self.up = parent
 *         elif method == "cpickle":             # <<<<<<<<<<<<<<
 *             parent = self.up
 *             self.up = None
 */
    goto __pyx_L3;
  }

  /* "ete4/core/tree.pyx":1106
 *             self.up = parent
 *         else:
 *             raise TreeError("Invalid copy method")             # <<<<<<<<<<<<<<
 * 
 *         return new_node
 */
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_TreeError); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1106, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    __pyx_t_4 = 0;
    #if CYTHON_UNPACK_METHODS
    if (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_4 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_kp_u_Invalid_copy_method};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1106, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 1106, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "ete4/core/tree.pyx":1108
 *             raise TreeError("Invalid copy method")
 * 
 *         return new_node             # <<<<<<<<<<<<<<
 * 
 *     def ladderize(self, topological=False, reverse=False):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_new_node);
  __pyx_r = __pyx_v_new_node;
  goto __pyx_L0;

  /* "ete4/core/tree.pyx":1065
 *         explorer.remove_tree(name)
 * 
 *     def copy(self, method="cpickle"):             # <<<<<<<<<<<<<<
 *         """Return a copy of the current node.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("ete4.core.tree.Tree.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_new_node);
  __Pyx_XDECREF((PyObject *)__pyx_v_parent);
  __Pyx_XDECREF(__pyx_v_method);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ete4/core/tree.pyx":1110
 *         return new_node
 * 
 *     def ladderize(self, topological=False, reverse=False):             # <<<<<<<<<<<<<<
 *         """Sort branches according to the size of each partition."""
 *         ops.ladderize(self, topological, reverse)
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_128ladderize(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_4ete4_4core_4tree_4Tree_127ladderize, "Tree.ladderize(self, topological=False, reverse=False)\nSort branches according to the size of each partition.");
static PyMethodDef __pyx_mdef_4ete4_4core_4tree_4Tree_128ladderize = {"ladderize", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_128ladderize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_127ladderize};
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_128ladderize(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_topological = 0;
  PyObject *__pyx_v_reverse = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ladderize (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_topological,&__pyx_n_s_reverse,0};
    values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_False));
    values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_False));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_topological);
          if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1110, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_reverse);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1110, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "ladderize") < 0)) __PYX_ERR(0, 1110, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_topological = values[0];
    __pyx_v_reverse = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ladderize", 0, 0, 2, __pyx_nargs); __PYX_ERR(0, 1110, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("ete4.core.tree.Tree.ladderize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_127ladderize(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self), __pyx_v_topological, __pyx_v_reverse);

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

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_127ladderize(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_topological, PyObject *__pyx_v_reverse) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ladderize", 1);

  /* "ete4/core/tree.pyx":1112
 *     def ladderize(self, topological=False, reverse=False):
 *         """Sort branches according to the size of each partition."""
 *         ops.ladderize(self, topological, reverse)             # <<<<<<<<<<<<<<
 * 
 *     def sort_descendants(self, prop='name'):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ops); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ladderize); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_2, ((PyObject *)__pyx_v_self), __pyx_v_topological, __pyx_v_reverse};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 3+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1112, __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;

  /* "ete4/core/tree.pyx":1110
 *         return new_node
 * 
 *     def ladderize(self, topological=False, reverse=False):             # <<<<<<<<<<<<<<
 *         """Sort branches according to the size of each partition."""
 *         ops.ladderize(self, topological, reverse)
 */

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

/* "ete4/core/tree.pyx":1114
 *         ops.ladderize(self, topological, reverse)
 * 
 *     def sort_descendants(self, prop='name'):             # <<<<<<<<<<<<<<
 *         """Sort branches by leaf node values (names or any other given prop)."""
 *         leaf_values = self.get_cached_content(prop, container_type=list)
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_130sort_descendants(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_4ete4_4core_4tree_4Tree_129sort_descendants, "Tree.sort_descendants(self, prop=u'name')\nSort branches by leaf node values (names or any other given prop).");
static PyMethodDef __pyx_mdef_4ete4_4core_4tree_4Tree_130sort_descendants = {"sort_descendants", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_130sort_descendants, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_129sort_descendants};
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_130sort_descendants(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_prop = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sort_descendants (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_prop,0};
    values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_n_u_name));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_prop);
          if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1114, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "sort_descendants") < 0)) __PYX_ERR(0, 1114, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_prop = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sort_descendants", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 1114, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("ete4.core.tree.Tree.sort_descendants", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_129sort_descendants(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self), __pyx_v_prop);

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

/* "ete4/core/tree.pyx":1117
 *         """Sort branches by leaf node values (names or any other given prop)."""
 *         leaf_values = self.get_cached_content(prop, container_type=list)
 *         ops.sort(self, key=lambda node: tuple(sorted(leaf_values[node])))             # <<<<<<<<<<<<<<
 * 
 *     def get_cached_content(self, prop=None, container_type=set,
 */

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

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

static PyObject *__pyx_lambda_funcdef_lambda11(PyObject *__pyx_self, PyObject *__pyx_v_node) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_24_sort_descendants *__pyx_cur_scope;
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_24_sort_descendants *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("lambda11", 1);
  __pyx_outer_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_24_sort_descendants *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_leaf_values)) { __Pyx_RaiseClosureNameError("leaf_values"); __PYX_ERR(0, 1117, __pyx_L1_error) }
  __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_cur_scope->__pyx_v_leaf_values, __pyx_v_node); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PySequence_List(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_1 = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_4 = PyList_Sort(__pyx_t_1); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 1117, __pyx_L1_error)
  __pyx_t_3 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("ete4.core.tree.Tree.sort_descendants.lambda11", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ete4/core/tree.pyx":1114
 *         ops.ladderize(self, topological, reverse)
 * 
 *     def sort_descendants(self, prop='name'):             # <<<<<<<<<<<<<<
 *         """Sort branches by leaf node values (names or any other given prop)."""
 *         leaf_values = self.get_cached_content(prop, container_type=list)
 */

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_129sort_descendants(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_prop) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_24_sort_descendants *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("sort_descendants", 0);
  __pyx_cur_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_24_sort_descendants *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_24_sort_descendants(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_24_sort_descendants, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_24_sort_descendants *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1114, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }

  /* "ete4/core/tree.pyx":1116
 *     def sort_descendants(self, prop='name'):
 *         """Sort branches by leaf node values (names or any other given prop)."""
 *         leaf_values = self.get_cached_content(prop, container_type=list)             # <<<<<<<<<<<<<<
 *         ops.sort(self, key=lambda node: tuple(sorted(leaf_values[node])))
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_cached_content); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1116, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1116, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_prop);
  __Pyx_GIVEREF(__pyx_v_prop);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_prop)) __PYX_ERR(0, 1116, __pyx_L1_error);
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1116, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_container_type, ((PyObject *)(&PyList_Type))) < 0) __PYX_ERR(0, 1116, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1116, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_cur_scope->__pyx_v_leaf_values = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "ete4/core/tree.pyx":1117
 *         """Sort branches by leaf node values (names or any other given prop)."""
 *         leaf_values = self.get_cached_content(prop, container_type=list)
 *         ops.sort(self, key=lambda node: tuple(sorted(leaf_values[node])))             # <<<<<<<<<<<<<<
 * 
 *     def get_cached_content(self, prop=None, container_type=set,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ops); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_sort); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_self))) __PYX_ERR(0, 1117, __pyx_L1_error);
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_16sort_descendants_lambda11, 0, __pyx_n_s_sort_descendants_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_ete4_core_tree, __pyx_d, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_key, __pyx_t_1) < 0) __PYX_ERR(0, 1117, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1117, __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_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ete4/core/tree.pyx":1114
 *         ops.ladderize(self, topological, reverse)
 * 
 *     def sort_descendants(self, prop='name'):             # <<<<<<<<<<<<<<
 *         """Sort branches by leaf node values (names or any other given prop)."""
 *         leaf_values = self.get_cached_content(prop, container_type=list)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("ete4.core.tree.Tree.sort_descendants", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ete4/core/tree.pyx":1119
 *         ops.sort(self, key=lambda node: tuple(sorted(leaf_values[node])))
 * 
 *     def get_cached_content(self, prop=None, container_type=set,             # <<<<<<<<<<<<<<
 *                            leaves_only=True):
 *         """Return dict that assigns to each node a set of its leaves.
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_132get_cached_content(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_4ete4_4core_4tree_4Tree_131get_cached_content, "Tree.get_cached_content(self, prop=None, container_type=set, leaves_only=True)\nReturn dict that assigns to each node a set of its leaves.\n\n        The dictionary serves as a cache for operations that require\n        many traversals of the nodes under this tree.\n\n        Instead of assigning a set, it can assign a list (with\n        ``container_type``). And instead of the leaves themselves, it\n        can be any of their properties (like their names, with ``prop``).\n\n        :param prop: Node property that should be cached (i.e.\n            name, distance, etc.). If None, it caches the node itself.\n        :param container_type: Type of container for the leaves (set, list).\n        :param leaves_only: If False, for each node it stores all its\n            descendant nodes, not only its leaves.\n        ");
static PyMethodDef __pyx_mdef_4ete4_4core_4tree_4Tree_132get_cached_content = {"get_cached_content", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_132get_cached_content, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_131get_cached_content};
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_132get_cached_content(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_prop = 0;
  PyObject *__pyx_v_container_type = 0;
  PyObject *__pyx_v_leaves_only = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_cached_content (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_prop,&__pyx_n_s_container_type,&__pyx_n_s_leaves_only,0};
    values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    values[1] = __Pyx_Arg_NewRef_FASTCALL(__pyx_k__24);

    /* "ete4/core/tree.pyx":1120
 * 
 *     def get_cached_content(self, prop=None, container_type=set,
 *                            leaves_only=True):             # <<<<<<<<<<<<<<
 *         """Return dict that assigns to each node a set of its leaves.
 * 
 */
    values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_True));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_prop);
          if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1119, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_container_type);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1119, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_leaves_only);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1119, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_cached_content") < 0)) __PYX_ERR(0, 1119, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_prop = values[0];
    __pyx_v_container_type = values[1];
    __pyx_v_leaves_only = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_cached_content", 0, 0, 3, __pyx_nargs); __PYX_ERR(0, 1119, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("ete4.core.tree.Tree.get_cached_content", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_131get_cached_content(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self), __pyx_v_prop, __pyx_v_container_type, __pyx_v_leaves_only);

  /* "ete4/core/tree.pyx":1119
 *         ops.sort(self, key=lambda node: tuple(sorted(leaf_values[node])))
 * 
 *     def get_cached_content(self, prop=None, container_type=set,             # <<<<<<<<<<<<<<
 *                            leaves_only=True):
 *         """Return dict that assigns to each node a set of its leaves.
 */

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

/* "ete4/core/tree.pyx":1136
 *             descendant nodes, not only its leaves.
 *         """
 *         def get_content():  # return the node itself, or its requested prop             # <<<<<<<<<<<<<<
 *             return self if prop is None else self.get_prop(prop)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_18get_cached_content_1get_content(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_4ete4_4core_4tree_4Tree_18get_cached_content_1get_content = {"get_content", (PyCFunction)__pyx_pw_4ete4_4core_4tree_4Tree_18get_cached_content_1get_content, METH_NOARGS, 0};
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_18get_cached_content_1get_content(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_content (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_18get_cached_content_get_content(__pyx_self);

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

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_18get_cached_content_get_content(PyObject *__pyx_self) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_25_get_cached_content *__pyx_cur_scope;
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_25_get_cached_content *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  unsigned int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_content", 1);
  __pyx_outer_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_25_get_cached_content *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "ete4/core/tree.pyx":1137
 *         """
 *         def get_content():  # return the node itself, or its requested prop
 *             return self if prop is None else self.get_prop(prop)             # <<<<<<<<<<<<<<
 * 
 *         # Leaves, or nodes, or just their requested property, for each node.
 */
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_prop)) { __Pyx_RaiseClosureNameError("prop"); __PYX_ERR(0, 1137, __pyx_L1_error) }
  __pyx_t_2 = (__pyx_cur_scope->__pyx_v_prop == Py_None);
  if (__pyx_t_2) {
    if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 1137, __pyx_L1_error) }
    __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
    __pyx_t_1 = ((PyObject *)__pyx_cur_scope->__pyx_v_self);
  } else {
    if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 1137, __pyx_L1_error) }
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_get_prop); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1137, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (unlikely(!__pyx_cur_scope->__pyx_v_prop)) { __Pyx_RaiseClosureNameError("prop"); __PYX_ERR(0, 1137, __pyx_L1_error) }
    __pyx_t_5 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_cur_scope->__pyx_v_prop};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1137, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "ete4/core/tree.pyx":1136
 *             descendant nodes, not only its leaves.
 *         """
 *         def get_content():  # return the node itself, or its requested prop             # <<<<<<<<<<<<<<
 *             return self if prop is None else self.get_prop(prop)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("ete4.core.tree.Tree.get_cached_content.get_content", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ete4/core/tree.pyx":1119
 *         ops.sort(self, key=lambda node: tuple(sorted(leaf_values[node])))
 * 
 *     def get_cached_content(self, prop=None, container_type=set,             # <<<<<<<<<<<<<<
 *                            leaves_only=True):
 *         """Return dict that assigns to each node a set of its leaves.
 */

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_131get_cached_content(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_prop, PyObject *__pyx_v_container_type, PyObject *__pyx_v_leaves_only) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_25_get_cached_content *__pyx_cur_scope;
  PyObject *__pyx_v_get_content = 0;
  PyObject *__pyx_v_leaves = NULL;
  PyObject *__pyx_v_node = NULL;
  PyObject *__pyx_v_node_leaves = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  unsigned int __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  PyObject *(*__pyx_t_11)(PyObject *);
  struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_t_12 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_cached_content", 0);
  __pyx_cur_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_25_get_cached_content *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_25_get_cached_content(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_25_get_cached_content, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_25_get_cached_content *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1119, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __pyx_cur_scope->__pyx_v_prop = __pyx_v_prop;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_prop);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_prop);

  /* "ete4/core/tree.pyx":1136
 *             descendant nodes, not only its leaves.
 *         """
 *         def get_content():  # return the node itself, or its requested prop             # <<<<<<<<<<<<<<
 *             return self if prop is None else self.get_prop(prop)
 * 
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_18get_cached_content_1get_content, 0, __pyx_n_s_get_cached_content_locals_get_co, ((PyObject*)__pyx_cur_scope), __pyx_n_s_ete4_core_tree, __pyx_d, ((PyObject *)__pyx_codeobj__25)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1136, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_get_content = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "ete4/core/tree.pyx":1140
 * 
 *         # Leaves, or nodes, or just their requested property, for each node.
 *         leaves = {self: container_type(             # <<<<<<<<<<<<<<
 *             [get_content()] if self.is_leaf or not leaves_only else [])}
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1140, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "ete4/core/tree.pyx":1141
 *         # Leaves, or nodes, or just their requested property, for each node.
 *         leaves = {self: container_type(
 *             [get_content()] if self.is_leaf or not leaves_only else [])}             # <<<<<<<<<<<<<<
 * 
 *         for node in self.children:
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_is_leaf); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1141, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1141, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (!__pyx_t_6) {
  } else {
    __pyx_t_4 = __pyx_t_6;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_leaves_only); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1141, __pyx_L1_error)
  __pyx_t_7 = (!__pyx_t_6);
  __pyx_t_4 = __pyx_t_7;
  __pyx_L3_bool_binop_done:;
  if (__pyx_t_4) {
    __pyx_t_5 = __pyx_pf_4ete4_4core_4tree_4Tree_18get_cached_content_get_content(__pyx_v_get_content); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1141, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_8 = PyList_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1141, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_5);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 0, __pyx_t_5)) __PYX_ERR(0, 1141, __pyx_L1_error);
    __pyx_t_5 = 0;
    __pyx_t_3 = __pyx_t_8;
    __pyx_t_8 = 0;
  } else {
    __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1141, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_3 = __pyx_t_8;
    __pyx_t_8 = 0;
  }
  __Pyx_INCREF(__pyx_v_container_type);
  __pyx_t_8 = __pyx_v_container_type; __pyx_t_5 = NULL;
  __pyx_t_9 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_8))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_8);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_8, function);
      __pyx_t_9 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
    __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, 1140, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  }
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_t_2) < 0) __PYX_ERR(0, 1140, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_leaves = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "ete4/core/tree.pyx":1143
 *             [get_content()] if self.is_leaf or not leaves_only else [])}
 * 
 *         for node in self.children:             # <<<<<<<<<<<<<<
 *             node_leaves = node.get_cached_content(prop=prop,
 *                                                   container_type=container_type,
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_children); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2);
    __pyx_t_10 = 0;
    __pyx_t_11 = NULL;
  } else {
    __pyx_t_10 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1143, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1143, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_11)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1143, __pyx_L1_error)
          #endif
          if (__pyx_t_10 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_10); __Pyx_INCREF(__pyx_t_1); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 1143, __pyx_L1_error)
        #else
        __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1143, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1143, __pyx_L1_error)
          #endif
          if (__pyx_t_10 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_10); __Pyx_INCREF(__pyx_t_1); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 1143, __pyx_L1_error)
        #else
        __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1143, __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, 1143, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_node, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "ete4/core/tree.pyx":1144
 * 
 *         for node in self.children:
 *             node_leaves = node.get_cached_content(prop=prop,             # <<<<<<<<<<<<<<
 *                                                   container_type=container_type,
 *                                                   leaves_only=leaves_only)
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_node, __pyx_n_s_get_cached_content); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1144, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1144, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_prop, __pyx_cur_scope->__pyx_v_prop) < 0) __PYX_ERR(0, 1144, __pyx_L1_error)

    /* "ete4/core/tree.pyx":1145
 *         for node in self.children:
 *             node_leaves = node.get_cached_content(prop=prop,
 *                                                   container_type=container_type,             # <<<<<<<<<<<<<<
 *                                                   leaves_only=leaves_only)
 *             # Update the leaves dictionary.
 */
    if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_container_type, __pyx_v_container_type) < 0) __PYX_ERR(0, 1144, __pyx_L1_error)

    /* "ete4/core/tree.pyx":1146
 *             node_leaves = node.get_cached_content(prop=prop,
 *                                                   container_type=container_type,
 *                                                   leaves_only=leaves_only)             # <<<<<<<<<<<<<<
 *             # Update the leaves dictionary.
 *             leaves.update(node_leaves)
 */
    if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_leaves_only, __pyx_v_leaves_only) < 0) __PYX_ERR(0, 1144, __pyx_L1_error)

    /* "ete4/core/tree.pyx":1144
 * 
 *         for node in self.children:
 *             node_leaves = node.get_cached_content(prop=prop,             # <<<<<<<<<<<<<<
 *                                                   container_type=container_type,
 *                                                   leaves_only=leaves_only)
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1144, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF_SET(__pyx_v_node_leaves, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "ete4/core/tree.pyx":1148
 *                                                   leaves_only=leaves_only)
 *             # Update the leaves dictionary.
 *             leaves.update(node_leaves)             # <<<<<<<<<<<<<<
 * 
 *             # Update the leaves (or nodes, or their prop) assigned to self.
 */
    __pyx_t_3 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyDict_Type_update, __pyx_v_leaves, __pyx_v_node_leaves); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1148, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "ete4/core/tree.pyx":1151
 * 
 *             # Update the leaves (or nodes, or their prop) assigned to self.
 *             if container_type == set:             # <<<<<<<<<<<<<<
 *                 leaves[self].update(node_leaves[node])
 *             elif container_type == list:
 */
    __pyx_t_3 = PyObject_RichCompare(__pyx_v_container_type, ((PyObject *)(&PySet_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1151, __pyx_L1_error)
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1151, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_4) {

      /* "ete4/core/tree.pyx":1152
 *             # Update the leaves (or nodes, or their prop) assigned to self.
 *             if container_type == set:
 *                 leaves[self].update(node_leaves[node])             # <<<<<<<<<<<<<<
 *             elif container_type == list:
 *                 leaves[self] += node_leaves[node]
 */
      __pyx_t_8 = __Pyx_PyDict_GetItem(__pyx_v_leaves, ((PyObject *)__pyx_cur_scope->__pyx_v_self)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1152, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_update); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1152, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_v_node_leaves, __pyx_v_node); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1152, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_5 = NULL;
      __pyx_t_9 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
          __pyx_t_9 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_8};
        __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1152, __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;

      /* "ete4/core/tree.pyx":1151
 * 
 *             # Update the leaves (or nodes, or their prop) assigned to self.
 *             if container_type == set:             # <<<<<<<<<<<<<<
 *                 leaves[self].update(node_leaves[node])
 *             elif container_type == list:
 */
      goto __pyx_L7;
    }

    /* "ete4/core/tree.pyx":1153
 *             if container_type == set:
 *                 leaves[self].update(node_leaves[node])
 *             elif container_type == list:             # <<<<<<<<<<<<<<
 *                 leaves[self] += node_leaves[node]
 * 
 */
    __pyx_t_3 = PyObject_RichCompare(__pyx_v_container_type, ((PyObject *)(&PyList_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1153, __pyx_L1_error)
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1153, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_4) {

      /* "ete4/core/tree.pyx":1154
 *                 leaves[self].update(node_leaves[node])
 *             elif container_type == list:
 *                 leaves[self] += node_leaves[node]             # <<<<<<<<<<<<<<
 * 
 *         return leaves
 */
      __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
      __pyx_t_12 = __pyx_cur_scope->__pyx_v_self;
      __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_leaves, ((PyObject *)__pyx_t_12)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1154, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_node_leaves, __pyx_v_node); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1154, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_8 = PyNumber_InPlaceAdd(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1154, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely((PyDict_SetItem(__pyx_v_leaves, ((PyObject *)__pyx_t_12), __pyx_t_8) < 0))) __PYX_ERR(0, 1154, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF((PyObject *)__pyx_t_12); __pyx_t_12 = 0;

      /* "ete4/core/tree.pyx":1153
 *             if container_type == set:
 *                 leaves[self].update(node_leaves[node])
 *             elif container_type == list:             # <<<<<<<<<<<<<<
 *                 leaves[self] += node_leaves[node]
 * 
 */
    }
    __pyx_L7:;

    /* "ete4/core/tree.pyx":1143
 *             [get_content()] if self.is_leaf or not leaves_only else [])}
 * 
 *         for node in self.children:             # <<<<<<<<<<<<<<
 *             node_leaves = node.get_cached_content(prop=prop,
 *                                                   container_type=container_type,
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ete4/core/tree.pyx":1156
 *                 leaves[self] += node_leaves[node]
 * 
 *         return leaves             # <<<<<<<<<<<<<<
 * 
 *     def robinson_foulds(self, t2, prop_t1='name', prop_t2='name',
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_leaves);
  __pyx_r = __pyx_v_leaves;
  goto __pyx_L0;

  /* "ete4/core/tree.pyx":1119
 *         ops.sort(self, key=lambda node: tuple(sorted(leaf_values[node])))
 * 
 *     def get_cached_content(self, prop=None, container_type=set,             # <<<<<<<<<<<<<<
 *                            leaves_only=True):
 *         """Return dict that assigns to each node a set of its leaves.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF((PyObject *)__pyx_t_12);
  __Pyx_AddTraceback("ete4.core.tree.Tree.get_cached_content", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_get_content);
  __Pyx_XDECREF(__pyx_v_leaves);
  __Pyx_XDECREF(__pyx_v_node);
  __Pyx_XDECREF(__pyx_v_node_leaves);
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ete4/core/tree.pyx":1158
 *         return leaves
 * 
 *     def robinson_foulds(self, t2, prop_t1='name', prop_t2='name',             # <<<<<<<<<<<<<<
 *                         unrooted_trees=False, expand_polytomies=False,
 *                         polytomy_size_limit=5, skip_large_polytomies=False,
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_134robinson_foulds(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_4ete4_4core_4tree_4Tree_133robinson_foulds, "Tree.robinson_foulds(self, t2, prop_t1=u'name', prop_t2=u'name', unrooted_trees=False, expand_polytomies=False, polytomy_size_limit=5, skip_large_polytomies=False, correct_by_polytomy_size=False, min_support_t1=0.0, min_support_t2=0.0)\nReturn the Robinson-Foulds distance to the tree, and related info.\n\n        The returned tuple contains the Robinson-Foulds symmetric\n        distance (rf), but also more information::\n\n          (rf, rf_max, common,\n           edges_t1, edges_t2, discarded_edges_t1, discarded_edges_t2)\n\n        :param t2: Target tree (tree to compare to the reference tree).\n        :param prop_t1: Property to use in the reference tree as the\n            node name when comparing trees.\n        :param prop_t2: Property to use in the target tree as the node\n            name when comparing trees.\n        :param unrooted_trees: If True, consider trees as unrooted.\n        :param expand_polytomies: If True, all polytomies in the\n           reference and target tree will be expanded into all\n           possible binary trees. Robinson-Foulds distance will be\n           calculated between all tree combinations and the minimum\n           value will be returned. See also :func:`Tree.expand_polytomy`.\n        ");
static PyMethodDef __pyx_mdef_4ete4_4core_4tree_4Tree_134robinson_foulds = {"robinson_foulds", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_134robinson_foulds, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_133robinson_foulds};
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_134robinson_foulds(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_t2 = 0;
  PyObject *__pyx_v_prop_t1 = 0;
  PyObject *__pyx_v_prop_t2 = 0;
  PyObject *__pyx_v_unrooted_trees = 0;
  PyObject *__pyx_v_expand_polytomies = 0;
  PyObject *__pyx_v_polytomy_size_limit = 0;
  PyObject *__pyx_v_skip_large_polytomies = 0;
  PyObject *__pyx_v_correct_by_polytomy_size = 0;
  PyObject *__pyx_v_min_support_t1 = 0;
  PyObject *__pyx_v_min_support_t2 = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("robinson_foulds (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t2,&__pyx_n_s_prop_t1,&__pyx_n_s_prop_t2,&__pyx_n_s_unrooted_trees,&__pyx_n_s_expand_polytomies,&__pyx_n_s_polytomy_size_limit,&__pyx_n_s_skip_large_polytomies,&__pyx_n_s_correct_by_polytomy_size,&__pyx_n_s_min_support_t1,&__pyx_n_s_min_support_t2,0};
    values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_n_u_name));
    values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_n_u_name));

    /* "ete4/core/tree.pyx":1159
 * 
 *     def robinson_foulds(self, t2, prop_t1='name', prop_t2='name',
 *                         unrooted_trees=False, expand_polytomies=False,             # <<<<<<<<<<<<<<
 *                         polytomy_size_limit=5, skip_large_polytomies=False,
 *                         correct_by_polytomy_size=False, min_support_t1=0.0,
 */
    values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_False));
    values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_False));
    values[5] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_5));

    /* "ete4/core/tree.pyx":1160
 *     def robinson_foulds(self, t2, prop_t1='name', prop_t2='name',
 *                         unrooted_trees=False, expand_polytomies=False,
 *                         polytomy_size_limit=5, skip_large_polytomies=False,             # <<<<<<<<<<<<<<
 *                         correct_by_polytomy_size=False, min_support_t1=0.0,
 *                         min_support_t2=0.0):
 */
    values[6] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_False));

    /* "ete4/core/tree.pyx":1161
 *                         unrooted_trees=False, expand_polytomies=False,
 *                         polytomy_size_limit=5, skip_large_polytomies=False,
 *                         correct_by_polytomy_size=False, min_support_t1=0.0,             # <<<<<<<<<<<<<<
 *                         min_support_t2=0.0):
 *         """Return the Robinson-Foulds distance to the tree, and related info.
 */
    values[7] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_False));
    values[8] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_float_0_0));
    values[9] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_float_0_0));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case 10: values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t2)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1158, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_prop_t1);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1158, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_prop_t2);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1158, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_unrooted_trees);
          if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1158, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_expand_polytomies);
          if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1158, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_polytomy_size_limit);
          if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1158, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_skip_large_polytomies);
          if (value) { values[6] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1158, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_correct_by_polytomy_size);
          if (value) { values[7] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1158, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_min_support_t1);
          if (value) { values[8] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1158, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_min_support_t2);
          if (value) { values[9] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1158, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "robinson_foulds") < 0)) __PYX_ERR(0, 1158, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case 10: values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_t2 = values[0];
    __pyx_v_prop_t1 = values[1];
    __pyx_v_prop_t2 = values[2];
    __pyx_v_unrooted_trees = values[3];
    __pyx_v_expand_polytomies = values[4];
    __pyx_v_polytomy_size_limit = values[5];
    __pyx_v_skip_large_polytomies = values[6];
    __pyx_v_correct_by_polytomy_size = values[7];
    __pyx_v_min_support_t1 = values[8];
    __pyx_v_min_support_t2 = values[9];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("robinson_foulds", 0, 1, 10, __pyx_nargs); __PYX_ERR(0, 1158, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("ete4.core.tree.Tree.robinson_foulds", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_133robinson_foulds(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self), __pyx_v_t2, __pyx_v_prop_t1, __pyx_v_prop_t2, __pyx_v_unrooted_trees, __pyx_v_expand_polytomies, __pyx_v_polytomy_size_limit, __pyx_v_skip_large_polytomies, __pyx_v_correct_by_polytomy_size, __pyx_v_min_support_t1, __pyx_v_min_support_t2);

  /* "ete4/core/tree.pyx":1158
 *         return leaves
 * 
 *     def robinson_foulds(self, t2, prop_t1='name', prop_t2='name',             # <<<<<<<<<<<<<<
 *                         unrooted_trees=False, expand_polytomies=False,
 *                         polytomy_size_limit=5, skip_large_polytomies=False,
 */

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

/* "ete4/core/tree.pyx":1199
 * 
 *         # Some helper functions to access properties.
 *         def has_prop(node, prop):             # <<<<<<<<<<<<<<
 *             return hasattr(node, prop) or prop in node.props
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_15robinson_foulds_1has_prop(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_4ete4_4core_4tree_4Tree_15robinson_foulds_1has_prop = {"has_prop", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_15robinson_foulds_1has_prop, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_15robinson_foulds_1has_prop(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_node = 0;
  PyObject *__pyx_v_prop = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("has_prop (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_node,&__pyx_n_s_prop,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_node)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1199, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_prop)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1199, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("has_prop", 1, 2, 2, 1); __PYX_ERR(0, 1199, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "has_prop") < 0)) __PYX_ERR(0, 1199, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_node = values[0];
    __pyx_v_prop = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("has_prop", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1199, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("ete4.core.tree.Tree.robinson_foulds.has_prop", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_15robinson_foulds_has_prop(__pyx_self, __pyx_v_node, __pyx_v_prop);

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

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_15robinson_foulds_has_prop(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_node, PyObject *__pyx_v_prop) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("has_prop", 1);

  /* "ete4/core/tree.pyx":1200
 *         # Some helper functions to access properties.
 *         def has_prop(node, prop):
 *             return hasattr(node, prop) or prop in node.props             # <<<<<<<<<<<<<<
 * 
 *         common = (  # common leaf values in the two trees
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_HasAttr(__pyx_v_node, __pyx_v_prop); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1200, __pyx_L1_error)
  if (!__pyx_t_2) {
  } else {
    __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1200, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_node, __pyx_n_s_props); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1200, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_prop, __pyx_t_3, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1200, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1200, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_L3_bool_binop_done:;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "ete4/core/tree.pyx":1199
 * 
 *         # Some helper functions to access properties.
 *         def has_prop(node, prop):             # <<<<<<<<<<<<<<
 *             return hasattr(node, prop) or prop in node.props
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("ete4.core.tree.Tree.robinson_foulds.has_prop", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_4ete4_4core_4tree_4Tree_15robinson_foulds_4generator21(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "ete4/core/tree.pyx":1239
 *             polytomy_correction = max(corr1, corr2)
 * 
 *         def from_common(nodes, prop):  # helper function             # <<<<<<<<<<<<<<
 *             """Yield values (if existing in both trees) for property prop."""
 *             for node in nodes:
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_15robinson_foulds_3from_common(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_4ete4_4core_4tree_4Tree_15robinson_foulds_2from_common, "Yield values (if existing in both trees) for property prop.");
static PyMethodDef __pyx_mdef_4ete4_4core_4tree_4Tree_15robinson_foulds_3from_common = {"from_common", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_15robinson_foulds_3from_common, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_15robinson_foulds_2from_common};
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_15robinson_foulds_3from_common(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_nodes = 0;
  PyObject *__pyx_v_prop = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_common (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nodes,&__pyx_n_s_prop,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_nodes)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1239, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_prop)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1239, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("from_common", 1, 2, 2, 1); __PYX_ERR(0, 1239, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "from_common") < 0)) __PYX_ERR(0, 1239, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_nodes = values[0];
    __pyx_v_prop = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_common", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1239, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("ete4.core.tree.Tree.robinson_foulds.from_common", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_15robinson_foulds_2from_common(__pyx_self, __pyx_v_nodes, __pyx_v_prop);

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

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_15robinson_foulds_2from_common(PyObject *__pyx_self, PyObject *__pyx_v_nodes, PyObject *__pyx_v_prop) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_31_from_common *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("from_common", 0);
  __pyx_cur_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_31_from_common *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_31_from_common(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_31_from_common, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_31_from_common *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1239, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope);
  __pyx_cur_scope->__pyx_v_nodes = __pyx_v_nodes;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_nodes);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_nodes);
  __pyx_cur_scope->__pyx_v_prop = __pyx_v_prop;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_prop);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_prop);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4ete4_4core_4tree_4Tree_15robinson_foulds_4generator21, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_from_common, __pyx_n_s_robinson_foulds_locals_from_comm, __pyx_n_s_ete4_core_tree); if (unlikely(!gen)) __PYX_ERR(0, 1239, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("ete4.core.tree.Tree.robinson_foulds.from_common", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_4ete4_4core_4tree_4Tree_15robinson_foulds_4generator21(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_31_from_common *__pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_31_from_common *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  unsigned int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_common", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L8_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1239, __pyx_L1_error)

  /* "ete4/core/tree.pyx":1241
 *         def from_common(nodes, prop):  # helper function
 *             """Yield values (if existing in both trees) for property prop."""
 *             for node in nodes:             # <<<<<<<<<<<<<<
 *                 if has_prop(node, prop):
 *                     value = node.get_prop(prop)
 */
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_nodes)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_nodes)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_v_nodes; __Pyx_INCREF(__pyx_t_1);
    __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_nodes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1241, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1241, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1241, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 1241, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1241, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1241, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 1241, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1241, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1241, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_node);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_node, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;

    /* "ete4/core/tree.pyx":1242
 *             """Yield values (if existing in both trees) for property prop."""
 *             for node in nodes:
 *                 if has_prop(node, prop):             # <<<<<<<<<<<<<<
 *                     value = node.get_prop(prop)
 *                     if value in common:
 */
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_has_prop)) { __Pyx_RaiseClosureNameError("has_prop"); __PYX_ERR(0, 1242, __pyx_L1_error) }
    __pyx_t_4 = __pyx_pf_4ete4_4core_4tree_4Tree_15robinson_foulds_has_prop(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_has_prop, __pyx_cur_scope->__pyx_v_node, __pyx_cur_scope->__pyx_v_prop); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1242, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1242, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_5) {

      /* "ete4/core/tree.pyx":1243
 *             for node in nodes:
 *                 if has_prop(node, prop):
 *                     value = node.get_prop(prop)             # <<<<<<<<<<<<<<
 *                     if value in common:
 *                         yield value
 */
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s_get_prop); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1243, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = NULL;
      __pyx_t_8 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_cur_scope->__pyx_v_prop};
        __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1243, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_value);
      __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_value, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ete4/core/tree.pyx":1244
 *                 if has_prop(node, prop):
 *                     value = node.get_prop(prop)
 *                     if value in common:             # <<<<<<<<<<<<<<
 *                         yield value
 * 
 */
      if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_common)) { __Pyx_RaiseClosureNameError("common"); __PYX_ERR(0, 1244, __pyx_L1_error) }
      if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_common == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
        __PYX_ERR(0, 1244, __pyx_L1_error)
      }
      __pyx_t_5 = (__Pyx_PySet_ContainsTF(__pyx_cur_scope->__pyx_v_value, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_common, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1244, __pyx_L1_error)
      if (__pyx_t_5) {

        /* "ete4/core/tree.pyx":1245
 *                     value = node.get_prop(prop)
 *                     if value in common:
 *                         yield value             # <<<<<<<<<<<<<<
 * 
 *         min_comparison = None
 */
        __Pyx_INCREF(__pyx_cur_scope->__pyx_v_value);
        __pyx_r = __pyx_cur_scope->__pyx_v_value;
        __Pyx_XGIVEREF(__pyx_t_1);
        __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
        __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
        __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
        __Pyx_XGIVEREF(__pyx_r);
        __Pyx_RefNannyFinishContext();
        __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
        /* return from generator, yielding value */
        __pyx_generator->resume_label = 1;
        return __pyx_r;
        __pyx_L8_resume_from_yield:;
        __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
        __pyx_cur_scope->__pyx_t_0 = 0;
        __Pyx_XGOTREF(__pyx_t_1);
        __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
        __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
        if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1245, __pyx_L1_error)

        /* "ete4/core/tree.pyx":1244
 *                 if has_prop(node, prop):
 *                     value = node.get_prop(prop)
 *                     if value in common:             # <<<<<<<<<<<<<<
 *                         yield value
 * 
 */
      }

      /* "ete4/core/tree.pyx":1242
 *             """Yield values (if existing in both trees) for property prop."""
 *             for node in nodes:
 *                 if has_prop(node, prop):             # <<<<<<<<<<<<<<
 *                     value = node.get_prop(prop)
 *                     if value in common:
 */
    }

    /* "ete4/core/tree.pyx":1241
 *         def from_common(nodes, prop):  # helper function
 *             """Yield values (if existing in both trees) for property prop."""
 *             for node in nodes:             # <<<<<<<<<<<<<<
 *                 if has_prop(node, prop):
 *                     value = node.get_prop(prop)
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "ete4/core/tree.pyx":1239
 *             polytomy_correction = max(corr1, corr2)
 * 
 *         def from_common(nodes, prop):  # helper function             # <<<<<<<<<<<<<<
 *             """Yield values (if existing in both trees) for property prop."""
 *             for node in nodes:
 */

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

/* "ete4/core/tree.pyx":1207
 * 
 *         # Check for duplicated items (is it necessary? can we optimize? what's the impact in performance?')
 *         size1 = sum(1 for n in origin_t if n.get_prop(prop_t1) in common)             # <<<<<<<<<<<<<<
 *         size2 = sum(1 for n in target_t if n.get_prop(prop_t2) in common)
 * 
 */

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_15robinson_foulds_5genexpr(PyObject *__pyx_self, struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_genexpr_arg_0) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_27_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_27_genexpr *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_27_genexpr(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_27_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_27_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1207, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds *) __pyx_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope);
  __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_genexpr_arg_0);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_genexpr_arg_0);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4ete4_4core_4tree_4Tree_15robinson_foulds_7generator22, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_robinson_foulds_locals_genexpr, __pyx_n_s_ete4_core_tree); if (unlikely(!gen)) __PYX_ERR(0, 1207, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("ete4.core.tree.Tree.robinson_foulds.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_4ete4_4core_4tree_4Tree_15robinson_foulds_7generator22(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_27_genexpr *__pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_27_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  unsigned int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L7_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1207, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1207, __pyx_L1_error) }
  if (likely(PyList_CheckExact(((PyObject *)__pyx_cur_scope->__pyx_genexpr_arg_0))) || PyTuple_CheckExact(((PyObject *)__pyx_cur_scope->__pyx_genexpr_arg_0))) {
    __pyx_t_1 = ((PyObject *)__pyx_cur_scope->__pyx_genexpr_arg_0); __Pyx_INCREF(__pyx_t_1);
    __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(((PyObject *)__pyx_cur_scope->__pyx_genexpr_arg_0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1207, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1207, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1207, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 1207, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1207, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1207, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 1207, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1207, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1207, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_n);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_n, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_n, __pyx_n_s_get_prop); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1207, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_prop_t1)) { __Pyx_RaiseClosureNameError("prop_t1"); __PYX_ERR(0, 1207, __pyx_L1_error) }
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_prop_t1};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1207, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_common)) { __Pyx_RaiseClosureNameError("common"); __PYX_ERR(0, 1207, __pyx_L1_error) }
    if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_common == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(0, 1207, __pyx_L1_error)
    }
    __pyx_t_8 = (__Pyx_PySet_ContainsTF(__pyx_t_4, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_common, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1207, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_8) {
      __Pyx_INCREF(__pyx_int_1);
      __pyx_r = __pyx_int_1;
      __Pyx_XGIVEREF(__pyx_t_1);
      __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
      __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
      __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
      /* return from generator, yielding value */
      __pyx_generator->resume_label = 1;
      return __pyx_r;
      __pyx_L7_resume_from_yield:;
      __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
      __pyx_cur_scope->__pyx_t_0 = 0;
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
      __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
      if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1207, __pyx_L1_error)
    }
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

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

/* "ete4/core/tree.pyx":1208
 *         # Check for duplicated items (is it necessary? can we optimize? what's the impact in performance?')
 *         size1 = sum(1 for n in origin_t if n.get_prop(prop_t1) in common)
 *         size2 = sum(1 for n in target_t if n.get_prop(prop_t2) in common)             # <<<<<<<<<<<<<<
 * 
 *         if size1 > len(common):
 */

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_15robinson_foulds_8genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_28_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_28_genexpr *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_28_genexpr(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_28_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_28_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1208, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds *) __pyx_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope);
  __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4ete4_4core_4tree_4Tree_15robinson_foulds_10generator23, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_robinson_foulds_locals_genexpr, __pyx_n_s_ete4_core_tree); if (unlikely(!gen)) __PYX_ERR(0, 1208, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("ete4.core.tree.Tree.robinson_foulds.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_4ete4_4core_4tree_4Tree_15robinson_foulds_10generator23(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_28_genexpr *__pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_28_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  unsigned int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L7_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1208, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1208, __pyx_L1_error) }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1);
    __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1208, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1208, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1208, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 1208, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1208, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1208, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 1208, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1208, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1208, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_n);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_n, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_n, __pyx_n_s_get_prop); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1208, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_prop_t2)) { __Pyx_RaiseClosureNameError("prop_t2"); __PYX_ERR(0, 1208, __pyx_L1_error) }
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_prop_t2};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1208, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_common)) { __Pyx_RaiseClosureNameError("common"); __PYX_ERR(0, 1208, __pyx_L1_error) }
    if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_common == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(0, 1208, __pyx_L1_error)
    }
    __pyx_t_8 = (__Pyx_PySet_ContainsTF(__pyx_t_4, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_common, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1208, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_8) {
      __Pyx_INCREF(__pyx_int_1);
      __pyx_r = __pyx_int_1;
      __Pyx_XGIVEREF(__pyx_t_1);
      __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
      __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
      __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
      /* return from generator, yielding value */
      __pyx_generator->resume_label = 1;
      return __pyx_r;
      __pyx_L7_resume_from_yield:;
      __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
      __pyx_cur_scope->__pyx_t_0 = 0;
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
      __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
      if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1208, __pyx_L1_error)
    }
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

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

/* "ete4/core/tree.pyx":1231
 *         polytomy_correction = 0
 *         if correct_by_polytomy_size:
 *             corr1 = sum(len(n.children) - 2 for n in origin_t.traverse() if len(n.children) > 2)             # <<<<<<<<<<<<<<
 *             corr2 = sum(len(n.children) - 2 for n in target_t.traverse() if len(n.children) > 2)
 * 
 */

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_15robinson_foulds_11genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_29_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_29_genexpr *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_29_genexpr(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_29_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_29_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1231, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4ete4_4core_4tree_4Tree_15robinson_foulds_13generator24, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_robinson_foulds_locals_genexpr, __pyx_n_s_ete4_core_tree); if (unlikely(!gen)) __PYX_ERR(0, 1231, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("ete4.core.tree.Tree.robinson_foulds.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_4ete4_4core_4tree_4Tree_15robinson_foulds_13generator24(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_29_genexpr *__pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_29_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L7_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1231, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1231, __pyx_L1_error) }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1);
    __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1231, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1231, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1231, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 1231, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1231, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1231, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 1231, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1231, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1231, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_n);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_n, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_n, __pyx_n_s_children); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1231, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1231, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = (__pyx_t_5 > 2);
    if (__pyx_t_6) {
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_n, __pyx_n_s_children); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1231, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1231, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyInt_FromSsize_t((__pyx_t_5 - 2)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1231, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      __Pyx_XGIVEREF(__pyx_t_1);
      __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
      __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
      __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
      /* return from generator, yielding value */
      __pyx_generator->resume_label = 1;
      return __pyx_r;
      __pyx_L7_resume_from_yield:;
      __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
      __pyx_cur_scope->__pyx_t_0 = 0;
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
      __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
      if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1231, __pyx_L1_error)
    }
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

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

/* "ete4/core/tree.pyx":1232
 *         if correct_by_polytomy_size:
 *             corr1 = sum(len(n.children) - 2 for n in origin_t.traverse() if len(n.children) > 2)
 *             corr2 = sum(len(n.children) - 2 for n in target_t.traverse() if len(n.children) > 2)             # <<<<<<<<<<<<<<
 * 
 *             if corr1 > 0 and corr2 > 0:
 */

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_15robinson_foulds_14genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_30_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_30_genexpr *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_30_genexpr(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_30_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_30_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1232, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4ete4_4core_4tree_4Tree_15robinson_foulds_16generator25, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_robinson_foulds_locals_genexpr, __pyx_n_s_ete4_core_tree); if (unlikely(!gen)) __PYX_ERR(0, 1232, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("ete4.core.tree.Tree.robinson_foulds.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_4ete4_4core_4tree_4Tree_15robinson_foulds_16generator25(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_30_genexpr *__pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_30_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L7_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1232, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1232, __pyx_L1_error) }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1);
    __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1232, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1232, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1232, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 1232, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1232, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1232, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 1232, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1232, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1232, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_n);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_n, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_n, __pyx_n_s_children); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1232, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1232, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = (__pyx_t_5 > 2);
    if (__pyx_t_6) {
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_n, __pyx_n_s_children); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1232, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1232, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyInt_FromSsize_t((__pyx_t_5 - 2)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1232, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      __Pyx_XGIVEREF(__pyx_t_1);
      __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
      __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
      __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
      /* return from generator, yielding value */
      __pyx_generator->resume_label = 1;
      return __pyx_r;
      __pyx_L7_resume_from_yield:;
      __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
      __pyx_cur_scope->__pyx_t_0 = 0;
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
      __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
      if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1232, __pyx_L1_error)
    }
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

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

/* "ete4/core/tree.pyx":1265
 * 
 *             if min_support_t1:
 *                 support_t1 = {tuple(sorted(from_common(leaves, prop_t1) for n in leaves)): branch.support or 0             # <<<<<<<<<<<<<<
 *                               for branch, leaves in t1_leaves.items()}
 * 
 */

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_15robinson_foulds_9genexpr23_genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_32_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_32_genexpr *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_32_genexpr(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_32_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_32_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1265, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds *) __pyx_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope);
  __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4ete4_4core_4tree_4Tree_15robinson_foulds_9genexpr23_2generator26, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_robinson_foulds_locals_genexpr, __pyx_n_s_ete4_core_tree); if (unlikely(!gen)) __PYX_ERR(0, 1265, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("ete4.core.tree.Tree.robinson_foulds.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_4ete4_4core_4tree_4Tree_15robinson_foulds_9genexpr23_2generator26(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_32_genexpr *__pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_32_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1265, __pyx_L1_error)
  __pyx_r = PyList_New(0); if (unlikely(!__pyx_r)) __PYX_ERR(0, 1265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1265, __pyx_L1_error) }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1);
    __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1265, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1265, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1265, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 1265, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1265, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1265, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 1265, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1265, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1265, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_n);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_n, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_9genexpr23__pyx_v_leaves)) { __Pyx_RaiseClosureNameError("leaves"); __PYX_ERR(0, 1265, __pyx_L1_error) }
    __pyx_t_4 = __pyx_cur_scope->__pyx_outer_scope->__pyx_9genexpr23__pyx_v_leaves;
    __Pyx_INCREF(__pyx_t_4);
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_prop_t1)) { __Pyx_RaiseClosureNameError("prop_t1"); __PYX_ERR(0, 1265, __pyx_L1_error) }
    __pyx_t_5 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_prop_t1;
    __Pyx_INCREF(__pyx_t_5);
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_from_common)) { __Pyx_RaiseClosureNameError("from_common"); __PYX_ERR(0, 1265, __pyx_L1_error) }
    __pyx_t_6 = __pyx_pf_4ete4_4core_4tree_4Tree_15robinson_foulds_2from_common(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_from_common, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1265, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(__Pyx_ListComp_Append(__pyx_r, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 1265, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

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

/* "ete4/core/tree.pyx":1285
 * 
 *                 if min_support_t2:
 *                     support_t2 = {tuple(sorted(from_common(leaves, prop_t2) for n in leaves)): branch.support or 0             # <<<<<<<<<<<<<<
 *                                   for branch, leaves in t2_leaves.items()}
 * 
 */

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_15robinson_foulds_9genexpr27_genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_33_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_33_genexpr *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_33_genexpr(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_33_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_33_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1285, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds *) __pyx_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope);
  __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4ete4_4core_4tree_4Tree_15robinson_foulds_9genexpr27_2generator27, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_robinson_foulds_locals_genexpr, __pyx_n_s_ete4_core_tree); if (unlikely(!gen)) __PYX_ERR(0, 1285, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("ete4.core.tree.Tree.robinson_foulds.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_4ete4_4core_4tree_4Tree_15robinson_foulds_9genexpr27_2generator27(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_33_genexpr *__pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_33_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1285, __pyx_L1_error)
  __pyx_r = PyList_New(0); if (unlikely(!__pyx_r)) __PYX_ERR(0, 1285, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1285, __pyx_L1_error) }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1);
    __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1285, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1285, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1285, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 1285, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1285, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1285, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 1285, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1285, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1285, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_n);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_n, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_9genexpr27__pyx_v_leaves)) { __Pyx_RaiseClosureNameError("leaves"); __PYX_ERR(0, 1285, __pyx_L1_error) }
    __pyx_t_4 = __pyx_cur_scope->__pyx_outer_scope->__pyx_9genexpr27__pyx_v_leaves;
    __Pyx_INCREF(__pyx_t_4);
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_prop_t2)) { __Pyx_RaiseClosureNameError("prop_t2"); __PYX_ERR(0, 1285, __pyx_L1_error) }
    __pyx_t_5 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_prop_t2;
    __Pyx_INCREF(__pyx_t_5);
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_from_common)) { __Pyx_RaiseClosureNameError("from_common"); __PYX_ERR(0, 1285, __pyx_L1_error) }
    __pyx_t_6 = __pyx_pf_4ete4_4core_4tree_4Tree_15robinson_foulds_2from_common(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_from_common, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1285, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(__Pyx_ListComp_Append(__pyx_r, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 1285, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

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

/* "ete4/core/tree.pyx":1306
 *                 if unrooted_trees:
 *                     max_parts = (
 *                         sum(1 for p in edges1 - discard_t1 if len(p[0]) > 1 and len(p[1]) > 1) +             # <<<<<<<<<<<<<<
 *                         sum(1 for p in edges2 - discard_t2 if len(p[0]) > 1 and len(p[1]) > 1))
 *                 else:
 */

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_15robinson_foulds_17genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_34_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_34_genexpr *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_34_genexpr(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_34_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_34_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1306, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds *) __pyx_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope);
  __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4ete4_4core_4tree_4Tree_15robinson_foulds_19generator28, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_robinson_foulds_locals_genexpr, __pyx_n_s_ete4_core_tree); if (unlikely(!gen)) __PYX_ERR(0, 1306, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("ete4.core.tree.Tree.robinson_foulds.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_4ete4_4core_4tree_4Tree_15robinson_foulds_19generator28(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_34_genexpr *__pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_34_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L9_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1306, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1306, __pyx_L1_error) }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1);
    __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1306, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1306, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1306, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 1306, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1306, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1306, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 1306, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1306, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1306, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_p);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_p, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_p, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1306, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1306, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_7 = (__pyx_t_6 > 1);
    if (__pyx_t_7) {
    } else {
      __pyx_t_5 = __pyx_t_7;
      goto __pyx_L7_bool_binop_done;
    }
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_p, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1306, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1306, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_7 = (__pyx_t_6 > 1);
    __pyx_t_5 = __pyx_t_7;
    __pyx_L7_bool_binop_done:;
    if (__pyx_t_5) {
      __Pyx_INCREF(__pyx_int_1);
      __pyx_r = __pyx_int_1;
      __Pyx_XGIVEREF(__pyx_t_1);
      __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
      __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
      __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
      /* return from generator, yielding value */
      __pyx_generator->resume_label = 1;
      return __pyx_r;
      __pyx_L9_resume_from_yield:;
      __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
      __pyx_cur_scope->__pyx_t_0 = 0;
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
      __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
      if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1306, __pyx_L1_error)
    }
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

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

/* "ete4/core/tree.pyx":1307
 *                     max_parts = (
 *                         sum(1 for p in edges1 - discard_t1 if len(p[0]) > 1 and len(p[1]) > 1) +
 *                         sum(1 for p in edges2 - discard_t2 if len(p[0]) > 1 and len(p[1]) > 1))             # <<<<<<<<<<<<<<
 *                 else:
 *                     # Otherwise we need to count the actual number of valid
 */

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_15robinson_foulds_20genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_35_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_35_genexpr *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_35_genexpr(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_35_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_35_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1307, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds *) __pyx_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope);
  __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4ete4_4core_4tree_4Tree_15robinson_foulds_22generator29, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_robinson_foulds_locals_genexpr, __pyx_n_s_ete4_core_tree); if (unlikely(!gen)) __PYX_ERR(0, 1307, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("ete4.core.tree.Tree.robinson_foulds.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_4ete4_4core_4tree_4Tree_15robinson_foulds_22generator29(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_35_genexpr *__pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_35_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L9_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1307, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1307, __pyx_L1_error) }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1);
    __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1307, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1307, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1307, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 1307, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1307, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1307, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 1307, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1307, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1307, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_p);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_p, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_p, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1307, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1307, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_7 = (__pyx_t_6 > 1);
    if (__pyx_t_7) {
    } else {
      __pyx_t_5 = __pyx_t_7;
      goto __pyx_L7_bool_binop_done;
    }
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_p, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1307, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1307, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_7 = (__pyx_t_6 > 1);
    __pyx_t_5 = __pyx_t_7;
    __pyx_L7_bool_binop_done:;
    if (__pyx_t_5) {
      __Pyx_INCREF(__pyx_int_1);
      __pyx_r = __pyx_int_1;
      __Pyx_XGIVEREF(__pyx_t_1);
      __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
      __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
      __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
      /* return from generator, yielding value */
      __pyx_generator->resume_label = 1;
      return __pyx_r;
      __pyx_L9_resume_from_yield:;
      __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
      __pyx_cur_scope->__pyx_t_0 = 0;
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
      __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
      if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1307, __pyx_L1_error)
    }
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

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

/* "ete4/core/tree.pyx":1313
 *                     # partition of the two trees (only needed in rooted trees)
 *                     max_parts = (
 *                         sum(1 for p in edges1 - discard_t1 if len(p) > 1) +             # <<<<<<<<<<<<<<
 *                         sum(1 for p in edges2 - discard_t2 if len(p) > 1)) - 2
 * 
 */

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_15robinson_foulds_23genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_36_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_36_genexpr *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_36_genexpr(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_36_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_36_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1313, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds *) __pyx_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope);
  __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4ete4_4core_4tree_4Tree_15robinson_foulds_25generator30, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_robinson_foulds_locals_genexpr, __pyx_n_s_ete4_core_tree); if (unlikely(!gen)) __PYX_ERR(0, 1313, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("ete4.core.tree.Tree.robinson_foulds.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_4ete4_4core_4tree_4Tree_15robinson_foulds_25generator30(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_36_genexpr *__pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_36_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L7_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1313, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1313, __pyx_L1_error) }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1);
    __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1313, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1313, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1313, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 1313, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1313, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1313, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 1313, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1313, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1313, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_p);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_p, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_5 = PyObject_Length(__pyx_cur_scope->__pyx_v_p); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1313, __pyx_L1_error)
    __pyx_t_6 = (__pyx_t_5 > 1);
    if (__pyx_t_6) {
      __Pyx_INCREF(__pyx_int_1);
      __pyx_r = __pyx_int_1;
      __Pyx_XGIVEREF(__pyx_t_1);
      __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
      __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
      __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
      /* return from generator, yielding value */
      __pyx_generator->resume_label = 1;
      return __pyx_r;
      __pyx_L7_resume_from_yield:;
      __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
      __pyx_cur_scope->__pyx_t_0 = 0;
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
      __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
      if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1313, __pyx_L1_error)
    }
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

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

/* "ete4/core/tree.pyx":1314
 *                     max_parts = (
 *                         sum(1 for p in edges1 - discard_t1 if len(p) > 1) +
 *                         sum(1 for p in edges2 - discard_t2 if len(p) > 1)) - 2             # <<<<<<<<<<<<<<
 * 
 *                 if not min_comparison or (min_comparison[0] is not None and min_comparison[0] > rf):
 */

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_15robinson_foulds_26genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_37_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_37_genexpr *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_37_genexpr(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_37_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_37_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1314, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds *) __pyx_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope);
  __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4ete4_4core_4tree_4Tree_15robinson_foulds_28generator31, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_robinson_foulds_locals_genexpr, __pyx_n_s_ete4_core_tree); if (unlikely(!gen)) __PYX_ERR(0, 1314, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("ete4.core.tree.Tree.robinson_foulds.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_4ete4_4core_4tree_4Tree_15robinson_foulds_28generator31(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_37_genexpr *__pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_37_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L7_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1314, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1314, __pyx_L1_error) }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1);
    __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1314, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1314, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1314, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 1314, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1314, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1314, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 1314, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1314, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1314, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_p);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_p, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_5 = PyObject_Length(__pyx_cur_scope->__pyx_v_p); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1314, __pyx_L1_error)
    __pyx_t_6 = (__pyx_t_5 > 1);
    if (__pyx_t_6) {
      __Pyx_INCREF(__pyx_int_1);
      __pyx_r = __pyx_int_1;
      __Pyx_XGIVEREF(__pyx_t_1);
      __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
      __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
      __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
      /* return from generator, yielding value */
      __pyx_generator->resume_label = 1;
      return __pyx_r;
      __pyx_L7_resume_from_yield:;
      __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
      __pyx_cur_scope->__pyx_t_0 = 0;
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
      __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
      if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1314, __pyx_L1_error)
    }
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

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

/* "ete4/core/tree.pyx":1158
 *         return leaves
 * 
 *     def robinson_foulds(self, t2, prop_t1='name', prop_t2='name',             # <<<<<<<<<<<<<<
 *                         unrooted_trees=False, expand_polytomies=False,
 *                         polytomy_size_limit=5, skip_large_polytomies=False,
 */

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_133robinson_foulds(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_t2, PyObject *__pyx_v_prop_t1, PyObject *__pyx_v_prop_t2, PyObject *__pyx_v_unrooted_trees, PyObject *__pyx_v_expand_polytomies, PyObject *__pyx_v_polytomy_size_limit, PyObject *__pyx_v_skip_large_polytomies, PyObject *__pyx_v_correct_by_polytomy_size, PyObject *__pyx_v_min_support_t1, PyObject *__pyx_v_min_support_t2) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds *__pyx_cur_scope;
  struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_origin_t = NULL;
  PyObject *__pyx_v_target_t = NULL;
  PyObject *__pyx_v_size1 = NULL;
  PyObject *__pyx_v_size2 = NULL;
  PyObject *__pyx_v_origin_trees = NULL;
  PyObject *__pyx_v_target_trees = NULL;
  PyObject *__pyx_v_polytomy_correction = NULL;
  PyObject *__pyx_v_corr1 = NULL;
  PyObject *__pyx_v_corr2 = NULL;
  PyObject *__pyx_gb_4ete4_4core_4tree_4Tree_15robinson_foulds_4generator21 = 0;
  PyObject *__pyx_v_min_comparison = NULL;
  PyObject *__pyx_v_t1 = NULL;
  PyObject *__pyx_v_t1_leaves = NULL;
  PyObject *__pyx_v_t1_leaves_all = NULL;
  PyObject *__pyx_v_support_t1 = NULL;
  PyObject *__pyx_v_t2_leaves = NULL;
  PyObject *__pyx_v_t2_leaves_all = NULL;
  PyObject *__pyx_v_support_t2 = NULL;
  PyObject *__pyx_v_rf = NULL;
  PyObject *__pyx_v_max_parts = NULL;
  PyObject *__pyx_9genexpr13__pyx_v_n = NULL;
  PyObject *__pyx_9genexpr14__pyx_v_n = NULL;
  PyObject *__pyx_gb_4ete4_4core_4tree_4Tree_15robinson_foulds_7generator22 = 0;
  PyObject *__pyx_gb_4ete4_4core_4tree_4Tree_15robinson_foulds_10generator23 = 0;
  PyObject *__pyx_9genexpr17__pyx_v_nw = NULL;
  PyObject *__pyx_9genexpr18__pyx_v_nw = NULL;
  PyObject *__pyx_gb_4ete4_4core_4tree_4Tree_15robinson_foulds_13generator24 = 0;
  PyObject *__pyx_gb_4ete4_4core_4tree_4Tree_15robinson_foulds_16generator25 = 0;
  PyObject *__pyx_9genexpr21__pyx_v_leaves = NULL;
  PyObject *__pyx_9genexpr22__pyx_v_leaves = NULL;
  PyObject *__pyx_9genexpr23__pyx_v_branch = NULL;
  PyObject *__pyx_9genexpr23__pyx_v_0 = NULL;
  PyObject *__pyx_9genexpr25__pyx_v_leaves = NULL;
  PyObject *__pyx_9genexpr26__pyx_v_leaves = NULL;
  PyObject *__pyx_9genexpr27__pyx_v_branch = NULL;
  PyObject *__pyx_9genexpr27__pyx_v_1 = NULL;
  PyObject *__pyx_9genexpr29__pyx_v_p = NULL;
  PyObject *__pyx_9genexpr30__pyx_v_p = NULL;
  PyObject *__pyx_9genexpr31__pyx_v_p = NULL;
  PyObject *__pyx_9genexpr32__pyx_v_p = NULL;
  PyObject *__pyx_gb_4ete4_4core_4tree_4Tree_15robinson_foulds_19generator28 = 0;
  PyObject *__pyx_gb_4ete4_4core_4tree_4Tree_15robinson_foulds_22generator29 = 0;
  PyObject *__pyx_gb_4ete4_4core_4tree_4Tree_15robinson_foulds_25generator30 = 0;
  PyObject *__pyx_gb_4ete4_4core_4tree_4Tree_15robinson_foulds_28generator31 = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  unsigned int __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  int __pyx_t_15;
  int __pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  int __pyx_t_18;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  Py_ssize_t __pyx_t_21;
  PyObject *__pyx_t_22 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("robinson_foulds", 0);
  __pyx_cur_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1158, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_prop_t1 = __pyx_v_prop_t1;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_prop_t1);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_prop_t1);
  __pyx_cur_scope->__pyx_v_prop_t2 = __pyx_v_prop_t2;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_prop_t2);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_prop_t2);
  __Pyx_INCREF(__pyx_v_t2);

  /* "ete4/core/tree.pyx":1184
 *         """
 *         # Give aliases for clarity.
 *         origin_t = self  # reference tree             # <<<<<<<<<<<<<<
 *         target_t = t2
 * 
 */
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_v_origin_t = __pyx_v_self;

  /* "ete4/core/tree.pyx":1185
 *         # Give aliases for clarity.
 *         origin_t = self  # reference tree
 *         target_t = t2             # <<<<<<<<<<<<<<
 * 
 *         # Check that the arguments are consistent.
 */
  __Pyx_INCREF(__pyx_v_t2);
  __pyx_v_target_t = __pyx_v_t2;

  /* "ete4/core/tree.pyx":1188
 * 
 *         # Check that the arguments are consistent.
 *         if not unrooted_trees and (len(origin_t.children) > 2 or             # <<<<<<<<<<<<<<
 *                                    len(target_t.children) > 2):
 *             raise TreeError('Unrooted tree found! You may want to set unrooted_trees=True.')
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_unrooted_trees); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1188, __pyx_L1_error)
  __pyx_t_3 = (!__pyx_t_2);
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_origin_t), __pyx_n_s_children); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1188, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1188, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_3 = (__pyx_t_5 > 2);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }

  /* "ete4/core/tree.pyx":1189
 *         # Check that the arguments are consistent.
 *         if not unrooted_trees and (len(origin_t.children) > 2 or
 *                                    len(target_t.children) > 2):             # <<<<<<<<<<<<<<
 *             raise TreeError('Unrooted tree found! You may want to set unrooted_trees=True.')
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_target_t, __pyx_n_s_children); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1189, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1189, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_3 = (__pyx_t_5 > 2);
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;

  /* "ete4/core/tree.pyx":1188
 * 
 *         # Check that the arguments are consistent.
 *         if not unrooted_trees and (len(origin_t.children) > 2 or             # <<<<<<<<<<<<<<
 *                                    len(target_t.children) > 2):
 *             raise TreeError('Unrooted tree found! You may want to set unrooted_trees=True.')
 */
  if (unlikely(__pyx_t_1)) {

    /* "ete4/core/tree.pyx":1190
 *         if not unrooted_trees and (len(origin_t.children) > 2 or
 *                                    len(target_t.children) > 2):
 *             raise TreeError('Unrooted tree found! You may want to set unrooted_trees=True.')             # <<<<<<<<<<<<<<
 * 
 *         if expand_polytomies and correct_by_polytomy_size:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_TreeError); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1190, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    __pyx_t_8 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_8 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_kp_u_Unrooted_tree_found_You_may_want};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1190, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(0, 1190, __pyx_L1_error)

    /* "ete4/core/tree.pyx":1188
 * 
 *         # Check that the arguments are consistent.
 *         if not unrooted_trees and (len(origin_t.children) > 2 or             # <<<<<<<<<<<<<<
 *                                    len(target_t.children) > 2):
 *             raise TreeError('Unrooted tree found! You may want to set unrooted_trees=True.')
 */
  }

  /* "ete4/core/tree.pyx":1192
 *             raise TreeError('Unrooted tree found! You may want to set unrooted_trees=True.')
 * 
 *         if expand_polytomies and correct_by_polytomy_size:             # <<<<<<<<<<<<<<
 *             raise TreeError('expand_polytomies and correct_by_polytomy_size are mutually exclusive.')
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_expand_polytomies); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1192, __pyx_L1_error)
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L8_bool_binop_done;
  }
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_correct_by_polytomy_size); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1192, __pyx_L1_error)
  __pyx_t_1 = __pyx_t_3;
  __pyx_L8_bool_binop_done:;
  if (unlikely(__pyx_t_1)) {

    /* "ete4/core/tree.pyx":1193
 * 
 *         if expand_polytomies and correct_by_polytomy_size:
 *             raise TreeError('expand_polytomies and correct_by_polytomy_size are mutually exclusive.')             # <<<<<<<<<<<<<<
 * 
 *         if expand_polytomies and unrooted_trees:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_TreeError); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1193, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    __pyx_t_8 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_8 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_kp_u_expand_polytomies_and_correct_by};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1193, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(0, 1193, __pyx_L1_error)

    /* "ete4/core/tree.pyx":1192
 *             raise TreeError('Unrooted tree found! You may want to set unrooted_trees=True.')
 * 
 *         if expand_polytomies and correct_by_polytomy_size:             # <<<<<<<<<<<<<<
 *             raise TreeError('expand_polytomies and correct_by_polytomy_size are mutually exclusive.')
 * 
 */
  }

  /* "ete4/core/tree.pyx":1195
 *             raise TreeError('expand_polytomies and correct_by_polytomy_size are mutually exclusive.')
 * 
 *         if expand_polytomies and unrooted_trees:             # <<<<<<<<<<<<<<
 *             raise TreeError('expand_polytomies and unrooted_trees are mutually exclusive.')
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_expand_polytomies); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1195, __pyx_L1_error)
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L11_bool_binop_done;
  }
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_unrooted_trees); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1195, __pyx_L1_error)
  __pyx_t_1 = __pyx_t_3;
  __pyx_L11_bool_binop_done:;
  if (unlikely(__pyx_t_1)) {

    /* "ete4/core/tree.pyx":1196
 * 
 *         if expand_polytomies and unrooted_trees:
 *             raise TreeError('expand_polytomies and unrooted_trees are mutually exclusive.')             # <<<<<<<<<<<<<<
 * 
 *         # Some helper functions to access properties.
 */
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_TreeError); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1196, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    __pyx_t_8 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_8 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_kp_u_expand_polytomies_and_unrooted_t};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1196, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(0, 1196, __pyx_L1_error)

    /* "ete4/core/tree.pyx":1195
 *             raise TreeError('expand_polytomies and correct_by_polytomy_size are mutually exclusive.')
 * 
 *         if expand_polytomies and unrooted_trees:             # <<<<<<<<<<<<<<
 *             raise TreeError('expand_polytomies and unrooted_trees are mutually exclusive.')
 * 
 */
  }

  /* "ete4/core/tree.pyx":1199
 * 
 *         # Some helper functions to access properties.
 *         def has_prop(node, prop):             # <<<<<<<<<<<<<<
 *             return hasattr(node, prop) or prop in node.props
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_15robinson_foulds_1has_prop, 0, __pyx_n_s_robinson_foulds_locals_has_prop, NULL, __pyx_n_s_ete4_core_tree, __pyx_d, ((PyObject *)__pyx_codeobj__27)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1199, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_cur_scope->__pyx_v_has_prop = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "ete4/core/tree.pyx":1203
 * 
 *         common = (  # common leaf values in the two trees
 *             {n.get_prop(prop_t1) for n in origin_t if has_prop(n, prop_t1)} &             # <<<<<<<<<<<<<<
 *             {n.get_prop(prop_t2) for n in target_t if has_prop(n, prop_t2)})
 * 
 */
  { /* enter inner scope */
    __pyx_t_4 = PySet_New(NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1203, __pyx_L15_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (likely(PyList_CheckExact(((PyObject *)__pyx_v_origin_t))) || PyTuple_CheckExact(((PyObject *)__pyx_v_origin_t))) {
      __pyx_t_6 = ((PyObject *)__pyx_v_origin_t); __Pyx_INCREF(__pyx_t_6);
      __pyx_t_5 = 0;
      __pyx_t_9 = NULL;
    } else {
      __pyx_t_5 = -1; __pyx_t_6 = PyObject_GetIter(((PyObject *)__pyx_v_origin_t)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1203, __pyx_L15_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1203, __pyx_L15_error)
    }
    for (;;) {
      if (likely(!__pyx_t_9)) {
        if (likely(PyList_CheckExact(__pyx_t_6))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1203, __pyx_L15_error)
            #endif
            if (__pyx_t_5 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_7 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 1203, __pyx_L15_error)
          #else
          __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1203, __pyx_L15_error)
          __Pyx_GOTREF(__pyx_t_7);
          #endif
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_6);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1203, __pyx_L15_error)
            #endif
            if (__pyx_t_5 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 1203, __pyx_L15_error)
          #else
          __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1203, __pyx_L15_error)
          __Pyx_GOTREF(__pyx_t_7);
          #endif
        }
      } else {
        __pyx_t_7 = __pyx_t_9(__pyx_t_6);
        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, 1203, __pyx_L15_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_7);
      }
      __Pyx_XDECREF_SET(__pyx_9genexpr13__pyx_v_n, __pyx_t_7);
      __pyx_t_7 = 0;
      __pyx_t_7 = __pyx_cur_scope->__pyx_v_prop_t1;
      __Pyx_INCREF(__pyx_t_7);
      __pyx_t_10 = __pyx_pf_4ete4_4core_4tree_4Tree_15robinson_foulds_has_prop(__pyx_cur_scope->__pyx_v_has_prop, __pyx_9genexpr13__pyx_v_n, __pyx_t_7); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1203, __pyx_L15_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1203, __pyx_L15_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (__pyx_t_1) {
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr13__pyx_v_n, __pyx_n_s_get_prop); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1203, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_11 = NULL;
        __pyx_t_8 = 0;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_7))) {
          __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_7);
          if (likely(__pyx_t_11)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
            __Pyx_INCREF(__pyx_t_11);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_7, function);
            __pyx_t_8 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_cur_scope->__pyx_v_prop_t1};
          __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1203, __pyx_L15_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        }
        if (unlikely(PySet_Add(__pyx_t_4, (PyObject*)__pyx_t_10))) __PYX_ERR(0, 1203, __pyx_L15_error)
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_9genexpr13__pyx_v_n); __pyx_9genexpr13__pyx_v_n = 0;
    goto __pyx_L20_exit_scope;
    __pyx_L15_error:;
    __Pyx_XDECREF(__pyx_9genexpr13__pyx_v_n); __pyx_9genexpr13__pyx_v_n = 0;
    goto __pyx_L1_error;
    __pyx_L20_exit_scope:;
  } /* exit inner scope */
  { /* enter inner scope */

    /* "ete4/core/tree.pyx":1204
 *         common = (  # common leaf values in the two trees
 *             {n.get_prop(prop_t1) for n in origin_t if has_prop(n, prop_t1)} &
 *             {n.get_prop(prop_t2) for n in target_t if has_prop(n, prop_t2)})             # <<<<<<<<<<<<<<
 * 
 *         # Check for duplicated items (is it necessary? can we optimize? what's the impact in performance?')
 */
    __pyx_t_6 = PySet_New(NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1204, __pyx_L23_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (likely(PyList_CheckExact(__pyx_v_target_t)) || PyTuple_CheckExact(__pyx_v_target_t)) {
      __pyx_t_10 = __pyx_v_target_t; __Pyx_INCREF(__pyx_t_10);
      __pyx_t_5 = 0;
      __pyx_t_9 = NULL;
    } else {
      __pyx_t_5 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_v_target_t); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1204, __pyx_L23_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1204, __pyx_L23_error)
    }
    for (;;) {
      if (likely(!__pyx_t_9)) {
        if (likely(PyList_CheckExact(__pyx_t_10))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_10);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1204, __pyx_L23_error)
            #endif
            if (__pyx_t_5 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_7 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 1204, __pyx_L23_error)
          #else
          __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_10, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1204, __pyx_L23_error)
          __Pyx_GOTREF(__pyx_t_7);
          #endif
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_10);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1204, __pyx_L23_error)
            #endif
            if (__pyx_t_5 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 1204, __pyx_L23_error)
          #else
          __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_10, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1204, __pyx_L23_error)
          __Pyx_GOTREF(__pyx_t_7);
          #endif
        }
      } else {
        __pyx_t_7 = __pyx_t_9(__pyx_t_10);
        if (unlikely(!__pyx_t_7)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 1204, __pyx_L23_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_7);
      }
      __Pyx_XDECREF_SET(__pyx_9genexpr14__pyx_v_n, __pyx_t_7);
      __pyx_t_7 = 0;
      __pyx_t_7 = __pyx_cur_scope->__pyx_v_prop_t2;
      __Pyx_INCREF(__pyx_t_7);
      __pyx_t_11 = __pyx_pf_4ete4_4core_4tree_4Tree_15robinson_foulds_has_prop(__pyx_cur_scope->__pyx_v_has_prop, __pyx_9genexpr14__pyx_v_n, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1204, __pyx_L23_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1204, __pyx_L23_error)
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (__pyx_t_1) {
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr14__pyx_v_n, __pyx_n_s_get_prop); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1204, __pyx_L23_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_12 = NULL;
        __pyx_t_8 = 0;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_7))) {
          __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_7);
          if (likely(__pyx_t_12)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
            __Pyx_INCREF(__pyx_t_12);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_7, function);
            __pyx_t_8 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_cur_scope->__pyx_v_prop_t2};
          __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1204, __pyx_L23_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        }
        if (unlikely(PySet_Add(__pyx_t_6, (PyObject*)__pyx_t_11))) __PYX_ERR(0, 1204, __pyx_L23_error)
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_9genexpr14__pyx_v_n); __pyx_9genexpr14__pyx_v_n = 0;
    goto __pyx_L28_exit_scope;
    __pyx_L23_error:;
    __Pyx_XDECREF(__pyx_9genexpr14__pyx_v_n); __pyx_9genexpr14__pyx_v_n = 0;
    goto __pyx_L1_error;
    __pyx_L28_exit_scope:;
  } /* exit inner scope */

  /* "ete4/core/tree.pyx":1203
 * 
 *         common = (  # common leaf values in the two trees
 *             {n.get_prop(prop_t1) for n in origin_t if has_prop(n, prop_t1)} &             # <<<<<<<<<<<<<<
 *             {n.get_prop(prop_t2) for n in target_t if has_prop(n, prop_t2)})
 * 
 */
  __pyx_t_10 = PyNumber_And(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1203, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_GIVEREF(__pyx_t_10);
  __pyx_cur_scope->__pyx_v_common = ((PyObject*)__pyx_t_10);
  __pyx_t_10 = 0;

  /* "ete4/core/tree.pyx":1207
 * 
 *         # Check for duplicated items (is it necessary? can we optimize? what's the impact in performance?')
 *         size1 = sum(1 for n in origin_t if n.get_prop(prop_t1) in common)             # <<<<<<<<<<<<<<
 *         size2 = sum(1 for n in target_t if n.get_prop(prop_t2) in common)
 * 
 */
  __pyx_t_10 = __pyx_pf_4ete4_4core_4tree_4Tree_15robinson_foulds_5genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_origin_t); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_v_size1 = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "ete4/core/tree.pyx":1208
 *         # Check for duplicated items (is it necessary? can we optimize? what's the impact in performance?')
 *         size1 = sum(1 for n in origin_t if n.get_prop(prop_t1) in common)
 *         size2 = sum(1 for n in target_t if n.get_prop(prop_t2) in common)             # <<<<<<<<<<<<<<
 * 
 *         if size1 > len(common):
 */
  __pyx_t_6 = __pyx_pf_4ete4_4core_4tree_4Tree_15robinson_foulds_8genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_target_t); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1208, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1208, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_size2 = __pyx_t_10;
  __pyx_t_10 = 0;

  /* "ete4/core/tree.pyx":1210
 *         size2 = sum(1 for n in target_t if n.get_prop(prop_t2) in common)
 * 
 *         if size1 > len(common):             # <<<<<<<<<<<<<<
 *             raise TreeError('Duplicated items found in reference tree.')
 *         if size2 > len(common):
 */
  __pyx_t_10 = __pyx_cur_scope->__pyx_v_common;
  __Pyx_INCREF(__pyx_t_10);
  __pyx_t_5 = __Pyx_PySet_GET_SIZE(__pyx_t_10); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1210, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1210, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_6 = PyObject_RichCompare(__pyx_v_size1, __pyx_t_10, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1210, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1210, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(__pyx_t_1)) {

    /* "ete4/core/tree.pyx":1211
 * 
 *         if size1 > len(common):
 *             raise TreeError('Duplicated items found in reference tree.')             # <<<<<<<<<<<<<<
 *         if size2 > len(common):
 *             raise TreeError('Duplicated items found in target tree.')
 */
    __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_TreeError); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1211, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_4 = NULL;
    __pyx_t_8 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_10))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_10);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_10, function);
        __pyx_t_8 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_u_Duplicated_items_found_in_refere};
      __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1211, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    }
    __Pyx_Raise(__pyx_t_6, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __PYX_ERR(0, 1211, __pyx_L1_error)

    /* "ete4/core/tree.pyx":1210
 *         size2 = sum(1 for n in target_t if n.get_prop(prop_t2) in common)
 * 
 *         if size1 > len(common):             # <<<<<<<<<<<<<<
 *             raise TreeError('Duplicated items found in reference tree.')
 *         if size2 > len(common):
 */
  }

  /* "ete4/core/tree.pyx":1212
 *         if size1 > len(common):
 *             raise TreeError('Duplicated items found in reference tree.')
 *         if size2 > len(common):             # <<<<<<<<<<<<<<
 *             raise TreeError('Duplicated items found in target tree.')
 * 
 */
  __pyx_t_6 = __pyx_cur_scope->__pyx_v_common;
  __Pyx_INCREF(__pyx_t_6);
  __pyx_t_5 = __Pyx_PySet_GET_SIZE(__pyx_t_6); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1212, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1212, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_10 = PyObject_RichCompare(__pyx_v_size2, __pyx_t_6, Py_GT); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1212, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1212, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (unlikely(__pyx_t_1)) {

    /* "ete4/core/tree.pyx":1213
 *             raise TreeError('Duplicated items found in reference tree.')
 *         if size2 > len(common):
 *             raise TreeError('Duplicated items found in target tree.')             # <<<<<<<<<<<<<<
 * 
 *         if expand_polytomies:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_TreeError); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1213, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = NULL;
    __pyx_t_8 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_8 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_u_Duplicated_items_found_in_target};
      __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1213, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_Raise(__pyx_t_10, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __PYX_ERR(0, 1213, __pyx_L1_error)

    /* "ete4/core/tree.pyx":1212
 *         if size1 > len(common):
 *             raise TreeError('Duplicated items found in reference tree.')
 *         if size2 > len(common):             # <<<<<<<<<<<<<<
 *             raise TreeError('Duplicated items found in target tree.')
 * 
 */
  }

  /* "ete4/core/tree.pyx":1215
 *             raise TreeError('Duplicated items found in target tree.')
 * 
 *         if expand_polytomies:             # <<<<<<<<<<<<<<
 *             origin_trees = [Tree(nw) for nw in
 *                             origin_t.expand_polytomies(map_prop=prop_t1,
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_expand_polytomies); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1215, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "ete4/core/tree.pyx":1216
 * 
 *         if expand_polytomies:
 *             origin_trees = [Tree(nw) for nw in             # <<<<<<<<<<<<<<
 *                             origin_t.expand_polytomies(map_prop=prop_t1,
 *                                                        polytomy_size_limit=polytomy_size_limit,
 */
    { /* enter inner scope */
      __pyx_t_10 = PyList_New(0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1216, __pyx_L34_error)
      __Pyx_GOTREF(__pyx_t_10);

      /* "ete4/core/tree.pyx":1217
 *         if expand_polytomies:
 *             origin_trees = [Tree(nw) for nw in
 *                             origin_t.expand_polytomies(map_prop=prop_t1,             # <<<<<<<<<<<<<<
 *                                                        polytomy_size_limit=polytomy_size_limit,
 *                                                        skip_large_polytomies=skip_large_polytomies)]
 */
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_origin_t), __pyx_n_s_expand_polytomies); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1217, __pyx_L34_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1217, __pyx_L34_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_map_prop, __pyx_cur_scope->__pyx_v_prop_t1) < 0) __PYX_ERR(0, 1217, __pyx_L34_error)

      /* "ete4/core/tree.pyx":1218
 *             origin_trees = [Tree(nw) for nw in
 *                             origin_t.expand_polytomies(map_prop=prop_t1,
 *                                                        polytomy_size_limit=polytomy_size_limit,             # <<<<<<<<<<<<<<
 *                                                        skip_large_polytomies=skip_large_polytomies)]
 *             target_trees = [Tree(nw) for nw in
 */
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_polytomy_size_limit, __pyx_v_polytomy_size_limit) < 0) __PYX_ERR(0, 1217, __pyx_L34_error)

      /* "ete4/core/tree.pyx":1219
 *                             origin_t.expand_polytomies(map_prop=prop_t1,
 *                                                        polytomy_size_limit=polytomy_size_limit,
 *                                                        skip_large_polytomies=skip_large_polytomies)]             # <<<<<<<<<<<<<<
 *             target_trees = [Tree(nw) for nw in
 *                             target_t.expand_polytomies(map_prop=prop_t2,
 */
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_skip_large_polytomies, __pyx_v_skip_large_polytomies) < 0) __PYX_ERR(0, 1217, __pyx_L34_error)

      /* "ete4/core/tree.pyx":1217
 *         if expand_polytomies:
 *             origin_trees = [Tree(nw) for nw in
 *                             origin_t.expand_polytomies(map_prop=prop_t1,             # <<<<<<<<<<<<<<
 *                                                        polytomy_size_limit=polytomy_size_limit,
 *                                                        skip_large_polytomies=skip_large_polytomies)]
 */
      __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1217, __pyx_L34_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (likely(PyList_CheckExact(__pyx_t_11)) || PyTuple_CheckExact(__pyx_t_11)) {
        __pyx_t_4 = __pyx_t_11; __Pyx_INCREF(__pyx_t_4);
        __pyx_t_5 = 0;
        __pyx_t_9 = NULL;
      } else {
        __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1217, __pyx_L34_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1217, __pyx_L34_error)
      }
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      for (;;) {
        if (likely(!__pyx_t_9)) {
          if (likely(PyList_CheckExact(__pyx_t_4))) {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4);
              #if !CYTHON_ASSUME_SAFE_MACROS
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1217, __pyx_L34_error)
              #endif
              if (__pyx_t_5 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_11 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_11); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 1217, __pyx_L34_error)
            #else
            __pyx_t_11 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1217, __pyx_L34_error)
            __Pyx_GOTREF(__pyx_t_11);
            #endif
          } else {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4);
              #if !CYTHON_ASSUME_SAFE_MACROS
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1217, __pyx_L34_error)
              #endif
              if (__pyx_t_5 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_11 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_11); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 1217, __pyx_L34_error)
            #else
            __pyx_t_11 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1217, __pyx_L34_error)
            __Pyx_GOTREF(__pyx_t_11);
            #endif
          }
        } else {
          __pyx_t_11 = __pyx_t_9(__pyx_t_4);
          if (unlikely(!__pyx_t_11)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 1217, __pyx_L34_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_11);
        }
        __Pyx_XDECREF_SET(__pyx_9genexpr17__pyx_v_nw, __pyx_t_11);
        __pyx_t_11 = 0;

        /* "ete4/core/tree.pyx":1216
 * 
 *         if expand_polytomies:
 *             origin_trees = [Tree(nw) for nw in             # <<<<<<<<<<<<<<
 *                             origin_t.expand_polytomies(map_prop=prop_t1,
 *                                                        polytomy_size_limit=polytomy_size_limit,
 */
        __pyx_t_11 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree), __pyx_9genexpr17__pyx_v_nw); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1216, __pyx_L34_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_10, (PyObject*)__pyx_t_11))) __PYX_ERR(0, 1216, __pyx_L34_error)
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_9genexpr17__pyx_v_nw); __pyx_9genexpr17__pyx_v_nw = 0;
      goto __pyx_L38_exit_scope;
      __pyx_L34_error:;
      __Pyx_XDECREF(__pyx_9genexpr17__pyx_v_nw); __pyx_9genexpr17__pyx_v_nw = 0;
      goto __pyx_L1_error;
      __pyx_L38_exit_scope:;
    } /* exit inner scope */
    __pyx_v_origin_trees = ((PyObject*)__pyx_t_10);
    __pyx_t_10 = 0;

    /* "ete4/core/tree.pyx":1220
 *                                                        polytomy_size_limit=polytomy_size_limit,
 *                                                        skip_large_polytomies=skip_large_polytomies)]
 *             target_trees = [Tree(nw) for nw in             # <<<<<<<<<<<<<<
 *                             target_t.expand_polytomies(map_prop=prop_t2,
 *                                                        polytomy_size_limit=polytomy_size_limit,
 */
    { /* enter inner scope */
      __pyx_t_10 = PyList_New(0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1220, __pyx_L41_error)
      __Pyx_GOTREF(__pyx_t_10);

      /* "ete4/core/tree.pyx":1221
 *                                                        skip_large_polytomies=skip_large_polytomies)]
 *             target_trees = [Tree(nw) for nw in
 *                             target_t.expand_polytomies(map_prop=prop_t2,             # <<<<<<<<<<<<<<
 *                                                        polytomy_size_limit=polytomy_size_limit,
 *                                                        skip_large_polytomies=skip_large_polytomies)]
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_target_t, __pyx_n_s_expand_polytomies); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1221, __pyx_L41_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_11 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1221, __pyx_L41_error)
      __Pyx_GOTREF(__pyx_t_11);
      if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_map_prop, __pyx_cur_scope->__pyx_v_prop_t2) < 0) __PYX_ERR(0, 1221, __pyx_L41_error)

      /* "ete4/core/tree.pyx":1222
 *             target_trees = [Tree(nw) for nw in
 *                             target_t.expand_polytomies(map_prop=prop_t2,
 *                                                        polytomy_size_limit=polytomy_size_limit,             # <<<<<<<<<<<<<<
 *                                                        skip_large_polytomies=skip_large_polytomies)]
 *             prop_t1, prop_t2 = 'name', 'name'
 */
      if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_polytomy_size_limit, __pyx_v_polytomy_size_limit) < 0) __PYX_ERR(0, 1221, __pyx_L41_error)

      /* "ete4/core/tree.pyx":1223
 *                             target_t.expand_polytomies(map_prop=prop_t2,
 *                                                        polytomy_size_limit=polytomy_size_limit,
 *                                                        skip_large_polytomies=skip_large_polytomies)]             # <<<<<<<<<<<<<<
 *             prop_t1, prop_t2 = 'name', 'name'
 *         else:
 */
      if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_skip_large_polytomies, __pyx_v_skip_large_polytomies) < 0) __PYX_ERR(0, 1221, __pyx_L41_error)

      /* "ete4/core/tree.pyx":1221
 *                                                        skip_large_polytomies=skip_large_polytomies)]
 *             target_trees = [Tree(nw) for nw in
 *                             target_t.expand_polytomies(map_prop=prop_t2,             # <<<<<<<<<<<<<<
 *                                                        polytomy_size_limit=polytomy_size_limit,
 *                                                        skip_large_polytomies=skip_large_polytomies)]
 */
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1221, __pyx_L41_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) {
        __pyx_t_11 = __pyx_t_6; __Pyx_INCREF(__pyx_t_11);
        __pyx_t_5 = 0;
        __pyx_t_9 = NULL;
      } else {
        __pyx_t_5 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1221, __pyx_L41_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_11); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1221, __pyx_L41_error)
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      for (;;) {
        if (likely(!__pyx_t_9)) {
          if (likely(PyList_CheckExact(__pyx_t_11))) {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_11);
              #if !CYTHON_ASSUME_SAFE_MACROS
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1221, __pyx_L41_error)
              #endif
              if (__pyx_t_5 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_6 = PyList_GET_ITEM(__pyx_t_11, __pyx_t_5); __Pyx_INCREF(__pyx_t_6); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 1221, __pyx_L41_error)
            #else
            __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_11, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1221, __pyx_L41_error)
            __Pyx_GOTREF(__pyx_t_6);
            #endif
          } else {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_11);
              #if !CYTHON_ASSUME_SAFE_MACROS
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1221, __pyx_L41_error)
              #endif
              if (__pyx_t_5 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_11, __pyx_t_5); __Pyx_INCREF(__pyx_t_6); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 1221, __pyx_L41_error)
            #else
            __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_11, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1221, __pyx_L41_error)
            __Pyx_GOTREF(__pyx_t_6);
            #endif
          }
        } else {
          __pyx_t_6 = __pyx_t_9(__pyx_t_11);
          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, 1221, __pyx_L41_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_6);
        }
        __Pyx_XDECREF_SET(__pyx_9genexpr18__pyx_v_nw, __pyx_t_6);
        __pyx_t_6 = 0;

        /* "ete4/core/tree.pyx":1220
 *                                                        polytomy_size_limit=polytomy_size_limit,
 *                                                        skip_large_polytomies=skip_large_polytomies)]
 *             target_trees = [Tree(nw) for nw in             # <<<<<<<<<<<<<<
 *                             target_t.expand_polytomies(map_prop=prop_t2,
 *                                                        polytomy_size_limit=polytomy_size_limit,
 */
        __pyx_t_6 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree), __pyx_9genexpr18__pyx_v_nw); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1220, __pyx_L41_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_10, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 1220, __pyx_L41_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_XDECREF(__pyx_9genexpr18__pyx_v_nw); __pyx_9genexpr18__pyx_v_nw = 0;
      goto __pyx_L45_exit_scope;
      __pyx_L41_error:;
      __Pyx_XDECREF(__pyx_9genexpr18__pyx_v_nw); __pyx_9genexpr18__pyx_v_nw = 0;
      goto __pyx_L1_error;
      __pyx_L45_exit_scope:;
    } /* exit inner scope */
    __pyx_v_target_trees = ((PyObject*)__pyx_t_10);
    __pyx_t_10 = 0;

    /* "ete4/core/tree.pyx":1224
 *                                                        polytomy_size_limit=polytomy_size_limit,
 *                                                        skip_large_polytomies=skip_large_polytomies)]
 *             prop_t1, prop_t2 = 'name', 'name'             # <<<<<<<<<<<<<<
 *         else:
 *             origin_trees = [origin_t]
 */
    __pyx_t_10 = __pyx_n_u_name;
    __Pyx_INCREF(__pyx_t_10);
    __pyx_t_11 = __pyx_n_u_name;
    __Pyx_INCREF(__pyx_t_11);
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_prop_t1);
    __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_prop_t1, __pyx_t_10);
    __Pyx_GIVEREF(__pyx_t_10);
    __pyx_t_10 = 0;
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_prop_t2);
    __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_prop_t2, __pyx_t_11);
    __Pyx_GIVEREF(__pyx_t_11);
    __pyx_t_11 = 0;

    /* "ete4/core/tree.pyx":1215
 *             raise TreeError('Duplicated items found in target tree.')
 * 
 *         if expand_polytomies:             # <<<<<<<<<<<<<<
 *             origin_trees = [Tree(nw) for nw in
 *                             origin_t.expand_polytomies(map_prop=prop_t1,
 */
    goto __pyx_L31;
  }

  /* "ete4/core/tree.pyx":1226
 *             prop_t1, prop_t2 = 'name', 'name'
 *         else:
 *             origin_trees = [origin_t]             # <<<<<<<<<<<<<<
 *             target_trees = [target_t]
 * 
 */
  /*else*/ {
    __pyx_t_11 = PyList_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1226, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_INCREF((PyObject *)__pyx_v_origin_t);
    __Pyx_GIVEREF((PyObject *)__pyx_v_origin_t);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_11, 0, ((PyObject *)__pyx_v_origin_t))) __PYX_ERR(0, 1226, __pyx_L1_error);
    __pyx_v_origin_trees = ((PyObject*)__pyx_t_11);
    __pyx_t_11 = 0;

    /* "ete4/core/tree.pyx":1227
 *         else:
 *             origin_trees = [origin_t]
 *             target_trees = [target_t]             # <<<<<<<<<<<<<<
 * 
 *         polytomy_correction = 0
 */
    __pyx_t_11 = PyList_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1227, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_INCREF(__pyx_v_target_t);
    __Pyx_GIVEREF(__pyx_v_target_t);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_11, 0, __pyx_v_target_t)) __PYX_ERR(0, 1227, __pyx_L1_error);
    __pyx_v_target_trees = ((PyObject*)__pyx_t_11);
    __pyx_t_11 = 0;
  }
  __pyx_L31:;

  /* "ete4/core/tree.pyx":1229
 *             target_trees = [target_t]
 * 
 *         polytomy_correction = 0             # <<<<<<<<<<<<<<
 *         if correct_by_polytomy_size:
 *             corr1 = sum(len(n.children) - 2 for n in origin_t.traverse() if len(n.children) > 2)
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_v_polytomy_correction = __pyx_int_0;

  /* "ete4/core/tree.pyx":1230
 * 
 *         polytomy_correction = 0
 *         if correct_by_polytomy_size:             # <<<<<<<<<<<<<<
 *             corr1 = sum(len(n.children) - 2 for n in origin_t.traverse() if len(n.children) > 2)
 *             corr2 = sum(len(n.children) - 2 for n in target_t.traverse() if len(n.children) > 2)
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_correct_by_polytomy_size); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1230, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "ete4/core/tree.pyx":1231
 *         polytomy_correction = 0
 *         if correct_by_polytomy_size:
 *             corr1 = sum(len(n.children) - 2 for n in origin_t.traverse() if len(n.children) > 2)             # <<<<<<<<<<<<<<
 *             corr2 = sum(len(n.children) - 2 for n in target_t.traverse() if len(n.children) > 2)
 * 
 */
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_origin_t), __pyx_n_s_traverse); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1231, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_6 = NULL;
    __pyx_t_8 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_10))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_10);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_10, function);
        __pyx_t_8 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
      __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_8, 0+__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1231, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    }
    __pyx_t_10 = __pyx_pf_4ete4_4core_4tree_4Tree_15robinson_foulds_11genexpr(NULL, __pyx_t_11); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1231, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1231, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_v_corr1 = __pyx_t_11;
    __pyx_t_11 = 0;

    /* "ete4/core/tree.pyx":1232
 *         if correct_by_polytomy_size:
 *             corr1 = sum(len(n.children) - 2 for n in origin_t.traverse() if len(n.children) > 2)
 *             corr2 = sum(len(n.children) - 2 for n in target_t.traverse() if len(n.children) > 2)             # <<<<<<<<<<<<<<
 * 
 *             if corr1 > 0 and corr2 > 0:
 */
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_target_t, __pyx_n_s_traverse); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1232, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_6 = NULL;
    __pyx_t_8 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_10))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_10);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_10, function);
        __pyx_t_8 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
      __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_8, 0+__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1232, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    }
    __pyx_t_10 = __pyx_pf_4ete4_4core_4tree_4Tree_15robinson_foulds_14genexpr(NULL, __pyx_t_11); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1232, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1232, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_v_corr2 = __pyx_t_11;
    __pyx_t_11 = 0;

    /* "ete4/core/tree.pyx":1234
 *             corr2 = sum(len(n.children) - 2 for n in target_t.traverse() if len(n.children) > 2)
 * 
 *             if corr1 > 0 and corr2 > 0:             # <<<<<<<<<<<<<<
 *                 raise TreeError('Both trees contain polytomies! Try expand_polytomies=True instead.')
 * 
 */
    __pyx_t_11 = PyObject_RichCompare(__pyx_v_corr1, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1234, __pyx_L1_error)
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1234, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    if (__pyx_t_3) {
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L48_bool_binop_done;
    }
    __pyx_t_11 = PyObject_RichCompare(__pyx_v_corr2, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1234, __pyx_L1_error)
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1234, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_1 = __pyx_t_3;
    __pyx_L48_bool_binop_done:;
    if (unlikely(__pyx_t_1)) {

      /* "ete4/core/tree.pyx":1235
 * 
 *             if corr1 > 0 and corr2 > 0:
 *                 raise TreeError('Both trees contain polytomies! Try expand_polytomies=True instead.')             # <<<<<<<<<<<<<<
 * 
 *             polytomy_correction = max(corr1, corr2)
 */
      __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_TreeError); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1235, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_6 = NULL;
      __pyx_t_8 = 0;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_10))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_10);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_10, function);
          __pyx_t_8 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_kp_u_Both_trees_contain_polytomies_Tr};
        __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1235, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      }
      __Pyx_Raise(__pyx_t_11, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __PYX_ERR(0, 1235, __pyx_L1_error)

      /* "ete4/core/tree.pyx":1234
 *             corr2 = sum(len(n.children) - 2 for n in target_t.traverse() if len(n.children) > 2)
 * 
 *             if corr1 > 0 and corr2 > 0:             # <<<<<<<<<<<<<<
 *                 raise TreeError('Both trees contain polytomies! Try expand_polytomies=True instead.')
 * 
 */
    }

    /* "ete4/core/tree.pyx":1237
 *                 raise TreeError('Both trees contain polytomies! Try expand_polytomies=True instead.')
 * 
 *             polytomy_correction = max(corr1, corr2)             # <<<<<<<<<<<<<<
 * 
 *         def from_common(nodes, prop):  # helper function
 */
    __Pyx_INCREF(__pyx_v_corr2);
    __pyx_t_11 = __pyx_v_corr2;
    __Pyx_INCREF(__pyx_v_corr1);
    __pyx_t_10 = __pyx_v_corr1;
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_11, __pyx_t_10, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1237, __pyx_L1_error)
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1237, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_1) {
      __Pyx_INCREF(__pyx_t_11);
      __pyx_t_6 = __pyx_t_11;
    } else {
      __Pyx_INCREF(__pyx_t_10);
      __pyx_t_6 = __pyx_t_10;
    }
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_11 = __pyx_t_6;
    __Pyx_INCREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF_SET(__pyx_v_polytomy_correction, __pyx_t_11);
    __pyx_t_11 = 0;

    /* "ete4/core/tree.pyx":1230
 * 
 *         polytomy_correction = 0
 *         if correct_by_polytomy_size:             # <<<<<<<<<<<<<<
 *             corr1 = sum(len(n.children) - 2 for n in origin_t.traverse() if len(n.children) > 2)
 *             corr2 = sum(len(n.children) - 2 for n in target_t.traverse() if len(n.children) > 2)
 */
  }

  /* "ete4/core/tree.pyx":1239
 *             polytomy_correction = max(corr1, corr2)
 * 
 *         def from_common(nodes, prop):  # helper function             # <<<<<<<<<<<<<<
 *             """Yield values (if existing in both trees) for property prop."""
 *             for node in nodes:
 */
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_15robinson_foulds_3from_common, 0, __pyx_n_s_robinson_foulds_locals_from_comm, ((PyObject*)__pyx_cur_scope), __pyx_n_s_ete4_core_tree, __pyx_d, ((PyObject *)__pyx_codeobj__29)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1239, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_GIVEREF(__pyx_t_11);
  __pyx_cur_scope->__pyx_v_from_common = __pyx_t_11;
  __pyx_t_11 = 0;

  /* "ete4/core/tree.pyx":1247
 *                         yield value
 * 
 *         min_comparison = None             # <<<<<<<<<<<<<<
 *         for t1 in origin_trees:
 *             t1_leaves = t1.get_cached_content()
 */
  __Pyx_INCREF(Py_None);
  __pyx_v_min_comparison = ((PyObject*)Py_None);

  /* "ete4/core/tree.pyx":1248
 * 
 *         min_comparison = None
 *         for t1 in origin_trees:             # <<<<<<<<<<<<<<
 *             t1_leaves = t1.get_cached_content()
 *             t1_leaves_all = t1_leaves[t1]
 */
  __pyx_t_11 = __pyx_v_origin_trees; __Pyx_INCREF(__pyx_t_11);
  __pyx_t_5 = 0;
  for (;;) {
    {
      Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_11);
      #if !CYTHON_ASSUME_SAFE_MACROS
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1248, __pyx_L1_error)
      #endif
      if (__pyx_t_5 >= __pyx_temp) break;
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_6 = PyList_GET_ITEM(__pyx_t_11, __pyx_t_5); __Pyx_INCREF(__pyx_t_6); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 1248, __pyx_L1_error)
    #else
    __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_11, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1248, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_t1, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "ete4/core/tree.pyx":1249
 *         min_comparison = None
 *         for t1 in origin_trees:
 *             t1_leaves = t1.get_cached_content()             # <<<<<<<<<<<<<<
 *             t1_leaves_all = t1_leaves[t1]
 * 
 */
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_t1, __pyx_n_s_get_cached_content); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1249, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_4 = NULL;
    __pyx_t_8 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_10))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_10);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_10, function);
        __pyx_t_8 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
      __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_8, 0+__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1249, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    }
    __Pyx_XDECREF_SET(__pyx_v_t1_leaves, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "ete4/core/tree.pyx":1250
 *         for t1 in origin_trees:
 *             t1_leaves = t1.get_cached_content()
 *             t1_leaves_all = t1_leaves[t1]             # <<<<<<<<<<<<<<
 * 
 *             if unrooted_trees:
 */
    __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_t1_leaves, __pyx_v_t1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1250, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_XDECREF_SET(__pyx_v_t1_leaves_all, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "ete4/core/tree.pyx":1252
 *             t1_leaves_all = t1_leaves[t1]
 * 
 *             if unrooted_trees:             # <<<<<<<<<<<<<<
 *                 edges1 = {  # set that looks like {((a, b, ...), (x, y, ...)), ...}
 *                     tuple(sorted([
 */
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_unrooted_trees); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1252, __pyx_L1_error)
    if (__pyx_t_1) {

      /* "ete4/core/tree.pyx":1253
 * 
 *             if unrooted_trees:
 *                 edges1 = {  # set that looks like {((a, b, ...), (x, y, ...)), ...}             # <<<<<<<<<<<<<<
 *                     tuple(sorted([
 *                         tuple(sorted(from_common(leaves, prop_t1))),
 */
      { /* enter inner scope */
        __pyx_t_6 = PySet_New(NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1253, __pyx_L55_error)
        __Pyx_GOTREF(__pyx_t_6);

        /* "ete4/core/tree.pyx":1257
 *                         tuple(sorted(from_common(leaves, prop_t1))),
 *                         tuple(sorted(from_common(t1_leaves_all - leaves, prop_t1)))]))
 *                     for leaves in t1_leaves.values()}             # <<<<<<<<<<<<<<
 *                 edges1.discard(((), ()))  # probably unnecessary
 *             else:
 */
        __pyx_t_13 = 0;
        if (unlikely(__pyx_v_t1_leaves == Py_None)) {
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "values");
          __PYX_ERR(0, 1257, __pyx_L55_error)
        }
        __pyx_t_4 = __Pyx_dict_iterator(__pyx_v_t1_leaves, 0, __pyx_n_s_values, (&__pyx_t_14), (&__pyx_t_15)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1257, __pyx_L55_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_XDECREF(__pyx_t_10);
        __pyx_t_10 = __pyx_t_4;
        __pyx_t_4 = 0;
        while (1) {
          __pyx_t_16 = __Pyx_dict_iter_next(__pyx_t_10, __pyx_t_14, &__pyx_t_13, NULL, &__pyx_t_4, NULL, __pyx_t_15);
          if (unlikely(__pyx_t_16 == 0)) break;
          if (unlikely(__pyx_t_16 == -1)) __PYX_ERR(0, 1257, __pyx_L55_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_XDECREF_SET(__pyx_9genexpr21__pyx_v_leaves, __pyx_t_4);
          __pyx_t_4 = 0;

          /* "ete4/core/tree.pyx":1255
 *                 edges1 = {  # set that looks like {((a, b, ...), (x, y, ...)), ...}
 *                     tuple(sorted([
 *                         tuple(sorted(from_common(leaves, prop_t1))),             # <<<<<<<<<<<<<<
 *                         tuple(sorted(from_common(t1_leaves_all - leaves, prop_t1)))]))
 *                     for leaves in t1_leaves.values()}
 */
          __pyx_t_12 = __pyx_cur_scope->__pyx_v_prop_t1;
          __Pyx_INCREF(__pyx_t_12);
          __pyx_t_17 = __pyx_pf_4ete4_4core_4tree_4Tree_15robinson_foulds_2from_common(__pyx_cur_scope->__pyx_v_from_common, __pyx_9genexpr21__pyx_v_leaves, __pyx_t_12); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1255, __pyx_L55_error)
          __Pyx_GOTREF(__pyx_t_17);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = PySequence_List(__pyx_t_17); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1255, __pyx_L55_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
          __pyx_t_7 = ((PyObject*)__pyx_t_12);
          __pyx_t_12 = 0;
          __pyx_t_18 = PyList_Sort(__pyx_t_7); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 1255, __pyx_L55_error)
          __pyx_t_12 = PyList_AsTuple(((PyObject*)__pyx_t_7)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1255, __pyx_L55_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

          /* "ete4/core/tree.pyx":1256
 *                     tuple(sorted([
 *                         tuple(sorted(from_common(leaves, prop_t1))),
 *                         tuple(sorted(from_common(t1_leaves_all - leaves, prop_t1)))]))             # <<<<<<<<<<<<<<
 *                     for leaves in t1_leaves.values()}
 *                 edges1.discard(((), ()))  # probably unnecessary
 */
          __pyx_t_17 = PyNumber_Subtract(__pyx_v_t1_leaves_all, __pyx_9genexpr21__pyx_v_leaves); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1256, __pyx_L55_error)
          __Pyx_GOTREF(__pyx_t_17);
          __pyx_t_19 = __pyx_cur_scope->__pyx_v_prop_t1;
          __Pyx_INCREF(__pyx_t_19);
          __pyx_t_20 = __pyx_pf_4ete4_4core_4tree_4Tree_15robinson_foulds_2from_common(__pyx_cur_scope->__pyx_v_from_common, __pyx_t_17, __pyx_t_19); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1256, __pyx_L55_error)
          __Pyx_GOTREF(__pyx_t_20);
          __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
          __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
          __pyx_t_19 = PySequence_List(__pyx_t_20); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1256, __pyx_L55_error)
          __Pyx_GOTREF(__pyx_t_19);
          __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
          __pyx_t_7 = ((PyObject*)__pyx_t_19);
          __pyx_t_19 = 0;
          __pyx_t_18 = PyList_Sort(__pyx_t_7); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 1256, __pyx_L55_error)
          __pyx_t_19 = PyList_AsTuple(((PyObject*)__pyx_t_7)); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1256, __pyx_L55_error)
          __Pyx_GOTREF(__pyx_t_19);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

          /* "ete4/core/tree.pyx":1254
 *             if unrooted_trees:
 *                 edges1 = {  # set that looks like {((a, b, ...), (x, y, ...)), ...}
 *                     tuple(sorted([             # <<<<<<<<<<<<<<
 *                         tuple(sorted(from_common(leaves, prop_t1))),
 *                         tuple(sorted(from_common(t1_leaves_all - leaves, prop_t1)))]))
 */
          __pyx_t_7 = PyList_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1254, __pyx_L55_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_12);
          if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 0, __pyx_t_12)) __PYX_ERR(0, 1254, __pyx_L55_error);
          __Pyx_GIVEREF(__pyx_t_19);
          if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 1, __pyx_t_19)) __PYX_ERR(0, 1254, __pyx_L55_error);
          __pyx_t_12 = 0;
          __pyx_t_19 = 0;
          __pyx_t_4 = ((PyObject*)__pyx_t_7);
          __pyx_t_7 = 0;
          __pyx_t_18 = PyList_Sort(__pyx_t_4); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 1254, __pyx_L55_error)
          __pyx_t_7 = PyList_AsTuple(((PyObject*)__pyx_t_4)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1254, __pyx_L55_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(PySet_Add(__pyx_t_6, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 1254, __pyx_L55_error)
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        }
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_XDECREF(__pyx_9genexpr21__pyx_v_leaves); __pyx_9genexpr21__pyx_v_leaves = 0;
        goto __pyx_L58_exit_scope;
        __pyx_L55_error:;
        __Pyx_XDECREF(__pyx_9genexpr21__pyx_v_leaves); __pyx_9genexpr21__pyx_v_leaves = 0;
        goto __pyx_L1_error;
        __pyx_L58_exit_scope:;
      } /* exit inner scope */
      __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_edges1);
      __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_edges1, ((PyObject*)__pyx_t_6));
      __Pyx_GIVEREF(__pyx_t_6);
      __pyx_t_6 = 0;

      /* "ete4/core/tree.pyx":1258
 *                         tuple(sorted(from_common(t1_leaves_all - leaves, prop_t1)))]))
 *                     for leaves in t1_leaves.values()}
 *                 edges1.discard(((), ()))  # probably unnecessary             # <<<<<<<<<<<<<<
 *             else:
 *                 edges1 = {tuple(sorted(from_common(leaves, prop_t1)))
 */
      __pyx_t_18 = __Pyx_PySet_Discard(__pyx_cur_scope->__pyx_v_edges1, __pyx_tuple__30); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 1258, __pyx_L1_error)

      /* "ete4/core/tree.pyx":1252
 *             t1_leaves_all = t1_leaves[t1]
 * 
 *             if unrooted_trees:             # <<<<<<<<<<<<<<
 *                 edges1 = {  # set that looks like {((a, b, ...), (x, y, ...)), ...}
 *                     tuple(sorted([
 */
      goto __pyx_L52;
    }

    /* "ete4/core/tree.pyx":1260
 *                 edges1.discard(((), ()))  # probably unnecessary
 *             else:
 *                 edges1 = {tuple(sorted(from_common(leaves, prop_t1)))             # <<<<<<<<<<<<<<
 *                           for leaves in t1_leaves.values()}
 *                 edges1.discard(())
 */
    /*else*/ {
      { /* enter inner scope */
        __pyx_t_6 = PySet_New(NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1260, __pyx_L61_error)
        __Pyx_GOTREF(__pyx_t_6);

        /* "ete4/core/tree.pyx":1261
 *             else:
 *                 edges1 = {tuple(sorted(from_common(leaves, prop_t1)))
 *                           for leaves in t1_leaves.values()}             # <<<<<<<<<<<<<<
 *                 edges1.discard(())
 * 
 */
        __pyx_t_14 = 0;
        if (unlikely(__pyx_v_t1_leaves == Py_None)) {
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "values");
          __PYX_ERR(0, 1261, __pyx_L61_error)
        }
        __pyx_t_7 = __Pyx_dict_iterator(__pyx_v_t1_leaves, 0, __pyx_n_s_values, (&__pyx_t_13), (&__pyx_t_15)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1261, __pyx_L61_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_XDECREF(__pyx_t_10);
        __pyx_t_10 = __pyx_t_7;
        __pyx_t_7 = 0;
        while (1) {
          __pyx_t_16 = __Pyx_dict_iter_next(__pyx_t_10, __pyx_t_13, &__pyx_t_14, NULL, &__pyx_t_7, NULL, __pyx_t_15);
          if (unlikely(__pyx_t_16 == 0)) break;
          if (unlikely(__pyx_t_16 == -1)) __PYX_ERR(0, 1261, __pyx_L61_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_XDECREF_SET(__pyx_9genexpr22__pyx_v_leaves, __pyx_t_7);
          __pyx_t_7 = 0;

          /* "ete4/core/tree.pyx":1260
 *                 edges1.discard(((), ()))  # probably unnecessary
 *             else:
 *                 edges1 = {tuple(sorted(from_common(leaves, prop_t1)))             # <<<<<<<<<<<<<<
 *                           for leaves in t1_leaves.values()}
 *                 edges1.discard(())
 */
          __pyx_t_4 = __pyx_cur_scope->__pyx_v_prop_t1;
          __Pyx_INCREF(__pyx_t_4);
          __pyx_t_19 = __pyx_pf_4ete4_4core_4tree_4Tree_15robinson_foulds_2from_common(__pyx_cur_scope->__pyx_v_from_common, __pyx_9genexpr22__pyx_v_leaves, __pyx_t_4); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1260, __pyx_L61_error)
          __Pyx_GOTREF(__pyx_t_19);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_4 = PySequence_List(__pyx_t_19); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1260, __pyx_L61_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
          __pyx_t_7 = ((PyObject*)__pyx_t_4);
          __pyx_t_4 = 0;
          __pyx_t_18 = PyList_Sort(__pyx_t_7); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 1260, __pyx_L61_error)
          __pyx_t_4 = PyList_AsTuple(((PyObject*)__pyx_t_7)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1260, __pyx_L61_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (unlikely(PySet_Add(__pyx_t_6, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 1260, __pyx_L61_error)
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        }
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_XDECREF(__pyx_9genexpr22__pyx_v_leaves); __pyx_9genexpr22__pyx_v_leaves = 0;
        goto __pyx_L64_exit_scope;
        __pyx_L61_error:;
        __Pyx_XDECREF(__pyx_9genexpr22__pyx_v_leaves); __pyx_9genexpr22__pyx_v_leaves = 0;
        goto __pyx_L1_error;
        __pyx_L64_exit_scope:;
      } /* exit inner scope */
      __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_edges1);
      __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_edges1, ((PyObject*)__pyx_t_6));
      __Pyx_GIVEREF(__pyx_t_6);
      __pyx_t_6 = 0;

      /* "ete4/core/tree.pyx":1262
 *                 edges1 = {tuple(sorted(from_common(leaves, prop_t1)))
 *                           for leaves in t1_leaves.values()}
 *                 edges1.discard(())             # <<<<<<<<<<<<<<
 * 
 *             if min_support_t1:
 */
      __pyx_t_18 = __Pyx_PySet_Discard(__pyx_cur_scope->__pyx_v_edges1, __pyx_empty_tuple); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 1262, __pyx_L1_error)
    }
    __pyx_L52:;

    /* "ete4/core/tree.pyx":1264
 *                 edges1.discard(())
 * 
 *             if min_support_t1:             # <<<<<<<<<<<<<<
 *                 support_t1 = {tuple(sorted(from_common(leaves, prop_t1) for n in leaves)): branch.support or 0
 *                               for branch, leaves in t1_leaves.items()}
 */
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_min_support_t1); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1264, __pyx_L1_error)
    if (__pyx_t_1) {

      /* "ete4/core/tree.pyx":1265
 * 
 *             if min_support_t1:
 *                 support_t1 = {tuple(sorted(from_common(leaves, prop_t1) for n in leaves)): branch.support or 0             # <<<<<<<<<<<<<<
 *                               for branch, leaves in t1_leaves.items()}
 * 
 */
      { /* enter inner scope */
        __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1265, __pyx_L68_error)
        __Pyx_GOTREF(__pyx_t_6);

        /* "ete4/core/tree.pyx":1266
 *             if min_support_t1:
 *                 support_t1 = {tuple(sorted(from_common(leaves, prop_t1) for n in leaves)): branch.support or 0
 *                               for branch, leaves in t1_leaves.items()}             # <<<<<<<<<<<<<<
 * 
 *             for t2 in target_trees:
 */
        __pyx_t_13 = 0;
        if (unlikely(__pyx_v_t1_leaves == Py_None)) {
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
          __PYX_ERR(0, 1266, __pyx_L68_error)
        }
        __pyx_t_4 = __Pyx_dict_iterator(__pyx_v_t1_leaves, 0, __pyx_n_s_items, (&__pyx_t_14), (&__pyx_t_15)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1266, __pyx_L68_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_XDECREF(__pyx_t_10);
        __pyx_t_10 = __pyx_t_4;
        __pyx_t_4 = 0;
        while (1) {
          __pyx_t_16 = __Pyx_dict_iter_next(__pyx_t_10, __pyx_t_14, &__pyx_t_13, &__pyx_t_4, &__pyx_t_7, NULL, __pyx_t_15);
          if (unlikely(__pyx_t_16 == 0)) break;
          if (unlikely(__pyx_t_16 == -1)) __PYX_ERR(0, 1266, __pyx_L68_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_XDECREF_SET(__pyx_9genexpr23__pyx_v_branch, __pyx_t_4);
          __pyx_t_4 = 0;
          __Pyx_XGOTREF(__pyx_cur_scope->__pyx_9genexpr23__pyx_v_leaves);
          __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_9genexpr23__pyx_v_leaves, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_7);
          __pyx_t_7 = 0;

          /* "ete4/core/tree.pyx":1265
 * 
 *             if min_support_t1:
 *                 support_t1 = {tuple(sorted(from_common(leaves, prop_t1) for n in leaves)): branch.support or 0             # <<<<<<<<<<<<<<
 *                               for branch, leaves in t1_leaves.items()}
 * 
 */
          __pyx_t_4 = __pyx_pf_4ete4_4core_4tree_4Tree_15robinson_foulds_9genexpr23_genexpr(((PyObject*)__pyx_cur_scope), __pyx_cur_scope->__pyx_9genexpr23__pyx_v_leaves); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1265, __pyx_L68_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_19 = __Pyx_Generator_Next(__pyx_t_4); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1265, __pyx_L68_error)
          __Pyx_GOTREF(__pyx_t_19);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_7 = ((PyObject*)__pyx_t_19);
          __pyx_t_19 = 0;
          __pyx_t_18 = PyList_Sort(__pyx_t_7); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 1265, __pyx_L68_error)
          __pyx_t_19 = PyList_AsTuple(((PyObject*)__pyx_t_7)); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1265, __pyx_L68_error)
          __Pyx_GOTREF(__pyx_t_19);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr23__pyx_v_branch, __pyx_n_s_support); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1265, __pyx_L68_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1265, __pyx_L68_error)
          if (!__pyx_t_1) {
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          } else {
            __Pyx_INCREF(__pyx_t_4);
            __pyx_t_7 = __pyx_t_4;
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            goto __pyx_L71_bool_binop_done;
          }
          __pyx_t_4 = __Pyx_PyInt_From_long(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1265, __pyx_L68_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_7 = __pyx_t_4;
          __pyx_t_4 = 0;
          __pyx_L71_bool_binop_done:;
          if (unlikely(PyDict_SetItem(__pyx_t_6, (PyObject*)__pyx_t_19, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 1265, __pyx_L68_error)
          __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        }
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_XDECREF(__pyx_9genexpr23__pyx_v_branch); __pyx_9genexpr23__pyx_v_branch = 0;
        goto __pyx_L73_exit_scope;
        __pyx_L68_error:;
        __Pyx_XDECREF(__pyx_9genexpr23__pyx_v_branch); __pyx_9genexpr23__pyx_v_branch = 0;
        goto __pyx_L1_error;
        __pyx_L73_exit_scope:;
      } /* exit inner scope */
      __Pyx_XDECREF_SET(__pyx_v_support_t1, ((PyObject*)__pyx_t_6));
      __pyx_t_6 = 0;

      /* "ete4/core/tree.pyx":1264
 *                 edges1.discard(())
 * 
 *             if min_support_t1:             # <<<<<<<<<<<<<<
 *                 support_t1 = {tuple(sorted(from_common(leaves, prop_t1) for n in leaves)): branch.support or 0
 *                               for branch, leaves in t1_leaves.items()}
 */
    }

    /* "ete4/core/tree.pyx":1268
 *                               for branch, leaves in t1_leaves.items()}
 * 
 *             for t2 in target_trees:             # <<<<<<<<<<<<<<
 *                 t2_leaves = t2.get_cached_content()
 *                 t2_leaves_all = t2_leaves[t2]
 */
    __pyx_t_6 = __pyx_v_target_trees; __Pyx_INCREF(__pyx_t_6);
    __pyx_t_14 = 0;
    for (;;) {
      {
        Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6);
        #if !CYTHON_ASSUME_SAFE_MACROS
        if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1268, __pyx_L1_error)
        #endif
        if (__pyx_t_14 >= __pyx_temp) break;
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_10 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_14); __Pyx_INCREF(__pyx_t_10); __pyx_t_14++; if (unlikely((0 < 0))) __PYX_ERR(0, 1268, __pyx_L1_error)
      #else
      __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1268, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      #endif
      __Pyx_DECREF_SET(__pyx_v_t2, __pyx_t_10);
      __pyx_t_10 = 0;

      /* "ete4/core/tree.pyx":1269
 * 
 *             for t2 in target_trees:
 *                 t2_leaves = t2.get_cached_content()             # <<<<<<<<<<<<<<
 *                 t2_leaves_all = t2_leaves[t2]
 * 
 */
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_t2, __pyx_n_s_get_cached_content); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1269, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_19 = NULL;
      __pyx_t_8 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_19 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_19)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_19);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_19, NULL};
        __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_8, 0+__pyx_t_8);
        __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
        if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1269, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_XDECREF_SET(__pyx_v_t2_leaves, __pyx_t_10);
      __pyx_t_10 = 0;

      /* "ete4/core/tree.pyx":1270
 *             for t2 in target_trees:
 *                 t2_leaves = t2.get_cached_content()
 *                 t2_leaves_all = t2_leaves[t2]             # <<<<<<<<<<<<<<
 * 
 *                 if unrooted_trees:
 */
      __pyx_t_10 = __Pyx_PyObject_GetItem(__pyx_v_t2_leaves, __pyx_v_t2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1270, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_XDECREF_SET(__pyx_v_t2_leaves_all, __pyx_t_10);
      __pyx_t_10 = 0;

      /* "ete4/core/tree.pyx":1272
 *                 t2_leaves_all = t2_leaves[t2]
 * 
 *                 if unrooted_trees:             # <<<<<<<<<<<<<<
 *                     edges2 = {
 *                         tuple(sorted([
 */
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_unrooted_trees); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1272, __pyx_L1_error)
      if (__pyx_t_1) {

        /* "ete4/core/tree.pyx":1273
 * 
 *                 if unrooted_trees:
 *                     edges2 = {             # <<<<<<<<<<<<<<
 *                         tuple(sorted([
 *                             tuple(sorted(from_common(leaves, prop_t2))),
 */
        { /* enter inner scope */
          __pyx_t_10 = PySet_New(NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1273, __pyx_L79_error)
          __Pyx_GOTREF(__pyx_t_10);

          /* "ete4/core/tree.pyx":1277
 *                             tuple(sorted(from_common(leaves, prop_t2))),
 *                             tuple(sorted(from_common(t2_leaves_all - leaves, prop_t2)))]))
 *                         for leaves in t2_leaves.values()}             # <<<<<<<<<<<<<<
 *                     edges2.discard(((), ()))
 *                 else:
 */
          __pyx_t_13 = 0;
          if (unlikely(__pyx_v_t2_leaves == Py_None)) {
            PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "values");
            __PYX_ERR(0, 1277, __pyx_L79_error)
          }
          __pyx_t_19 = __Pyx_dict_iterator(__pyx_v_t2_leaves, 0, __pyx_n_s_values, (&__pyx_t_21), (&__pyx_t_15)); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1277, __pyx_L79_error)
          __Pyx_GOTREF(__pyx_t_19);
          __Pyx_XDECREF(__pyx_t_7);
          __pyx_t_7 = __pyx_t_19;
          __pyx_t_19 = 0;
          while (1) {
            __pyx_t_16 = __Pyx_dict_iter_next(__pyx_t_7, __pyx_t_21, &__pyx_t_13, NULL, &__pyx_t_19, NULL, __pyx_t_15);
            if (unlikely(__pyx_t_16 == 0)) break;
            if (unlikely(__pyx_t_16 == -1)) __PYX_ERR(0, 1277, __pyx_L79_error)
            __Pyx_GOTREF(__pyx_t_19);
            __Pyx_XDECREF_SET(__pyx_9genexpr25__pyx_v_leaves, __pyx_t_19);
            __pyx_t_19 = 0;

            /* "ete4/core/tree.pyx":1275
 *                     edges2 = {
 *                         tuple(sorted([
 *                             tuple(sorted(from_common(leaves, prop_t2))),             # <<<<<<<<<<<<<<
 *                             tuple(sorted(from_common(t2_leaves_all - leaves, prop_t2)))]))
 *                         for leaves in t2_leaves.values()}
 */
            __pyx_t_12 = __pyx_cur_scope->__pyx_v_prop_t2;
            __Pyx_INCREF(__pyx_t_12);
            __pyx_t_20 = __pyx_pf_4ete4_4core_4tree_4Tree_15robinson_foulds_2from_common(__pyx_cur_scope->__pyx_v_from_common, __pyx_9genexpr25__pyx_v_leaves, __pyx_t_12); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1275, __pyx_L79_error)
            __Pyx_GOTREF(__pyx_t_20);
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            __pyx_t_12 = PySequence_List(__pyx_t_20); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1275, __pyx_L79_error)
            __Pyx_GOTREF(__pyx_t_12);
            __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
            __pyx_t_4 = ((PyObject*)__pyx_t_12);
            __pyx_t_12 = 0;
            __pyx_t_18 = PyList_Sort(__pyx_t_4); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 1275, __pyx_L79_error)
            __pyx_t_12 = PyList_AsTuple(((PyObject*)__pyx_t_4)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1275, __pyx_L79_error)
            __Pyx_GOTREF(__pyx_t_12);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

            /* "ete4/core/tree.pyx":1276
 *                         tuple(sorted([
 *                             tuple(sorted(from_common(leaves, prop_t2))),
 *                             tuple(sorted(from_common(t2_leaves_all - leaves, prop_t2)))]))             # <<<<<<<<<<<<<<
 *                         for leaves in t2_leaves.values()}
 *                     edges2.discard(((), ()))
 */
            __pyx_t_20 = PyNumber_Subtract(__pyx_v_t2_leaves_all, __pyx_9genexpr25__pyx_v_leaves); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1276, __pyx_L79_error)
            __Pyx_GOTREF(__pyx_t_20);
            __pyx_t_17 = __pyx_cur_scope->__pyx_v_prop_t2;
            __Pyx_INCREF(__pyx_t_17);
            __pyx_t_22 = __pyx_pf_4ete4_4core_4tree_4Tree_15robinson_foulds_2from_common(__pyx_cur_scope->__pyx_v_from_common, __pyx_t_20, __pyx_t_17); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 1276, __pyx_L79_error)
            __Pyx_GOTREF(__pyx_t_22);
            __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
            __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
            __pyx_t_17 = PySequence_List(__pyx_t_22); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1276, __pyx_L79_error)
            __Pyx_GOTREF(__pyx_t_17);
            __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
            __pyx_t_4 = ((PyObject*)__pyx_t_17);
            __pyx_t_17 = 0;
            __pyx_t_18 = PyList_Sort(__pyx_t_4); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 1276, __pyx_L79_error)
            __pyx_t_17 = PyList_AsTuple(((PyObject*)__pyx_t_4)); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1276, __pyx_L79_error)
            __Pyx_GOTREF(__pyx_t_17);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

            /* "ete4/core/tree.pyx":1274
 *                 if unrooted_trees:
 *                     edges2 = {
 *                         tuple(sorted([             # <<<<<<<<<<<<<<
 *                             tuple(sorted(from_common(leaves, prop_t2))),
 *                             tuple(sorted(from_common(t2_leaves_all - leaves, prop_t2)))]))
 */
            __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1274, __pyx_L79_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_GIVEREF(__pyx_t_12);
            if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_12)) __PYX_ERR(0, 1274, __pyx_L79_error);
            __Pyx_GIVEREF(__pyx_t_17);
            if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_t_17)) __PYX_ERR(0, 1274, __pyx_L79_error);
            __pyx_t_12 = 0;
            __pyx_t_17 = 0;
            __pyx_t_19 = ((PyObject*)__pyx_t_4);
            __pyx_t_4 = 0;
            __pyx_t_18 = PyList_Sort(__pyx_t_19); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 1274, __pyx_L79_error)
            __pyx_t_4 = PyList_AsTuple(((PyObject*)__pyx_t_19)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1274, __pyx_L79_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
            if (unlikely(PySet_Add(__pyx_t_10, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 1274, __pyx_L79_error)
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          }
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_9genexpr25__pyx_v_leaves); __pyx_9genexpr25__pyx_v_leaves = 0;
          goto __pyx_L82_exit_scope;
          __pyx_L79_error:;
          __Pyx_XDECREF(__pyx_9genexpr25__pyx_v_leaves); __pyx_9genexpr25__pyx_v_leaves = 0;
          goto __pyx_L1_error;
          __pyx_L82_exit_scope:;
        } /* exit inner scope */
        __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_edges2);
        __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_edges2, ((PyObject*)__pyx_t_10));
        __Pyx_GIVEREF(__pyx_t_10);
        __pyx_t_10 = 0;

        /* "ete4/core/tree.pyx":1278
 *                             tuple(sorted(from_common(t2_leaves_all - leaves, prop_t2)))]))
 *                         for leaves in t2_leaves.values()}
 *                     edges2.discard(((), ()))             # <<<<<<<<<<<<<<
 *                 else:
 *                     edges2 = {tuple(sorted(from_common(leaves, prop_t2)))
 */
        __pyx_t_18 = __Pyx_PySet_Discard(__pyx_cur_scope->__pyx_v_edges2, __pyx_tuple__30); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 1278, __pyx_L1_error)

        /* "ete4/core/tree.pyx":1272
 *                 t2_leaves_all = t2_leaves[t2]
 * 
 *                 if unrooted_trees:             # <<<<<<<<<<<<<<
 *                     edges2 = {
 *                         tuple(sorted([
 */
        goto __pyx_L76;
      }

      /* "ete4/core/tree.pyx":1280
 *                     edges2.discard(((), ()))
 *                 else:
 *                     edges2 = {tuple(sorted(from_common(leaves, prop_t2)))             # <<<<<<<<<<<<<<
 *                               for leaves in t2_leaves.values()}
 *                     edges2.discard(())
 */
      /*else*/ {
        { /* enter inner scope */
          __pyx_t_10 = PySet_New(NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1280, __pyx_L85_error)
          __Pyx_GOTREF(__pyx_t_10);

          /* "ete4/core/tree.pyx":1281
 *                 else:
 *                     edges2 = {tuple(sorted(from_common(leaves, prop_t2)))
 *                               for leaves in t2_leaves.values()}             # <<<<<<<<<<<<<<
 *                     edges2.discard(())
 * 
 */
          __pyx_t_21 = 0;
          if (unlikely(__pyx_v_t2_leaves == Py_None)) {
            PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "values");
            __PYX_ERR(0, 1281, __pyx_L85_error)
          }
          __pyx_t_4 = __Pyx_dict_iterator(__pyx_v_t2_leaves, 0, __pyx_n_s_values, (&__pyx_t_13), (&__pyx_t_15)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1281, __pyx_L85_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_XDECREF(__pyx_t_7);
          __pyx_t_7 = __pyx_t_4;
          __pyx_t_4 = 0;
          while (1) {
            __pyx_t_16 = __Pyx_dict_iter_next(__pyx_t_7, __pyx_t_13, &__pyx_t_21, NULL, &__pyx_t_4, NULL, __pyx_t_15);
            if (unlikely(__pyx_t_16 == 0)) break;
            if (unlikely(__pyx_t_16 == -1)) __PYX_ERR(0, 1281, __pyx_L85_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_XDECREF_SET(__pyx_9genexpr26__pyx_v_leaves, __pyx_t_4);
            __pyx_t_4 = 0;

            /* "ete4/core/tree.pyx":1280
 *                     edges2.discard(((), ()))
 *                 else:
 *                     edges2 = {tuple(sorted(from_common(leaves, prop_t2)))             # <<<<<<<<<<<<<<
 *                               for leaves in t2_leaves.values()}
 *                     edges2.discard(())
 */
            __pyx_t_19 = __pyx_cur_scope->__pyx_v_prop_t2;
            __Pyx_INCREF(__pyx_t_19);
            __pyx_t_17 = __pyx_pf_4ete4_4core_4tree_4Tree_15robinson_foulds_2from_common(__pyx_cur_scope->__pyx_v_from_common, __pyx_9genexpr26__pyx_v_leaves, __pyx_t_19); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1280, __pyx_L85_error)
            __Pyx_GOTREF(__pyx_t_17);
            __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
            __pyx_t_19 = PySequence_List(__pyx_t_17); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1280, __pyx_L85_error)
            __Pyx_GOTREF(__pyx_t_19);
            __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
            __pyx_t_4 = ((PyObject*)__pyx_t_19);
            __pyx_t_19 = 0;
            __pyx_t_18 = PyList_Sort(__pyx_t_4); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 1280, __pyx_L85_error)
            __pyx_t_19 = PyList_AsTuple(((PyObject*)__pyx_t_4)); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1280, __pyx_L85_error)
            __Pyx_GOTREF(__pyx_t_19);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            if (unlikely(PySet_Add(__pyx_t_10, (PyObject*)__pyx_t_19))) __PYX_ERR(0, 1280, __pyx_L85_error)
            __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
          }
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_9genexpr26__pyx_v_leaves); __pyx_9genexpr26__pyx_v_leaves = 0;
          goto __pyx_L88_exit_scope;
          __pyx_L85_error:;
          __Pyx_XDECREF(__pyx_9genexpr26__pyx_v_leaves); __pyx_9genexpr26__pyx_v_leaves = 0;
          goto __pyx_L1_error;
          __pyx_L88_exit_scope:;
        } /* exit inner scope */
        __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_edges2);
        __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_edges2, ((PyObject*)__pyx_t_10));
        __Pyx_GIVEREF(__pyx_t_10);
        __pyx_t_10 = 0;

        /* "ete4/core/tree.pyx":1282
 *                     edges2 = {tuple(sorted(from_common(leaves, prop_t2)))
 *                               for leaves in t2_leaves.values()}
 *                     edges2.discard(())             # <<<<<<<<<<<<<<
 * 
 *                 if min_support_t2:
 */
        __pyx_t_18 = __Pyx_PySet_Discard(__pyx_cur_scope->__pyx_v_edges2, __pyx_empty_tuple); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 1282, __pyx_L1_error)
      }
      __pyx_L76:;

      /* "ete4/core/tree.pyx":1284
 *                     edges2.discard(())
 * 
 *                 if min_support_t2:             # <<<<<<<<<<<<<<
 *                     support_t2 = {tuple(sorted(from_common(leaves, prop_t2) for n in leaves)): branch.support or 0
 *                                   for branch, leaves in t2_leaves.items()}
 */
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_min_support_t2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1284, __pyx_L1_error)
      if (__pyx_t_1) {

        /* "ete4/core/tree.pyx":1285
 * 
 *                 if min_support_t2:
 *                     support_t2 = {tuple(sorted(from_common(leaves, prop_t2) for n in leaves)): branch.support or 0             # <<<<<<<<<<<<<<
 *                                   for branch, leaves in t2_leaves.items()}
 * 
 */
        { /* enter inner scope */
          __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1285, __pyx_L92_error)
          __Pyx_GOTREF(__pyx_t_10);

          /* "ete4/core/tree.pyx":1286
 *                 if min_support_t2:
 *                     support_t2 = {tuple(sorted(from_common(leaves, prop_t2) for n in leaves)): branch.support or 0
 *                                   for branch, leaves in t2_leaves.items()}             # <<<<<<<<<<<<<<
 * 
 *                 # if a support value is passed as a constraint, discard lowly supported branches from the analysis
 */
          __pyx_t_13 = 0;
          if (unlikely(__pyx_v_t2_leaves == Py_None)) {
            PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
            __PYX_ERR(0, 1286, __pyx_L92_error)
          }
          __pyx_t_19 = __Pyx_dict_iterator(__pyx_v_t2_leaves, 0, __pyx_n_s_items, (&__pyx_t_21), (&__pyx_t_15)); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1286, __pyx_L92_error)
          __Pyx_GOTREF(__pyx_t_19);
          __Pyx_XDECREF(__pyx_t_7);
          __pyx_t_7 = __pyx_t_19;
          __pyx_t_19 = 0;
          while (1) {
            __pyx_t_16 = __Pyx_dict_iter_next(__pyx_t_7, __pyx_t_21, &__pyx_t_13, &__pyx_t_19, &__pyx_t_4, NULL, __pyx_t_15);
            if (unlikely(__pyx_t_16 == 0)) break;
            if (unlikely(__pyx_t_16 == -1)) __PYX_ERR(0, 1286, __pyx_L92_error)
            __Pyx_GOTREF(__pyx_t_19);
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_XDECREF_SET(__pyx_9genexpr27__pyx_v_branch, __pyx_t_19);
            __pyx_t_19 = 0;
            __Pyx_XGOTREF(__pyx_cur_scope->__pyx_9genexpr27__pyx_v_leaves);
            __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_9genexpr27__pyx_v_leaves, __pyx_t_4);
            __Pyx_GIVEREF(__pyx_t_4);
            __pyx_t_4 = 0;

            /* "ete4/core/tree.pyx":1285
 * 
 *                 if min_support_t2:
 *                     support_t2 = {tuple(sorted(from_common(leaves, prop_t2) for n in leaves)): branch.support or 0             # <<<<<<<<<<<<<<
 *                                   for branch, leaves in t2_leaves.items()}
 * 
 */
            __pyx_t_19 = __pyx_pf_4ete4_4core_4tree_4Tree_15robinson_foulds_9genexpr27_genexpr(((PyObject*)__pyx_cur_scope), __pyx_cur_scope->__pyx_9genexpr27__pyx_v_leaves); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1285, __pyx_L92_error)
            __Pyx_GOTREF(__pyx_t_19);
            __pyx_t_17 = __Pyx_Generator_Next(__pyx_t_19); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1285, __pyx_L92_error)
            __Pyx_GOTREF(__pyx_t_17);
            __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
            __pyx_t_4 = ((PyObject*)__pyx_t_17);
            __pyx_t_17 = 0;
            __pyx_t_18 = PyList_Sort(__pyx_t_4); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 1285, __pyx_L92_error)
            __pyx_t_17 = PyList_AsTuple(((PyObject*)__pyx_t_4)); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1285, __pyx_L92_error)
            __Pyx_GOTREF(__pyx_t_17);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr27__pyx_v_branch, __pyx_n_s_support); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1285, __pyx_L92_error)
            __Pyx_GOTREF(__pyx_t_19);
            __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_19); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1285, __pyx_L92_error)
            if (!__pyx_t_1) {
              __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
            } else {
              __Pyx_INCREF(__pyx_t_19);
              __pyx_t_4 = __pyx_t_19;
              __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
              goto __pyx_L95_bool_binop_done;
            }
            __pyx_t_19 = __Pyx_PyInt_From_long(0); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1285, __pyx_L92_error)
            __Pyx_GOTREF(__pyx_t_19);
            __pyx_t_4 = __pyx_t_19;
            __pyx_t_19 = 0;
            __pyx_L95_bool_binop_done:;
            if (unlikely(PyDict_SetItem(__pyx_t_10, (PyObject*)__pyx_t_17, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 1285, __pyx_L92_error)
            __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          }
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_9genexpr27__pyx_v_branch); __pyx_9genexpr27__pyx_v_branch = 0;
          goto __pyx_L97_exit_scope;
          __pyx_L92_error:;
          __Pyx_XDECREF(__pyx_9genexpr27__pyx_v_branch); __pyx_9genexpr27__pyx_v_branch = 0;
          goto __pyx_L1_error;
          __pyx_L97_exit_scope:;
        } /* exit inner scope */
        __Pyx_XDECREF_SET(__pyx_v_support_t2, ((PyObject*)__pyx_t_10));
        __pyx_t_10 = 0;

        /* "ete4/core/tree.pyx":1284
 *                     edges2.discard(())
 * 
 *                 if min_support_t2:             # <<<<<<<<<<<<<<
 *                     support_t2 = {tuple(sorted(from_common(leaves, prop_t2) for n in leaves)): branch.support or 0
 *                                   for branch, leaves in t2_leaves.items()}
 */
      }

      /* "ete4/core/tree.pyx":1289
 * 
 *                 # if a support value is passed as a constraint, discard lowly supported branches from the analysis
 *                 discard_t1, discard_t2 = set(), set()             # <<<<<<<<<<<<<<
 *                 if min_support_t1 and unrooted_trees:
 *                     discard_t1 = {p for p in edges1 if support_t1.get(p[0], support_t1.get(p[1], math.inf)) < min_support_t1}
 */
      __pyx_t_10 = PySet_New(0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1289, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_7 = PySet_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1289, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_discard_t1);
      __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_discard_t1, ((PyObject*)__pyx_t_10));
      __Pyx_GIVEREF(__pyx_t_10);
      __pyx_t_10 = 0;
      __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_discard_t2);
      __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_discard_t2, ((PyObject*)__pyx_t_7));
      __Pyx_GIVEREF(__pyx_t_7);
      __pyx_t_7 = 0;

      /* "ete4/core/tree.pyx":1290
 *                 # if a support value is passed as a constraint, discard lowly supported branches from the analysis
 *                 discard_t1, discard_t2 = set(), set()
 *                 if min_support_t1 and unrooted_trees:             # <<<<<<<<<<<<<<
 *                     discard_t1 = {p for p in edges1 if support_t1.get(p[0], support_t1.get(p[1], math.inf)) < min_support_t1}
 *                 elif min_support_t1:
 */
      __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_min_support_t1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1290, __pyx_L1_error)
      if (__pyx_t_3) {
      } else {
        __pyx_t_1 = __pyx_t_3;
        goto __pyx_L99_bool_binop_done;
      }
      __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_unrooted_trees); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1290, __pyx_L1_error)
      __pyx_t_1 = __pyx_t_3;
      __pyx_L99_bool_binop_done:;
      if (__pyx_t_1) {

        /* "ete4/core/tree.pyx":1291
 *                 discard_t1, discard_t2 = set(), set()
 *                 if min_support_t1 and unrooted_trees:
 *                     discard_t1 = {p for p in edges1 if support_t1.get(p[0], support_t1.get(p[1], math.inf)) < min_support_t1}             # <<<<<<<<<<<<<<
 *                 elif min_support_t1:
 *                     discard_t1 = {p for p in edges1 if support_t1[p] is not None and support_t1[p] < min_support_t1}
 */
        { /* enter inner scope */
          __pyx_t_7 = PySet_New(NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1291, __pyx_L103_error)
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_21 = 0;
          __pyx_t_4 = __Pyx_set_iterator(__pyx_cur_scope->__pyx_v_edges1, 1, (&__pyx_t_13), (&__pyx_t_15)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1291, __pyx_L103_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_XDECREF(__pyx_t_10);
          __pyx_t_10 = __pyx_t_4;
          __pyx_t_4 = 0;
          while (1) {
            __pyx_t_16 = __Pyx_set_iter_next(__pyx_t_10, __pyx_t_13, &__pyx_t_21, &__pyx_t_4, __pyx_t_15);
            if (unlikely(__pyx_t_16 == 0)) break;
            if (unlikely(__pyx_t_16 == -1)) __PYX_ERR(0, 1291, __pyx_L103_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_XDECREF_SET(__pyx_9genexpr29__pyx_v_p, __pyx_t_4);
            __pyx_t_4 = 0;
            if (unlikely(!__pyx_v_support_t1)) { __Pyx_RaiseUnboundLocalError("support_t1"); __PYX_ERR(0, 1291, __pyx_L103_error) }
            __pyx_t_4 = __Pyx_GetItemInt(__pyx_9genexpr29__pyx_v_p, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1291, __pyx_L103_error)
            __Pyx_GOTREF(__pyx_t_4);
            if (unlikely(!__pyx_v_support_t1)) { __Pyx_RaiseUnboundLocalError("support_t1"); __PYX_ERR(0, 1291, __pyx_L103_error) }
            __pyx_t_17 = __Pyx_GetItemInt(__pyx_9genexpr29__pyx_v_p, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1291, __pyx_L103_error)
            __Pyx_GOTREF(__pyx_t_17);
            __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_math); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1291, __pyx_L103_error)
            __Pyx_GOTREF(__pyx_t_19);
            __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_inf); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1291, __pyx_L103_error)
            __Pyx_GOTREF(__pyx_t_12);
            __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
            __pyx_t_19 = __Pyx_PyDict_GetItemDefault(__pyx_v_support_t1, __pyx_t_17, __pyx_t_12); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1291, __pyx_L103_error)
            __Pyx_GOTREF(__pyx_t_19);
            __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            __pyx_t_12 = __Pyx_PyDict_GetItemDefault(__pyx_v_support_t1, __pyx_t_4, __pyx_t_19); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1291, __pyx_L103_error)
            __Pyx_GOTREF(__pyx_t_12);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
            __pyx_t_19 = PyObject_RichCompare(__pyx_t_12, __pyx_v_min_support_t1, Py_LT); __Pyx_XGOTREF(__pyx_t_19); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1291, __pyx_L103_error)
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_19); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1291, __pyx_L103_error)
            __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
            if (__pyx_t_1) {
              if (unlikely(PySet_Add(__pyx_t_7, (PyObject*)__pyx_9genexpr29__pyx_v_p))) __PYX_ERR(0, 1291, __pyx_L103_error)
            }
          }
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_9genexpr29__pyx_v_p); __pyx_9genexpr29__pyx_v_p = 0;
          goto __pyx_L107_exit_scope;
          __pyx_L103_error:;
          __Pyx_XDECREF(__pyx_9genexpr29__pyx_v_p); __pyx_9genexpr29__pyx_v_p = 0;
          goto __pyx_L1_error;
          __pyx_L107_exit_scope:;
        } /* exit inner scope */
        __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_discard_t1);
        __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_discard_t1, ((PyObject*)__pyx_t_7));
        __Pyx_GIVEREF(__pyx_t_7);
        __pyx_t_7 = 0;

        /* "ete4/core/tree.pyx":1290
 *                 # if a support value is passed as a constraint, discard lowly supported branches from the analysis
 *                 discard_t1, discard_t2 = set(), set()
 *                 if min_support_t1 and unrooted_trees:             # <<<<<<<<<<<<<<
 *                     discard_t1 = {p for p in edges1 if support_t1.get(p[0], support_t1.get(p[1], math.inf)) < min_support_t1}
 *                 elif min_support_t1:
 */
        goto __pyx_L98;
      }

      /* "ete4/core/tree.pyx":1292
 *                 if min_support_t1 and unrooted_trees:
 *                     discard_t1 = {p for p in edges1 if support_t1.get(p[0], support_t1.get(p[1], math.inf)) < min_support_t1}
 *                 elif min_support_t1:             # <<<<<<<<<<<<<<
 *                     discard_t1 = {p for p in edges1 if support_t1[p] is not None and support_t1[p] < min_support_t1}
 * 
 */
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_min_support_t1); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1292, __pyx_L1_error)
      if (__pyx_t_1) {

        /* "ete4/core/tree.pyx":1293
 *                     discard_t1 = {p for p in edges1 if support_t1.get(p[0], support_t1.get(p[1], math.inf)) < min_support_t1}
 *                 elif min_support_t1:
 *                     discard_t1 = {p for p in edges1 if support_t1[p] is not None and support_t1[p] < min_support_t1}             # <<<<<<<<<<<<<<
 * 
 *                 if min_support_t2 and unrooted_trees:
 */
        { /* enter inner scope */
          __pyx_t_7 = PySet_New(NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1293, __pyx_L110_error)
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_13 = 0;
          __pyx_t_19 = __Pyx_set_iterator(__pyx_cur_scope->__pyx_v_edges1, 1, (&__pyx_t_21), (&__pyx_t_15)); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1293, __pyx_L110_error)
          __Pyx_GOTREF(__pyx_t_19);
          __Pyx_XDECREF(__pyx_t_10);
          __pyx_t_10 = __pyx_t_19;
          __pyx_t_19 = 0;
          while (1) {
            __pyx_t_16 = __Pyx_set_iter_next(__pyx_t_10, __pyx_t_21, &__pyx_t_13, &__pyx_t_19, __pyx_t_15);
            if (unlikely(__pyx_t_16 == 0)) break;
            if (unlikely(__pyx_t_16 == -1)) __PYX_ERR(0, 1293, __pyx_L110_error)
            __Pyx_GOTREF(__pyx_t_19);
            __Pyx_XDECREF_SET(__pyx_9genexpr30__pyx_v_p, __pyx_t_19);
            __pyx_t_19 = 0;
            if (unlikely(!__pyx_v_support_t1)) { __Pyx_RaiseUnboundLocalError("support_t1"); __PYX_ERR(0, 1293, __pyx_L110_error) }
            __pyx_t_19 = __Pyx_PyDict_GetItem(__pyx_v_support_t1, __pyx_9genexpr30__pyx_v_p); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1293, __pyx_L110_error)
            __Pyx_GOTREF(__pyx_t_19);
            __pyx_t_3 = (__pyx_t_19 != Py_None);
            __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
            if (__pyx_t_3) {
            } else {
              __pyx_t_1 = __pyx_t_3;
              goto __pyx_L114_bool_binop_done;
            }
            if (unlikely(!__pyx_v_support_t1)) { __Pyx_RaiseUnboundLocalError("support_t1"); __PYX_ERR(0, 1293, __pyx_L110_error) }
            __pyx_t_19 = __Pyx_PyDict_GetItem(__pyx_v_support_t1, __pyx_9genexpr30__pyx_v_p); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1293, __pyx_L110_error)
            __Pyx_GOTREF(__pyx_t_19);
            __pyx_t_12 = PyObject_RichCompare(__pyx_t_19, __pyx_v_min_support_t1, Py_LT); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1293, __pyx_L110_error)
            __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
            __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1293, __pyx_L110_error)
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            __pyx_t_1 = __pyx_t_3;
            __pyx_L114_bool_binop_done:;
            if (__pyx_t_1) {
              if (unlikely(PySet_Add(__pyx_t_7, (PyObject*)__pyx_9genexpr30__pyx_v_p))) __PYX_ERR(0, 1293, __pyx_L110_error)
            }
          }
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_9genexpr30__pyx_v_p); __pyx_9genexpr30__pyx_v_p = 0;
          goto __pyx_L116_exit_scope;
          __pyx_L110_error:;
          __Pyx_XDECREF(__pyx_9genexpr30__pyx_v_p); __pyx_9genexpr30__pyx_v_p = 0;
          goto __pyx_L1_error;
          __pyx_L116_exit_scope:;
        } /* exit inner scope */
        __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_discard_t1);
        __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_discard_t1, ((PyObject*)__pyx_t_7));
        __Pyx_GIVEREF(__pyx_t_7);
        __pyx_t_7 = 0;

        /* "ete4/core/tree.pyx":1292
 *                 if min_support_t1 and unrooted_trees:
 *                     discard_t1 = {p for p in edges1 if support_t1.get(p[0], support_t1.get(p[1], math.inf)) < min_support_t1}
 *                 elif min_support_t1:             # <<<<<<<<<<<<<<
 *                     discard_t1 = {p for p in edges1 if support_t1[p] is not None and support_t1[p] < min_support_t1}
 * 
 */
      }
      __pyx_L98:;

      /* "ete4/core/tree.pyx":1295
 *                     discard_t1 = {p for p in edges1 if support_t1[p] is not None and support_t1[p] < min_support_t1}
 * 
 *                 if min_support_t2 and unrooted_trees:             # <<<<<<<<<<<<<<
 *                     discard_t2 = {p for p in edges2 if support_t2.get(p[0], support_t2.get(p[1], math.inf)) < min_support_t2}
 *                 elif min_support_t2:
 */
      __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_min_support_t2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1295, __pyx_L1_error)
      if (__pyx_t_3) {
      } else {
        __pyx_t_1 = __pyx_t_3;
        goto __pyx_L118_bool_binop_done;
      }
      __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_unrooted_trees); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1295, __pyx_L1_error)
      __pyx_t_1 = __pyx_t_3;
      __pyx_L118_bool_binop_done:;
      if (__pyx_t_1) {

        /* "ete4/core/tree.pyx":1296
 * 
 *                 if min_support_t2 and unrooted_trees:
 *                     discard_t2 = {p for p in edges2 if support_t2.get(p[0], support_t2.get(p[1], math.inf)) < min_support_t2}             # <<<<<<<<<<<<<<
 *                 elif min_support_t2:
 *                     discard_t2 = {p for p in edges2 if support_t2[p] is not None and support_t2[p] < min_support_t2}
 */
        { /* enter inner scope */
          __pyx_t_7 = PySet_New(NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1296, __pyx_L122_error)
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_21 = 0;
          __pyx_t_12 = __Pyx_set_iterator(__pyx_cur_scope->__pyx_v_edges2, 1, (&__pyx_t_13), (&__pyx_t_15)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1296, __pyx_L122_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_XDECREF(__pyx_t_10);
          __pyx_t_10 = __pyx_t_12;
          __pyx_t_12 = 0;
          while (1) {
            __pyx_t_16 = __Pyx_set_iter_next(__pyx_t_10, __pyx_t_13, &__pyx_t_21, &__pyx_t_12, __pyx_t_15);
            if (unlikely(__pyx_t_16 == 0)) break;
            if (unlikely(__pyx_t_16 == -1)) __PYX_ERR(0, 1296, __pyx_L122_error)
            __Pyx_GOTREF(__pyx_t_12);
            __Pyx_XDECREF_SET(__pyx_9genexpr31__pyx_v_p, __pyx_t_12);
            __pyx_t_12 = 0;
            if (unlikely(!__pyx_v_support_t2)) { __Pyx_RaiseUnboundLocalError("support_t2"); __PYX_ERR(0, 1296, __pyx_L122_error) }
            __pyx_t_12 = __Pyx_GetItemInt(__pyx_9genexpr31__pyx_v_p, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1296, __pyx_L122_error)
            __Pyx_GOTREF(__pyx_t_12);
            if (unlikely(!__pyx_v_support_t2)) { __Pyx_RaiseUnboundLocalError("support_t2"); __PYX_ERR(0, 1296, __pyx_L122_error) }
            __pyx_t_19 = __Pyx_GetItemInt(__pyx_9genexpr31__pyx_v_p, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1296, __pyx_L122_error)
            __Pyx_GOTREF(__pyx_t_19);
            __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_math); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1296, __pyx_L122_error)
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_inf); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1296, __pyx_L122_error)
            __Pyx_GOTREF(__pyx_t_17);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __pyx_t_4 = __Pyx_PyDict_GetItemDefault(__pyx_v_support_t2, __pyx_t_19, __pyx_t_17); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1296, __pyx_L122_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
            __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
            __pyx_t_17 = __Pyx_PyDict_GetItemDefault(__pyx_v_support_t2, __pyx_t_12, __pyx_t_4); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1296, __pyx_L122_error)
            __Pyx_GOTREF(__pyx_t_17);
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __pyx_t_4 = PyObject_RichCompare(__pyx_t_17, __pyx_v_min_support_t2, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1296, __pyx_L122_error)
            __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
            __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1296, __pyx_L122_error)
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            if (__pyx_t_1) {
              if (unlikely(PySet_Add(__pyx_t_7, (PyObject*)__pyx_9genexpr31__pyx_v_p))) __PYX_ERR(0, 1296, __pyx_L122_error)
            }
          }
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_9genexpr31__pyx_v_p); __pyx_9genexpr31__pyx_v_p = 0;
          goto __pyx_L126_exit_scope;
          __pyx_L122_error:;
          __Pyx_XDECREF(__pyx_9genexpr31__pyx_v_p); __pyx_9genexpr31__pyx_v_p = 0;
          goto __pyx_L1_error;
          __pyx_L126_exit_scope:;
        } /* exit inner scope */
        __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_discard_t2);
        __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_discard_t2, ((PyObject*)__pyx_t_7));
        __Pyx_GIVEREF(__pyx_t_7);
        __pyx_t_7 = 0;

        /* "ete4/core/tree.pyx":1295
 *                     discard_t1 = {p for p in edges1 if support_t1[p] is not None and support_t1[p] < min_support_t1}
 * 
 *                 if min_support_t2 and unrooted_trees:             # <<<<<<<<<<<<<<
 *                     discard_t2 = {p for p in edges2 if support_t2.get(p[0], support_t2.get(p[1], math.inf)) < min_support_t2}
 *                 elif min_support_t2:
 */
        goto __pyx_L117;
      }

      /* "ete4/core/tree.pyx":1297
 *                 if min_support_t2 and unrooted_trees:
 *                     discard_t2 = {p for p in edges2 if support_t2.get(p[0], support_t2.get(p[1], math.inf)) < min_support_t2}
 *                 elif min_support_t2:             # <<<<<<<<<<<<<<
 *                     discard_t2 = {p for p in edges2 if support_t2[p] is not None and support_t2[p] < min_support_t2}
 * 
 */
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_min_support_t2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1297, __pyx_L1_error)
      if (__pyx_t_1) {

        /* "ete4/core/tree.pyx":1298
 *                     discard_t2 = {p for p in edges2 if support_t2.get(p[0], support_t2.get(p[1], math.inf)) < min_support_t2}
 *                 elif min_support_t2:
 *                     discard_t2 = {p for p in edges2 if support_t2[p] is not None and support_t2[p] < min_support_t2}             # <<<<<<<<<<<<<<
 * 
 *                 # the two root edges are never counted here, as they are always
 */
        { /* enter inner scope */
          __pyx_t_7 = PySet_New(NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1298, __pyx_L129_error)
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_13 = 0;
          __pyx_t_4 = __Pyx_set_iterator(__pyx_cur_scope->__pyx_v_edges2, 1, (&__pyx_t_21), (&__pyx_t_15)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1298, __pyx_L129_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_XDECREF(__pyx_t_10);
          __pyx_t_10 = __pyx_t_4;
          __pyx_t_4 = 0;
          while (1) {
            __pyx_t_16 = __Pyx_set_iter_next(__pyx_t_10, __pyx_t_21, &__pyx_t_13, &__pyx_t_4, __pyx_t_15);
            if (unlikely(__pyx_t_16 == 0)) break;
            if (unlikely(__pyx_t_16 == -1)) __PYX_ERR(0, 1298, __pyx_L129_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_XDECREF_SET(__pyx_9genexpr32__pyx_v_p, __pyx_t_4);
            __pyx_t_4 = 0;
            if (unlikely(!__pyx_v_support_t2)) { __Pyx_RaiseUnboundLocalError("support_t2"); __PYX_ERR(0, 1298, __pyx_L129_error) }
            __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_support_t2, __pyx_9genexpr32__pyx_v_p); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1298, __pyx_L129_error)
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_3 = (__pyx_t_4 != Py_None);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            if (__pyx_t_3) {
            } else {
              __pyx_t_1 = __pyx_t_3;
              goto __pyx_L133_bool_binop_done;
            }
            if (unlikely(!__pyx_v_support_t2)) { __Pyx_RaiseUnboundLocalError("support_t2"); __PYX_ERR(0, 1298, __pyx_L129_error) }
            __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_support_t2, __pyx_9genexpr32__pyx_v_p); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1298, __pyx_L129_error)
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_17 = PyObject_RichCompare(__pyx_t_4, __pyx_v_min_support_t2, Py_LT); __Pyx_XGOTREF(__pyx_t_17); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1298, __pyx_L129_error)
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_17); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1298, __pyx_L129_error)
            __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
            __pyx_t_1 = __pyx_t_3;
            __pyx_L133_bool_binop_done:;
            if (__pyx_t_1) {
              if (unlikely(PySet_Add(__pyx_t_7, (PyObject*)__pyx_9genexpr32__pyx_v_p))) __PYX_ERR(0, 1298, __pyx_L129_error)
            }
          }
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_9genexpr32__pyx_v_p); __pyx_9genexpr32__pyx_v_p = 0;
          goto __pyx_L135_exit_scope;
          __pyx_L129_error:;
          __Pyx_XDECREF(__pyx_9genexpr32__pyx_v_p); __pyx_9genexpr32__pyx_v_p = 0;
          goto __pyx_L1_error;
          __pyx_L135_exit_scope:;
        } /* exit inner scope */
        __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_discard_t2);
        __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_discard_t2, ((PyObject*)__pyx_t_7));
        __Pyx_GIVEREF(__pyx_t_7);
        __pyx_t_7 = 0;

        /* "ete4/core/tree.pyx":1297
 *                 if min_support_t2 and unrooted_trees:
 *                     discard_t2 = {p for p in edges2 if support_t2.get(p[0], support_t2.get(p[1], math.inf)) < min_support_t2}
 *                 elif min_support_t2:             # <<<<<<<<<<<<<<
 *                     discard_t2 = {p for p in edges2 if support_t2[p] is not None and support_t2[p] < min_support_t2}
 * 
 */
      }
      __pyx_L117:;

      /* "ete4/core/tree.pyx":1302
 *                 # the two root edges are never counted here, as they are always
 *                 # present in both trees because of the common property filters
 *                 rf = len(((edges1 ^ edges2) - discard_t2) - discard_t1) - polytomy_correction             # <<<<<<<<<<<<<<
 * 
 *                 if unrooted_trees:
 */
      __pyx_t_7 = PyNumber_Xor(__pyx_cur_scope->__pyx_v_edges1, __pyx_cur_scope->__pyx_v_edges2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1302, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_10 = PyNumber_Subtract(__pyx_t_7, __pyx_cur_scope->__pyx_v_discard_t2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1302, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyNumber_Subtract(__pyx_t_10, __pyx_cur_scope->__pyx_v_discard_t1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1302, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_21 = PyObject_Length(__pyx_t_7); if (unlikely(__pyx_t_21 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1302, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyInt_FromSsize_t(__pyx_t_21); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1302, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_10 = PyNumber_Subtract(__pyx_t_7, __pyx_v_polytomy_correction); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1302, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF_SET(__pyx_v_rf, __pyx_t_10);
      __pyx_t_10 = 0;

      /* "ete4/core/tree.pyx":1304
 *                 rf = len(((edges1 ^ edges2) - discard_t2) - discard_t1) - polytomy_correction
 * 
 *                 if unrooted_trees:             # <<<<<<<<<<<<<<
 *                     max_parts = (
 *                         sum(1 for p in edges1 - discard_t1 if len(p[0]) > 1 and len(p[1]) > 1) +
 */
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_unrooted_trees); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1304, __pyx_L1_error)
      if (__pyx_t_1) {

        /* "ete4/core/tree.pyx":1306
 *                 if unrooted_trees:
 *                     max_parts = (
 *                         sum(1 for p in edges1 - discard_t1 if len(p[0]) > 1 and len(p[1]) > 1) +             # <<<<<<<<<<<<<<
 *                         sum(1 for p in edges2 - discard_t2 if len(p[0]) > 1 and len(p[1]) > 1))
 *                 else:
 */
        __pyx_t_10 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_edges1, __pyx_cur_scope->__pyx_v_discard_t1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1306, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_7 = __pyx_pf_4ete4_4core_4tree_4Tree_15robinson_foulds_17genexpr(((PyObject*)__pyx_cur_scope), __pyx_t_10); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1306, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_7); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1306, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "ete4/core/tree.pyx":1307
 *                     max_parts = (
 *                         sum(1 for p in edges1 - discard_t1 if len(p[0]) > 1 and len(p[1]) > 1) +
 *                         sum(1 for p in edges2 - discard_t2 if len(p[0]) > 1 and len(p[1]) > 1))             # <<<<<<<<<<<<<<
 *                 else:
 *                     # Otherwise we need to count the actual number of valid
 */
        __pyx_t_7 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_edges2, __pyx_cur_scope->__pyx_v_discard_t2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1307, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_17 = __pyx_pf_4ete4_4core_4tree_4Tree_15robinson_foulds_20genexpr(((PyObject*)__pyx_cur_scope), __pyx_t_7); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1307, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_17);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_17); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1307, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

        /* "ete4/core/tree.pyx":1306
 *                 if unrooted_trees:
 *                     max_parts = (
 *                         sum(1 for p in edges1 - discard_t1 if len(p[0]) > 1 and len(p[1]) > 1) +             # <<<<<<<<<<<<<<
 *                         sum(1 for p in edges2 - discard_t2 if len(p[0]) > 1 and len(p[1]) > 1))
 *                 else:
 */
        __pyx_t_17 = PyNumber_Add(__pyx_t_10, __pyx_t_7); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1306, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_17);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF_SET(__pyx_v_max_parts, __pyx_t_17);
        __pyx_t_17 = 0;

        /* "ete4/core/tree.pyx":1304
 *                 rf = len(((edges1 ^ edges2) - discard_t2) - discard_t1) - polytomy_correction
 * 
 *                 if unrooted_trees:             # <<<<<<<<<<<<<<
 *                     max_parts = (
 *                         sum(1 for p in edges1 - discard_t1 if len(p[0]) > 1 and len(p[1]) > 1) +
 */
        goto __pyx_L136;
      }

      /* "ete4/core/tree.pyx":1314
 *                     max_parts = (
 *                         sum(1 for p in edges1 - discard_t1 if len(p) > 1) +
 *                         sum(1 for p in edges2 - discard_t2 if len(p) > 1)) - 2             # <<<<<<<<<<<<<<
 * 
 *                 if not min_comparison or (min_comparison[0] is not None and min_comparison[0] > rf):
 */
      /*else*/ {

        /* "ete4/core/tree.pyx":1313
 *                     # partition of the two trees (only needed in rooted trees)
 *                     max_parts = (
 *                         sum(1 for p in edges1 - discard_t1 if len(p) > 1) +             # <<<<<<<<<<<<<<
 *                         sum(1 for p in edges2 - discard_t2 if len(p) > 1)) - 2
 * 
 */
        __pyx_t_17 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_edges1, __pyx_cur_scope->__pyx_v_discard_t1); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1313, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_17);
        __pyx_t_7 = __pyx_pf_4ete4_4core_4tree_4Tree_15robinson_foulds_23genexpr(((PyObject*)__pyx_cur_scope), __pyx_t_17); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1313, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
        __pyx_t_17 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_7); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1313, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_17);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "ete4/core/tree.pyx":1314
 *                     max_parts = (
 *                         sum(1 for p in edges1 - discard_t1 if len(p) > 1) +
 *                         sum(1 for p in edges2 - discard_t2 if len(p) > 1)) - 2             # <<<<<<<<<<<<<<
 * 
 *                 if not min_comparison or (min_comparison[0] is not None and min_comparison[0] > rf):
 */
        __pyx_t_7 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_edges2, __pyx_cur_scope->__pyx_v_discard_t2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1314, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_10 = __pyx_pf_4ete4_4core_4tree_4Tree_15robinson_foulds_26genexpr(((PyObject*)__pyx_cur_scope), __pyx_t_7); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1314, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_10); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1314, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

        /* "ete4/core/tree.pyx":1313
 *                     # partition of the two trees (only needed in rooted trees)
 *                     max_parts = (
 *                         sum(1 for p in edges1 - discard_t1 if len(p) > 1) +             # <<<<<<<<<<<<<<
 *                         sum(1 for p in edges2 - discard_t2 if len(p) > 1)) - 2
 * 
 */
        __pyx_t_10 = PyNumber_Add(__pyx_t_17, __pyx_t_7); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1313, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "ete4/core/tree.pyx":1314
 *                     max_parts = (
 *                         sum(1 for p in edges1 - discard_t1 if len(p) > 1) +
 *                         sum(1 for p in edges2 - discard_t2 if len(p) > 1)) - 2             # <<<<<<<<<<<<<<
 * 
 *                 if not min_comparison or (min_comparison[0] is not None and min_comparison[0] > rf):
 */
        __pyx_t_7 = __Pyx_PyInt_SubtractObjC(__pyx_t_10, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1314, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_XDECREF_SET(__pyx_v_max_parts, __pyx_t_7);
        __pyx_t_7 = 0;
      }
      __pyx_L136:;

      /* "ete4/core/tree.pyx":1316
 *                         sum(1 for p in edges2 - discard_t2 if len(p) > 1)) - 2
 * 
 *                 if not min_comparison or (min_comparison[0] is not None and min_comparison[0] > rf):             # <<<<<<<<<<<<<<
 *                     min_comparison = [rf, max_parts, common, edges1, edges2, discard_t1, discard_t2]
 * 
 */
      __pyx_t_3 = (__pyx_v_min_comparison != Py_None)&&(PyList_GET_SIZE(__pyx_v_min_comparison) != 0);
      __pyx_t_2 = (!__pyx_t_3);
      if (!__pyx_t_2) {
      } else {
        __pyx_t_1 = __pyx_t_2;
        goto __pyx_L138_bool_binop_done;
      }
      if (unlikely(__pyx_v_min_comparison == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(0, 1316, __pyx_L1_error)
      }
      __pyx_t_7 = __Pyx_GetItemInt_List(__pyx_v_min_comparison, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1316, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_2 = (__pyx_t_7 != Py_None);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (__pyx_t_2) {
      } else {
        __pyx_t_1 = __pyx_t_2;
        goto __pyx_L138_bool_binop_done;
      }
      if (unlikely(__pyx_v_min_comparison == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(0, 1316, __pyx_L1_error)
      }
      __pyx_t_7 = __Pyx_GetItemInt_List(__pyx_v_min_comparison, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1316, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_10 = PyObject_RichCompare(__pyx_t_7, __pyx_v_rf, Py_GT); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1316, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1316, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_1 = __pyx_t_2;
      __pyx_L138_bool_binop_done:;
      if (__pyx_t_1) {

        /* "ete4/core/tree.pyx":1317
 * 
 *                 if not min_comparison or (min_comparison[0] is not None and min_comparison[0] > rf):
 *                     min_comparison = [rf, max_parts, common, edges1, edges2, discard_t1, discard_t2]             # <<<<<<<<<<<<<<
 * 
 *         return min_comparison
 */
        __pyx_t_10 = PyList_New(7); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1317, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_INCREF(__pyx_v_rf);
        __Pyx_GIVEREF(__pyx_v_rf);
        if (__Pyx_PyList_SET_ITEM(__pyx_t_10, 0, __pyx_v_rf)) __PYX_ERR(0, 1317, __pyx_L1_error);
        __Pyx_INCREF(__pyx_v_max_parts);
        __Pyx_GIVEREF(__pyx_v_max_parts);
        if (__Pyx_PyList_SET_ITEM(__pyx_t_10, 1, __pyx_v_max_parts)) __PYX_ERR(0, 1317, __pyx_L1_error);
        __Pyx_INCREF(__pyx_cur_scope->__pyx_v_common);
        __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_common);
        if (__Pyx_PyList_SET_ITEM(__pyx_t_10, 2, __pyx_cur_scope->__pyx_v_common)) __PYX_ERR(0, 1317, __pyx_L1_error);
        __Pyx_INCREF(__pyx_cur_scope->__pyx_v_edges1);
        __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_edges1);
        if (__Pyx_PyList_SET_ITEM(__pyx_t_10, 3, __pyx_cur_scope->__pyx_v_edges1)) __PYX_ERR(0, 1317, __pyx_L1_error);
        __Pyx_INCREF(__pyx_cur_scope->__pyx_v_edges2);
        __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_edges2);
        if (__Pyx_PyList_SET_ITEM(__pyx_t_10, 4, __pyx_cur_scope->__pyx_v_edges2)) __PYX_ERR(0, 1317, __pyx_L1_error);
        __Pyx_INCREF(__pyx_cur_scope->__pyx_v_discard_t1);
        __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_discard_t1);
        if (__Pyx_PyList_SET_ITEM(__pyx_t_10, 5, __pyx_cur_scope->__pyx_v_discard_t1)) __PYX_ERR(0, 1317, __pyx_L1_error);
        __Pyx_INCREF(__pyx_cur_scope->__pyx_v_discard_t2);
        __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_discard_t2);
        if (__Pyx_PyList_SET_ITEM(__pyx_t_10, 6, __pyx_cur_scope->__pyx_v_discard_t2)) __PYX_ERR(0, 1317, __pyx_L1_error);
        __Pyx_DECREF_SET(__pyx_v_min_comparison, ((PyObject*)__pyx_t_10));
        __pyx_t_10 = 0;

        /* "ete4/core/tree.pyx":1316
 *                         sum(1 for p in edges2 - discard_t2 if len(p) > 1)) - 2
 * 
 *                 if not min_comparison or (min_comparison[0] is not None and min_comparison[0] > rf):             # <<<<<<<<<<<<<<
 *                     min_comparison = [rf, max_parts, common, edges1, edges2, discard_t1, discard_t2]
 * 
 */
      }

      /* "ete4/core/tree.pyx":1268
 *                               for branch, leaves in t1_leaves.items()}
 * 
 *             for t2 in target_trees:             # <<<<<<<<<<<<<<
 *                 t2_leaves = t2.get_cached_content()
 *                 t2_leaves_all = t2_leaves[t2]
 */
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "ete4/core/tree.pyx":1248
 * 
 *         min_comparison = None
 *         for t1 in origin_trees:             # <<<<<<<<<<<<<<
 *             t1_leaves = t1.get_cached_content()
 *             t1_leaves_all = t1_leaves[t1]
 */
  }
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "ete4/core/tree.pyx":1319
 *                     min_comparison = [rf, max_parts, common, edges1, edges2, discard_t1, discard_t2]
 * 
 *         return min_comparison             # <<<<<<<<<<<<<<
 * 
 *     def compare(self, ref_tree, use_collateral=False, min_support_source=0.0, min_support_ref=0.0,
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_min_comparison);
  __pyx_r = __pyx_v_min_comparison;
  goto __pyx_L0;

  /* "ete4/core/tree.pyx":1158
 *         return leaves
 * 
 *     def robinson_foulds(self, t2, prop_t1='name', prop_t2='name',             # <<<<<<<<<<<<<<
 *                         unrooted_trees=False, expand_polytomies=False,
 *                         polytomy_size_limit=5, skip_large_polytomies=False,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_XDECREF(__pyx_t_19);
  __Pyx_XDECREF(__pyx_t_20);
  __Pyx_XDECREF(__pyx_t_22);
  __Pyx_AddTraceback("ete4.core.tree.Tree.robinson_foulds", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_origin_t);
  __Pyx_XDECREF(__pyx_v_target_t);
  __Pyx_XDECREF(__pyx_v_size1);
  __Pyx_XDECREF(__pyx_v_size2);
  __Pyx_XDECREF(__pyx_v_origin_trees);
  __Pyx_XDECREF(__pyx_v_target_trees);
  __Pyx_XDECREF(__pyx_v_polytomy_correction);
  __Pyx_XDECREF(__pyx_v_corr1);
  __Pyx_XDECREF(__pyx_v_corr2);
  __Pyx_XDECREF(__pyx_gb_4ete4_4core_4tree_4Tree_15robinson_foulds_4generator21);
  __Pyx_XDECREF(__pyx_v_min_comparison);
  __Pyx_XDECREF(__pyx_v_t1);
  __Pyx_XDECREF(__pyx_v_t1_leaves);
  __Pyx_XDECREF(__pyx_v_t1_leaves_all);
  __Pyx_XDECREF(__pyx_v_support_t1);
  __Pyx_XDECREF(__pyx_v_t2_leaves);
  __Pyx_XDECREF(__pyx_v_t2_leaves_all);
  __Pyx_XDECREF(__pyx_v_support_t2);
  __Pyx_XDECREF(__pyx_v_rf);
  __Pyx_XDECREF(__pyx_v_max_parts);
  __Pyx_XDECREF(__pyx_9genexpr13__pyx_v_n);
  __Pyx_XDECREF(__pyx_9genexpr14__pyx_v_n);
  __Pyx_XDECREF(__pyx_gb_4ete4_4core_4tree_4Tree_15robinson_foulds_7generator22);
  __Pyx_XDECREF(__pyx_gb_4ete4_4core_4tree_4Tree_15robinson_foulds_10generator23);
  __Pyx_XDECREF(__pyx_9genexpr17__pyx_v_nw);
  __Pyx_XDECREF(__pyx_9genexpr18__pyx_v_nw);
  __Pyx_XDECREF(__pyx_gb_4ete4_4core_4tree_4Tree_15robinson_foulds_13generator24);
  __Pyx_XDECREF(__pyx_gb_4ete4_4core_4tree_4Tree_15robinson_foulds_16generator25);
  __Pyx_XDECREF(__pyx_9genexpr21__pyx_v_leaves);
  __Pyx_XDECREF(__pyx_9genexpr22__pyx_v_leaves);
  __Pyx_XDECREF(__pyx_9genexpr23__pyx_v_branch);
  __Pyx_XDECREF(__pyx_9genexpr23__pyx_v_0);
  __Pyx_XDECREF(__pyx_9genexpr25__pyx_v_leaves);
  __Pyx_XDECREF(__pyx_9genexpr26__pyx_v_leaves);
  __Pyx_XDECREF(__pyx_9genexpr27__pyx_v_branch);
  __Pyx_XDECREF(__pyx_9genexpr27__pyx_v_1);
  __Pyx_XDECREF(__pyx_9genexpr29__pyx_v_p);
  __Pyx_XDECREF(__pyx_9genexpr30__pyx_v_p);
  __Pyx_XDECREF(__pyx_9genexpr31__pyx_v_p);
  __Pyx_XDECREF(__pyx_9genexpr32__pyx_v_p);
  __Pyx_XDECREF(__pyx_gb_4ete4_4core_4tree_4Tree_15robinson_foulds_19generator28);
  __Pyx_XDECREF(__pyx_gb_4ete4_4core_4tree_4Tree_15robinson_foulds_22generator29);
  __Pyx_XDECREF(__pyx_gb_4ete4_4core_4tree_4Tree_15robinson_foulds_25generator30);
  __Pyx_XDECREF(__pyx_gb_4ete4_4core_4tree_4Tree_15robinson_foulds_28generator31);
  __Pyx_XDECREF(__pyx_v_t2);
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ete4/core/tree.pyx":1321
 *         return min_comparison
 * 
 *     def compare(self, ref_tree, use_collateral=False, min_support_source=0.0, min_support_ref=0.0,             # <<<<<<<<<<<<<<
 *                 has_duplications=False, expand_polytomies=False, unrooted=False,
 *                 max_treeko_splits_to_be_artifact=1000, ref_tree_attr='name', source_tree_attr='name'):
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_136compare(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_4ete4_4core_4tree_4Tree_135compare, "Tree.compare(self, ref_tree, use_collateral=False, min_support_source=0.0, min_support_ref=0.0, has_duplications=False, expand_polytomies=False, unrooted=False, max_treeko_splits_to_be_artifact=1000, ref_tree_attr=u'name', source_tree_attr=u'name')\ncompare this tree with another using robinson foulds symmetric difference\n        and number of shared edges. Trees of different sizes and with duplicated\n        items allowed.\n\n        returns: a Python dictionary with results\n\n        ");
static PyMethodDef __pyx_mdef_4ete4_4core_4tree_4Tree_136compare = {"compare", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_136compare, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_135compare};
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_136compare(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_ref_tree = 0;
  CYTHON_UNUSED PyObject *__pyx_v_use_collateral = 0;
  PyObject *__pyx_v_min_support_source = 0;
  PyObject *__pyx_v_min_support_ref = 0;
  PyObject *__pyx_v_has_duplications = 0;
  PyObject *__pyx_v_expand_polytomies = 0;
  PyObject *__pyx_v_unrooted = 0;
  PyObject *__pyx_v_max_treeko_splits_to_be_artifact = 0;
  PyObject *__pyx_v_ref_tree_attr = 0;
  PyObject *__pyx_v_source_tree_attr = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("compare (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ref_tree,&__pyx_n_s_use_collateral,&__pyx_n_s_min_support_source,&__pyx_n_s_min_support_ref,&__pyx_n_s_has_duplications,&__pyx_n_s_expand_polytomies,&__pyx_n_s_unrooted,&__pyx_n_s_max_treeko_splits_to_be_artifact,&__pyx_n_s_ref_tree_attr,&__pyx_n_s_source_tree_attr,0};
    values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_False));
    values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_float_0_0));
    values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_float_0_0));

    /* "ete4/core/tree.pyx":1322
 * 
 *     def compare(self, ref_tree, use_collateral=False, min_support_source=0.0, min_support_ref=0.0,
 *                 has_duplications=False, expand_polytomies=False, unrooted=False,             # <<<<<<<<<<<<<<
 *                 max_treeko_splits_to_be_artifact=1000, ref_tree_attr='name', source_tree_attr='name'):
 * 
 */
    values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_False));
    values[5] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_False));
    values[6] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_False));
    values[7] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_1000));
    values[8] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_n_u_name));
    values[9] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_n_u_name));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case 10: values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ref_tree)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1321, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_use_collateral);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1321, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_min_support_source);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1321, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_min_support_ref);
          if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1321, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_has_duplications);
          if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1321, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_expand_polytomies);
          if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1321, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_unrooted);
          if (value) { values[6] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1321, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_max_treeko_splits_to_be_artifact);
          if (value) { values[7] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1321, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ref_tree_attr);
          if (value) { values[8] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1321, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_source_tree_attr);
          if (value) { values[9] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1321, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "compare") < 0)) __PYX_ERR(0, 1321, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case 10: values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_ref_tree = values[0];
    __pyx_v_use_collateral = values[1];
    __pyx_v_min_support_source = values[2];
    __pyx_v_min_support_ref = values[3];
    __pyx_v_has_duplications = values[4];
    __pyx_v_expand_polytomies = values[5];
    __pyx_v_unrooted = values[6];
    __pyx_v_max_treeko_splits_to_be_artifact = values[7];
    __pyx_v_ref_tree_attr = values[8];
    __pyx_v_source_tree_attr = values[9];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("compare", 0, 1, 10, __pyx_nargs); __PYX_ERR(0, 1321, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("ete4.core.tree.Tree.compare", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_135compare(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self), __pyx_v_ref_tree, __pyx_v_use_collateral, __pyx_v_min_support_source, __pyx_v_min_support_ref, __pyx_v_has_duplications, __pyx_v_expand_polytomies, __pyx_v_unrooted, __pyx_v_max_treeko_splits_to_be_artifact, __pyx_v_ref_tree_attr, __pyx_v_source_tree_attr);

  /* "ete4/core/tree.pyx":1321
 *         return min_comparison
 * 
 *     def compare(self, ref_tree, use_collateral=False, min_support_source=0.0, min_support_ref=0.0,             # <<<<<<<<<<<<<<
 *                 has_duplications=False, expand_polytomies=False, unrooted=False,
 *                 max_treeko_splits_to_be_artifact=1000, ref_tree_attr='name', source_tree_attr='name'):
 */

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

/* "ete4/core/tree.pyx":1334
 *         source_tree = self
 * 
 *         def _safe_div(a, b):             # <<<<<<<<<<<<<<
 *             if a != 0:
 *                 return a / float(b)
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_7compare_1_safe_div(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_4ete4_4core_4tree_4Tree_7compare_1_safe_div = {"_safe_div", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_7compare_1_safe_div, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_7compare_1_safe_div(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_a = 0;
  PyObject *__pyx_v_b = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_safe_div (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_b,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1334, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_b)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1334, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("_safe_div", 1, 2, 2, 1); __PYX_ERR(0, 1334, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_safe_div") < 0)) __PYX_ERR(0, 1334, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_a = values[0];
    __pyx_v_b = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_safe_div", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1334, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("ete4.core.tree.Tree.compare._safe_div", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_7compare__safe_div(__pyx_self, __pyx_v_a, __pyx_v_b);

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

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_7compare__safe_div(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_safe_div", 1);

  /* "ete4/core/tree.pyx":1335
 * 
 *         def _safe_div(a, b):
 *             if a != 0:             # <<<<<<<<<<<<<<
 *                 return a / float(b)
 *             else: return 0.0
 */
  __pyx_t_1 = (__Pyx_PyInt_BoolNeObjC(__pyx_v_a, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1335, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "ete4/core/tree.pyx":1336
 *         def _safe_div(a, b):
 *             if a != 0:
 *                 return a / float(b)             # <<<<<<<<<<<<<<
 *             else: return 0.0
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyNumber_Float(__pyx_v_b); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1336, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_v_a, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1336, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "ete4/core/tree.pyx":1335
 * 
 *         def _safe_div(a, b):
 *             if a != 0:             # <<<<<<<<<<<<<<
 *                 return a / float(b)
 *             else: return 0.0
 */
  }

  /* "ete4/core/tree.pyx":1337
 *             if a != 0:
 *                 return a / float(b)
 *             else: return 0.0             # <<<<<<<<<<<<<<
 * 
 *         def _compare(src_tree, ref_tree):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_float_0_0);
    __pyx_r = __pyx_float_0_0;
    goto __pyx_L0;
  }

  /* "ete4/core/tree.pyx":1334
 *         source_tree = self
 * 
 *         def _safe_div(a, b):             # <<<<<<<<<<<<<<
 *             if a != 0:
 *                 return a / float(b)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("ete4.core.tree.Tree.compare._safe_div", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ete4/core/tree.pyx":1339
 *             else: return 0.0
 * 
 *         def _compare(src_tree, ref_tree):             # <<<<<<<<<<<<<<
 *             # calculate partitions and rf distances
 *             rf, maxrf, common, ref_p, src_p, ref_disc, src_disc  = ref_tree.robinson_foulds(src_tree,
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_7compare_3_compare(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_4ete4_4core_4tree_4Tree_7compare_3_compare = {"_compare", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_7compare_3_compare, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_7compare_3_compare(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_src_tree = 0;
  PyObject *__pyx_v_ref_tree = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_compare (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_src_tree,&__pyx_n_s_ref_tree,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_src_tree)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1339, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ref_tree)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1339, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("_compare", 1, 2, 2, 1); __PYX_ERR(0, 1339, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_compare") < 0)) __PYX_ERR(0, 1339, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_src_tree = values[0];
    __pyx_v_ref_tree = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_compare", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1339, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("ete4.core.tree.Tree.compare._compare", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_7compare_2_compare(__pyx_self, __pyx_v_src_tree, __pyx_v_ref_tree);

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

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_7compare_2_compare(PyObject *__pyx_self, PyObject *__pyx_v_src_tree, PyObject *__pyx_v_ref_tree) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_38_compare *__pyx_cur_scope;
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_38_compare *__pyx_outer_scope;
  PyObject *__pyx_v_rf = NULL;
  PyObject *__pyx_v_maxrf = NULL;
  PyObject *__pyx_v_common = NULL;
  PyObject *__pyx_v_ref_p = NULL;
  PyObject *__pyx_v_src_p = NULL;
  PyObject *__pyx_v_ref_disc = NULL;
  PyObject *__pyx_v_src_disc = NULL;
  PyObject *__pyx_v_valid_ref_edges = NULL;
  PyObject *__pyx_v_valid_src_edges = NULL;
  PyObject *__pyx_v_common_edges = NULL;
  PyObject *__pyx_9genexpr37__pyx_v_p = NULL;
  PyObject *__pyx_9genexpr38__pyx_v_p = NULL;
  PyObject *__pyx_9genexpr39__pyx_v_p = NULL;
  PyObject *__pyx_9genexpr40__pyx_v_p = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *(*__pyx_t_10)(PyObject *);
  int __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  int __pyx_t_13;
  PyObject *(*__pyx_t_14)(PyObject *);
  Py_ssize_t __pyx_t_15;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_compare", 1);
  __pyx_outer_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_38_compare *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "ete4/core/tree.pyx":1341
 *         def _compare(src_tree, ref_tree):
 *             # calculate partitions and rf distances
 *             rf, maxrf, common, ref_p, src_p, ref_disc, src_disc  = ref_tree.robinson_foulds(src_tree,             # <<<<<<<<<<<<<<
 *                                                                                             expand_polytomies=expand_polytomies,
 *                                                                                             unrooted_trees=unrooted,
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_ref_tree, __pyx_n_s_robinson_foulds); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1341, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1341, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_src_tree);
  __Pyx_GIVEREF(__pyx_v_src_tree);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_src_tree)) __PYX_ERR(0, 1341, __pyx_L1_error);

  /* "ete4/core/tree.pyx":1342
 *             # calculate partitions and rf distances
 *             rf, maxrf, common, ref_p, src_p, ref_disc, src_disc  = ref_tree.robinson_foulds(src_tree,
 *                                                                                             expand_polytomies=expand_polytomies,             # <<<<<<<<<<<<<<
 *                                                                                             unrooted_trees=unrooted,
 *                                                                                             prop_t1=ref_tree_attr,
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1342, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (unlikely(!__pyx_cur_scope->__pyx_v_expand_polytomies)) { __Pyx_RaiseClosureNameError("expand_polytomies"); __PYX_ERR(0, 1342, __pyx_L1_error) }
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_expand_polytomies, __pyx_cur_scope->__pyx_v_expand_polytomies) < 0) __PYX_ERR(0, 1342, __pyx_L1_error)

  /* "ete4/core/tree.pyx":1343
 *             rf, maxrf, common, ref_p, src_p, ref_disc, src_disc  = ref_tree.robinson_foulds(src_tree,
 *                                                                                             expand_polytomies=expand_polytomies,
 *                                                                                             unrooted_trees=unrooted,             # <<<<<<<<<<<<<<
 *                                                                                             prop_t1=ref_tree_attr,
 *                                                                                             prop_t2=source_tree_attr,
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_unrooted)) { __Pyx_RaiseClosureNameError("unrooted"); __PYX_ERR(0, 1343, __pyx_L1_error) }
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_unrooted_trees, __pyx_cur_scope->__pyx_v_unrooted) < 0) __PYX_ERR(0, 1342, __pyx_L1_error)

  /* "ete4/core/tree.pyx":1344
 *                                                                                             expand_polytomies=expand_polytomies,
 *                                                                                             unrooted_trees=unrooted,
 *                                                                                             prop_t1=ref_tree_attr,             # <<<<<<<<<<<<<<
 *                                                                                             prop_t2=source_tree_attr,
 *                                                                                             min_support_t2=min_support_source,
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_ref_tree_attr)) { __Pyx_RaiseClosureNameError("ref_tree_attr"); __PYX_ERR(0, 1344, __pyx_L1_error) }
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_prop_t1, __pyx_cur_scope->__pyx_v_ref_tree_attr) < 0) __PYX_ERR(0, 1342, __pyx_L1_error)

  /* "ete4/core/tree.pyx":1345
 *                                                                                             unrooted_trees=unrooted,
 *                                                                                             prop_t1=ref_tree_attr,
 *                                                                                             prop_t2=source_tree_attr,             # <<<<<<<<<<<<<<
 *                                                                                             min_support_t2=min_support_source,
 *                                                                                             min_support_t1=min_support_ref)
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_source_tree_attr)) { __Pyx_RaiseClosureNameError("source_tree_attr"); __PYX_ERR(0, 1345, __pyx_L1_error) }
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_prop_t2, __pyx_cur_scope->__pyx_v_source_tree_attr) < 0) __PYX_ERR(0, 1342, __pyx_L1_error)

  /* "ete4/core/tree.pyx":1346
 *                                                                                             prop_t1=ref_tree_attr,
 *                                                                                             prop_t2=source_tree_attr,
 *                                                                                             min_support_t2=min_support_source,             # <<<<<<<<<<<<<<
 *                                                                                             min_support_t1=min_support_ref)
 * 
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_min_support_source)) { __Pyx_RaiseClosureNameError("min_support_source"); __PYX_ERR(0, 1346, __pyx_L1_error) }
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_min_support_t2, __pyx_cur_scope->__pyx_v_min_support_source) < 0) __PYX_ERR(0, 1342, __pyx_L1_error)

  /* "ete4/core/tree.pyx":1347
 *                                                                                             prop_t2=source_tree_attr,
 *                                                                                             min_support_t2=min_support_source,
 *                                                                                             min_support_t1=min_support_ref)             # <<<<<<<<<<<<<<
 * 
 *             # if trees share leaves, count their distances
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_min_support_ref)) { __Pyx_RaiseClosureNameError("min_support_ref"); __PYX_ERR(0, 1347, __pyx_L1_error) }
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_min_support_t1, __pyx_cur_scope->__pyx_v_min_support_ref) < 0) __PYX_ERR(0, 1342, __pyx_L1_error)

  /* "ete4/core/tree.pyx":1341
 *         def _compare(src_tree, ref_tree):
 *             # calculate partitions and rf distances
 *             rf, maxrf, common, ref_p, src_p, ref_disc, src_disc  = ref_tree.robinson_foulds(src_tree,             # <<<<<<<<<<<<<<
 *                                                                                             expand_polytomies=expand_polytomies,
 *                                                                                             unrooted_trees=unrooted,
 */
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1341, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  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 != 7)) {
      if (size > 7) __Pyx_RaiseTooManyValuesError(7);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 1341, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 2); 
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 3); 
      __pyx_t_6 = PyTuple_GET_ITEM(sequence, 4); 
      __pyx_t_7 = PyTuple_GET_ITEM(sequence, 5); 
      __pyx_t_8 = PyTuple_GET_ITEM(sequence, 6); 
    } else {
      __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
      __pyx_t_1 = PyList_GET_ITEM(sequence, 2); 
      __pyx_t_5 = PyList_GET_ITEM(sequence, 3); 
      __pyx_t_6 = PyList_GET_ITEM(sequence, 4); 
      __pyx_t_7 = PyList_GET_ITEM(sequence, 5); 
      __pyx_t_8 = PyList_GET_ITEM(sequence, 6); 
    }
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_t_7);
    __Pyx_INCREF(__pyx_t_8);
    #else
    {
      Py_ssize_t i;
      PyObject** temps[7] = {&__pyx_t_3,&__pyx_t_2,&__pyx_t_1,&__pyx_t_5,&__pyx_t_6,&__pyx_t_7,&__pyx_t_8};
      for (i=0; i < 7; i++) {
        PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 1341, __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[7] = {&__pyx_t_3,&__pyx_t_2,&__pyx_t_1,&__pyx_t_5,&__pyx_t_6,&__pyx_t_7,&__pyx_t_8};
    __pyx_t_9 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1341, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_10 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_9);
    for (index=0; index < 7; index++) {
      PyObject* item = __pyx_t_10(__pyx_t_9); if (unlikely(!item)) goto __pyx_L3_unpacking_failed;
      __Pyx_GOTREF(item);
      *(temps[index]) = item;
    }
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 7) < 0) __PYX_ERR(0, 1341, __pyx_L1_error)
    __pyx_t_10 = NULL;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_10 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 1341, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_rf = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_v_maxrf = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_v_common = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_ref_p = __pyx_t_5;
  __pyx_t_5 = 0;
  __pyx_v_src_p = __pyx_t_6;
  __pyx_t_6 = 0;
  __pyx_v_ref_disc = __pyx_t_7;
  __pyx_t_7 = 0;
  __pyx_v_src_disc = __pyx_t_8;
  __pyx_t_8 = 0;

  /* "ete4/core/tree.pyx":1350
 * 
 *             # if trees share leaves, count their distances
 *             if len(common) > 0 and src_p and ref_p:             # <<<<<<<<<<<<<<
 *                 if unrooted:
 *                     valid_ref_edges = set([p for p in (ref_p - ref_disc) if len(p[0])>1 and len(p[1])>0])
 */
  __pyx_t_12 = PyObject_Length(__pyx_v_common); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1350, __pyx_L1_error)
  __pyx_t_13 = (__pyx_t_12 > 0);
  if (__pyx_t_13) {
  } else {
    __pyx_t_11 = __pyx_t_13;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_v_src_p); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 1350, __pyx_L1_error)
  if (__pyx_t_13) {
  } else {
    __pyx_t_11 = __pyx_t_13;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_v_ref_p); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 1350, __pyx_L1_error)
  __pyx_t_11 = __pyx_t_13;
  __pyx_L6_bool_binop_done:;
  if (__pyx_t_11) {

    /* "ete4/core/tree.pyx":1351
 *             # if trees share leaves, count their distances
 *             if len(common) > 0 and src_p and ref_p:
 *                 if unrooted:             # <<<<<<<<<<<<<<
 *                     valid_ref_edges = set([p for p in (ref_p - ref_disc) if len(p[0])>1 and len(p[1])>0])
 *                     valid_src_edges = set([p for p in (src_p - src_disc) if len(p[0])>1 and len(p[1])>0])
 */
    if (unlikely(!__pyx_cur_scope->__pyx_v_unrooted)) { __Pyx_RaiseClosureNameError("unrooted"); __PYX_ERR(0, 1351, __pyx_L1_error) }
    __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_unrooted); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1351, __pyx_L1_error)
    if (__pyx_t_11) {

      /* "ete4/core/tree.pyx":1352
 *             if len(common) > 0 and src_p and ref_p:
 *                 if unrooted:
 *                     valid_ref_edges = set([p for p in (ref_p - ref_disc) if len(p[0])>1 and len(p[1])>0])             # <<<<<<<<<<<<<<
 *                     valid_src_edges = set([p for p in (src_p - src_disc) if len(p[0])>1 and len(p[1])>0])
 *                     common_edges = valid_ref_edges & valid_src_edges
 */
      { /* enter inner scope */
        __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1352, __pyx_L12_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_8 = PyNumber_Subtract(__pyx_v_ref_p, __pyx_v_ref_disc); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1352, __pyx_L12_error)
        __Pyx_GOTREF(__pyx_t_8);
        if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) {
          __pyx_t_7 = __pyx_t_8; __Pyx_INCREF(__pyx_t_7);
          __pyx_t_12 = 0;
          __pyx_t_14 = NULL;
        } else {
          __pyx_t_12 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1352, __pyx_L12_error)
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_14 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1352, __pyx_L12_error)
        }
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        for (;;) {
          if (likely(!__pyx_t_14)) {
            if (likely(PyList_CheckExact(__pyx_t_7))) {
              {
                Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_7);
                #if !CYTHON_ASSUME_SAFE_MACROS
                if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1352, __pyx_L12_error)
                #endif
                if (__pyx_t_12 >= __pyx_temp) break;
              }
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_8 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_12); __Pyx_INCREF(__pyx_t_8); __pyx_t_12++; if (unlikely((0 < 0))) __PYX_ERR(0, 1352, __pyx_L12_error)
              #else
              __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1352, __pyx_L12_error)
              __Pyx_GOTREF(__pyx_t_8);
              #endif
            } else {
              {
                Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_7);
                #if !CYTHON_ASSUME_SAFE_MACROS
                if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1352, __pyx_L12_error)
                #endif
                if (__pyx_t_12 >= __pyx_temp) break;
              }
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_12); __Pyx_INCREF(__pyx_t_8); __pyx_t_12++; if (unlikely((0 < 0))) __PYX_ERR(0, 1352, __pyx_L12_error)
              #else
              __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1352, __pyx_L12_error)
              __Pyx_GOTREF(__pyx_t_8);
              #endif
            }
          } else {
            __pyx_t_8 = __pyx_t_14(__pyx_t_7);
            if (unlikely(!__pyx_t_8)) {
              PyObject* exc_type = PyErr_Occurred();
              if (exc_type) {
                if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                else __PYX_ERR(0, 1352, __pyx_L12_error)
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_8);
          }
          __Pyx_XDECREF_SET(__pyx_9genexpr37__pyx_v_p, __pyx_t_8);
          __pyx_t_8 = 0;
          __pyx_t_8 = __Pyx_GetItemInt(__pyx_9genexpr37__pyx_v_p, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1352, __pyx_L12_error)
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_15 = PyObject_Length(__pyx_t_8); if (unlikely(__pyx_t_15 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1352, __pyx_L12_error)
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __pyx_t_13 = (__pyx_t_15 > 1);
          if (__pyx_t_13) {
          } else {
            __pyx_t_11 = __pyx_t_13;
            goto __pyx_L16_bool_binop_done;
          }
          __pyx_t_8 = __Pyx_GetItemInt(__pyx_9genexpr37__pyx_v_p, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1352, __pyx_L12_error)
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_15 = PyObject_Length(__pyx_t_8); if (unlikely(__pyx_t_15 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1352, __pyx_L12_error)
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __pyx_t_13 = (__pyx_t_15 > 0);
          __pyx_t_11 = __pyx_t_13;
          __pyx_L16_bool_binop_done:;
          if (__pyx_t_11) {
            if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_9genexpr37__pyx_v_p))) __PYX_ERR(0, 1352, __pyx_L12_error)
          }
        }
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_9genexpr37__pyx_v_p); __pyx_9genexpr37__pyx_v_p = 0;
        goto __pyx_L19_exit_scope;
        __pyx_L12_error:;
        __Pyx_XDECREF(__pyx_9genexpr37__pyx_v_p); __pyx_9genexpr37__pyx_v_p = 0;
        goto __pyx_L1_error;
        __pyx_L19_exit_scope:;
      } /* exit inner scope */
      __pyx_t_7 = PySet_New(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1352, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_valid_ref_edges = ((PyObject*)__pyx_t_7);
      __pyx_t_7 = 0;

      /* "ete4/core/tree.pyx":1353
 *                 if unrooted:
 *                     valid_ref_edges = set([p for p in (ref_p - ref_disc) if len(p[0])>1 and len(p[1])>0])
 *                     valid_src_edges = set([p for p in (src_p - src_disc) if len(p[0])>1 and len(p[1])>0])             # <<<<<<<<<<<<<<
 *                     common_edges = valid_ref_edges & valid_src_edges
 *                 else:
 */
      { /* enter inner scope */
        __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1353, __pyx_L22_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_4 = PyNumber_Subtract(__pyx_v_src_p, __pyx_v_src_disc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1353, __pyx_L22_error)
        __Pyx_GOTREF(__pyx_t_4);
        if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
          __pyx_t_8 = __pyx_t_4; __Pyx_INCREF(__pyx_t_8);
          __pyx_t_12 = 0;
          __pyx_t_14 = NULL;
        } else {
          __pyx_t_12 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1353, __pyx_L22_error)
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_14 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1353, __pyx_L22_error)
        }
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        for (;;) {
          if (likely(!__pyx_t_14)) {
            if (likely(PyList_CheckExact(__pyx_t_8))) {
              {
                Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_8);
                #if !CYTHON_ASSUME_SAFE_MACROS
                if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1353, __pyx_L22_error)
                #endif
                if (__pyx_t_12 >= __pyx_temp) break;
              }
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_4 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_12); __Pyx_INCREF(__pyx_t_4); __pyx_t_12++; if (unlikely((0 < 0))) __PYX_ERR(0, 1353, __pyx_L22_error)
              #else
              __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1353, __pyx_L22_error)
              __Pyx_GOTREF(__pyx_t_4);
              #endif
            } else {
              {
                Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_8);
                #if !CYTHON_ASSUME_SAFE_MACROS
                if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1353, __pyx_L22_error)
                #endif
                if (__pyx_t_12 >= __pyx_temp) break;
              }
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_12); __Pyx_INCREF(__pyx_t_4); __pyx_t_12++; if (unlikely((0 < 0))) __PYX_ERR(0, 1353, __pyx_L22_error)
              #else
              __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1353, __pyx_L22_error)
              __Pyx_GOTREF(__pyx_t_4);
              #endif
            }
          } else {
            __pyx_t_4 = __pyx_t_14(__pyx_t_8);
            if (unlikely(!__pyx_t_4)) {
              PyObject* exc_type = PyErr_Occurred();
              if (exc_type) {
                if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                else __PYX_ERR(0, 1353, __pyx_L22_error)
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_4);
          }
          __Pyx_XDECREF_SET(__pyx_9genexpr38__pyx_v_p, __pyx_t_4);
          __pyx_t_4 = 0;
          __pyx_t_4 = __Pyx_GetItemInt(__pyx_9genexpr38__pyx_v_p, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1353, __pyx_L22_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_15 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_15 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1353, __pyx_L22_error)
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_13 = (__pyx_t_15 > 1);
          if (__pyx_t_13) {
          } else {
            __pyx_t_11 = __pyx_t_13;
            goto __pyx_L26_bool_binop_done;
          }
          __pyx_t_4 = __Pyx_GetItemInt(__pyx_9genexpr38__pyx_v_p, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1353, __pyx_L22_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_15 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_15 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1353, __pyx_L22_error)
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_13 = (__pyx_t_15 > 0);
          __pyx_t_11 = __pyx_t_13;
          __pyx_L26_bool_binop_done:;
          if (__pyx_t_11) {
            if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_9genexpr38__pyx_v_p))) __PYX_ERR(0, 1353, __pyx_L22_error)
          }
        }
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF(__pyx_9genexpr38__pyx_v_p); __pyx_9genexpr38__pyx_v_p = 0;
        goto __pyx_L29_exit_scope;
        __pyx_L22_error:;
        __Pyx_XDECREF(__pyx_9genexpr38__pyx_v_p); __pyx_9genexpr38__pyx_v_p = 0;
        goto __pyx_L1_error;
        __pyx_L29_exit_scope:;
      } /* exit inner scope */
      __pyx_t_8 = PySet_New(__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1353, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_valid_src_edges = ((PyObject*)__pyx_t_8);
      __pyx_t_8 = 0;

      /* "ete4/core/tree.pyx":1354
 *                     valid_ref_edges = set([p for p in (ref_p - ref_disc) if len(p[0])>1 and len(p[1])>0])
 *                     valid_src_edges = set([p for p in (src_p - src_disc) if len(p[0])>1 and len(p[1])>0])
 *                     common_edges = valid_ref_edges & valid_src_edges             # <<<<<<<<<<<<<<
 *                 else:
 * 
 */
      __pyx_t_8 = PyNumber_And(__pyx_v_valid_ref_edges, __pyx_v_valid_src_edges); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1354, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_v_common_edges = ((PyObject*)__pyx_t_8);
      __pyx_t_8 = 0;

      /* "ete4/core/tree.pyx":1351
 *             # if trees share leaves, count their distances
 *             if len(common) > 0 and src_p and ref_p:
 *                 if unrooted:             # <<<<<<<<<<<<<<
 *                     valid_ref_edges = set([p for p in (ref_p - ref_disc) if len(p[0])>1 and len(p[1])>0])
 *                     valid_src_edges = set([p for p in (src_p - src_disc) if len(p[0])>1 and len(p[1])>0])
 */
      goto __pyx_L9;
    }

    /* "ete4/core/tree.pyx":1357
 *                 else:
 * 
 *                     valid_ref_edges = set([p for p in (ref_p - ref_disc) if len(p)>1])             # <<<<<<<<<<<<<<
 *                     valid_src_edges = set([p for p in (src_p - src_disc) if len(p)>1])
 *                     common_edges = valid_ref_edges & valid_src_edges
 */
    /*else*/ {
      { /* enter inner scope */
        __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1357, __pyx_L32_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_7 = PyNumber_Subtract(__pyx_v_ref_p, __pyx_v_ref_disc); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1357, __pyx_L32_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (likely(PyList_CheckExact(__pyx_t_7)) || PyTuple_CheckExact(__pyx_t_7)) {
          __pyx_t_4 = __pyx_t_7; __Pyx_INCREF(__pyx_t_4);
          __pyx_t_12 = 0;
          __pyx_t_14 = NULL;
        } else {
          __pyx_t_12 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1357, __pyx_L32_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_14 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1357, __pyx_L32_error)
        }
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        for (;;) {
          if (likely(!__pyx_t_14)) {
            if (likely(PyList_CheckExact(__pyx_t_4))) {
              {
                Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4);
                #if !CYTHON_ASSUME_SAFE_MACROS
                if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1357, __pyx_L32_error)
                #endif
                if (__pyx_t_12 >= __pyx_temp) break;
              }
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_12); __Pyx_INCREF(__pyx_t_7); __pyx_t_12++; if (unlikely((0 < 0))) __PYX_ERR(0, 1357, __pyx_L32_error)
              #else
              __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1357, __pyx_L32_error)
              __Pyx_GOTREF(__pyx_t_7);
              #endif
            } else {
              {
                Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4);
                #if !CYTHON_ASSUME_SAFE_MACROS
                if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1357, __pyx_L32_error)
                #endif
                if (__pyx_t_12 >= __pyx_temp) break;
              }
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_12); __Pyx_INCREF(__pyx_t_7); __pyx_t_12++; if (unlikely((0 < 0))) __PYX_ERR(0, 1357, __pyx_L32_error)
              #else
              __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1357, __pyx_L32_error)
              __Pyx_GOTREF(__pyx_t_7);
              #endif
            }
          } else {
            __pyx_t_7 = __pyx_t_14(__pyx_t_4);
            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, 1357, __pyx_L32_error)
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_7);
          }
          __Pyx_XDECREF_SET(__pyx_9genexpr39__pyx_v_p, __pyx_t_7);
          __pyx_t_7 = 0;
          __pyx_t_15 = PyObject_Length(__pyx_9genexpr39__pyx_v_p); if (unlikely(__pyx_t_15 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1357, __pyx_L32_error)
          __pyx_t_11 = (__pyx_t_15 > 1);
          if (__pyx_t_11) {
            if (unlikely(__Pyx_ListComp_Append(__pyx_t_8, (PyObject*)__pyx_9genexpr39__pyx_v_p))) __PYX_ERR(0, 1357, __pyx_L32_error)
          }
        }
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_9genexpr39__pyx_v_p); __pyx_9genexpr39__pyx_v_p = 0;
        goto __pyx_L37_exit_scope;
        __pyx_L32_error:;
        __Pyx_XDECREF(__pyx_9genexpr39__pyx_v_p); __pyx_9genexpr39__pyx_v_p = 0;
        goto __pyx_L1_error;
        __pyx_L37_exit_scope:;
      } /* exit inner scope */
      __pyx_t_4 = PySet_New(__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1357, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_v_valid_ref_edges = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ete4/core/tree.pyx":1358
 * 
 *                     valid_ref_edges = set([p for p in (ref_p - ref_disc) if len(p)>1])
 *                     valid_src_edges = set([p for p in (src_p - src_disc) if len(p)>1])             # <<<<<<<<<<<<<<
 *                     common_edges = valid_ref_edges & valid_src_edges
 * 
 */
      { /* enter inner scope */
        __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1358, __pyx_L40_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_8 = PyNumber_Subtract(__pyx_v_src_p, __pyx_v_src_disc); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1358, __pyx_L40_error)
        __Pyx_GOTREF(__pyx_t_8);
        if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) {
          __pyx_t_7 = __pyx_t_8; __Pyx_INCREF(__pyx_t_7);
          __pyx_t_12 = 0;
          __pyx_t_14 = NULL;
        } else {
          __pyx_t_12 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1358, __pyx_L40_error)
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_14 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1358, __pyx_L40_error)
        }
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        for (;;) {
          if (likely(!__pyx_t_14)) {
            if (likely(PyList_CheckExact(__pyx_t_7))) {
              {
                Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_7);
                #if !CYTHON_ASSUME_SAFE_MACROS
                if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1358, __pyx_L40_error)
                #endif
                if (__pyx_t_12 >= __pyx_temp) break;
              }
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_8 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_12); __Pyx_INCREF(__pyx_t_8); __pyx_t_12++; if (unlikely((0 < 0))) __PYX_ERR(0, 1358, __pyx_L40_error)
              #else
              __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1358, __pyx_L40_error)
              __Pyx_GOTREF(__pyx_t_8);
              #endif
            } else {
              {
                Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_7);
                #if !CYTHON_ASSUME_SAFE_MACROS
                if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1358, __pyx_L40_error)
                #endif
                if (__pyx_t_12 >= __pyx_temp) break;
              }
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_12); __Pyx_INCREF(__pyx_t_8); __pyx_t_12++; if (unlikely((0 < 0))) __PYX_ERR(0, 1358, __pyx_L40_error)
              #else
              __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1358, __pyx_L40_error)
              __Pyx_GOTREF(__pyx_t_8);
              #endif
            }
          } else {
            __pyx_t_8 = __pyx_t_14(__pyx_t_7);
            if (unlikely(!__pyx_t_8)) {
              PyObject* exc_type = PyErr_Occurred();
              if (exc_type) {
                if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                else __PYX_ERR(0, 1358, __pyx_L40_error)
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_8);
          }
          __Pyx_XDECREF_SET(__pyx_9genexpr40__pyx_v_p, __pyx_t_8);
          __pyx_t_8 = 0;
          __pyx_t_15 = PyObject_Length(__pyx_9genexpr40__pyx_v_p); if (unlikely(__pyx_t_15 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1358, __pyx_L40_error)
          __pyx_t_11 = (__pyx_t_15 > 1);
          if (__pyx_t_11) {
            if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_9genexpr40__pyx_v_p))) __PYX_ERR(0, 1358, __pyx_L40_error)
          }
        }
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_9genexpr40__pyx_v_p); __pyx_9genexpr40__pyx_v_p = 0;
        goto __pyx_L45_exit_scope;
        __pyx_L40_error:;
        __Pyx_XDECREF(__pyx_9genexpr40__pyx_v_p); __pyx_9genexpr40__pyx_v_p = 0;
        goto __pyx_L1_error;
        __pyx_L45_exit_scope:;
      } /* exit inner scope */
      __pyx_t_7 = PySet_New(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1358, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_valid_src_edges = ((PyObject*)__pyx_t_7);
      __pyx_t_7 = 0;

      /* "ete4/core/tree.pyx":1359
 *                     valid_ref_edges = set([p for p in (ref_p - ref_disc) if len(p)>1])
 *                     valid_src_edges = set([p for p in (src_p - src_disc) if len(p)>1])
 *                     common_edges = valid_ref_edges & valid_src_edges             # <<<<<<<<<<<<<<
 * 
 *             else:
 */
      __pyx_t_7 = PyNumber_And(__pyx_v_valid_ref_edges, __pyx_v_valid_src_edges); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1359, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_v_common_edges = ((PyObject*)__pyx_t_7);
      __pyx_t_7 = 0;
    }
    __pyx_L9:;

    /* "ete4/core/tree.pyx":1350
 * 
 *             # if trees share leaves, count their distances
 *             if len(common) > 0 and src_p and ref_p:             # <<<<<<<<<<<<<<
 *                 if unrooted:
 *                     valid_ref_edges = set([p for p in (ref_p - ref_disc) if len(p[0])>1 and len(p[1])>0])
 */
    goto __pyx_L5;
  }

  /* "ete4/core/tree.pyx":1362
 * 
 *             else:
 *                 valid_ref_edges = set()             # <<<<<<<<<<<<<<
 *                 valid_src_edges = set()
 *                 common_edges = set()
 */
  /*else*/ {
    __pyx_t_7 = PySet_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1362, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_v_valid_ref_edges = ((PyObject*)__pyx_t_7);
    __pyx_t_7 = 0;

    /* "ete4/core/tree.pyx":1363
 *             else:
 *                 valid_ref_edges = set()
 *                 valid_src_edges = set()             # <<<<<<<<<<<<<<
 *                 common_edges = set()
 * 
 */
    __pyx_t_7 = PySet_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1363, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_v_valid_src_edges = ((PyObject*)__pyx_t_7);
    __pyx_t_7 = 0;

    /* "ete4/core/tree.pyx":1364
 *                 valid_ref_edges = set()
 *                 valid_src_edges = set()
 *                 common_edges = set()             # <<<<<<<<<<<<<<
 * 
 *                 # # % of ref edges found in tree
 */
    __pyx_t_7 = PySet_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1364, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_v_common_edges = ((PyObject*)__pyx_t_7);
    __pyx_t_7 = 0;
  }
  __pyx_L5:;

  /* "ete4/core/tree.pyx":1375
 *                 #     target_found.append(1 - (incompatible_target_branches / (len(p2-d2))))
 * 
 *             return rf, maxrf, len(common), valid_ref_edges, valid_src_edges, common_edges             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_12 = PyObject_Length(__pyx_v_common); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1375, __pyx_L1_error)
  __pyx_t_7 = PyInt_FromSsize_t(__pyx_t_12); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1375, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_4 = PyTuple_New(6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1375, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_rf);
  __Pyx_GIVEREF(__pyx_v_rf);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_rf)) __PYX_ERR(0, 1375, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_maxrf);
  __Pyx_GIVEREF(__pyx_v_maxrf);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_maxrf)) __PYX_ERR(0, 1375, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_7)) __PYX_ERR(0, 1375, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_valid_ref_edges);
  __Pyx_GIVEREF(__pyx_v_valid_ref_edges);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_v_valid_ref_edges)) __PYX_ERR(0, 1375, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_valid_src_edges);
  __Pyx_GIVEREF(__pyx_v_valid_src_edges);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_v_valid_src_edges)) __PYX_ERR(0, 1375, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_common_edges);
  __Pyx_GIVEREF(__pyx_v_common_edges);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 5, __pyx_v_common_edges)) __PYX_ERR(0, 1375, __pyx_L1_error);
  __pyx_t_7 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "ete4/core/tree.pyx":1339
 *             else: return 0.0
 * 
 *         def _compare(src_tree, ref_tree):             # <<<<<<<<<<<<<<
 *             # calculate partitions and rf distances
 *             rf, maxrf, common, ref_p, src_p, ref_disc, src_disc  = ref_tree.robinson_foulds(src_tree,
 */

  /* 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_AddTraceback("ete4.core.tree.Tree.compare._compare", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_rf);
  __Pyx_XDECREF(__pyx_v_maxrf);
  __Pyx_XDECREF(__pyx_v_common);
  __Pyx_XDECREF(__pyx_v_ref_p);
  __Pyx_XDECREF(__pyx_v_src_p);
  __Pyx_XDECREF(__pyx_v_ref_disc);
  __Pyx_XDECREF(__pyx_v_src_disc);
  __Pyx_XDECREF(__pyx_v_valid_ref_edges);
  __Pyx_XDECREF(__pyx_v_valid_src_edges);
  __Pyx_XDECREF(__pyx_v_common_edges);
  __Pyx_XDECREF(__pyx_9genexpr37__pyx_v_p);
  __Pyx_XDECREF(__pyx_9genexpr38__pyx_v_p);
  __Pyx_XDECREF(__pyx_9genexpr39__pyx_v_p);
  __Pyx_XDECREF(__pyx_9genexpr40__pyx_v_p);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ete4/core/tree.pyx":1321
 *         return min_comparison
 * 
 *     def compare(self, ref_tree, use_collateral=False, min_support_source=0.0, min_support_ref=0.0,             # <<<<<<<<<<<<<<
 *                 has_duplications=False, expand_polytomies=False, unrooted=False,
 *                 max_treeko_splits_to_be_artifact=1000, ref_tree_attr='name', source_tree_attr='name'):
 */

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_135compare(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_ref_tree, CYTHON_UNUSED PyObject *__pyx_v_use_collateral, PyObject *__pyx_v_min_support_source, PyObject *__pyx_v_min_support_ref, PyObject *__pyx_v_has_duplications, PyObject *__pyx_v_expand_polytomies, PyObject *__pyx_v_unrooted, PyObject *__pyx_v_max_treeko_splits_to_be_artifact, PyObject *__pyx_v_ref_tree_attr, PyObject *__pyx_v_source_tree_attr) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_38_compare *__pyx_cur_scope;
  struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_source_tree = NULL;
  PyObject *__pyx_v__safe_div = 0;
  PyObject *__pyx_v__compare = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_v_total_valid_ref_edges;
  PyObject *__pyx_v_result = NULL;
  CYTHON_UNUSED Py_ssize_t __pyx_v_orig_target_size;
  PyObject *__pyx_v_ntrees = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_ndups = NULL;
  PyObject *__pyx_v_sp_trees = NULL;
  PyObject *__pyx_v_all_rf = NULL;
  PyObject *__pyx_v_ref_found = NULL;
  PyObject *__pyx_v_src_found = NULL;
  PyObject *__pyx_v_tree_sizes = NULL;
  PyObject *__pyx_v_all_max_rf = NULL;
  CYTHON_UNUSED long __pyx_v_common_names;
  PyObject *__pyx_v_subtree_nw = NULL;
  PyObject *__pyx_v_subtree = NULL;
  PyObject *__pyx_v_subtree_content = NULL;
  PyObject *__pyx_v_n = NULL;
  PyObject *__pyx_v_total_rf = NULL;
  PyObject *__pyx_v_max_rf = NULL;
  PyObject *__pyx_v_ncommon = NULL;
  PyObject *__pyx_v_valid_ref_edges = NULL;
  PyObject *__pyx_v_valid_src_edges = NULL;
  PyObject *__pyx_v_common_edges = NULL;
  PyObject *__pyx_v_ref_found_in_src = NULL;
  PyObject *__pyx_v_src_found_in_ref = NULL;
  PyObject *__pyx_v_alld = NULL;
  PyObject *__pyx_v_a = NULL;
  double __pyx_v_b;
  PyObject *__pyx_v_treeko_d = NULL;
  PyObject *__pyx_9genexpr41__pyx_v_n = NULL;
  Py_ssize_t __pyx_9genexpr42__pyx_v_i;
  Py_ssize_t __pyx_9genexpr43__pyx_v_i;
  Py_ssize_t __pyx_9genexpr44__pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  unsigned int __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  int __pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *(*__pyx_t_11)(PyObject *);
  Py_ssize_t __pyx_t_12;
  PyObject *(*__pyx_t_13)(PyObject *);
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  int __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  double __pyx_t_20;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("compare", 0);
  __pyx_cur_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_38_compare *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_38_compare(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_38_compare, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_38_compare *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1321, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_min_support_source = __pyx_v_min_support_source;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_min_support_source);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_min_support_source);
  __pyx_cur_scope->__pyx_v_min_support_ref = __pyx_v_min_support_ref;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_min_support_ref);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_min_support_ref);
  __pyx_cur_scope->__pyx_v_expand_polytomies = __pyx_v_expand_polytomies;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_expand_polytomies);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_expand_polytomies);
  __pyx_cur_scope->__pyx_v_unrooted = __pyx_v_unrooted;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_unrooted);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_unrooted);
  __pyx_cur_scope->__pyx_v_ref_tree_attr = __pyx_v_ref_tree_attr;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_ref_tree_attr);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_ref_tree_attr);
  __pyx_cur_scope->__pyx_v_source_tree_attr = __pyx_v_source_tree_attr;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_source_tree_attr);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_source_tree_attr);

  /* "ete4/core/tree.pyx":1332
 * 
 *         """
 *         source_tree = self             # <<<<<<<<<<<<<<
 * 
 *         def _safe_div(a, b):
 */
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_v_source_tree = __pyx_v_self;

  /* "ete4/core/tree.pyx":1334
 *         source_tree = self
 * 
 *         def _safe_div(a, b):             # <<<<<<<<<<<<<<
 *             if a != 0:
 *                 return a / float(b)
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_7compare_1_safe_div, 0, __pyx_n_s_compare_locals__safe_div, NULL, __pyx_n_s_ete4_core_tree, __pyx_d, ((PyObject *)__pyx_codeobj__32)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1334, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v__safe_div = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "ete4/core/tree.pyx":1339
 *             else: return 0.0
 * 
 *         def _compare(src_tree, ref_tree):             # <<<<<<<<<<<<<<
 *             # calculate partitions and rf distances
 *             rf, maxrf, common, ref_p, src_p, ref_disc, src_disc  = ref_tree.robinson_foulds(src_tree,
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_7compare_3_compare, 0, __pyx_n_s_compare_locals__compare, ((PyObject*)__pyx_cur_scope), __pyx_n_s_ete4_core_tree, __pyx_d, ((PyObject *)__pyx_codeobj__34)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1339, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v__compare = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "ete4/core/tree.pyx":1378
 * 
 * 
 *         total_valid_ref_edges = len([n for n in ref_tree.traverse()             # <<<<<<<<<<<<<<
 *                                      if n.children and n.support is not None and n.support > min_support_ref])
 *         result = {}
 */
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1378, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_ref_tree, __pyx_n_s_traverse); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1378, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1378, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
      __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3);
      __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1378, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1378, __pyx_L5_error)
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    for (;;) {
      if (likely(!__pyx_t_7)) {
        if (likely(PyList_CheckExact(__pyx_t_3))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1378, __pyx_L5_error)
            #endif
            if (__pyx_t_6 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 1378, __pyx_L5_error)
          #else
          __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1378, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1378, __pyx_L5_error)
            #endif
            if (__pyx_t_6 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 1378, __pyx_L5_error)
          #else
          __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1378, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        }
      } else {
        __pyx_t_2 = __pyx_t_7(__pyx_t_3);
        if (unlikely(!__pyx_t_2)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 1378, __pyx_L5_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_XDECREF_SET(__pyx_9genexpr41__pyx_v_n, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "ete4/core/tree.pyx":1379
 * 
 *         total_valid_ref_edges = len([n for n in ref_tree.traverse()
 *                                      if n.children and n.support is not None and n.support > min_support_ref])             # <<<<<<<<<<<<<<
 *         result = {}
 *         if has_duplications:
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr41__pyx_v_n, __pyx_n_s_children); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1379, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 1379, __pyx_L5_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (__pyx_t_9) {
      } else {
        __pyx_t_8 = __pyx_t_9;
        goto __pyx_L9_bool_binop_done;
      }
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr41__pyx_v_n, __pyx_n_s_support); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1379, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_9 = (__pyx_t_2 != Py_None);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (__pyx_t_9) {
      } else {
        __pyx_t_8 = __pyx_t_9;
        goto __pyx_L9_bool_binop_done;
      }
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr41__pyx_v_n, __pyx_n_s_support); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1379, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_cur_scope->__pyx_v_min_support_ref, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1379, __pyx_L5_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 1379, __pyx_L5_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_8 = __pyx_t_9;
      __pyx_L9_bool_binop_done:;
      if (__pyx_t_8) {

        /* "ete4/core/tree.pyx":1378
 * 
 * 
 *         total_valid_ref_edges = len([n for n in ref_tree.traverse()             # <<<<<<<<<<<<<<
 *                                      if n.children and n.support is not None and n.support > min_support_ref])
 *         result = {}
 */
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_9genexpr41__pyx_v_n))) __PYX_ERR(0, 1378, __pyx_L5_error)

        /* "ete4/core/tree.pyx":1379
 * 
 *         total_valid_ref_edges = len([n for n in ref_tree.traverse()
 *                                      if n.children and n.support is not None and n.support > min_support_ref])             # <<<<<<<<<<<<<<
 *         result = {}
 *         if has_duplications:
 */
      }

      /* "ete4/core/tree.pyx":1378
 * 
 * 
 *         total_valid_ref_edges = len([n for n in ref_tree.traverse()             # <<<<<<<<<<<<<<
 *                                      if n.children and n.support is not None and n.support > min_support_ref])
 *         result = {}
 */
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_9genexpr41__pyx_v_n); __pyx_9genexpr41__pyx_v_n = 0;
    goto __pyx_L13_exit_scope;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_9genexpr41__pyx_v_n); __pyx_9genexpr41__pyx_v_n = 0;
    goto __pyx_L1_error;
    __pyx_L13_exit_scope:;
  } /* exit inner scope */
  __pyx_t_6 = __Pyx_PyList_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1378, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_total_valid_ref_edges = __pyx_t_6;

  /* "ete4/core/tree.pyx":1380
 *         total_valid_ref_edges = len([n for n in ref_tree.traverse()
 *                                      if n.children and n.support is not None and n.support > min_support_ref])
 *         result = {}             # <<<<<<<<<<<<<<
 *         if has_duplications:
 *             orig_target_size = len(source_tree)
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1380, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "ete4/core/tree.pyx":1381
 *                                      if n.children and n.support is not None and n.support > min_support_ref])
 *         result = {}
 *         if has_duplications:             # <<<<<<<<<<<<<<
 *             orig_target_size = len(source_tree)
 *             ntrees, ndups, sp_trees = source_tree.get_speciation_trees(
 */
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_has_duplications); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1381, __pyx_L1_error)
  if (__pyx_t_8) {

    /* "ete4/core/tree.pyx":1382
 *         result = {}
 *         if has_duplications:
 *             orig_target_size = len(source_tree)             # <<<<<<<<<<<<<<
 *             ntrees, ndups, sp_trees = source_tree.get_speciation_trees(
 *                 autodetect_duplications=True, newick_only=True,
 */
    __pyx_t_6 = PyObject_Length(((PyObject *)__pyx_v_source_tree)); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1382, __pyx_L1_error)
    __pyx_v_orig_target_size = __pyx_t_6;

    /* "ete4/core/tree.pyx":1383
 *         if has_duplications:
 *             orig_target_size = len(source_tree)
 *             ntrees, ndups, sp_trees = source_tree.get_speciation_trees(             # <<<<<<<<<<<<<<
 *                 autodetect_duplications=True, newick_only=True,
 *                 prop=source_tree_attr, map_properties=[source_tree_attr, "support"])
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_source_tree), __pyx_n_s_get_speciation_trees); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1383, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "ete4/core/tree.pyx":1384
 *             orig_target_size = len(source_tree)
 *             ntrees, ndups, sp_trees = source_tree.get_speciation_trees(
 *                 autodetect_duplications=True, newick_only=True,             # <<<<<<<<<<<<<<
 *                 prop=source_tree_attr, map_properties=[source_tree_attr, "support"])
 * 
 */
    __pyx_t_3 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1384, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_autodetect_duplications, Py_True) < 0) __PYX_ERR(0, 1384, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_newick_only, Py_True) < 0) __PYX_ERR(0, 1384, __pyx_L1_error)

    /* "ete4/core/tree.pyx":1385
 *             ntrees, ndups, sp_trees = source_tree.get_speciation_trees(
 *                 autodetect_duplications=True, newick_only=True,
 *                 prop=source_tree_attr, map_properties=[source_tree_attr, "support"])             # <<<<<<<<<<<<<<
 * 
 *             if ntrees < max_treeko_splits_to_be_artifact:
 */
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_prop, __pyx_cur_scope->__pyx_v_source_tree_attr) < 0) __PYX_ERR(0, 1384, __pyx_L1_error)
    __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1385, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_source_tree_attr);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_source_tree_attr);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_cur_scope->__pyx_v_source_tree_attr)) __PYX_ERR(0, 1385, __pyx_L1_error);
    __Pyx_INCREF(__pyx_n_u_support);
    __Pyx_GIVEREF(__pyx_n_u_support);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_n_u_support)) __PYX_ERR(0, 1385, __pyx_L1_error);
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_map_properties, __pyx_t_4) < 0) __PYX_ERR(0, 1384, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ete4/core/tree.pyx":1383
 *         if has_duplications:
 *             orig_target_size = len(source_tree)
 *             ntrees, ndups, sp_trees = source_tree.get_speciation_trees(             # <<<<<<<<<<<<<<
 *                 autodetect_duplications=True, newick_only=True,
 *                 prop=source_tree_attr, map_properties=[source_tree_attr, "support"])
 */
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1383, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    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 != 3)) {
        if (size > 3) __Pyx_RaiseTooManyValuesError(3);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 1383, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
        __pyx_t_2 = PyTuple_GET_ITEM(sequence, 2); 
      } else {
        __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_1 = PyList_GET_ITEM(sequence, 1); 
        __pyx_t_2 = PyList_GET_ITEM(sequence, 2); 
      }
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_2);
      #else
      __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1383, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1383, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1383, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      #endif
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_10 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1383, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_10);
      index = 0; __pyx_t_3 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_3)) goto __pyx_L15_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_3);
      index = 1; __pyx_t_1 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_1)) goto __pyx_L15_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_1);
      index = 2; __pyx_t_2 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_2)) goto __pyx_L15_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_2);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 3) < 0) __PYX_ERR(0, 1383, __pyx_L1_error)
      __pyx_t_11 = NULL;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L16_unpacking_done;
      __pyx_L15_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_11 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 1383, __pyx_L1_error)
      __pyx_L16_unpacking_done:;
    }
    __pyx_v_ntrees = __pyx_t_3;
    __pyx_t_3 = 0;
    __pyx_v_ndups = __pyx_t_1;
    __pyx_t_1 = 0;
    __pyx_v_sp_trees = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "ete4/core/tree.pyx":1387
 *                 prop=source_tree_attr, map_properties=[source_tree_attr, "support"])
 * 
 *             if ntrees < max_treeko_splits_to_be_artifact:             # <<<<<<<<<<<<<<
 *                 all_rf = []
 *                 ref_found = []
 */
    __pyx_t_4 = PyObject_RichCompare(__pyx_v_ntrees, __pyx_v_max_treeko_splits_to_be_artifact, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1387, __pyx_L1_error)
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1387, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_8) {

      /* "ete4/core/tree.pyx":1388
 * 
 *             if ntrees < max_treeko_splits_to_be_artifact:
 *                 all_rf = []             # <<<<<<<<<<<<<<
 *                 ref_found = []
 *                 src_found = []
 */
      __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1388, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_v_all_rf = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ete4/core/tree.pyx":1389
 *             if ntrees < max_treeko_splits_to_be_artifact:
 *                 all_rf = []
 *                 ref_found = []             # <<<<<<<<<<<<<<
 *                 src_found = []
 *                 tree_sizes = []
 */
      __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1389, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_v_ref_found = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ete4/core/tree.pyx":1390
 *                 all_rf = []
 *                 ref_found = []
 *                 src_found = []             # <<<<<<<<<<<<<<
 *                 tree_sizes = []
 *                 all_max_rf = []
 */
      __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1390, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_v_src_found = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ete4/core/tree.pyx":1391
 *                 ref_found = []
 *                 src_found = []
 *                 tree_sizes = []             # <<<<<<<<<<<<<<
 *                 all_max_rf = []
 *                 common_names = 0
 */
      __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1391, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_v_tree_sizes = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ete4/core/tree.pyx":1392
 *                 src_found = []
 *                 tree_sizes = []
 *                 all_max_rf = []             # <<<<<<<<<<<<<<
 *                 common_names = 0
 * 
 */
      __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1392, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_v_all_max_rf = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ete4/core/tree.pyx":1393
 *                 tree_sizes = []
 *                 all_max_rf = []
 *                 common_names = 0             # <<<<<<<<<<<<<<
 * 
 *                 for subtree_nw in sp_trees:
 */
      __pyx_v_common_names = 0;

      /* "ete4/core/tree.pyx":1395
 *                 common_names = 0
 * 
 *                 for subtree_nw in sp_trees:             # <<<<<<<<<<<<<<
 * 
 *                     #if seedid and not use_collateral and (seedid not in subtree_nw):
 */
      if (likely(PyList_CheckExact(__pyx_v_sp_trees)) || PyTuple_CheckExact(__pyx_v_sp_trees)) {
        __pyx_t_4 = __pyx_v_sp_trees; __Pyx_INCREF(__pyx_t_4);
        __pyx_t_6 = 0;
        __pyx_t_7 = NULL;
      } else {
        __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_sp_trees); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1395, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1395, __pyx_L1_error)
      }
      for (;;) {
        if (likely(!__pyx_t_7)) {
          if (likely(PyList_CheckExact(__pyx_t_4))) {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4);
              #if !CYTHON_ASSUME_SAFE_MACROS
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1395, __pyx_L1_error)
              #endif
              if (__pyx_t_6 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 1395, __pyx_L1_error)
            #else
            __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1395, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            #endif
          } else {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4);
              #if !CYTHON_ASSUME_SAFE_MACROS
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1395, __pyx_L1_error)
              #endif
              if (__pyx_t_6 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 1395, __pyx_L1_error)
            #else
            __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1395, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            #endif
          }
        } else {
          __pyx_t_2 = __pyx_t_7(__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, 1395, __pyx_L1_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_2);
        }
        __Pyx_XDECREF_SET(__pyx_v_subtree_nw, __pyx_t_2);
        __pyx_t_2 = 0;

        /* "ete4/core/tree.pyx":1399
 *                     #if seedid and not use_collateral and (seedid not in subtree_nw):
 *                     #    continue
 *                     subtree = source_tree.__class__(subtree_nw,             # <<<<<<<<<<<<<<
 *                             sp_naming_function = source_tree.props.get('_speciesFunction'))
 *                     if not subtree.children:
 */
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_source_tree), __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1399, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1399, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_INCREF(__pyx_v_subtree_nw);
        __Pyx_GIVEREF(__pyx_v_subtree_nw);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_subtree_nw)) __PYX_ERR(0, 1399, __pyx_L1_error);

        /* "ete4/core/tree.pyx":1400
 *                     #    continue
 *                     subtree = source_tree.__class__(subtree_nw,
 *                             sp_naming_function = source_tree.props.get('_speciesFunction'))             # <<<<<<<<<<<<<<
 *                     if not subtree.children:
 *                         continue
 */
        __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1400, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        if (unlikely(__pyx_v_source_tree->props == Py_None)) {
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
          __PYX_ERR(0, 1400, __pyx_L1_error)
        }
        __pyx_t_10 = __Pyx_PyDict_GetItemDefault(__pyx_v_source_tree->props, __pyx_n_u_speciesFunction, Py_None); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1400, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_sp_naming_function, __pyx_t_10) < 0) __PYX_ERR(0, 1400, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

        /* "ete4/core/tree.pyx":1399
 *                     #if seedid and not use_collateral and (seedid not in subtree_nw):
 *                     #    continue
 *                     subtree = source_tree.__class__(subtree_nw,             # <<<<<<<<<<<<<<
 *                             sp_naming_function = source_tree.props.get('_speciesFunction'))
 *                     if not subtree.children:
 */
        __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1399, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF_SET(__pyx_v_subtree, __pyx_t_10);
        __pyx_t_10 = 0;

        /* "ete4/core/tree.pyx":1401
 *                     subtree = source_tree.__class__(subtree_nw,
 *                             sp_naming_function = source_tree.props.get('_speciesFunction'))
 *                     if not subtree.children:             # <<<<<<<<<<<<<<
 *                         continue
 * 
 */
        __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_subtree, __pyx_n_s_children); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1401, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1401, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_9 = (!__pyx_t_8);
        if (__pyx_t_9) {

          /* "ete4/core/tree.pyx":1402
 *                             sp_naming_function = source_tree.props.get('_speciesFunction'))
 *                     if not subtree.children:
 *                         continue             # <<<<<<<<<<<<<<
 * 
 *                     # only necessary if rf function is going to filter by support
 */
          goto __pyx_L18_continue;

          /* "ete4/core/tree.pyx":1401
 *                     subtree = source_tree.__class__(subtree_nw,
 *                             sp_naming_function = source_tree.props.get('_speciesFunction'))
 *                     if not subtree.children:             # <<<<<<<<<<<<<<
 *                         continue
 * 
 */
        }

        /* "ete4/core/tree.pyx":1408
 *                     # find the support for each node in the treeko tree from the
 *                     # original one.
 *                     if min_support_source > 0:             # <<<<<<<<<<<<<<
 *                         subtree_content = subtree.get_cached_content('name')
 *                         for n in subtree.traverse():
 */
        __pyx_t_10 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_min_support_source, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1408, __pyx_L1_error)
        __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 1408, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (__pyx_t_9) {

          /* "ete4/core/tree.pyx":1409
 *                     # original one.
 *                     if min_support_source > 0:
 *                         subtree_content = subtree.get_cached_content('name')             # <<<<<<<<<<<<<<
 *                         for n in subtree.traverse():
 *                             if n.children:
 */
          __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_subtree, __pyx_n_s_get_cached_content); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1409, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_1 = NULL;
          __pyx_t_5 = 0;
          #if CYTHON_UNPACK_METHODS
          if (likely(PyMethod_Check(__pyx_t_3))) {
            __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
            if (likely(__pyx_t_1)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
              __Pyx_INCREF(__pyx_t_1);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_3, function);
              __pyx_t_5 = 1;
            }
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_n_u_name};
            __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
            if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1409, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_10);
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          }
          __Pyx_XDECREF_SET(__pyx_v_subtree_content, __pyx_t_10);
          __pyx_t_10 = 0;

          /* "ete4/core/tree.pyx":1410
 *                     if min_support_source > 0:
 *                         subtree_content = subtree.get_cached_content('name')
 *                         for n in subtree.traverse():             # <<<<<<<<<<<<<<
 *                             if n.children:
 *                                 n.support = source_tree.common_ancestor(subtree_content[n]).support
 */
          __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_subtree, __pyx_n_s_traverse); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1410, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_1 = NULL;
          __pyx_t_5 = 0;
          #if CYTHON_UNPACK_METHODS
          if (likely(PyMethod_Check(__pyx_t_3))) {
            __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
            if (likely(__pyx_t_1)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
              __Pyx_INCREF(__pyx_t_1);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_3, function);
              __pyx_t_5 = 1;
            }
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
            __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
            if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1410, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_10);
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          }
          if (likely(PyList_CheckExact(__pyx_t_10)) || PyTuple_CheckExact(__pyx_t_10)) {
            __pyx_t_3 = __pyx_t_10; __Pyx_INCREF(__pyx_t_3);
            __pyx_t_12 = 0;
            __pyx_t_13 = NULL;
          } else {
            __pyx_t_12 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1410, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_13 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1410, __pyx_L1_error)
          }
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          for (;;) {
            if (likely(!__pyx_t_13)) {
              if (likely(PyList_CheckExact(__pyx_t_3))) {
                {
                  Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
                  #if !CYTHON_ASSUME_SAFE_MACROS
                  if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1410, __pyx_L1_error)
                  #endif
                  if (__pyx_t_12 >= __pyx_temp) break;
                }
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                __pyx_t_10 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_12); __Pyx_INCREF(__pyx_t_10); __pyx_t_12++; if (unlikely((0 < 0))) __PYX_ERR(0, 1410, __pyx_L1_error)
                #else
                __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1410, __pyx_L1_error)
                __Pyx_GOTREF(__pyx_t_10);
                #endif
              } else {
                {
                  Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
                  #if !CYTHON_ASSUME_SAFE_MACROS
                  if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1410, __pyx_L1_error)
                  #endif
                  if (__pyx_t_12 >= __pyx_temp) break;
                }
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_12); __Pyx_INCREF(__pyx_t_10); __pyx_t_12++; if (unlikely((0 < 0))) __PYX_ERR(0, 1410, __pyx_L1_error)
                #else
                __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1410, __pyx_L1_error)
                __Pyx_GOTREF(__pyx_t_10);
                #endif
              }
            } else {
              __pyx_t_10 = __pyx_t_13(__pyx_t_3);
              if (unlikely(!__pyx_t_10)) {
                PyObject* exc_type = PyErr_Occurred();
                if (exc_type) {
                  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                  else __PYX_ERR(0, 1410, __pyx_L1_error)
                }
                break;
              }
              __Pyx_GOTREF(__pyx_t_10);
            }
            __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_10);
            __pyx_t_10 = 0;

            /* "ete4/core/tree.pyx":1411
 *                         subtree_content = subtree.get_cached_content('name')
 *                         for n in subtree.traverse():
 *                             if n.children:             # <<<<<<<<<<<<<<
 *                                 n.support = source_tree.common_ancestor(subtree_content[n]).support
 *                                 # TODO: This function is almost surely broken. It relies on
 */
            __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_n, __pyx_n_s_children); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1411, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_10);
            __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 1411, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            if (__pyx_t_9) {

              /* "ete4/core/tree.pyx":1412
 *                         for n in subtree.traverse():
 *                             if n.children:
 *                                 n.support = source_tree.common_ancestor(subtree_content[n]).support             # <<<<<<<<<<<<<<
 *                                 # TODO: This function is almost surely broken. It relies on
 *                                 # an old behavior of get_common_ancestor().
 */
              __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_source_tree), __pyx_n_s_common_ancestor); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1412, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_1);
              __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_subtree_content, __pyx_v_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1412, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_2);
              __pyx_t_14 = NULL;
              __pyx_t_5 = 0;
              #if CYTHON_UNPACK_METHODS
              if (likely(PyMethod_Check(__pyx_t_1))) {
                __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_1);
                if (likely(__pyx_t_14)) {
                  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
                  __Pyx_INCREF(__pyx_t_14);
                  __Pyx_INCREF(function);
                  __Pyx_DECREF_SET(__pyx_t_1, function);
                  __pyx_t_5 = 1;
                }
              }
              #endif
              {
                PyObject *__pyx_callargs[2] = {__pyx_t_14, __pyx_t_2};
                __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
                __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
                __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1412, __pyx_L1_error)
                __Pyx_GOTREF(__pyx_t_10);
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              }
              __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_support); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1412, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_1);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
              if (__Pyx_PyObject_SetAttrStr(__pyx_v_n, __pyx_n_s_support, __pyx_t_1) < 0) __PYX_ERR(0, 1412, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

              /* "ete4/core/tree.pyx":1411
 *                         subtree_content = subtree.get_cached_content('name')
 *                         for n in subtree.traverse():
 *                             if n.children:             # <<<<<<<<<<<<<<
 *                                 n.support = source_tree.common_ancestor(subtree_content[n]).support
 *                                 # TODO: This function is almost surely broken. It relies on
 */
            }

            /* "ete4/core/tree.pyx":1410
 *                     if min_support_source > 0:
 *                         subtree_content = subtree.get_cached_content('name')
 *                         for n in subtree.traverse():             # <<<<<<<<<<<<<<
 *                             if n.children:
 *                                 n.support = source_tree.common_ancestor(subtree_content[n]).support
 */
          }
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

          /* "ete4/core/tree.pyx":1408
 *                     # find the support for each node in the treeko tree from the
 *                     # original one.
 *                     if min_support_source > 0:             # <<<<<<<<<<<<<<
 *                         subtree_content = subtree.get_cached_content('name')
 *                         for n in subtree.traverse():
 */
        }

        /* "ete4/core/tree.pyx":1416
 *                                 # an old behavior of get_common_ancestor().
 * 
 *                     total_rf, max_rf, ncommon, valid_ref_edges, valid_src_edges, common_edges = _compare(subtree, ref_tree)             # <<<<<<<<<<<<<<
 * 
 *                     all_rf.append(total_rf)
 */
        __pyx_t_3 = __pyx_pf_4ete4_4core_4tree_4Tree_7compare_2_compare(__pyx_v__compare, __pyx_v_subtree, __pyx_v_ref_tree); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1416, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
          PyObject* sequence = __pyx_t_3;
          Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
          if (unlikely(size != 6)) {
            if (size > 6) __Pyx_RaiseTooManyValuesError(6);
            else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
            __PYX_ERR(0, 1416, __pyx_L1_error)
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          if (likely(PyTuple_CheckExact(sequence))) {
            __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
            __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1); 
            __pyx_t_2 = PyTuple_GET_ITEM(sequence, 2); 
            __pyx_t_14 = PyTuple_GET_ITEM(sequence, 3); 
            __pyx_t_15 = PyTuple_GET_ITEM(sequence, 4); 
            __pyx_t_16 = PyTuple_GET_ITEM(sequence, 5); 
          } else {
            __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
            __pyx_t_10 = PyList_GET_ITEM(sequence, 1); 
            __pyx_t_2 = PyList_GET_ITEM(sequence, 2); 
            __pyx_t_14 = PyList_GET_ITEM(sequence, 3); 
            __pyx_t_15 = PyList_GET_ITEM(sequence, 4); 
            __pyx_t_16 = PyList_GET_ITEM(sequence, 5); 
          }
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_14);
          __Pyx_INCREF(__pyx_t_15);
          __Pyx_INCREF(__pyx_t_16);
          #else
          {
            Py_ssize_t i;
            PyObject** temps[6] = {&__pyx_t_1,&__pyx_t_10,&__pyx_t_2,&__pyx_t_14,&__pyx_t_15,&__pyx_t_16};
            for (i=0; i < 6; i++) {
              PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 1416, __pyx_L1_error)
              __Pyx_GOTREF(item);
              *(temps[i]) = item;
            }
          }
          #endif
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else {
          Py_ssize_t index = -1;
          PyObject** temps[6] = {&__pyx_t_1,&__pyx_t_10,&__pyx_t_2,&__pyx_t_14,&__pyx_t_15,&__pyx_t_16};
          __pyx_t_17 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1416, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_17);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_17);
          for (index=0; index < 6; index++) {
            PyObject* item = __pyx_t_11(__pyx_t_17); if (unlikely(!item)) goto __pyx_L26_unpacking_failed;
            __Pyx_GOTREF(item);
            *(temps[index]) = item;
          }
          if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_17), 6) < 0) __PYX_ERR(0, 1416, __pyx_L1_error)
          __pyx_t_11 = NULL;
          __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
          goto __pyx_L27_unpacking_done;
          __pyx_L26_unpacking_failed:;
          __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
          __pyx_t_11 = NULL;
          if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
          __PYX_ERR(0, 1416, __pyx_L1_error)
          __pyx_L27_unpacking_done:;
        }
        __Pyx_XDECREF_SET(__pyx_v_total_rf, __pyx_t_1);
        __pyx_t_1 = 0;
        __Pyx_XDECREF_SET(__pyx_v_max_rf, __pyx_t_10);
        __pyx_t_10 = 0;
        __Pyx_XDECREF_SET(__pyx_v_ncommon, __pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_XDECREF_SET(__pyx_v_valid_ref_edges, __pyx_t_14);
        __pyx_t_14 = 0;
        __Pyx_XDECREF_SET(__pyx_v_valid_src_edges, __pyx_t_15);
        __pyx_t_15 = 0;
        __Pyx_XDECREF_SET(__pyx_v_common_edges, __pyx_t_16);
        __pyx_t_16 = 0;

        /* "ete4/core/tree.pyx":1418
 *                     total_rf, max_rf, ncommon, valid_ref_edges, valid_src_edges, common_edges = _compare(subtree, ref_tree)
 * 
 *                     all_rf.append(total_rf)             # <<<<<<<<<<<<<<
 *                     all_max_rf.append(max_rf)
 *                     tree_sizes.append(ncommon)
 */
        __pyx_t_18 = __Pyx_PyList_Append(__pyx_v_all_rf, __pyx_v_total_rf); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 1418, __pyx_L1_error)

        /* "ete4/core/tree.pyx":1419
 * 
 *                     all_rf.append(total_rf)
 *                     all_max_rf.append(max_rf)             # <<<<<<<<<<<<<<
 *                     tree_sizes.append(ncommon)
 * 
 */
        __pyx_t_18 = __Pyx_PyList_Append(__pyx_v_all_max_rf, __pyx_v_max_rf); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 1419, __pyx_L1_error)

        /* "ete4/core/tree.pyx":1420
 *                     all_rf.append(total_rf)
 *                     all_max_rf.append(max_rf)
 *                     tree_sizes.append(ncommon)             # <<<<<<<<<<<<<<
 * 
 *                     if unrooted:
 */
        __pyx_t_18 = __Pyx_PyList_Append(__pyx_v_tree_sizes, __pyx_v_ncommon); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 1420, __pyx_L1_error)

        /* "ete4/core/tree.pyx":1422
 *                     tree_sizes.append(ncommon)
 * 
 *                     if unrooted:             # <<<<<<<<<<<<<<
 *                         ref_found_in_src = len(common_edges)/float(len(valid_ref_edges)) if valid_ref_edges else None
 *                         src_found_in_ref = len(common_edges)/float(len(valid_src_edges)) if valid_src_edges else None
 */
        __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_unrooted); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 1422, __pyx_L1_error)
        if (__pyx_t_9) {

          /* "ete4/core/tree.pyx":1423
 * 
 *                     if unrooted:
 *                         ref_found_in_src = len(common_edges)/float(len(valid_ref_edges)) if valid_ref_edges else None             # <<<<<<<<<<<<<<
 *                         src_found_in_ref = len(common_edges)/float(len(valid_src_edges)) if valid_src_edges else None
 *                     else:
 */
          __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_valid_ref_edges); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 1423, __pyx_L1_error)
          if (__pyx_t_9) {
            __pyx_t_12 = PyObject_Length(__pyx_v_common_edges); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1423, __pyx_L1_error)
            __pyx_t_19 = PyObject_Length(__pyx_v_valid_ref_edges); if (unlikely(__pyx_t_19 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1423, __pyx_L1_error)
            if (unlikely(((double)__pyx_t_19) == 0)) {
              PyErr_SetString(PyExc_ZeroDivisionError, "float division");
              __PYX_ERR(0, 1423, __pyx_L1_error)
            }
            __pyx_t_16 = PyFloat_FromDouble((((double)__pyx_t_12) / ((double)__pyx_t_19))); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1423, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_16);
            __pyx_t_3 = __pyx_t_16;
            __pyx_t_16 = 0;
          } else {
            __Pyx_INCREF(Py_None);
            __pyx_t_3 = Py_None;
          }
          __Pyx_XDECREF_SET(__pyx_v_ref_found_in_src, __pyx_t_3);
          __pyx_t_3 = 0;

          /* "ete4/core/tree.pyx":1424
 *                     if unrooted:
 *                         ref_found_in_src = len(common_edges)/float(len(valid_ref_edges)) if valid_ref_edges else None
 *                         src_found_in_ref = len(common_edges)/float(len(valid_src_edges)) if valid_src_edges else None             # <<<<<<<<<<<<<<
 *                     else:
 *                         # in rooted trees, we want to discount the root edge
 */
          __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_valid_src_edges); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 1424, __pyx_L1_error)
          if (__pyx_t_9) {
            __pyx_t_19 = PyObject_Length(__pyx_v_common_edges); if (unlikely(__pyx_t_19 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1424, __pyx_L1_error)
            __pyx_t_12 = PyObject_Length(__pyx_v_valid_src_edges); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1424, __pyx_L1_error)
            if (unlikely(((double)__pyx_t_12) == 0)) {
              PyErr_SetString(PyExc_ZeroDivisionError, "float division");
              __PYX_ERR(0, 1424, __pyx_L1_error)
            }
            __pyx_t_16 = PyFloat_FromDouble((((double)__pyx_t_19) / ((double)__pyx_t_12))); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1424, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_16);
            __pyx_t_3 = __pyx_t_16;
            __pyx_t_16 = 0;
          } else {
            __Pyx_INCREF(Py_None);
            __pyx_t_3 = Py_None;
          }
          __Pyx_XDECREF_SET(__pyx_v_src_found_in_ref, __pyx_t_3);
          __pyx_t_3 = 0;

          /* "ete4/core/tree.pyx":1422
 *                     tree_sizes.append(ncommon)
 * 
 *                     if unrooted:             # <<<<<<<<<<<<<<
 *                         ref_found_in_src = len(common_edges)/float(len(valid_ref_edges)) if valid_ref_edges else None
 *                         src_found_in_ref = len(common_edges)/float(len(valid_src_edges)) if valid_src_edges else None
 */
          goto __pyx_L28;
        }

        /* "ete4/core/tree.pyx":1429
 *                         # from the percentage of congruence. Otherwise we will never see a 0%
 *                         # congruence for totally different trees
 *                         ref_found_in_src = (len(common_edges)-1)/float(len(valid_ref_edges)-1) if len(valid_ref_edges)>1 else None             # <<<<<<<<<<<<<<
 *                         src_found_in_ref = (len(common_edges)-1)/float(len(valid_src_edges)-1) if len(valid_src_edges)>1 else None
 * 
 */
        /*else*/ {
          __pyx_t_12 = PyObject_Length(__pyx_v_valid_ref_edges); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1429, __pyx_L1_error)
          __pyx_t_9 = (__pyx_t_12 > 1);
          if (__pyx_t_9) {
            __pyx_t_12 = PyObject_Length(__pyx_v_common_edges); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1429, __pyx_L1_error)
            __pyx_t_19 = (__pyx_t_12 - 1);
            __pyx_t_12 = PyObject_Length(__pyx_v_valid_ref_edges); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1429, __pyx_L1_error)
            if (unlikely(((double)(__pyx_t_12 - 1)) == 0)) {
              PyErr_SetString(PyExc_ZeroDivisionError, "float division");
              __PYX_ERR(0, 1429, __pyx_L1_error)
            }
            __pyx_t_16 = PyFloat_FromDouble((((double)__pyx_t_19) / ((double)(__pyx_t_12 - 1)))); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1429, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_16);
            __pyx_t_3 = __pyx_t_16;
            __pyx_t_16 = 0;
          } else {
            __Pyx_INCREF(Py_None);
            __pyx_t_3 = Py_None;
          }
          __Pyx_XDECREF_SET(__pyx_v_ref_found_in_src, __pyx_t_3);
          __pyx_t_3 = 0;

          /* "ete4/core/tree.pyx":1430
 *                         # congruence for totally different trees
 *                         ref_found_in_src = (len(common_edges)-1)/float(len(valid_ref_edges)-1) if len(valid_ref_edges)>1 else None
 *                         src_found_in_ref = (len(common_edges)-1)/float(len(valid_src_edges)-1) if len(valid_src_edges)>1 else None             # <<<<<<<<<<<<<<
 * 
 *                     if ref_found_in_src is not None:
 */
          __pyx_t_12 = PyObject_Length(__pyx_v_valid_src_edges); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1430, __pyx_L1_error)
          __pyx_t_9 = (__pyx_t_12 > 1);
          if (__pyx_t_9) {
            __pyx_t_12 = PyObject_Length(__pyx_v_common_edges); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1430, __pyx_L1_error)
            __pyx_t_19 = (__pyx_t_12 - 1);
            __pyx_t_12 = PyObject_Length(__pyx_v_valid_src_edges); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1430, __pyx_L1_error)
            if (unlikely(((double)(__pyx_t_12 - 1)) == 0)) {
              PyErr_SetString(PyExc_ZeroDivisionError, "float division");
              __PYX_ERR(0, 1430, __pyx_L1_error)
            }
            __pyx_t_16 = PyFloat_FromDouble((((double)__pyx_t_19) / ((double)(__pyx_t_12 - 1)))); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1430, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_16);
            __pyx_t_3 = __pyx_t_16;
            __pyx_t_16 = 0;
          } else {
            __Pyx_INCREF(Py_None);
            __pyx_t_3 = Py_None;
          }
          __Pyx_XDECREF_SET(__pyx_v_src_found_in_ref, __pyx_t_3);
          __pyx_t_3 = 0;
        }
        __pyx_L28:;

        /* "ete4/core/tree.pyx":1432
 *                         src_found_in_ref = (len(common_edges)-1)/float(len(valid_src_edges)-1) if len(valid_src_edges)>1 else None
 * 
 *                     if ref_found_in_src is not None:             # <<<<<<<<<<<<<<
 *                         ref_found.append(ref_found_in_src)
 * 
 */
        __pyx_t_9 = (__pyx_v_ref_found_in_src != Py_None);
        if (__pyx_t_9) {

          /* "ete4/core/tree.pyx":1433
 * 
 *                     if ref_found_in_src is not None:
 *                         ref_found.append(ref_found_in_src)             # <<<<<<<<<<<<<<
 * 
 *                     if src_found_in_ref is not None:
 */
          __pyx_t_18 = __Pyx_PyList_Append(__pyx_v_ref_found, __pyx_v_ref_found_in_src); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 1433, __pyx_L1_error)

          /* "ete4/core/tree.pyx":1432
 *                         src_found_in_ref = (len(common_edges)-1)/float(len(valid_src_edges)-1) if len(valid_src_edges)>1 else None
 * 
 *                     if ref_found_in_src is not None:             # <<<<<<<<<<<<<<
 *                         ref_found.append(ref_found_in_src)
 * 
 */
        }

        /* "ete4/core/tree.pyx":1435
 *                         ref_found.append(ref_found_in_src)
 * 
 *                     if src_found_in_ref is not None:             # <<<<<<<<<<<<<<
 *                         src_found.append(src_found_in_ref)
 * 
 */
        __pyx_t_9 = (__pyx_v_src_found_in_ref != Py_None);
        if (__pyx_t_9) {

          /* "ete4/core/tree.pyx":1436
 * 
 *                     if src_found_in_ref is not None:
 *                         src_found.append(src_found_in_ref)             # <<<<<<<<<<<<<<
 * 
 *                 if all_rf:
 */
          __pyx_t_18 = __Pyx_PyList_Append(__pyx_v_src_found, __pyx_v_src_found_in_ref); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 1436, __pyx_L1_error)

          /* "ete4/core/tree.pyx":1435
 *                         ref_found.append(ref_found_in_src)
 * 
 *                     if src_found_in_ref is not None:             # <<<<<<<<<<<<<<
 *                         src_found.append(src_found_in_ref)
 * 
 */
        }

        /* "ete4/core/tree.pyx":1395
 *                 common_names = 0
 * 
 *                 for subtree_nw in sp_trees:             # <<<<<<<<<<<<<<
 * 
 *                     #if seedid and not use_collateral and (seedid not in subtree_nw):
 */
        __pyx_L18_continue:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ete4/core/tree.pyx":1438
 *                         src_found.append(src_found_in_ref)
 * 
 *                 if all_rf:             # <<<<<<<<<<<<<<
 *                     # Treeko speciation distance
 *                     alld = [_safe_div(all_rf[i], float(all_max_rf[i])) for i in range(len(all_rf))]
 */
      __pyx_t_9 = (PyList_GET_SIZE(__pyx_v_all_rf) != 0);
      if (__pyx_t_9) {

        /* "ete4/core/tree.pyx":1440
 *                 if all_rf:
 *                     # Treeko speciation distance
 *                     alld = [_safe_div(all_rf[i], float(all_max_rf[i])) for i in range(len(all_rf))]             # <<<<<<<<<<<<<<
 *                     a = sum([alld[i] * tree_sizes[i] for i in range(len(all_rf))])
 *                     b = float(sum(tree_sizes))
 */
        { /* enter inner scope */
          __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1440, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_6 = __Pyx_PyList_GET_SIZE(__pyx_v_all_rf); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1440, __pyx_L1_error)
          __pyx_t_12 = __pyx_t_6;
          for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_12; __pyx_t_19+=1) {
            __pyx_9genexpr42__pyx_v_i = __pyx_t_19;
            __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_all_rf, __pyx_9genexpr42__pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1440, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_16 = __Pyx_GetItemInt_List(__pyx_v_all_max_rf, __pyx_9genexpr42__pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1440, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_16);
            __pyx_t_15 = __Pyx_PyNumber_Float(__pyx_t_16); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1440, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_15);
            __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
            __pyx_t_16 = __pyx_pf_4ete4_4core_4tree_4Tree_7compare__safe_div(__pyx_v__safe_div, __pyx_t_3, __pyx_t_15); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1440, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_16);
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
            if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_16))) __PYX_ERR(0, 1440, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
          }
        } /* exit inner scope */
        __pyx_v_alld = ((PyObject*)__pyx_t_4);
        __pyx_t_4 = 0;

        /* "ete4/core/tree.pyx":1441
 *                     # Treeko speciation distance
 *                     alld = [_safe_div(all_rf[i], float(all_max_rf[i])) for i in range(len(all_rf))]
 *                     a = sum([alld[i] * tree_sizes[i] for i in range(len(all_rf))])             # <<<<<<<<<<<<<<
 *                     b = float(sum(tree_sizes))
 *                     treeko_d = a/b if a else 0.0
 */
        { /* enter inner scope */
          __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1441, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_6 = __Pyx_PyList_GET_SIZE(__pyx_v_all_rf); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1441, __pyx_L1_error)
          __pyx_t_12 = __pyx_t_6;
          for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_12; __pyx_t_19+=1) {
            __pyx_9genexpr43__pyx_v_i = __pyx_t_19;
            __pyx_t_16 = __Pyx_GetItemInt_List(__pyx_v_alld, __pyx_9genexpr43__pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1441, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_16);
            __pyx_t_15 = __Pyx_GetItemInt_List(__pyx_v_tree_sizes, __pyx_9genexpr43__pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1441, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_15);
            __pyx_t_3 = PyNumber_Multiply(__pyx_t_16, __pyx_t_15); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1441, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
            __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
            if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 1441, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          }
        } /* exit inner scope */
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1441, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_a = __pyx_t_3;
        __pyx_t_3 = 0;

        /* "ete4/core/tree.pyx":1442
 *                     alld = [_safe_div(all_rf[i], float(all_max_rf[i])) for i in range(len(all_rf))]
 *                     a = sum([alld[i] * tree_sizes[i] for i in range(len(all_rf))])
 *                     b = float(sum(tree_sizes))             # <<<<<<<<<<<<<<
 *                     treeko_d = a/b if a else 0.0
 *                     result["treeko_dist"] = treeko_d
 */
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_v_tree_sizes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1442, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_20 = __Pyx_PyObject_AsDouble(__pyx_t_3); if (unlikely(__pyx_t_20 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1442, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_v_b = __pyx_t_20;

        /* "ete4/core/tree.pyx":1443
 *                     a = sum([alld[i] * tree_sizes[i] for i in range(len(all_rf))])
 *                     b = float(sum(tree_sizes))
 *                     treeko_d = a/b if a else 0.0             # <<<<<<<<<<<<<<
 *                     result["treeko_dist"] = treeko_d
 * 
 */
        __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_a); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 1443, __pyx_L1_error)
        if (__pyx_t_9) {
          __pyx_t_4 = PyFloat_FromDouble(__pyx_v_b); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1443, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_15 = __Pyx_PyNumber_Divide(__pyx_v_a, __pyx_t_4); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1443, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_15);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_3 = __pyx_t_15;
          __pyx_t_15 = 0;
        } else {
          __Pyx_INCREF(__pyx_float_0_0);
          __pyx_t_3 = __pyx_float_0_0;
        }
        __pyx_v_treeko_d = __pyx_t_3;
        __pyx_t_3 = 0;

        /* "ete4/core/tree.pyx":1444
 *                     b = float(sum(tree_sizes))
 *                     treeko_d = a/b if a else 0.0
 *                     result["treeko_dist"] = treeko_d             # <<<<<<<<<<<<<<
 * 
 *                     result["rf"] = utils.mean(all_rf)
 */
        if (unlikely((PyDict_SetItem(__pyx_v_result, __pyx_n_u_treeko_dist, __pyx_v_treeko_d) < 0))) __PYX_ERR(0, 1444, __pyx_L1_error)

        /* "ete4/core/tree.pyx":1446
 *                     result["treeko_dist"] = treeko_d
 * 
 *                     result["rf"] = utils.mean(all_rf)             # <<<<<<<<<<<<<<
 *                     result["max_rf"] = max(all_max_rf)
 *                     result["effective_tree_size"] = utils.mean(tree_sizes)
 */
        __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_utils); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1446, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_15);
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_mean); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1446, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        __pyx_t_15 = NULL;
        __pyx_t_5 = 0;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_15)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_15);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
            __pyx_t_5 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_15, __pyx_v_all_rf};
          __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
          __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
          if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1446, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        }
        if (unlikely((PyDict_SetItem(__pyx_v_result, __pyx_n_u_rf, __pyx_t_3) < 0))) __PYX_ERR(0, 1446, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

        /* "ete4/core/tree.pyx":1447
 * 
 *                     result["rf"] = utils.mean(all_rf)
 *                     result["max_rf"] = max(all_max_rf)             # <<<<<<<<<<<<<<
 *                     result["effective_tree_size"] = utils.mean(tree_sizes)
 *                     result["norm_rf"] = utils.mean([_safe_div(all_rf[i], float(all_max_rf[i])) for i in range(len(all_rf))])
 */
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_max, __pyx_v_all_max_rf); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1447, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        if (unlikely((PyDict_SetItem(__pyx_v_result, __pyx_n_u_max_rf, __pyx_t_3) < 0))) __PYX_ERR(0, 1447, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

        /* "ete4/core/tree.pyx":1448
 *                     result["rf"] = utils.mean(all_rf)
 *                     result["max_rf"] = max(all_max_rf)
 *                     result["effective_tree_size"] = utils.mean(tree_sizes)             # <<<<<<<<<<<<<<
 *                     result["norm_rf"] = utils.mean([_safe_div(all_rf[i], float(all_max_rf[i])) for i in range(len(all_rf))])
 * 
 */
        __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_utils); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1448, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_mean); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1448, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_15);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = NULL;
        __pyx_t_5 = 0;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_15))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_15);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_15, function);
            __pyx_t_5 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_tree_sizes};
          __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_15, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1448, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        }
        if (unlikely((PyDict_SetItem(__pyx_v_result, __pyx_n_u_effective_tree_size, __pyx_t_3) < 0))) __PYX_ERR(0, 1448, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

        /* "ete4/core/tree.pyx":1449
 *                     result["max_rf"] = max(all_max_rf)
 *                     result["effective_tree_size"] = utils.mean(tree_sizes)
 *                     result["norm_rf"] = utils.mean([_safe_div(all_rf[i], float(all_max_rf[i])) for i in range(len(all_rf))])             # <<<<<<<<<<<<<<
 * 
 *                     result["ref_edges_in_source"] = utils.mean(ref_found)
 */
        __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_utils); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1449, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_15);
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_mean); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1449, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        { /* enter inner scope */
          __pyx_t_15 = PyList_New(0); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1449, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_15);
          __pyx_t_6 = __Pyx_PyList_GET_SIZE(__pyx_v_all_rf); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1449, __pyx_L1_error)
          __pyx_t_12 = __pyx_t_6;
          for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_12; __pyx_t_19+=1) {
            __pyx_9genexpr44__pyx_v_i = __pyx_t_19;
            __pyx_t_16 = __Pyx_GetItemInt_List(__pyx_v_all_rf, __pyx_9genexpr44__pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1449, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_16);
            __pyx_t_14 = __Pyx_GetItemInt_List(__pyx_v_all_max_rf, __pyx_9genexpr44__pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1449, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_14);
            __pyx_t_2 = __Pyx_PyNumber_Float(__pyx_t_14); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1449, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
            __pyx_t_14 = __pyx_pf_4ete4_4core_4tree_4Tree_7compare__safe_div(__pyx_v__safe_div, __pyx_t_16, __pyx_t_2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1449, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_14);
            __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            if (unlikely(__Pyx_ListComp_Append(__pyx_t_15, (PyObject*)__pyx_t_14))) __PYX_ERR(0, 1449, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          }
        } /* exit inner scope */
        __pyx_t_14 = NULL;
        __pyx_t_5 = 0;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_14)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_14);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
            __pyx_t_5 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_14, __pyx_t_15};
          __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
          if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1449, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        }
        if (unlikely((PyDict_SetItem(__pyx_v_result, __pyx_n_u_norm_rf, __pyx_t_3) < 0))) __PYX_ERR(0, 1449, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

        /* "ete4/core/tree.pyx":1451
 *                     result["norm_rf"] = utils.mean([_safe_div(all_rf[i], float(all_max_rf[i])) for i in range(len(all_rf))])
 * 
 *                     result["ref_edges_in_source"] = utils.mean(ref_found)             # <<<<<<<<<<<<<<
 *                     result["source_edges_in_ref"] = utils.mean(src_found)
 * 
 */
        __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_utils); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1451, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_mean); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1451, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_15);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = NULL;
        __pyx_t_5 = 0;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_15))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_15);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_15, function);
            __pyx_t_5 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_ref_found};
          __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_15, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1451, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        }
        if (unlikely((PyDict_SetItem(__pyx_v_result, __pyx_n_u_ref_edges_in_source, __pyx_t_3) < 0))) __PYX_ERR(0, 1451, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

        /* "ete4/core/tree.pyx":1452
 * 
 *                     result["ref_edges_in_source"] = utils.mean(ref_found)
 *                     result["source_edges_in_ref"] = utils.mean(src_found)             # <<<<<<<<<<<<<<
 * 
 *                     result["source_subtrees"] = len(all_rf)
 */
        __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_utils); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1452, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_15);
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_mean); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1452, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        __pyx_t_15 = NULL;
        __pyx_t_5 = 0;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_15)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_15);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
            __pyx_t_5 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_15, __pyx_v_src_found};
          __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
          __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
          if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1452, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        }
        if (unlikely((PyDict_SetItem(__pyx_v_result, __pyx_n_u_source_edges_in_ref, __pyx_t_3) < 0))) __PYX_ERR(0, 1452, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

        /* "ete4/core/tree.pyx":1454
 *                     result["source_edges_in_ref"] = utils.mean(src_found)
 * 
 *                     result["source_subtrees"] = len(all_rf)             # <<<<<<<<<<<<<<
 *                     result["common_edges"] = set()
 *                     result["source_edges"] = set()
 */
        __pyx_t_6 = __Pyx_PyList_GET_SIZE(__pyx_v_all_rf); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1454, __pyx_L1_error)
        __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1454, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        if (unlikely((PyDict_SetItem(__pyx_v_result, __pyx_n_u_source_subtrees, __pyx_t_3) < 0))) __PYX_ERR(0, 1454, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

        /* "ete4/core/tree.pyx":1455
 * 
 *                     result["source_subtrees"] = len(all_rf)
 *                     result["common_edges"] = set()             # <<<<<<<<<<<<<<
 *                     result["source_edges"] = set()
 *                     result["ref_edges"] = set()
 */
        __pyx_t_3 = PySet_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1455, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        if (unlikely((PyDict_SetItem(__pyx_v_result, __pyx_n_u_common_edges, __pyx_t_3) < 0))) __PYX_ERR(0, 1455, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

        /* "ete4/core/tree.pyx":1456
 *                     result["source_subtrees"] = len(all_rf)
 *                     result["common_edges"] = set()
 *                     result["source_edges"] = set()             # <<<<<<<<<<<<<<
 *                     result["ref_edges"] = set()
 *         else:
 */
        __pyx_t_3 = PySet_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1456, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        if (unlikely((PyDict_SetItem(__pyx_v_result, __pyx_n_u_source_edges, __pyx_t_3) < 0))) __PYX_ERR(0, 1456, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

        /* "ete4/core/tree.pyx":1457
 *                     result["common_edges"] = set()
 *                     result["source_edges"] = set()
 *                     result["ref_edges"] = set()             # <<<<<<<<<<<<<<
 *         else:
 *             total_rf, max_rf, ncommon, valid_ref_edges, valid_src_edges, common_edges = _compare(source_tree, ref_tree)
 */
        __pyx_t_3 = PySet_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1457, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        if (unlikely((PyDict_SetItem(__pyx_v_result, __pyx_n_u_ref_edges, __pyx_t_3) < 0))) __PYX_ERR(0, 1457, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

        /* "ete4/core/tree.pyx":1438
 *                         src_found.append(src_found_in_ref)
 * 
 *                 if all_rf:             # <<<<<<<<<<<<<<
 *                     # Treeko speciation distance
 *                     alld = [_safe_div(all_rf[i], float(all_max_rf[i])) for i in range(len(all_rf))]
 */
      }

      /* "ete4/core/tree.pyx":1387
 *                 prop=source_tree_attr, map_properties=[source_tree_attr, "support"])
 * 
 *             if ntrees < max_treeko_splits_to_be_artifact:             # <<<<<<<<<<<<<<
 *                 all_rf = []
 *                 ref_found = []
 */
    }

    /* "ete4/core/tree.pyx":1381
 *                                      if n.children and n.support is not None and n.support > min_support_ref])
 *         result = {}
 *         if has_duplications:             # <<<<<<<<<<<<<<
 *             orig_target_size = len(source_tree)
 *             ntrees, ndups, sp_trees = source_tree.get_speciation_trees(
 */
    goto __pyx_L14;
  }

  /* "ete4/core/tree.pyx":1459
 *                     result["ref_edges"] = set()
 *         else:
 *             total_rf, max_rf, ncommon, valid_ref_edges, valid_src_edges, common_edges = _compare(source_tree, ref_tree)             # <<<<<<<<<<<<<<
 * 
 *             result["rf"] = float(total_rf) if max_rf else "NA"
 */
  /*else*/ {
    __pyx_t_3 = __pyx_pf_4ete4_4core_4tree_4Tree_7compare_2_compare(__pyx_v__compare, ((PyObject *)__pyx_v_source_tree), __pyx_v_ref_tree); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1459, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
      PyObject* sequence = __pyx_t_3;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 6)) {
        if (size > 6) __Pyx_RaiseTooManyValuesError(6);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 1459, __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_15 = PyTuple_GET_ITEM(sequence, 1); 
        __pyx_t_14 = PyTuple_GET_ITEM(sequence, 2); 
        __pyx_t_2 = PyTuple_GET_ITEM(sequence, 3); 
        __pyx_t_16 = PyTuple_GET_ITEM(sequence, 4); 
        __pyx_t_10 = PyTuple_GET_ITEM(sequence, 5); 
      } else {
        __pyx_t_4 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_15 = PyList_GET_ITEM(sequence, 1); 
        __pyx_t_14 = PyList_GET_ITEM(sequence, 2); 
        __pyx_t_2 = PyList_GET_ITEM(sequence, 3); 
        __pyx_t_16 = PyList_GET_ITEM(sequence, 4); 
        __pyx_t_10 = PyList_GET_ITEM(sequence, 5); 
      }
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_15);
      __Pyx_INCREF(__pyx_t_14);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_16);
      __Pyx_INCREF(__pyx_t_10);
      #else
      {
        Py_ssize_t i;
        PyObject** temps[6] = {&__pyx_t_4,&__pyx_t_15,&__pyx_t_14,&__pyx_t_2,&__pyx_t_16,&__pyx_t_10};
        for (i=0; i < 6; i++) {
          PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 1459, __pyx_L1_error)
          __Pyx_GOTREF(item);
          *(temps[i]) = item;
        }
      }
      #endif
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else {
      Py_ssize_t index = -1;
      PyObject** temps[6] = {&__pyx_t_4,&__pyx_t_15,&__pyx_t_14,&__pyx_t_2,&__pyx_t_16,&__pyx_t_10};
      __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1459, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1);
      for (index=0; index < 6; index++) {
        PyObject* item = __pyx_t_11(__pyx_t_1); if (unlikely(!item)) goto __pyx_L39_unpacking_failed;
        __Pyx_GOTREF(item);
        *(temps[index]) = item;
      }
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_1), 6) < 0) __PYX_ERR(0, 1459, __pyx_L1_error)
      __pyx_t_11 = NULL;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L40_unpacking_done;
      __pyx_L39_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_11 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 1459, __pyx_L1_error)
      __pyx_L40_unpacking_done:;
    }
    __pyx_v_total_rf = __pyx_t_4;
    __pyx_t_4 = 0;
    __pyx_v_max_rf = __pyx_t_15;
    __pyx_t_15 = 0;
    __pyx_v_ncommon = __pyx_t_14;
    __pyx_t_14 = 0;
    __pyx_v_valid_ref_edges = __pyx_t_2;
    __pyx_t_2 = 0;
    __pyx_v_valid_src_edges = __pyx_t_16;
    __pyx_t_16 = 0;
    __pyx_v_common_edges = __pyx_t_10;
    __pyx_t_10 = 0;

    /* "ete4/core/tree.pyx":1461
 *             total_rf, max_rf, ncommon, valid_ref_edges, valid_src_edges, common_edges = _compare(source_tree, ref_tree)
 * 
 *             result["rf"] = float(total_rf) if max_rf else "NA"             # <<<<<<<<<<<<<<
 *             result["max_rf"] = float(max_rf)
 *             if unrooted:
 */
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_max_rf); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 1461, __pyx_L1_error)
    if (__pyx_t_9) {
      __pyx_t_10 = __Pyx_PyNumber_Float(__pyx_v_total_rf); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1461, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_3 = __pyx_t_10;
      __pyx_t_10 = 0;
    } else {
      __Pyx_INCREF(__pyx_n_u_NA);
      __pyx_t_3 = __pyx_n_u_NA;
    }
    if (unlikely((PyDict_SetItem(__pyx_v_result, __pyx_n_u_rf, __pyx_t_3) < 0))) __PYX_ERR(0, 1461, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "ete4/core/tree.pyx":1462
 * 
 *             result["rf"] = float(total_rf) if max_rf else "NA"
 *             result["max_rf"] = float(max_rf)             # <<<<<<<<<<<<<<
 *             if unrooted:
 *                 result["ref_edges_in_source"] = len(common_edges)/float(len(valid_ref_edges)) if valid_ref_edges else "NA"
 */
    __pyx_t_3 = __Pyx_PyNumber_Float(__pyx_v_max_rf); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1462, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (unlikely((PyDict_SetItem(__pyx_v_result, __pyx_n_u_max_rf, __pyx_t_3) < 0))) __PYX_ERR(0, 1462, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "ete4/core/tree.pyx":1463
 *             result["rf"] = float(total_rf) if max_rf else "NA"
 *             result["max_rf"] = float(max_rf)
 *             if unrooted:             # <<<<<<<<<<<<<<
 *                 result["ref_edges_in_source"] = len(common_edges)/float(len(valid_ref_edges)) if valid_ref_edges else "NA"
 *                 result["source_edges_in_ref"] = len(common_edges)/float(len(valid_src_edges)) if valid_src_edges else "NA"
 */
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_unrooted); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 1463, __pyx_L1_error)
    if (__pyx_t_9) {

      /* "ete4/core/tree.pyx":1464
 *             result["max_rf"] = float(max_rf)
 *             if unrooted:
 *                 result["ref_edges_in_source"] = len(common_edges)/float(len(valid_ref_edges)) if valid_ref_edges else "NA"             # <<<<<<<<<<<<<<
 *                 result["source_edges_in_ref"] = len(common_edges)/float(len(valid_src_edges)) if valid_src_edges else "NA"
 *             else:
 */
      __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_valid_ref_edges); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 1464, __pyx_L1_error)
      if (__pyx_t_9) {
        __pyx_t_6 = PyObject_Length(__pyx_v_common_edges); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1464, __pyx_L1_error)
        __pyx_t_12 = PyObject_Length(__pyx_v_valid_ref_edges); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1464, __pyx_L1_error)
        if (unlikely(((double)__pyx_t_12) == 0)) {
          PyErr_SetString(PyExc_ZeroDivisionError, "float division");
          __PYX_ERR(0, 1464, __pyx_L1_error)
        }
        __pyx_t_10 = PyFloat_FromDouble((((double)__pyx_t_6) / ((double)__pyx_t_12))); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1464, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_3 = __pyx_t_10;
        __pyx_t_10 = 0;
      } else {
        __Pyx_INCREF(__pyx_n_u_NA);
        __pyx_t_3 = __pyx_n_u_NA;
      }
      if (unlikely((PyDict_SetItem(__pyx_v_result, __pyx_n_u_ref_edges_in_source, __pyx_t_3) < 0))) __PYX_ERR(0, 1464, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "ete4/core/tree.pyx":1465
 *             if unrooted:
 *                 result["ref_edges_in_source"] = len(common_edges)/float(len(valid_ref_edges)) if valid_ref_edges else "NA"
 *                 result["source_edges_in_ref"] = len(common_edges)/float(len(valid_src_edges)) if valid_src_edges else "NA"             # <<<<<<<<<<<<<<
 *             else:
 *                 # in rooted trees, we want to discount the root edge from the
 */
      __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_valid_src_edges); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 1465, __pyx_L1_error)
      if (__pyx_t_9) {
        __pyx_t_12 = PyObject_Length(__pyx_v_common_edges); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1465, __pyx_L1_error)
        __pyx_t_6 = PyObject_Length(__pyx_v_valid_src_edges); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1465, __pyx_L1_error)
        if (unlikely(((double)__pyx_t_6) == 0)) {
          PyErr_SetString(PyExc_ZeroDivisionError, "float division");
          __PYX_ERR(0, 1465, __pyx_L1_error)
        }
        __pyx_t_10 = PyFloat_FromDouble((((double)__pyx_t_12) / ((double)__pyx_t_6))); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1465, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_3 = __pyx_t_10;
        __pyx_t_10 = 0;
      } else {
        __Pyx_INCREF(__pyx_n_u_NA);
        __pyx_t_3 = __pyx_n_u_NA;
      }
      if (unlikely((PyDict_SetItem(__pyx_v_result, __pyx_n_u_source_edges_in_ref, __pyx_t_3) < 0))) __PYX_ERR(0, 1465, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "ete4/core/tree.pyx":1463
 *             result["rf"] = float(total_rf) if max_rf else "NA"
 *             result["max_rf"] = float(max_rf)
 *             if unrooted:             # <<<<<<<<<<<<<<
 *                 result["ref_edges_in_source"] = len(common_edges)/float(len(valid_ref_edges)) if valid_ref_edges else "NA"
 *                 result["source_edges_in_ref"] = len(common_edges)/float(len(valid_src_edges)) if valid_src_edges else "NA"
 */
      goto __pyx_L41;
    }

    /* "ete4/core/tree.pyx":1470
 *                 # percentage of congruence. Otherwise we will never see a 0%
 *                 # congruence for totally different trees
 *                 result["ref_edges_in_source"] = (len(common_edges)-1)/float(len(valid_ref_edges)-1) if len(valid_ref_edges)>1 else "NA"             # <<<<<<<<<<<<<<
 *                 result["source_edges_in_ref"] = (len(common_edges)-1)/float(len(valid_src_edges)-1) if len(valid_src_edges)>1 else "NA"
 * 
 */
    /*else*/ {
      __pyx_t_6 = PyObject_Length(__pyx_v_valid_ref_edges); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1470, __pyx_L1_error)
      __pyx_t_9 = (__pyx_t_6 > 1);
      if (__pyx_t_9) {
        __pyx_t_6 = PyObject_Length(__pyx_v_common_edges); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1470, __pyx_L1_error)
        __pyx_t_12 = (__pyx_t_6 - 1);
        __pyx_t_6 = PyObject_Length(__pyx_v_valid_ref_edges); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1470, __pyx_L1_error)
        if (unlikely(((double)(__pyx_t_6 - 1)) == 0)) {
          PyErr_SetString(PyExc_ZeroDivisionError, "float division");
          __PYX_ERR(0, 1470, __pyx_L1_error)
        }
        __pyx_t_10 = PyFloat_FromDouble((((double)__pyx_t_12) / ((double)(__pyx_t_6 - 1)))); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1470, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_3 = __pyx_t_10;
        __pyx_t_10 = 0;
      } else {
        __Pyx_INCREF(__pyx_n_u_NA);
        __pyx_t_3 = __pyx_n_u_NA;
      }
      if (unlikely((PyDict_SetItem(__pyx_v_result, __pyx_n_u_ref_edges_in_source, __pyx_t_3) < 0))) __PYX_ERR(0, 1470, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "ete4/core/tree.pyx":1471
 *                 # congruence for totally different trees
 *                 result["ref_edges_in_source"] = (len(common_edges)-1)/float(len(valid_ref_edges)-1) if len(valid_ref_edges)>1 else "NA"
 *                 result["source_edges_in_ref"] = (len(common_edges)-1)/float(len(valid_src_edges)-1) if len(valid_src_edges)>1 else "NA"             # <<<<<<<<<<<<<<
 * 
 *             result["effective_tree_size"] = ncommon
 */
      __pyx_t_6 = PyObject_Length(__pyx_v_valid_src_edges); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1471, __pyx_L1_error)
      __pyx_t_9 = (__pyx_t_6 > 1);
      if (__pyx_t_9) {
        __pyx_t_6 = PyObject_Length(__pyx_v_common_edges); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1471, __pyx_L1_error)
        __pyx_t_12 = (__pyx_t_6 - 1);
        __pyx_t_6 = PyObject_Length(__pyx_v_valid_src_edges); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1471, __pyx_L1_error)
        if (unlikely(((double)(__pyx_t_6 - 1)) == 0)) {
          PyErr_SetString(PyExc_ZeroDivisionError, "float division");
          __PYX_ERR(0, 1471, __pyx_L1_error)
        }
        __pyx_t_10 = PyFloat_FromDouble((((double)__pyx_t_12) / ((double)(__pyx_t_6 - 1)))); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1471, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_3 = __pyx_t_10;
        __pyx_t_10 = 0;
      } else {
        __Pyx_INCREF(__pyx_n_u_NA);
        __pyx_t_3 = __pyx_n_u_NA;
      }
      if (unlikely((PyDict_SetItem(__pyx_v_result, __pyx_n_u_source_edges_in_ref, __pyx_t_3) < 0))) __PYX_ERR(0, 1471, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __pyx_L41:;

    /* "ete4/core/tree.pyx":1473
 *                 result["source_edges_in_ref"] = (len(common_edges)-1)/float(len(valid_src_edges)-1) if len(valid_src_edges)>1 else "NA"
 * 
 *             result["effective_tree_size"] = ncommon             # <<<<<<<<<<<<<<
 *             result["norm_rf"] = total_rf/float(max_rf) if max_rf else "NA"
 *             result["treeko_dist"] = "NA"
 */
    if (unlikely((PyDict_SetItem(__pyx_v_result, __pyx_n_u_effective_tree_size, __pyx_v_ncommon) < 0))) __PYX_ERR(0, 1473, __pyx_L1_error)

    /* "ete4/core/tree.pyx":1474
 * 
 *             result["effective_tree_size"] = ncommon
 *             result["norm_rf"] = total_rf/float(max_rf) if max_rf else "NA"             # <<<<<<<<<<<<<<
 *             result["treeko_dist"] = "NA"
 *             result["source_subtrees"] = 1
 */
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_max_rf); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 1474, __pyx_L1_error)
    if (__pyx_t_9) {
      __pyx_t_10 = __Pyx_PyNumber_Float(__pyx_v_max_rf); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1474, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_16 = __Pyx_PyNumber_Divide(__pyx_v_total_rf, __pyx_t_10); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1474, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_16);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_3 = __pyx_t_16;
      __pyx_t_16 = 0;
    } else {
      __Pyx_INCREF(__pyx_n_u_NA);
      __pyx_t_3 = __pyx_n_u_NA;
    }
    if (unlikely((PyDict_SetItem(__pyx_v_result, __pyx_n_u_norm_rf, __pyx_t_3) < 0))) __PYX_ERR(0, 1474, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "ete4/core/tree.pyx":1475
 *             result["effective_tree_size"] = ncommon
 *             result["norm_rf"] = total_rf/float(max_rf) if max_rf else "NA"
 *             result["treeko_dist"] = "NA"             # <<<<<<<<<<<<<<
 *             result["source_subtrees"] = 1
 *             result["common_edges"] = common_edges
 */
    if (unlikely((PyDict_SetItem(__pyx_v_result, __pyx_n_u_treeko_dist, __pyx_n_u_NA) < 0))) __PYX_ERR(0, 1475, __pyx_L1_error)

    /* "ete4/core/tree.pyx":1476
 *             result["norm_rf"] = total_rf/float(max_rf) if max_rf else "NA"
 *             result["treeko_dist"] = "NA"
 *             result["source_subtrees"] = 1             # <<<<<<<<<<<<<<
 *             result["common_edges"] = common_edges
 *             result["source_edges"] = valid_src_edges
 */
    if (unlikely((PyDict_SetItem(__pyx_v_result, __pyx_n_u_source_subtrees, __pyx_int_1) < 0))) __PYX_ERR(0, 1476, __pyx_L1_error)

    /* "ete4/core/tree.pyx":1477
 *             result["treeko_dist"] = "NA"
 *             result["source_subtrees"] = 1
 *             result["common_edges"] = common_edges             # <<<<<<<<<<<<<<
 *             result["source_edges"] = valid_src_edges
 *             result["ref_edges"] = valid_ref_edges
 */
    if (unlikely((PyDict_SetItem(__pyx_v_result, __pyx_n_u_common_edges, __pyx_v_common_edges) < 0))) __PYX_ERR(0, 1477, __pyx_L1_error)

    /* "ete4/core/tree.pyx":1478
 *             result["source_subtrees"] = 1
 *             result["common_edges"] = common_edges
 *             result["source_edges"] = valid_src_edges             # <<<<<<<<<<<<<<
 *             result["ref_edges"] = valid_ref_edges
 *         return result
 */
    if (unlikely((PyDict_SetItem(__pyx_v_result, __pyx_n_u_source_edges, __pyx_v_valid_src_edges) < 0))) __PYX_ERR(0, 1478, __pyx_L1_error)

    /* "ete4/core/tree.pyx":1479
 *             result["common_edges"] = common_edges
 *             result["source_edges"] = valid_src_edges
 *             result["ref_edges"] = valid_ref_edges             # <<<<<<<<<<<<<<
 *         return result
 * 
 */
    if (unlikely((PyDict_SetItem(__pyx_v_result, __pyx_n_u_ref_edges, __pyx_v_valid_ref_edges) < 0))) __PYX_ERR(0, 1479, __pyx_L1_error)
  }
  __pyx_L14:;

  /* "ete4/core/tree.pyx":1480
 *             result["source_edges"] = valid_src_edges
 *             result["ref_edges"] = valid_ref_edges
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def _diff(self, t2, output='topology', prop_t1='name', prop_t2='name', color=True):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "ete4/core/tree.pyx":1321
 *         return min_comparison
 * 
 *     def compare(self, ref_tree, use_collateral=False, min_support_source=0.0, min_support_ref=0.0,             # <<<<<<<<<<<<<<
 *                 has_duplications=False, expand_polytomies=False, unrooted=False,
 *                 max_treeko_splits_to_be_artifact=1000, ref_tree_attr='name', source_tree_attr='name'):
 */

  /* 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_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_AddTraceback("ete4.core.tree.Tree.compare", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_source_tree);
  __Pyx_XDECREF(__pyx_v__safe_div);
  __Pyx_XDECREF(__pyx_v__compare);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_ntrees);
  __Pyx_XDECREF(__pyx_v_ndups);
  __Pyx_XDECREF(__pyx_v_sp_trees);
  __Pyx_XDECREF(__pyx_v_all_rf);
  __Pyx_XDECREF(__pyx_v_ref_found);
  __Pyx_XDECREF(__pyx_v_src_found);
  __Pyx_XDECREF(__pyx_v_tree_sizes);
  __Pyx_XDECREF(__pyx_v_all_max_rf);
  __Pyx_XDECREF(__pyx_v_subtree_nw);
  __Pyx_XDECREF(__pyx_v_subtree);
  __Pyx_XDECREF(__pyx_v_subtree_content);
  __Pyx_XDECREF(__pyx_v_n);
  __Pyx_XDECREF(__pyx_v_total_rf);
  __Pyx_XDECREF(__pyx_v_max_rf);
  __Pyx_XDECREF(__pyx_v_ncommon);
  __Pyx_XDECREF(__pyx_v_valid_ref_edges);
  __Pyx_XDECREF(__pyx_v_valid_src_edges);
  __Pyx_XDECREF(__pyx_v_common_edges);
  __Pyx_XDECREF(__pyx_v_ref_found_in_src);
  __Pyx_XDECREF(__pyx_v_src_found_in_ref);
  __Pyx_XDECREF(__pyx_v_alld);
  __Pyx_XDECREF(__pyx_v_a);
  __Pyx_XDECREF(__pyx_v_treeko_d);
  __Pyx_XDECREF(__pyx_9genexpr41__pyx_v_n);
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ete4/core/tree.pyx":1482
 *         return result
 * 
 *     def _diff(self, t2, output='topology', prop_t1='name', prop_t2='name', color=True):             # <<<<<<<<<<<<<<
 *         """Return the difference between two tree topologies.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_138_diff(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_4ete4_4core_4tree_4Tree_137_diff, "Tree._diff(self, t2, output=u'topology', prop_t1=u'name', prop_t2=u'name', color=True)\nReturn the difference between two tree topologies.\n\n        :param [raw|table|topology|diffs|diffs_tab] output: Output type.\n        ");
static PyMethodDef __pyx_mdef_4ete4_4core_4tree_4Tree_138_diff = {"_diff", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_138_diff, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_137_diff};
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_138_diff(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_t2 = 0;
  PyObject *__pyx_v_output = 0;
  PyObject *__pyx_v_prop_t1 = 0;
  PyObject *__pyx_v_prop_t2 = 0;
  PyObject *__pyx_v_color = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[5] = {0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_diff (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t2,&__pyx_n_s_output,&__pyx_n_s_prop_t1,&__pyx_n_s_prop_t2,&__pyx_n_s_color,0};
    values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_n_u_topology));
    values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_n_u_name));
    values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_n_u_name));
    values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_True));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t2)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1482, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_output);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1482, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_prop_t1);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1482, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_prop_t2);
          if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1482, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color);
          if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1482, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_diff") < 0)) __PYX_ERR(0, 1482, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_t2 = values[0];
    __pyx_v_output = values[1];
    __pyx_v_prop_t1 = values[2];
    __pyx_v_prop_t2 = values[3];
    __pyx_v_color = values[4];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_diff", 0, 1, 5, __pyx_nargs); __PYX_ERR(0, 1482, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("ete4.core.tree.Tree._diff", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_137_diff(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self), __pyx_v_t2, __pyx_v_output, __pyx_v_prop_t1, __pyx_v_prop_t2, __pyx_v_color);

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

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_137_diff(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_t2, PyObject *__pyx_v_output, PyObject *__pyx_v_prop_t1, PyObject *__pyx_v_prop_t2, PyObject *__pyx_v_color) {
  PyObject *__pyx_v_ete_diff = NULL;
  PyObject *__pyx_v_difftable = NULL;
  PyObject *__pyx_v_rf = NULL;
  PyObject *__pyx_v_rf_max = NULL;
  CYTHON_UNUSED PyObject *__pyx_v__ = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  unsigned int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *(*__pyx_t_12)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_diff", 1);

  /* "ete4/core/tree.pyx":1487
 *         :param [raw|table|topology|diffs|diffs_tab] output: Output type.
 *         """
 *         from ..tools import ete_diff             # <<<<<<<<<<<<<<
 * 
 *         difftable = ete_diff.treediff(self, t2, prop1=prop_t1, prop2=prop_t2)
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1487, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_ete_diff);
  __Pyx_GIVEREF(__pyx_n_s_ete_diff);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_ete_diff)) __PYX_ERR(0, 1487, __pyx_L1_error);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_tools, __pyx_t_1, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1487, __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_ete_diff); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1487, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_ete_diff = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ete4/core/tree.pyx":1489
 *         from ..tools import ete_diff
 * 
 *         difftable = ete_diff.treediff(self, t2, prop1=prop_t1, prop2=prop_t2)             # <<<<<<<<<<<<<<
 * 
 *         # TODO: Fix the show_difftable*() functions and return get_difftable*() here.
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_ete_diff, __pyx_n_s_treediff); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1489, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1489, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self))) __PYX_ERR(0, 1489, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_t2);
  __Pyx_GIVEREF(__pyx_v_t2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_t2)) __PYX_ERR(0, 1489, __pyx_L1_error);
  __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1489, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_prop1, __pyx_v_prop_t1) < 0) __PYX_ERR(0, 1489, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_prop2, __pyx_v_prop_t2) < 0) __PYX_ERR(0, 1489, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1489, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_difftable = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "ete4/core/tree.pyx":1492
 * 
 *         # TODO: Fix the show_difftable*() functions and return get_difftable*() here.
 *         if output == 'topology':             # <<<<<<<<<<<<<<
 *             ete_diff.show_difftable_topo(difftable, prop_t1, prop_t2, usecolor=color)
 *         elif output == 'diffs':
 */
  __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_v_output, __pyx_n_u_topology, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1492, __pyx_L1_error)
  if (__pyx_t_5) {

    /* "ete4/core/tree.pyx":1493
 *         # TODO: Fix the show_difftable*() functions and return get_difftable*() here.
 *         if output == 'topology':
 *             ete_diff.show_difftable_topo(difftable, prop_t1, prop_t2, usecolor=color)             # <<<<<<<<<<<<<<
 *         elif output == 'diffs':
 *             ete_diff.show_difftable(difftable)
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_ete_diff, __pyx_n_s_show_difftable_topo); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1493, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1493, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_difftable);
    __Pyx_GIVEREF(__pyx_v_difftable);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_difftable)) __PYX_ERR(0, 1493, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_prop_t1);
    __Pyx_GIVEREF(__pyx_v_prop_t1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_prop_t1)) __PYX_ERR(0, 1493, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_prop_t2);
    __Pyx_GIVEREF(__pyx_v_prop_t2);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_prop_t2)) __PYX_ERR(0, 1493, __pyx_L1_error);
    __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1493, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_usecolor, __pyx_v_color) < 0) __PYX_ERR(0, 1493, __pyx_L1_error)
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1493, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "ete4/core/tree.pyx":1492
 * 
 *         # TODO: Fix the show_difftable*() functions and return get_difftable*() here.
 *         if output == 'topology':             # <<<<<<<<<<<<<<
 *             ete_diff.show_difftable_topo(difftable, prop_t1, prop_t2, usecolor=color)
 *         elif output == 'diffs':
 */
    goto __pyx_L3;
  }

  /* "ete4/core/tree.pyx":1494
 *         if output == 'topology':
 *             ete_diff.show_difftable_topo(difftable, prop_t1, prop_t2, usecolor=color)
 *         elif output == 'diffs':             # <<<<<<<<<<<<<<
 *             ete_diff.show_difftable(difftable)
 *         elif output == 'diffs_tab':
 */
  __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_v_output, __pyx_n_u_diffs, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1494, __pyx_L1_error)
  if (__pyx_t_5) {

    /* "ete4/core/tree.pyx":1495
 *             ete_diff.show_difftable_topo(difftable, prop_t1, prop_t2, usecolor=color)
 *         elif output == 'diffs':
 *             ete_diff.show_difftable(difftable)             # <<<<<<<<<<<<<<
 *         elif output == 'diffs_tab':
 *             ete_diff.show_difftable_tab(difftable)
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_ete_diff, __pyx_n_s_show_difftable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1495, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_difftable};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1495, __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;

    /* "ete4/core/tree.pyx":1494
 *         if output == 'topology':
 *             ete_diff.show_difftable_topo(difftable, prop_t1, prop_t2, usecolor=color)
 *         elif output == 'diffs':             # <<<<<<<<<<<<<<
 *             ete_diff.show_difftable(difftable)
 *         elif output == 'diffs_tab':
 */
    goto __pyx_L3;
  }

  /* "ete4/core/tree.pyx":1496
 *         elif output == 'diffs':
 *             ete_diff.show_difftable(difftable)
 *         elif output == 'diffs_tab':             # <<<<<<<<<<<<<<
 *             ete_diff.show_difftable_tab(difftable)
 *         elif output == 'table':
 */
  __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_v_output, __pyx_n_u_diffs_tab, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1496, __pyx_L1_error)
  if (__pyx_t_5) {

    /* "ete4/core/tree.pyx":1497
 *             ete_diff.show_difftable(difftable)
 *         elif output == 'diffs_tab':
 *             ete_diff.show_difftable_tab(difftable)             # <<<<<<<<<<<<<<
 *         elif output == 'table':
 *             rf, rf_max, _, _, _, _, _ = self.robinson_foulds(t2, prop_t1=prop_t1, prop_t2=prop_t2)[:2]
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_ete_diff, __pyx_n_s_show_difftable_tab); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1497, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_difftable};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1497, __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;

    /* "ete4/core/tree.pyx":1496
 *         elif output == 'diffs':
 *             ete_diff.show_difftable(difftable)
 *         elif output == 'diffs_tab':             # <<<<<<<<<<<<<<
 *             ete_diff.show_difftable_tab(difftable)
 *         elif output == 'table':
 */
    goto __pyx_L3;
  }

  /* "ete4/core/tree.pyx":1498
 *         elif output == 'diffs_tab':
 *             ete_diff.show_difftable_tab(difftable)
 *         elif output == 'table':             # <<<<<<<<<<<<<<
 *             rf, rf_max, _, _, _, _, _ = self.robinson_foulds(t2, prop_t1=prop_t1, prop_t2=prop_t2)[:2]
 *             ete_diff.show_difftable_summary(difftable, rf, rf_max)
 */
  __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_v_output, __pyx_n_u_table, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1498, __pyx_L1_error)
  if (__pyx_t_5) {

    /* "ete4/core/tree.pyx":1499
 *             ete_diff.show_difftable_tab(difftable)
 *         elif output == 'table':
 *             rf, rf_max, _, _, _, _, _ = self.robinson_foulds(t2, prop_t1=prop_t1, prop_t2=prop_t2)[:2]             # <<<<<<<<<<<<<<
 *             ete_diff.show_difftable_summary(difftable, rf, rf_max)
 *         elif output == 'raw':
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_robinson_foulds); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1499, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1499, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_t2);
    __Pyx_GIVEREF(__pyx_v_t2);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_t2)) __PYX_ERR(0, 1499, __pyx_L1_error);
    __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1499, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_prop_t1, __pyx_v_prop_t1) < 0) __PYX_ERR(0, 1499, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_prop_t2, __pyx_v_prop_t2) < 0) __PYX_ERR(0, 1499, __pyx_L1_error)
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1499, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_t_4, 0, 2, NULL, NULL, &__pyx_slice__35, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1499, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
      PyObject* sequence = __pyx_t_3;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 7)) {
        if (size > 7) __Pyx_RaiseTooManyValuesError(7);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 1499, __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_1 = PyTuple_GET_ITEM(sequence, 1); 
        __pyx_t_2 = PyTuple_GET_ITEM(sequence, 2); 
        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 3); 
        __pyx_t_8 = PyTuple_GET_ITEM(sequence, 4); 
        __pyx_t_9 = PyTuple_GET_ITEM(sequence, 5); 
        __pyx_t_10 = PyTuple_GET_ITEM(sequence, 6); 
      } else {
        __pyx_t_4 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_1 = PyList_GET_ITEM(sequence, 1); 
        __pyx_t_2 = PyList_GET_ITEM(sequence, 2); 
        __pyx_t_7 = PyList_GET_ITEM(sequence, 3); 
        __pyx_t_8 = PyList_GET_ITEM(sequence, 4); 
        __pyx_t_9 = PyList_GET_ITEM(sequence, 5); 
        __pyx_t_10 = PyList_GET_ITEM(sequence, 6); 
      }
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_10);
      #else
      {
        Py_ssize_t i;
        PyObject** temps[7] = {&__pyx_t_4,&__pyx_t_1,&__pyx_t_2,&__pyx_t_7,&__pyx_t_8,&__pyx_t_9,&__pyx_t_10};
        for (i=0; i < 7; i++) {
          PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 1499, __pyx_L1_error)
          __Pyx_GOTREF(item);
          *(temps[i]) = item;
        }
      }
      #endif
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else {
      Py_ssize_t index = -1;
      PyObject** temps[7] = {&__pyx_t_4,&__pyx_t_1,&__pyx_t_2,&__pyx_t_7,&__pyx_t_8,&__pyx_t_9,&__pyx_t_10};
      __pyx_t_11 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1499, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_12 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_11);
      for (index=0; index < 7; index++) {
        PyObject* item = __pyx_t_12(__pyx_t_11); if (unlikely(!item)) goto __pyx_L4_unpacking_failed;
        __Pyx_GOTREF(item);
        *(temps[index]) = item;
      }
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 7) < 0) __PYX_ERR(0, 1499, __pyx_L1_error)
      __pyx_t_12 = NULL;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      goto __pyx_L5_unpacking_done;
      __pyx_L4_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_12 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 1499, __pyx_L1_error)
      __pyx_L5_unpacking_done:;
    }
    __pyx_v_rf = __pyx_t_4;
    __pyx_t_4 = 0;
    __pyx_v_rf_max = __pyx_t_1;
    __pyx_t_1 = 0;
    __pyx_v__ = __pyx_t_2;
    __pyx_t_2 = 0;
    __Pyx_DECREF_SET(__pyx_v__, __pyx_t_7);
    __pyx_t_7 = 0;
    __Pyx_DECREF_SET(__pyx_v__, __pyx_t_8);
    __pyx_t_8 = 0;
    __Pyx_DECREF_SET(__pyx_v__, __pyx_t_9);
    __pyx_t_9 = 0;
    __Pyx_DECREF_SET(__pyx_v__, __pyx_t_10);
    __pyx_t_10 = 0;

    /* "ete4/core/tree.pyx":1500
 *         elif output == 'table':
 *             rf, rf_max, _, _, _, _, _ = self.robinson_foulds(t2, prop_t1=prop_t1, prop_t2=prop_t2)[:2]
 *             ete_diff.show_difftable_summary(difftable, rf, rf_max)             # <<<<<<<<<<<<<<
 *         elif output == 'raw':
 *             return difftable
 */
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_ete_diff, __pyx_n_s_show_difftable_summary); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1500, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_9 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_10))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_10, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[4] = {__pyx_t_9, __pyx_v_difftable, __pyx_v_rf, __pyx_v_rf_max};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_6, 3+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1500, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "ete4/core/tree.pyx":1498
 *         elif output == 'diffs_tab':
 *             ete_diff.show_difftable_tab(difftable)
 *         elif output == 'table':             # <<<<<<<<<<<<<<
 *             rf, rf_max, _, _, _, _, _ = self.robinson_foulds(t2, prop_t1=prop_t1, prop_t2=prop_t2)[:2]
 *             ete_diff.show_difftable_summary(difftable, rf, rf_max)
 */
    goto __pyx_L3;
  }

  /* "ete4/core/tree.pyx":1501
 *             rf, rf_max, _, _, _, _, _ = self.robinson_foulds(t2, prop_t1=prop_t1, prop_t2=prop_t2)[:2]
 *             ete_diff.show_difftable_summary(difftable, rf, rf_max)
 *         elif output == 'raw':             # <<<<<<<<<<<<<<
 *             return difftable
 *         else:
 */
  __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_v_output, __pyx_n_u_raw, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1501, __pyx_L1_error)
  if (likely(__pyx_t_5)) {

    /* "ete4/core/tree.pyx":1502
 *             ete_diff.show_difftable_summary(difftable, rf, rf_max)
 *         elif output == 'raw':
 *             return difftable             # <<<<<<<<<<<<<<
 *         else:
 *             raise TreeError(f'Unknown output for diff: {output}')
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_difftable);
    __pyx_r = __pyx_v_difftable;
    goto __pyx_L0;

    /* "ete4/core/tree.pyx":1501
 *             rf, rf_max, _, _, _, _, _ = self.robinson_foulds(t2, prop_t1=prop_t1, prop_t2=prop_t2)[:2]
 *             ete_diff.show_difftable_summary(difftable, rf, rf_max)
 *         elif output == 'raw':             # <<<<<<<<<<<<<<
 *             return difftable
 *         else:
 */
  }

  /* "ete4/core/tree.pyx":1504
 *             return difftable
 *         else:
 *             raise TreeError(f'Unknown output for diff: {output}')             # <<<<<<<<<<<<<<
 * 
 *     def edges(self, cached_content=None):
 */
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_TreeError); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1504, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_9 = __Pyx_PyObject_FormatSimple(__pyx_v_output, __pyx_empty_unicode); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1504, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_8 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Unknown_output_for_diff, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1504, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_10))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_10, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_8};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1504, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    }
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 1504, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "ete4/core/tree.pyx":1482
 *         return result
 * 
 *     def _diff(self, t2, output='topology', prop_t1='name', prop_t2='name', color=True):             # <<<<<<<<<<<<<<
 *         """Return the difference between two tree topologies.
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("ete4.core.tree.Tree._diff", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ete_diff);
  __Pyx_XDECREF(__pyx_v_difftable);
  __Pyx_XDECREF(__pyx_v_rf);
  __Pyx_XDECREF(__pyx_v_rf_max);
  __Pyx_XDECREF(__pyx_v__);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_4ete4_4core_4tree_4Tree_141generator11(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "ete4/core/tree.pyx":1506
 *             raise TreeError(f'Unknown output for diff: {output}')
 * 
 *     def edges(self, cached_content=None):             # <<<<<<<<<<<<<<
 *         """Yield a pair of sets of leafs for every partition of the tree.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_140edges(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_4ete4_4core_4tree_4Tree_139edges, "Tree.edges(self, cached_content=None)\nYield a pair of sets of leafs for every partition of the tree.\n\n        For every node, there are leaves that lay on one side of that\n        node, and leaves that lay on the other. This generator yields\n        all those pairs of sets.\n\n        :param cached_content: Dictionary that to each node associates the\n            leaves that descend from it. If passed, it won't be recomputed.\n        ");
static PyMethodDef __pyx_mdef_4ete4_4core_4tree_4Tree_140edges = {"edges", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_140edges, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_139edges};
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_140edges(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_cached_content = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("edges (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cached_content,0};
    values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_cached_content);
          if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1506, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "edges") < 0)) __PYX_ERR(0, 1506, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_cached_content = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("edges", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 1506, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("ete4.core.tree.Tree.edges", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_139edges(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self), __pyx_v_cached_content);

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

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_139edges(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_cached_content) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_39_edges *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("edges", 0);
  __pyx_cur_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_39_edges *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_39_edges(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_39_edges, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_39_edges *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1506, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __pyx_cur_scope->__pyx_v_cached_content = __pyx_v_cached_content;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_cached_content);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_cached_content);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4ete4_4core_4tree_4Tree_141generator11, __pyx_codeobj__36, (PyObject *) __pyx_cur_scope, __pyx_n_s_edges, __pyx_n_s_Tree_edges, __pyx_n_s_ete4_core_tree); if (unlikely(!gen)) __PYX_ERR(0, 1506, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("ete4.core.tree.Tree.edges", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_4ete4_4core_4tree_4Tree_141generator11(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_39_edges *__pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_39_edges *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  unsigned int __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  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_RefNannyDeclarations
  __Pyx_RefNannySetupContext("edges", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L7_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1506, __pyx_L1_error)

  /* "ete4/core/tree.pyx":1516
 *             leaves that descend from it. If passed, it won't be recomputed.
 *         """
 *         if not cached_content:             # <<<<<<<<<<<<<<
 *             cached_content = self.get_cached_content()  # d[node] = {leaf, ...}
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_cached_content); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1516, __pyx_L1_error)
  __pyx_t_2 = (!__pyx_t_1);
  if (__pyx_t_2) {

    /* "ete4/core/tree.pyx":1517
 *         """
 *         if not cached_content:
 *             cached_content = self.get_cached_content()  # d[node] = {leaf, ...}             # <<<<<<<<<<<<<<
 * 
 *         all_leaves = cached_content[self]
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_get_cached_content); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1517, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1517, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_cached_content);
    __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_cached_content, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;

    /* "ete4/core/tree.pyx":1516
 *             leaves that descend from it. If passed, it won't be recomputed.
 *         """
 *         if not cached_content:             # <<<<<<<<<<<<<<
 *             cached_content = self.get_cached_content()  # d[node] = {leaf, ...}
 * 
 */
  }

  /* "ete4/core/tree.pyx":1519
 *             cached_content = self.get_cached_content()  # d[node] = {leaf, ...}
 * 
 *         all_leaves = cached_content[self]             # <<<<<<<<<<<<<<
 * 
 *         for leaves_descendant in cached_content.values():
 */
  __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_cur_scope->__pyx_v_cached_content, ((PyObject *)__pyx_cur_scope->__pyx_v_self)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1519, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_cur_scope->__pyx_v_all_leaves = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "ete4/core/tree.pyx":1521
 *         all_leaves = cached_content[self]
 * 
 *         for leaves_descendant in cached_content.values():             # <<<<<<<<<<<<<<
 *             yield (leaves_descendant, all_leaves - leaves_descendant)
 * 
 */
  __pyx_t_7 = 0;
  if (unlikely(__pyx_cur_scope->__pyx_v_cached_content == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "values");
    __PYX_ERR(0, 1521, __pyx_L1_error)
  }
  __pyx_t_4 = __Pyx_dict_iterator(__pyx_cur_scope->__pyx_v_cached_content, 0, __pyx_n_s_values, (&__pyx_t_8), (&__pyx_t_9)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1521, __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_10 = __Pyx_dict_iter_next(__pyx_t_3, __pyx_t_8, &__pyx_t_7, NULL, &__pyx_t_4, NULL, __pyx_t_9);
    if (unlikely(__pyx_t_10 == 0)) break;
    if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 1521, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_leaves_descendant);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_leaves_descendant, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;

    /* "ete4/core/tree.pyx":1522
 * 
 *         for leaves_descendant in cached_content.values():
 *             yield (leaves_descendant, all_leaves - leaves_descendant)             # <<<<<<<<<<<<<<
 * 
 *     def standardize(self, delete_orphan=True, preserve_branch_length=True):
 */
    __pyx_t_4 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_all_leaves, __pyx_cur_scope->__pyx_v_leaves_descendant); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1522, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1522, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_leaves_descendant);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_leaves_descendant);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_cur_scope->__pyx_v_leaves_descendant)) __PYX_ERR(0, 1522, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_4);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4)) __PYX_ERR(0, 1522, __pyx_L1_error);
    __pyx_t_4 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    __Pyx_XGIVEREF(__pyx_t_3);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_3;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_7;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_8;
    __pyx_cur_scope->__pyx_t_3 = __pyx_t_9;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L7_resume_from_yield:;
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_3);
    __pyx_t_7 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_8 = __pyx_cur_scope->__pyx_t_2;
    __pyx_t_9 = __pyx_cur_scope->__pyx_t_3;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1522, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "ete4/core/tree.pyx":1506
 *             raise TreeError(f'Unknown output for diff: {output}')
 * 
 *     def edges(self, cached_content=None):             # <<<<<<<<<<<<<<
 *         """Yield a pair of sets of leafs for every partition of the tree.
 * 
 */

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

/* "ete4/core/tree.pyx":1524
 *             yield (leaves_descendant, all_leaves - leaves_descendant)
 * 
 *     def standardize(self, delete_orphan=True, preserve_branch_length=True):             # <<<<<<<<<<<<<<
 *         """Resolve multifurcations and remove single-child nodes.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_143standardize(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_4ete4_4core_4tree_4Tree_142standardize, "Tree.standardize(self, delete_orphan=True, preserve_branch_length=True)\nResolve multifurcations and remove single-child nodes.\n\n        This function changes the current tree structure to produce a\n        standardized topology: nodes with only one child are removed\n        and multifurcations are automatically resolved.\n        ");
static PyMethodDef __pyx_mdef_4ete4_4core_4tree_4Tree_143standardize = {"standardize", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_143standardize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_142standardize};
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_143standardize(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v_delete_orphan = 0;
  PyObject *__pyx_v_preserve_branch_length = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("standardize (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_delete_orphan,&__pyx_n_s_preserve_branch_length,0};
    values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_True));
    values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_True));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_delete_orphan);
          if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1524, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_preserve_branch_length);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1524, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "standardize") < 0)) __PYX_ERR(0, 1524, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_delete_orphan = values[0];
    __pyx_v_preserve_branch_length = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("standardize", 0, 0, 2, __pyx_nargs); __PYX_ERR(0, 1524, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("ete4.core.tree.Tree.standardize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_142standardize(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self), __pyx_v_delete_orphan, __pyx_v_preserve_branch_length);

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

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_142standardize(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_delete_orphan, PyObject *__pyx_v_preserve_branch_length) {
  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;
  unsigned int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  Py_ssize_t __pyx_t_7;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("standardize", 1);

  /* "ete4/core/tree.pyx":1531
 *         and multifurcations are automatically resolved.
 *         """
 *         self.resolve_polytomy()             # <<<<<<<<<<<<<<
 * 
 *         for n in self.descendants():
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_resolve_polytomy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1531, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1531, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ete4/core/tree.pyx":1533
 *         self.resolve_polytomy()
 * 
 *         for n in self.descendants():             # <<<<<<<<<<<<<<
 *             if len(n.children) == 1:
 *                 n.delete(prevent_nondicotomic=True,
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_descendants); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1533, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1533, __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_5 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1533, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1533, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_6)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1533, __pyx_L1_error)
          #endif
          if (__pyx_t_5 >= __pyx_temp) 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, 1533, __pyx_L1_error)
        #else
        __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1533, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1533, __pyx_L1_error)
          #endif
          if (__pyx_t_5 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 1533, __pyx_L1_error)
        #else
        __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1533, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_6(__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, 1533, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "ete4/core/tree.pyx":1534
 * 
 *         for n in self.descendants():
 *             if len(n.children) == 1:             # <<<<<<<<<<<<<<
 *                 n.delete(prevent_nondicotomic=True,
 *                          preserve_branch_length=preserve_branch_length)
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_n, __pyx_n_s_children); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1534, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1534, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_8 = (__pyx_t_7 == 1);
    if (__pyx_t_8) {

      /* "ete4/core/tree.pyx":1535
 *         for n in self.descendants():
 *             if len(n.children) == 1:
 *                 n.delete(prevent_nondicotomic=True,             # <<<<<<<<<<<<<<
 *                          preserve_branch_length=preserve_branch_length)
 * 
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_n, __pyx_n_s_delete); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1535, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1535, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_prevent_nondicotomic, Py_True) < 0) __PYX_ERR(0, 1535, __pyx_L1_error)

      /* "ete4/core/tree.pyx":1536
 *             if len(n.children) == 1:
 *                 n.delete(prevent_nondicotomic=True,
 *                          preserve_branch_length=preserve_branch_length)             # <<<<<<<<<<<<<<
 * 
 *     def get_topology_id(self, prop='name'):
 */
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_preserve_branch_length, __pyx_v_preserve_branch_length) < 0) __PYX_ERR(0, 1535, __pyx_L1_error)

      /* "ete4/core/tree.pyx":1535
 *         for n in self.descendants():
 *             if len(n.children) == 1:
 *                 n.delete(prevent_nondicotomic=True,             # <<<<<<<<<<<<<<
 *                          preserve_branch_length=preserve_branch_length)
 * 
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1535, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

      /* "ete4/core/tree.pyx":1534
 * 
 *         for n in self.descendants():
 *             if len(n.children) == 1:             # <<<<<<<<<<<<<<
 *                 n.delete(prevent_nondicotomic=True,
 *                          preserve_branch_length=preserve_branch_length)
 */
    }

    /* "ete4/core/tree.pyx":1533
 *         self.resolve_polytomy()
 * 
 *         for n in self.descendants():             # <<<<<<<<<<<<<<
 *             if len(n.children) == 1:
 *                 n.delete(prevent_nondicotomic=True,
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ete4/core/tree.pyx":1524
 *             yield (leaves_descendant, all_leaves - leaves_descendant)
 * 
 *     def standardize(self, delete_orphan=True, preserve_branch_length=True):             # <<<<<<<<<<<<<<
 *         """Resolve multifurcations and remove single-child nodes.
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("ete4.core.tree.Tree.standardize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_n);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ete4/core/tree.pyx":1538
 *                          preserve_branch_length=preserve_branch_length)
 * 
 *     def get_topology_id(self, prop='name'):             # <<<<<<<<<<<<<<
 *         """Return a unique ID representing the topology of the tree.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_145get_topology_id(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_4ete4_4core_4tree_4Tree_144get_topology_id, "Tree.get_topology_id(self, prop=u'name')\nReturn a unique ID representing the topology of the tree.\n\n        Two trees with the same topology will produce the same id.\n        This is useful to detect the number of unique topologies over\n        a bunch of trees, without requiring full distance methods.\n\n        The id is, by default, calculated based on the terminal node's\n        names. Any other node property could be used instead.\n\n        If trees are unrooted, make sure that the root node is not\n        binary or use the tree.unroot() function before generating the\n        topology id.\n        ");
static PyMethodDef __pyx_mdef_4ete4_4core_4tree_4Tree_145get_topology_id = {"get_topology_id", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_145get_topology_id, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_144get_topology_id};
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_145get_topology_id(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_prop = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_topology_id (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_prop,0};
    values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_n_u_name));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_prop);
          if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1538, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_topology_id") < 0)) __PYX_ERR(0, 1538, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_prop = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_topology_id", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 1538, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("ete4.core.tree.Tree.get_topology_id", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_144get_topology_id(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self), __pyx_v_prop);

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

/* "ete4/core/tree.pyx":1554
 *         edge_keys = []
 *         for s1, s2 in self.edges():
 *             k1 = sorted(e.props.get(prop, getattr(e, prop)) for e in s1)             # <<<<<<<<<<<<<<
 *             k2 = sorted(e.props.get(prop, getattr(e, prop)) for e in s2)
 * 
 */

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_15get_topology_id_genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_41_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_41_genexpr *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_41_genexpr(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_41_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_41_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1554, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_40_get_topology_id *) __pyx_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope);
  __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4ete4_4core_4tree_4Tree_15get_topology_id_2generator32, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_get_topology_id_locals_genexpr, __pyx_n_s_ete4_core_tree); if (unlikely(!gen)) __PYX_ERR(0, 1554, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("ete4.core.tree.Tree.get_topology_id.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_4ete4_4core_4tree_4Tree_15get_topology_id_2generator32(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_41_genexpr *__pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_41_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  unsigned int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1554, __pyx_L1_error)
  __pyx_r = PyList_New(0); if (unlikely(!__pyx_r)) __PYX_ERR(0, 1554, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1554, __pyx_L1_error) }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1);
    __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1554, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1554, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1554, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 1554, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1554, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1554, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 1554, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1554, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1554, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_e);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_e, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_e, __pyx_n_s_props); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1554, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_get); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1554, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_prop)) { __Pyx_RaiseClosureNameError("prop"); __PYX_ERR(0, 1554, __pyx_L1_error) }
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_prop)) { __Pyx_RaiseClosureNameError("prop"); __PYX_ERR(0, 1554, __pyx_L1_error) }
    __pyx_t_5 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_prop;
    __Pyx_INCREF(__pyx_t_5);
    __pyx_t_7 = __Pyx_GetAttr(__pyx_cur_scope->__pyx_v_e, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1554, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    __pyx_t_8 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_8 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_prop, __pyx_t_7};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1554, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    if (unlikely(__Pyx_ListComp_Append(__pyx_r, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 1554, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

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

/* "ete4/core/tree.pyx":1555
 *         for s1, s2 in self.edges():
 *             k1 = sorted(e.props.get(prop, getattr(e, prop)) for e in s1)
 *             k2 = sorted(e.props.get(prop, getattr(e, prop)) for e in s2)             # <<<<<<<<<<<<<<
 * 
 *             edge_keys.append(sorted([k1, k2]))
 */

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_15get_topology_id_3genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_42_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_42_genexpr *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_42_genexpr(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_42_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_42_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1555, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_40_get_topology_id *) __pyx_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope);
  __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4ete4_4core_4tree_4Tree_15get_topology_id_5generator33, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_get_topology_id_locals_genexpr, __pyx_n_s_ete4_core_tree); if (unlikely(!gen)) __PYX_ERR(0, 1555, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("ete4.core.tree.Tree.get_topology_id.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_4ete4_4core_4tree_4Tree_15get_topology_id_5generator33(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_42_genexpr *__pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_42_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  unsigned int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1555, __pyx_L1_error)
  __pyx_r = PyList_New(0); if (unlikely(!__pyx_r)) __PYX_ERR(0, 1555, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1555, __pyx_L1_error) }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1);
    __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1555, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1555, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1555, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 1555, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1555, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1555, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 1555, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1555, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1555, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_e);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_e, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_e, __pyx_n_s_props); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1555, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_get); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1555, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_prop)) { __Pyx_RaiseClosureNameError("prop"); __PYX_ERR(0, 1555, __pyx_L1_error) }
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_prop)) { __Pyx_RaiseClosureNameError("prop"); __PYX_ERR(0, 1555, __pyx_L1_error) }
    __pyx_t_5 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_prop;
    __Pyx_INCREF(__pyx_t_5);
    __pyx_t_7 = __Pyx_GetAttr(__pyx_cur_scope->__pyx_v_e, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1555, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    __pyx_t_8 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_8 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_prop, __pyx_t_7};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1555, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    if (unlikely(__Pyx_ListComp_Append(__pyx_r, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 1555, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

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

/* "ete4/core/tree.pyx":1538
 *                          preserve_branch_length=preserve_branch_length)
 * 
 *     def get_topology_id(self, prop='name'):             # <<<<<<<<<<<<<<
 *         """Return a unique ID representing the topology of the tree.
 * 
 */

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_144get_topology_id(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_prop) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_40_get_topology_id *__pyx_cur_scope;
  PyObject *__pyx_v_edge_keys = NULL;
  PyObject *__pyx_v_s1 = NULL;
  PyObject *__pyx_v_s2 = NULL;
  PyObject *__pyx_v_k1 = NULL;
  PyObject *__pyx_v_k2 = NULL;
  PyObject *__pyx_gb_4ete4_4core_4tree_4Tree_15get_topology_id_2generator32 = 0;
  PyObject *__pyx_gb_4ete4_4core_4tree_4Tree_15get_topology_id_5generator33 = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *(*__pyx_t_9)(PyObject *);
  int __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_topology_id", 0);
  __pyx_cur_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_40_get_topology_id *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_40_get_topology_id(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_40_get_topology_id, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_40_get_topology_id *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1538, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_prop = __pyx_v_prop;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_prop);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_prop);

  /* "ete4/core/tree.pyx":1552
 *         topology id.
 *         """
 *         edge_keys = []             # <<<<<<<<<<<<<<
 *         for s1, s2 in self.edges():
 *             k1 = sorted(e.props.get(prop, getattr(e, prop)) for e in s1)
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1552, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_edge_keys = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "ete4/core/tree.pyx":1553
 *         """
 *         edge_keys = []
 *         for s1, s2 in self.edges():             # <<<<<<<<<<<<<<
 *             k1 = sorted(e.props.get(prop, getattr(e, prop)) for e in s1)
 *             k2 = sorted(e.props.get(prop, getattr(e, prop)) for e in s2)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_edges); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1553, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1553, __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_5 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1553, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1553, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_6)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1553, __pyx_L1_error)
          #endif
          if (__pyx_t_5 >= __pyx_temp) 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, 1553, __pyx_L1_error)
        #else
        __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1553, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1553, __pyx_L1_error)
          #endif
          if (__pyx_t_5 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 1553, __pyx_L1_error)
        #else
        __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1553, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_6(__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, 1553, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
      PyObject* sequence = __pyx_t_1;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 1553, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_7 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_7);
      #else
      __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1553, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1553, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_8 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1553, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_8);
      index = 0; __pyx_t_3 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_3);
      index = 1; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_7);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 1553, __pyx_L1_error)
      __pyx_t_9 = NULL;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L6_unpacking_done;
      __pyx_L5_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_9 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 1553, __pyx_L1_error)
      __pyx_L6_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_s1, __pyx_t_3);
    __pyx_t_3 = 0;
    __Pyx_XDECREF_SET(__pyx_v_s2, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "ete4/core/tree.pyx":1554
 *         edge_keys = []
 *         for s1, s2 in self.edges():
 *             k1 = sorted(e.props.get(prop, getattr(e, prop)) for e in s1)             # <<<<<<<<<<<<<<
 *             k2 = sorted(e.props.get(prop, getattr(e, prop)) for e in s2)
 * 
 */
    __pyx_t_7 = __pyx_pf_4ete4_4core_4tree_4Tree_15get_topology_id_genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_s1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1554, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_3 = __Pyx_Generator_Next(__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1554, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_1 = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_10 = PyList_Sort(__pyx_t_1); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 1554, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_k1, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "ete4/core/tree.pyx":1555
 *         for s1, s2 in self.edges():
 *             k1 = sorted(e.props.get(prop, getattr(e, prop)) for e in s1)
 *             k2 = sorted(e.props.get(prop, getattr(e, prop)) for e in s2)             # <<<<<<<<<<<<<<
 * 
 *             edge_keys.append(sorted([k1, k2]))
 */
    __pyx_t_3 = __pyx_pf_4ete4_4core_4tree_4Tree_15get_topology_id_3genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_s2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1555, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = __Pyx_Generator_Next(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1555, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_1 = ((PyObject*)__pyx_t_7);
    __pyx_t_7 = 0;
    __pyx_t_10 = PyList_Sort(__pyx_t_1); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 1555, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_k2, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "ete4/core/tree.pyx":1557
 *             k2 = sorted(e.props.get(prop, getattr(e, prop)) for e in s2)
 * 
 *             edge_keys.append(sorted([k1, k2]))             # <<<<<<<<<<<<<<
 * 
 *         return md5(str(sorted(edge_keys)).encode('utf-8')).hexdigest()
 */
    __pyx_t_7 = PyList_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1557, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_INCREF(__pyx_v_k1);
    __Pyx_GIVEREF(__pyx_v_k1);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 0, __pyx_v_k1)) __PYX_ERR(0, 1557, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_k2);
    __Pyx_GIVEREF(__pyx_v_k2);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 1, __pyx_v_k2)) __PYX_ERR(0, 1557, __pyx_L1_error);
    __pyx_t_1 = ((PyObject*)__pyx_t_7);
    __pyx_t_7 = 0;
    __pyx_t_10 = PyList_Sort(__pyx_t_1); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 1557, __pyx_L1_error)
    __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_edge_keys, __pyx_t_1); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 1557, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "ete4/core/tree.pyx":1553
 *         """
 *         edge_keys = []
 *         for s1, s2 in self.edges():             # <<<<<<<<<<<<<<
 *             k1 = sorted(e.props.get(prop, getattr(e, prop)) for e in s1)
 *             k2 = sorted(e.props.get(prop, getattr(e, prop)) for e in s2)
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ete4/core/tree.pyx":1559
 *             edge_keys.append(sorted([k1, k2]))
 * 
 *         return md5(str(sorted(edge_keys)).encode('utf-8')).hexdigest()             # <<<<<<<<<<<<<<
 * 
 *     def to_ultrametric(self, topological=False):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_md5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1559, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = PySequence_List(__pyx_v_edge_keys); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1559, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_3 = ((PyObject*)__pyx_t_8);
  __pyx_t_8 = 0;
  __pyx_t_10 = PyList_Sort(__pyx_t_3); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 1559, __pyx_L1_error)
  __pyx_t_8 = __Pyx_PyObject_Unicode(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1559, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyUnicode_AsUTF8String(((PyObject*)__pyx_t_8)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1559, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (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_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1559, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_hexdigest); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1559, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1559, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "ete4/core/tree.pyx":1538
 *                          preserve_branch_length=preserve_branch_length)
 * 
 *     def get_topology_id(self, prop='name'):             # <<<<<<<<<<<<<<
 *         """Return a unique ID representing the topology of the tree.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("ete4.core.tree.Tree.get_topology_id", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_edge_keys);
  __Pyx_XDECREF(__pyx_v_s1);
  __Pyx_XDECREF(__pyx_v_s2);
  __Pyx_XDECREF(__pyx_v_k1);
  __Pyx_XDECREF(__pyx_v_k2);
  __Pyx_XDECREF(__pyx_gb_4ete4_4core_4tree_4Tree_15get_topology_id_2generator32);
  __Pyx_XDECREF(__pyx_gb_4ete4_4core_4tree_4Tree_15get_topology_id_5generator33);
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ete4/core/tree.pyx":1561
 *         return md5(str(sorted(edge_keys)).encode('utf-8')).hexdigest()
 * 
 *     def to_ultrametric(self, topological=False):             # <<<<<<<<<<<<<<
 *         """Convert tree to ultrametric (all leaves equidistant from root)."""
 *         ops.to_ultrametric(self, topological)
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_147to_ultrametric(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_4ete4_4core_4tree_4Tree_146to_ultrametric, "Tree.to_ultrametric(self, topological=False)\nConvert tree to ultrametric (all leaves equidistant from root).");
static PyMethodDef __pyx_mdef_4ete4_4core_4tree_4Tree_147to_ultrametric = {"to_ultrametric", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_147to_ultrametric, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_146to_ultrametric};
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_147to_ultrametric(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_topological = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_ultrametric (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_topological,0};
    values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_False));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_topological);
          if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1561, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "to_ultrametric") < 0)) __PYX_ERR(0, 1561, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_topological = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("to_ultrametric", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 1561, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("ete4.core.tree.Tree.to_ultrametric", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_146to_ultrametric(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self), __pyx_v_topological);

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

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_146to_ultrametric(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_topological) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_ultrametric", 1);

  /* "ete4/core/tree.pyx":1563
 *     def to_ultrametric(self, topological=False):
 *         """Convert tree to ultrametric (all leaves equidistant from root)."""
 *         ops.to_ultrametric(self, topological)             # <<<<<<<<<<<<<<
 * 
 *     def is_monophyletic(self, nodes):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ops); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1563, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_to_ultrametric); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1563, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_2, ((PyObject *)__pyx_v_self), __pyx_v_topological};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1563, __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;

  /* "ete4/core/tree.pyx":1561
 *         return md5(str(sorted(edge_keys)).encode('utf-8')).hexdigest()
 * 
 *     def to_ultrametric(self, topological=False):             # <<<<<<<<<<<<<<
 *         """Convert tree to ultrametric (all leaves equidistant from root)."""
 *         ops.to_ultrametric(self, topological)
 */

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

/* "ete4/core/tree.pyx":1565
 *         ops.to_ultrametric(self, topological)
 * 
 *     def is_monophyletic(self, nodes):             # <<<<<<<<<<<<<<
 *         """Return True if the nodes form a monophyletic group."""
 *         nodes = set(nodes)  # in case it is not a set already
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_149is_monophyletic(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_4ete4_4core_4tree_4Tree_148is_monophyletic, "Tree.is_monophyletic(self, nodes)\nReturn True if the nodes form a monophyletic group.");
static PyMethodDef __pyx_mdef_4ete4_4core_4tree_4Tree_149is_monophyletic = {"is_monophyletic", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_149is_monophyletic, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_148is_monophyletic};
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_149is_monophyletic(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_nodes = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_monophyletic (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nodes,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_nodes)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1565, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_monophyletic") < 0)) __PYX_ERR(0, 1565, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_nodes = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_monophyletic", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1565, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("ete4.core.tree.Tree.is_monophyletic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_148is_monophyletic(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self), __pyx_v_nodes);

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

/* "ete4/core/tree.pyx":1568
 *         """Return True if the nodes form a monophyletic group."""
 *         nodes = set(nodes)  # in case it is not a set already
 *         return all(n in nodes for n in self.common_ancestor(nodes).leaves())             # <<<<<<<<<<<<<<
 * 
 *     def check_monophyly(self, values, prop='name', unrooted=False):
 */

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_15is_monophyletic_genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_44_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_44_genexpr *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_44_genexpr(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_44_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_44_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1568, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_43_is_monophyletic *) __pyx_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope);
  __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4ete4_4core_4tree_4Tree_15is_monophyletic_2generator34, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_is_monophyletic_locals_genexpr, __pyx_n_s_ete4_core_tree); if (unlikely(!gen)) __PYX_ERR(0, 1568, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("ete4.core.tree.Tree.is_monophyletic.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_4ete4_4core_4tree_4Tree_15is_monophyletic_2generator34(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_44_genexpr *__pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_44_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1568, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1568, __pyx_L1_error) }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1);
    __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1568, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1568, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1568, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 1568, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1568, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1568, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 1568, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1568, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1568, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_n);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_n, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_nodes)) { __Pyx_RaiseClosureNameError("nodes"); __PYX_ERR(0, 1568, __pyx_L1_error) }
    __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_cur_scope->__pyx_v_n, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_nodes, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1568, __pyx_L1_error)
    __pyx_t_6 = (!__pyx_t_5);
    if (__pyx_t_6) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_False);
      __pyx_r = Py_False;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_True);
    __pyx_r = Py_True;
    goto __pyx_L0;
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

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

/* "ete4/core/tree.pyx":1565
 *         ops.to_ultrametric(self, topological)
 * 
 *     def is_monophyletic(self, nodes):             # <<<<<<<<<<<<<<
 *         """Return True if the nodes form a monophyletic group."""
 *         nodes = set(nodes)  # in case it is not a set already
 */

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_148is_monophyletic(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_nodes) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_43_is_monophyletic *__pyx_cur_scope;
  PyObject *__pyx_gb_4ete4_4core_4tree_4Tree_15is_monophyletic_2generator34 = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  unsigned int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_monophyletic", 0);
  __pyx_cur_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_43_is_monophyletic *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_43_is_monophyletic(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_43_is_monophyletic, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_43_is_monophyletic *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1565, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_nodes = __pyx_v_nodes;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_nodes);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_nodes);

  /* "ete4/core/tree.pyx":1567
 *     def is_monophyletic(self, nodes):
 *         """Return True if the nodes form a monophyletic group."""
 *         nodes = set(nodes)  # in case it is not a set already             # <<<<<<<<<<<<<<
 *         return all(n in nodes for n in self.common_ancestor(nodes).leaves())
 * 
 */
  __pyx_t_1 = PySet_New(__pyx_cur_scope->__pyx_v_nodes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1567, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_nodes);
  __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_nodes, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "ete4/core/tree.pyx":1568
 *         """Return True if the nodes form a monophyletic group."""
 *         nodes = set(nodes)  # in case it is not a set already
 *         return all(n in nodes for n in self.common_ancestor(nodes).leaves())             # <<<<<<<<<<<<<<
 * 
 *     def check_monophyly(self, values, prop='name', unrooted=False):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_common_ancestor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1568, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_cur_scope->__pyx_v_nodes};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1568, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_leaves); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1568, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1568, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_t_3 = __pyx_pf_4ete4_4core_4tree_4Tree_15is_monophyletic_genexpr(((PyObject*)__pyx_cur_scope), __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1568, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_Generator_Next(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1568, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "ete4/core/tree.pyx":1565
 *         ops.to_ultrametric(self, topological)
 * 
 *     def is_monophyletic(self, nodes):             # <<<<<<<<<<<<<<
 *         """Return True if the nodes form a monophyletic group."""
 *         nodes = set(nodes)  # in case it is not a set already
 */

  /* 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("ete4.core.tree.Tree.is_monophyletic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_gb_4ete4_4core_4tree_4Tree_15is_monophyletic_2generator34);
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ete4/core/tree.pyx":1570
 *         return all(n in nodes for n in self.common_ancestor(nodes).leaves())
 * 
 *     def check_monophyly(self, values, prop='name', unrooted=False):             # <<<<<<<<<<<<<<
 *         """Return tuple (is_monophyletic, clade_type, leaves_extra).
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_151check_monophyly(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_4ete4_4core_4tree_4Tree_150check_monophyly, "Tree.check_monophyly(self, values, prop=u'name', unrooted=False)\nReturn tuple (is_monophyletic, clade_type, leaves_extra).\n\n        :param values: List of values of the selected nodes.\n        :param prop: Node property being used to check monophyly (i.e.\n            'species' for species trees, 'name' for gene family trees,\n            or any custom feature present in the tree).\n        ");
static PyMethodDef __pyx_mdef_4ete4_4core_4tree_4Tree_151check_monophyly = {"check_monophyly", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_151check_monophyly, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_150check_monophyly};
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_151check_monophyly(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_values = 0;
  PyObject *__pyx_v_prop = 0;
  PyObject *__pyx_v_unrooted = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("check_monophyly (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_prop,&__pyx_n_s_unrooted,0};
    values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_n_u_name));
    values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_False));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_values)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1570, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_prop);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1570, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_unrooted);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1570, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "check_monophyly") < 0)) __PYX_ERR(0, 1570, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_values = values[0];
    __pyx_v_prop = values[1];
    __pyx_v_unrooted = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("check_monophyly", 0, 1, 3, __pyx_nargs); __PYX_ERR(0, 1570, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("ete4.core.tree.Tree.check_monophyly", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_150check_monophyly(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self), __pyx_v_values, __pyx_v_prop, __pyx_v_unrooted);

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

/* "ete4/core/tree.pyx":1580
 *         values = set(values)  # in case it is not a set (so we check faster)
 * 
 *         nodes = set(n for n in self.leaves()             # <<<<<<<<<<<<<<
 *                         if n.props.get(prop, getattr(n, prop)) in values)
 * 
 */

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_15check_monophyly_genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_46_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_46_genexpr *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_46_genexpr(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_46_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_46_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1580, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_45_check_monophyly *) __pyx_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope);
  __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4ete4_4core_4tree_4Tree_15check_monophyly_2generator35, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_check_monophyly_locals_genexpr, __pyx_n_s_ete4_core_tree); if (unlikely(!gen)) __PYX_ERR(0, 1580, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("ete4.core.tree.Tree.check_monophyly.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_4ete4_4core_4tree_4Tree_15check_monophyly_2generator35(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_46_genexpr *__pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_46_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  unsigned int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1580, __pyx_L1_error)
  __pyx_r = PySet_New(NULL); if (unlikely(!__pyx_r)) __PYX_ERR(0, 1580, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1580, __pyx_L1_error) }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1);
    __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1580, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1580, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1580, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 1580, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1580, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1580, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 1580, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1580, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1580, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_n);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_n, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;

    /* "ete4/core/tree.pyx":1581
 * 
 *         nodes = set(n for n in self.leaves()
 *                         if n.props.get(prop, getattr(n, prop)) in values)             # <<<<<<<<<<<<<<
 * 
 *         if not unrooted:
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_n, __pyx_n_s_props); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1581, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_get); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1581, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_prop)) { __Pyx_RaiseClosureNameError("prop"); __PYX_ERR(0, 1581, __pyx_L1_error) }
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_prop)) { __Pyx_RaiseClosureNameError("prop"); __PYX_ERR(0, 1581, __pyx_L1_error) }
    __pyx_t_5 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_prop;
    __Pyx_INCREF(__pyx_t_5);
    __pyx_t_7 = __Pyx_GetAttr(__pyx_cur_scope->__pyx_v_n, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1581, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    __pyx_t_8 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_8 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_prop, __pyx_t_7};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1581, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_values)) { __Pyx_RaiseClosureNameError("values"); __PYX_ERR(0, 1581, __pyx_L1_error) }
    __pyx_t_9 = (__Pyx_PySequence_ContainsTF(__pyx_t_4, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_values, Py_EQ)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 1581, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_9) {

      /* "ete4/core/tree.pyx":1580
 *         values = set(values)  # in case it is not a set (so we check faster)
 * 
 *         nodes = set(n for n in self.leaves()             # <<<<<<<<<<<<<<
 *                         if n.props.get(prop, getattr(n, prop)) in values)
 * 
 */
      if (unlikely(PySet_Add(__pyx_r, (PyObject*)__pyx_cur_scope->__pyx_v_n))) __PYX_ERR(0, 1580, __pyx_L1_error)

      /* "ete4/core/tree.pyx":1581
 * 
 *         nodes = set(n for n in self.leaves()
 *                         if n.props.get(prop, getattr(n, prop)) in values)             # <<<<<<<<<<<<<<
 * 
 *         if not unrooted:
 */
    }

    /* "ete4/core/tree.pyx":1580
 *         values = set(values)  # in case it is not a set (so we check faster)
 * 
 *         nodes = set(n for n in self.leaves()             # <<<<<<<<<<<<<<
 *                         if n.props.get(prop, getattr(n, prop)) in values)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

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

/* "ete4/core/tree.pyx":1584
 * 
 *         if not unrooted:
 *             leaves_from_ancestor = set(n for n in self.common_ancestor(nodes).leaves())             # <<<<<<<<<<<<<<
 * 
 *             leaves_extra = leaves_from_ancestor - nodes
 */

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_15check_monophyly_3genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_47_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_47_genexpr *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_47_genexpr(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_47_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_47_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1584, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4ete4_4core_4tree_4Tree_15check_monophyly_5generator36, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_check_monophyly_locals_genexpr, __pyx_n_s_ete4_core_tree); if (unlikely(!gen)) __PYX_ERR(0, 1584, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("ete4.core.tree.Tree.check_monophyly.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_4ete4_4core_4tree_4Tree_15check_monophyly_5generator36(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_47_genexpr *__pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_47_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1584, __pyx_L1_error)
  __pyx_r = PySet_New(NULL); if (unlikely(!__pyx_r)) __PYX_ERR(0, 1584, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1584, __pyx_L1_error) }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1);
    __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1584, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1584, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1584, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 1584, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1584, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1584, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 1584, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1584, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1584, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_n);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_n, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    if (unlikely(PySet_Add(__pyx_r, (PyObject*)__pyx_cur_scope->__pyx_v_n))) __PYX_ERR(0, 1584, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

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

/* "ete4/core/tree.pyx":1570
 *         return all(n in nodes for n in self.common_ancestor(nodes).leaves())
 * 
 *     def check_monophyly(self, values, prop='name', unrooted=False):             # <<<<<<<<<<<<<<
 *         """Return tuple (is_monophyletic, clade_type, leaves_extra).
 * 
 */

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_150check_monophyly(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_values, PyObject *__pyx_v_prop, PyObject *__pyx_v_unrooted) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_45_check_monophyly *__pyx_cur_scope;
  PyObject *__pyx_v_nodes = NULL;
  PyObject *__pyx_v_leaves_from_ancestor = NULL;
  PyObject *__pyx_v_leaves_extra = NULL;
  PyObject *__pyx_v_smallest = NULL;
  PyObject *__pyx_v_side1 = NULL;
  PyObject *__pyx_v_side2 = NULL;
  PyObject *__pyx_gb_4ete4_4core_4tree_4Tree_15check_monophyly_2generator35 = 0;
  PyObject *__pyx_gb_4ete4_4core_4tree_4Tree_15check_monophyly_5generator36 = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  PyObject *__pyx_t_10 = NULL;
  PyObject *(*__pyx_t_11)(PyObject *);
  int __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("check_monophyly", 0);
  __pyx_cur_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_45_check_monophyly *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_45_check_monophyly(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_45_check_monophyly, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_45_check_monophyly *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1570, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_values = __pyx_v_values;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_values);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_values);
  __pyx_cur_scope->__pyx_v_prop = __pyx_v_prop;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_prop);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_prop);

  /* "ete4/core/tree.pyx":1578
 *             or any custom feature present in the tree).
 *         """
 *         values = set(values)  # in case it is not a set (so we check faster)             # <<<<<<<<<<<<<<
 * 
 *         nodes = set(n for n in self.leaves()
 */
  __pyx_t_1 = PySet_New(__pyx_cur_scope->__pyx_v_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1578, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_values);
  __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_values, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "ete4/core/tree.pyx":1580
 *         values = set(values)  # in case it is not a set (so we check faster)
 * 
 *         nodes = set(n for n in self.leaves()             # <<<<<<<<<<<<<<
 *                         if n.props.get(prop, getattr(n, prop)) in values)
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_leaves); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1580, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1580, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_t_2 = __pyx_pf_4ete4_4core_4tree_4Tree_15check_monophyly_genexpr(((PyObject*)__pyx_cur_scope), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1580, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_Generator_Next(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1580, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_nodes = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "ete4/core/tree.pyx":1583
 *                         if n.props.get(prop, getattr(n, prop)) in values)
 * 
 *         if not unrooted:             # <<<<<<<<<<<<<<
 *             leaves_from_ancestor = set(n for n in self.common_ancestor(nodes).leaves())
 * 
 */
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_unrooted); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1583, __pyx_L1_error)
  __pyx_t_6 = (!__pyx_t_5);
  if (__pyx_t_6) {

    /* "ete4/core/tree.pyx":1584
 * 
 *         if not unrooted:
 *             leaves_from_ancestor = set(n for n in self.common_ancestor(nodes).leaves())             # <<<<<<<<<<<<<<
 * 
 *             leaves_extra = leaves_from_ancestor - nodes
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_common_ancestor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1584, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = NULL;
    __pyx_t_4 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_4 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_nodes};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1584, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_leaves); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1584, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = NULL;
    __pyx_t_4 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_4 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1584, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __pyx_t_3 = __pyx_pf_4ete4_4core_4tree_4Tree_15check_monophyly_3genexpr(NULL, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1584, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_Generator_Next(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1584, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_leaves_from_ancestor = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "ete4/core/tree.pyx":1586
 *             leaves_from_ancestor = set(n for n in self.common_ancestor(nodes).leaves())
 * 
 *             leaves_extra = leaves_from_ancestor - nodes             # <<<<<<<<<<<<<<
 *         else:
 *             smallest = None
 */
    __pyx_t_1 = PyNumber_Subtract(__pyx_v_leaves_from_ancestor, __pyx_v_nodes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1586, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_leaves_extra = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "ete4/core/tree.pyx":1583
 *                         if n.props.get(prop, getattr(n, prop)) in values)
 * 
 *         if not unrooted:             # <<<<<<<<<<<<<<
 *             leaves_from_ancestor = set(n for n in self.common_ancestor(nodes).leaves())
 * 
 */
    goto __pyx_L3;
  }

  /* "ete4/core/tree.pyx":1588
 *             leaves_extra = leaves_from_ancestor - nodes
 *         else:
 *             smallest = None             # <<<<<<<<<<<<<<
 *             for side1, side2 in self.edges():
 *                 if nodes.issubset(side1) and (not smallest or len(side1) < len(smallest)):
 */
  /*else*/ {
    __Pyx_INCREF(Py_None);
    __pyx_v_smallest = Py_None;

    /* "ete4/core/tree.pyx":1589
 *         else:
 *             smallest = None
 *             for side1, side2 in self.edges():             # <<<<<<<<<<<<<<
 *                 if nodes.issubset(side1) and (not smallest or len(side1) < len(smallest)):
 *                     smallest = side1
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_edges); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1589, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = NULL;
    __pyx_t_4 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_4 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1589, __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_8 = 0;
      __pyx_t_9 = NULL;
    } else {
      __pyx_t_8 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1589, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1589, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    for (;;) {
      if (likely(!__pyx_t_9)) {
        if (likely(PyList_CheckExact(__pyx_t_3))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1589, __pyx_L1_error)
            #endif
            if (__pyx_t_8 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 1589, __pyx_L1_error)
          #else
          __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1589, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          #endif
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1589, __pyx_L1_error)
            #endif
            if (__pyx_t_8 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 1589, __pyx_L1_error)
          #else
          __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1589, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          #endif
        }
      } else {
        __pyx_t_1 = __pyx_t_9(__pyx_t_3);
        if (unlikely(!__pyx_t_1)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 1589, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_1);
      }
      if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
        PyObject* sequence = __pyx_t_1;
        Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          __PYX_ERR(0, 1589, __pyx_L1_error)
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_7 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_7);
        #else
        __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1589, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1589, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        #endif
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_10 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1589, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_10);
        index = 0; __pyx_t_2 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_2)) goto __pyx_L6_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_2);
        index = 1; __pyx_t_7 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_7)) goto __pyx_L6_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_7);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < 0) __PYX_ERR(0, 1589, __pyx_L1_error)
        __pyx_t_11 = NULL;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        goto __pyx_L7_unpacking_done;
        __pyx_L6_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_11 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(0, 1589, __pyx_L1_error)
        __pyx_L7_unpacking_done:;
      }
      __Pyx_XDECREF_SET(__pyx_v_side1, __pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_XDECREF_SET(__pyx_v_side2, __pyx_t_7);
      __pyx_t_7 = 0;

      /* "ete4/core/tree.pyx":1590
 *             smallest = None
 *             for side1, side2 in self.edges():
 *                 if nodes.issubset(side1) and (not smallest or len(side1) < len(smallest)):             # <<<<<<<<<<<<<<
 *                     smallest = side1
 *                 elif nodes.issubset(side2) and (not smallest or len(side2) < len(smallest)):
 */
      __pyx_t_1 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PySet_Type_issubset, __pyx_v_nodes, __pyx_v_side1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1590, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1590, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (__pyx_t_5) {
      } else {
        __pyx_t_6 = __pyx_t_5;
        goto __pyx_L9_bool_binop_done;
      }
      __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_smallest); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1590, __pyx_L1_error)
      __pyx_t_12 = (!__pyx_t_5);
      if (!__pyx_t_12) {
      } else {
        __pyx_t_6 = __pyx_t_12;
        goto __pyx_L9_bool_binop_done;
      }
      __pyx_t_13 = PyObject_Length(__pyx_v_side1); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1590, __pyx_L1_error)
      __pyx_t_14 = PyObject_Length(__pyx_v_smallest); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1590, __pyx_L1_error)
      __pyx_t_12 = (__pyx_t_13 < __pyx_t_14);
      __pyx_t_6 = __pyx_t_12;
      __pyx_L9_bool_binop_done:;
      if (__pyx_t_6) {

        /* "ete4/core/tree.pyx":1591
 *             for side1, side2 in self.edges():
 *                 if nodes.issubset(side1) and (not smallest or len(side1) < len(smallest)):
 *                     smallest = side1             # <<<<<<<<<<<<<<
 *                 elif nodes.issubset(side2) and (not smallest or len(side2) < len(smallest)):
 *                     smallest = side2
 */
        __Pyx_INCREF(__pyx_v_side1);
        __Pyx_DECREF_SET(__pyx_v_smallest, __pyx_v_side1);

        /* "ete4/core/tree.pyx":1590
 *             smallest = None
 *             for side1, side2 in self.edges():
 *                 if nodes.issubset(side1) and (not smallest or len(side1) < len(smallest)):             # <<<<<<<<<<<<<<
 *                     smallest = side1
 *                 elif nodes.issubset(side2) and (not smallest or len(side2) < len(smallest)):
 */
        goto __pyx_L8;
      }

      /* "ete4/core/tree.pyx":1592
 *                 if nodes.issubset(side1) and (not smallest or len(side1) < len(smallest)):
 *                     smallest = side1
 *                 elif nodes.issubset(side2) and (not smallest or len(side2) < len(smallest)):             # <<<<<<<<<<<<<<
 *                     smallest = side2
 * 
 */
      __pyx_t_1 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PySet_Type_issubset, __pyx_v_nodes, __pyx_v_side2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1592, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1592, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (__pyx_t_12) {
      } else {
        __pyx_t_6 = __pyx_t_12;
        goto __pyx_L12_bool_binop_done;
      }
      __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_smallest); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1592, __pyx_L1_error)
      __pyx_t_5 = (!__pyx_t_12);
      if (!__pyx_t_5) {
      } else {
        __pyx_t_6 = __pyx_t_5;
        goto __pyx_L12_bool_binop_done;
      }
      __pyx_t_14 = PyObject_Length(__pyx_v_side2); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1592, __pyx_L1_error)
      __pyx_t_13 = PyObject_Length(__pyx_v_smallest); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1592, __pyx_L1_error)
      __pyx_t_5 = (__pyx_t_14 < __pyx_t_13);
      __pyx_t_6 = __pyx_t_5;
      __pyx_L12_bool_binop_done:;
      if (__pyx_t_6) {

        /* "ete4/core/tree.pyx":1593
 *                     smallest = side1
 *                 elif nodes.issubset(side2) and (not smallest or len(side2) < len(smallest)):
 *                     smallest = side2             # <<<<<<<<<<<<<<
 * 
 *                 if smallest and len(smallest) == len(nodes):
 */
        __Pyx_INCREF(__pyx_v_side2);
        __Pyx_DECREF_SET(__pyx_v_smallest, __pyx_v_side2);

        /* "ete4/core/tree.pyx":1592
 *                 if nodes.issubset(side1) and (not smallest or len(side1) < len(smallest)):
 *                     smallest = side1
 *                 elif nodes.issubset(side2) and (not smallest or len(side2) < len(smallest)):             # <<<<<<<<<<<<<<
 *                     smallest = side2
 * 
 */
      }
      __pyx_L8:;

      /* "ete4/core/tree.pyx":1595
 *                     smallest = side2
 * 
 *                 if smallest and len(smallest) == len(nodes):             # <<<<<<<<<<<<<<
 *                     break
 * 
 */
      __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_smallest); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1595, __pyx_L1_error)
      if (__pyx_t_5) {
      } else {
        __pyx_t_6 = __pyx_t_5;
        goto __pyx_L16_bool_binop_done;
      }
      __pyx_t_13 = PyObject_Length(__pyx_v_smallest); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1595, __pyx_L1_error)
      if (unlikely(__pyx_v_nodes == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
        __PYX_ERR(0, 1595, __pyx_L1_error)
      }
      __pyx_t_14 = __Pyx_PySet_GET_SIZE(__pyx_v_nodes); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1595, __pyx_L1_error)
      __pyx_t_5 = (__pyx_t_13 == __pyx_t_14);
      __pyx_t_6 = __pyx_t_5;
      __pyx_L16_bool_binop_done:;
      if (__pyx_t_6) {

        /* "ete4/core/tree.pyx":1596
 * 
 *                 if smallest and len(smallest) == len(nodes):
 *                     break             # <<<<<<<<<<<<<<
 * 
 *             leaves_extra = smallest - nodes
 */
        goto __pyx_L5_break;

        /* "ete4/core/tree.pyx":1595
 *                     smallest = side2
 * 
 *                 if smallest and len(smallest) == len(nodes):             # <<<<<<<<<<<<<<
 *                     break
 * 
 */
      }

      /* "ete4/core/tree.pyx":1589
 *         else:
 *             smallest = None
 *             for side1, side2 in self.edges():             # <<<<<<<<<<<<<<
 *                 if nodes.issubset(side1) and (not smallest or len(side1) < len(smallest)):
 *                     smallest = side1
 */
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L18_for_end;
    __pyx_L5_break:;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L18_for_end;
    __pyx_L18_for_end:;

    /* "ete4/core/tree.pyx":1598
 *                     break
 * 
 *             leaves_extra = smallest - nodes             # <<<<<<<<<<<<<<
 * 
 *         if not leaves_extra:  # nodes account for all leaves from common ancestor
 */
    __pyx_t_3 = PyNumber_Subtract(__pyx_v_smallest, __pyx_v_nodes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1598, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_leaves_extra = __pyx_t_3;
    __pyx_t_3 = 0;
  }
  __pyx_L3:;

  /* "ete4/core/tree.pyx":1600
 *             leaves_extra = smallest - nodes
 * 
 *         if not leaves_extra:  # nodes account for all leaves from common ancestor             # <<<<<<<<<<<<<<
 *             return True, 'monophyletic', leaves_extra
 *         elif self.is_monophyletic(leaves_extra):  # we leave out a monophyly
 */
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_leaves_extra); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1600, __pyx_L1_error)
  __pyx_t_5 = (!__pyx_t_6);
  if (__pyx_t_5) {

    /* "ete4/core/tree.pyx":1601
 * 
 *         if not leaves_extra:  # nodes account for all leaves from common ancestor
 *             return True, 'monophyletic', leaves_extra             # <<<<<<<<<<<<<<
 *         elif self.is_monophyletic(leaves_extra):  # we leave out a monophyly
 *             return False, 'paraphyletic', leaves_extra
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1601, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(Py_True);
    __Pyx_GIVEREF(Py_True);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, Py_True)) __PYX_ERR(0, 1601, __pyx_L1_error);
    __Pyx_INCREF(__pyx_n_u_monophyletic);
    __Pyx_GIVEREF(__pyx_n_u_monophyletic);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_n_u_monophyletic)) __PYX_ERR(0, 1601, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_leaves_extra);
    __Pyx_GIVEREF(__pyx_v_leaves_extra);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_leaves_extra)) __PYX_ERR(0, 1601, __pyx_L1_error);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "ete4/core/tree.pyx":1600
 *             leaves_extra = smallest - nodes
 * 
 *         if not leaves_extra:  # nodes account for all leaves from common ancestor             # <<<<<<<<<<<<<<
 *             return True, 'monophyletic', leaves_extra
 *         elif self.is_monophyletic(leaves_extra):  # we leave out a monophyly
 */
  }

  /* "ete4/core/tree.pyx":1602
 *         if not leaves_extra:  # nodes account for all leaves from common ancestor
 *             return True, 'monophyletic', leaves_extra
 *         elif self.is_monophyletic(leaves_extra):  # we leave out a monophyly             # <<<<<<<<<<<<<<
 *             return False, 'paraphyletic', leaves_extra
 *         else:  # a funny mixture
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_monophyletic); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1602, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_leaves_extra};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1602, __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, 1602, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_5) {

    /* "ete4/core/tree.pyx":1603
 *             return True, 'monophyletic', leaves_extra
 *         elif self.is_monophyletic(leaves_extra):  # we leave out a monophyly
 *             return False, 'paraphyletic', leaves_extra             # <<<<<<<<<<<<<<
 *         else:  # a funny mixture
 *             return False, 'polyphyletic', leaves_extra
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1603, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(Py_False);
    __Pyx_GIVEREF(Py_False);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, Py_False)) __PYX_ERR(0, 1603, __pyx_L1_error);
    __Pyx_INCREF(__pyx_n_u_paraphyletic);
    __Pyx_GIVEREF(__pyx_n_u_paraphyletic);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_n_u_paraphyletic)) __PYX_ERR(0, 1603, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_leaves_extra);
    __Pyx_GIVEREF(__pyx_v_leaves_extra);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_leaves_extra)) __PYX_ERR(0, 1603, __pyx_L1_error);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "ete4/core/tree.pyx":1602
 *         if not leaves_extra:  # nodes account for all leaves from common ancestor
 *             return True, 'monophyletic', leaves_extra
 *         elif self.is_monophyletic(leaves_extra):  # we leave out a monophyly             # <<<<<<<<<<<<<<
 *             return False, 'paraphyletic', leaves_extra
 *         else:  # a funny mixture
 */
  }

  /* "ete4/core/tree.pyx":1605
 *             return False, 'paraphyletic', leaves_extra
 *         else:  # a funny mixture
 *             return False, 'polyphyletic', leaves_extra             # <<<<<<<<<<<<<<
 * 
 *     def get_monophyletic(self, values, prop='name'):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1605, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(Py_False);
    __Pyx_GIVEREF(Py_False);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, Py_False)) __PYX_ERR(0, 1605, __pyx_L1_error);
    __Pyx_INCREF(__pyx_n_u_polyphyletic);
    __Pyx_GIVEREF(__pyx_n_u_polyphyletic);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_n_u_polyphyletic)) __PYX_ERR(0, 1605, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_leaves_extra);
    __Pyx_GIVEREF(__pyx_v_leaves_extra);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_leaves_extra)) __PYX_ERR(0, 1605, __pyx_L1_error);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }

  /* "ete4/core/tree.pyx":1570
 *         return all(n in nodes for n in self.common_ancestor(nodes).leaves())
 * 
 *     def check_monophyly(self, values, prop='name', unrooted=False):             # <<<<<<<<<<<<<<
 *         """Return tuple (is_monophyletic, clade_type, leaves_extra).
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("ete4.core.tree.Tree.check_monophyly", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_nodes);
  __Pyx_XDECREF(__pyx_v_leaves_from_ancestor);
  __Pyx_XDECREF(__pyx_v_leaves_extra);
  __Pyx_XDECREF(__pyx_v_smallest);
  __Pyx_XDECREF(__pyx_v_side1);
  __Pyx_XDECREF(__pyx_v_side2);
  __Pyx_XDECREF(__pyx_gb_4ete4_4core_4tree_4Tree_15check_monophyly_2generator35);
  __Pyx_XDECREF(__pyx_gb_4ete4_4core_4tree_4Tree_15check_monophyly_5generator36);
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_4ete4_4core_4tree_4Tree_154generator12(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "ete4/core/tree.pyx":1607
 *             return False, 'polyphyletic', leaves_extra
 * 
 *     def get_monophyletic(self, values, prop='name'):             # <<<<<<<<<<<<<<
 *         """Yield nodes matching the provided monophyly criteria.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_153get_monophyletic(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_4ete4_4core_4tree_4Tree_152get_monophyletic, "Tree.get_monophyletic(self, values, prop=u'name')\nYield nodes matching the provided monophyly criteria.\n\n        For a node to be considered a match, all ``prop`` values within\n        the node, and exclusively them, should be grouped.\n\n        :param values: List of values of the selected nodes.\n        :param prop: Property being used to check monophyly (for example\n            'species' for species trees, 'name' for gene family trees).\n        ");
static PyMethodDef __pyx_mdef_4ete4_4core_4tree_4Tree_153get_monophyletic = {"get_monophyletic", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_153get_monophyletic, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_152get_monophyletic};
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_153get_monophyletic(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_values = 0;
  PyObject *__pyx_v_prop = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_monophyletic (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_prop,0};
    values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_n_u_name));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_values)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1607, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_prop);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1607, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_monophyletic") < 0)) __PYX_ERR(0, 1607, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_values = values[0];
    __pyx_v_prop = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_monophyletic", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 1607, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("ete4.core.tree.Tree.get_monophyletic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_152get_monophyletic(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self), __pyx_v_values, __pyx_v_prop);

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

/* "ete4/core/tree.pyx":1621
 *         n2values = self.get_cached_content(prop)
 * 
 *         is_monophyletic = lambda node: n2values[node] == values             # <<<<<<<<<<<<<<
 * 
 *         yield from self.leaves(is_leaf_fn=is_monophyletic)
 */

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

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

static PyObject *__pyx_lambda_funcdef_lambda27(PyObject *__pyx_self, PyObject *__pyx_v_node) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_48_get_monophyletic *__pyx_cur_scope;
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_48_get_monophyletic *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("lambda27", 1);
  __pyx_outer_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_48_get_monophyletic *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_n2values)) { __Pyx_RaiseClosureNameError("n2values"); __PYX_ERR(0, 1621, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_cur_scope->__pyx_v_n2values, __pyx_v_node); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1621, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(!__pyx_cur_scope->__pyx_v_values)) { __Pyx_RaiseClosureNameError("values"); __PYX_ERR(0, 1621, __pyx_L1_error) }
  __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_cur_scope->__pyx_v_values, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1621, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("ete4.core.tree.Tree.get_monophyletic.lambda27", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ete4/core/tree.pyx":1607
 *             return False, 'polyphyletic', leaves_extra
 * 
 *     def get_monophyletic(self, values, prop='name'):             # <<<<<<<<<<<<<<
 *         """Yield nodes matching the provided monophyly criteria.
 * 
 */

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_152get_monophyletic(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_values, PyObject *__pyx_v_prop) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_48_get_monophyletic *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_monophyletic", 0);
  __pyx_cur_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_48_get_monophyletic *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_48_get_monophyletic(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_48_get_monophyletic, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_48_get_monophyletic *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1607, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __pyx_cur_scope->__pyx_v_values = __pyx_v_values;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_values);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_values);
  __pyx_cur_scope->__pyx_v_prop = __pyx_v_prop;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_prop);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_prop);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4ete4_4core_4tree_4Tree_154generator12, __pyx_codeobj__37, (PyObject *) __pyx_cur_scope, __pyx_n_s_get_monophyletic, __pyx_n_s_Tree_get_monophyletic, __pyx_n_s_ete4_core_tree); if (unlikely(!gen)) __PYX_ERR(0, 1607, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("ete4.core.tree.Tree.get_monophyletic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_4ete4_4core_4tree_4Tree_154generator12(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_48_get_monophyletic *__pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_48_get_monophyletic *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_monophyletic", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L4_resume_from_yield_from;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1607, __pyx_L1_error)

  /* "ete4/core/tree.pyx":1617
 *             'species' for species trees, 'name' for gene family trees).
 *         """
 *         values = set(values)  # in case it is not a set             # <<<<<<<<<<<<<<
 * 
 *         n2values = self.get_cached_content(prop)
 */
  __pyx_t_1 = PySet_New(__pyx_cur_scope->__pyx_v_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_values);
  __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_values, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "ete4/core/tree.pyx":1619
 *         values = set(values)  # in case it is not a set
 * 
 *         n2values = self.get_cached_content(prop)             # <<<<<<<<<<<<<<
 * 
 *         is_monophyletic = lambda node: n2values[node] == values
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_get_cached_content); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1619, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_cur_scope->__pyx_v_prop};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1619, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_n2values = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "ete4/core/tree.pyx":1621
 *         n2values = self.get_cached_content(prop)
 * 
 *         is_monophyletic = lambda node: n2values[node] == values             # <<<<<<<<<<<<<<
 * 
 *         yield from self.leaves(is_leaf_fn=is_monophyletic)
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_16get_monophyletic_lambda27, 0, __pyx_n_s_get_monophyletic_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_ete4_core_tree, __pyx_d, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1621, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_is_monophyletic = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "ete4/core/tree.pyx":1623
 *         is_monophyletic = lambda node: n2values[node] == values
 * 
 *         yield from self.leaves(is_leaf_fn=is_monophyletic)             # <<<<<<<<<<<<<<
 * 
 *     def expand_polytomies(self, map_prop="name", polytomy_size_limit=5,
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_leaves); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1623, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1623, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_is_leaf_fn, __pyx_cur_scope->__pyx_v_is_monophyletic) < 0) __PYX_ERR(0, 1623, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1623, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __Pyx_Generator_Yield_From(__pyx_generator, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_XGOTREF(__pyx_r);
  if (likely(__pyx_r)) {
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L4_resume_from_yield_from:;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1623, __pyx_L1_error)
  } else {
    PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType();
    if (exc_type) {
      if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear();
      else __PYX_ERR(0, 1623, __pyx_L1_error)
    }
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "ete4/core/tree.pyx":1607
 *             return False, 'polyphyletic', leaves_extra
 * 
 *     def get_monophyletic(self, values, prop='name'):             # <<<<<<<<<<<<<<
 *         """Yield nodes matching the provided monophyly criteria.
 * 
 */

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

/* "ete4/core/tree.pyx":1625
 *         yield from self.leaves(is_leaf_fn=is_monophyletic)
 * 
 *     def expand_polytomies(self, map_prop="name", polytomy_size_limit=5,             # <<<<<<<<<<<<<<
 *                           skip_large_polytomies=False):
 *         """Return all combinations of solutions of the multifurcated nodes.
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_156expand_polytomies(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_4ete4_4core_4tree_4Tree_155expand_polytomies, "Tree.expand_polytomies(self, map_prop=u'name', polytomy_size_limit=5, skip_large_polytomies=False)\nReturn all combinations of solutions of the multifurcated nodes.\n\n        If the tree has one or more polytomies, this functions returns\n        the list of all trees (in newick format) resulting from the\n        combination of all possible solutions of the multifurcated\n        nodes.\n\n        .. warning::\n           The number of possible binary trees grows exponentially\n           with the number and size of polytomies. Using this function\n           with large multifurcations is not recommended.\n\n           polytomy size:          3,  4,   5,   6,     7,      8,       9\n           number of binary trees: 3, 15, 105, 945, 10395, 135135, 2027025\n\n        See https://ajmonline.org/2010/darwin.php\n        ");
static PyMethodDef __pyx_mdef_4ete4_4core_4tree_4Tree_156expand_polytomies = {"expand_polytomies", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_156expand_polytomies, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_155expand_polytomies};
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_156expand_polytomies(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_map_prop = 0;
  PyObject *__pyx_v_polytomy_size_limit = 0;
  PyObject *__pyx_v_skip_large_polytomies = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("expand_polytomies (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_map_prop,&__pyx_n_s_polytomy_size_limit,&__pyx_n_s_skip_large_polytomies,0};
    values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_n_u_name));
    values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_5));

    /* "ete4/core/tree.pyx":1626
 * 
 *     def expand_polytomies(self, map_prop="name", polytomy_size_limit=5,
 *                           skip_large_polytomies=False):             # <<<<<<<<<<<<<<
 *         """Return all combinations of solutions of the multifurcated nodes.
 * 
 */
    values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_False));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_map_prop);
          if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1625, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_polytomy_size_limit);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1625, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_skip_large_polytomies);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1625, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "expand_polytomies") < 0)) __PYX_ERR(0, 1625, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_map_prop = values[0];
    __pyx_v_polytomy_size_limit = values[1];
    __pyx_v_skip_large_polytomies = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("expand_polytomies", 0, 0, 3, __pyx_nargs); __PYX_ERR(0, 1625, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("ete4.core.tree.Tree.expand_polytomies", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_155expand_polytomies(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self), __pyx_v_map_prop, __pyx_v_polytomy_size_limit, __pyx_v_skip_large_polytomies);

  /* "ete4/core/tree.pyx":1625
 *         yield from self.leaves(is_leaf_fn=is_monophyletic)
 * 
 *     def expand_polytomies(self, map_prop="name", polytomy_size_limit=5,             # <<<<<<<<<<<<<<
 *                           skip_large_polytomies=False):
 *         """Return all combinations of solutions of the multifurcated nodes.
 */

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

/* "ete4/core/tree.pyx":1648
 *             pass
 * 
 *         def add_leaf(tree, label):             # <<<<<<<<<<<<<<
 *           yield (label, tree)
 *           if not isinstance(tree, TipTuple) and isinstance(tree, tuple):
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_17expand_polytomies_1add_leaf(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_4ete4_4core_4tree_4Tree_17expand_polytomies_1add_leaf = {"add_leaf", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_17expand_polytomies_1add_leaf, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_17expand_polytomies_1add_leaf(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_tree = 0;
  PyObject *__pyx_v_label = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add_leaf (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tree,&__pyx_n_s_label,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_tree)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1648, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_label)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1648, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("add_leaf", 1, 2, 2, 1); __PYX_ERR(0, 1648, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "add_leaf") < 0)) __PYX_ERR(0, 1648, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_tree = values[0];
    __pyx_v_label = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("add_leaf", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1648, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("ete4.core.tree.Tree.expand_polytomies.add_leaf", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_17expand_polytomies_add_leaf(__pyx_self, __pyx_v_tree, __pyx_v_label);

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

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_17expand_polytomies_add_leaf(PyObject *__pyx_self, PyObject *__pyx_v_tree, PyObject *__pyx_v_label) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_50_add_leaf *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("add_leaf", 0);
  __pyx_cur_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_50_add_leaf *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_50_add_leaf(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_50_add_leaf, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_50_add_leaf *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1648, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_49_expand_polytomies *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope);
  __pyx_cur_scope->__pyx_v_tree = __pyx_v_tree;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_tree);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_tree);
  __pyx_cur_scope->__pyx_v_label = __pyx_v_label;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_label);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_label);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4ete4_4core_4tree_4Tree_17expand_polytomies_2generator37, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_add_leaf, __pyx_n_s_expand_polytomies_locals_add_lea, __pyx_n_s_ete4_core_tree); if (unlikely(!gen)) __PYX_ERR(0, 1648, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("ete4.core.tree.Tree.expand_polytomies.add_leaf", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_4ete4_4core_4tree_4Tree_17expand_polytomies_2generator37(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_50_add_leaf *__pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_50_add_leaf *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add_leaf", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L4_resume_from_yield;
    case 2: goto __pyx_L10_resume_from_yield;
    case 3: goto __pyx_L14_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1648, __pyx_L1_error)

  /* "ete4/core/tree.pyx":1649
 * 
 *         def add_leaf(tree, label):
 *           yield (label, tree)             # <<<<<<<<<<<<<<
 *           if not isinstance(tree, TipTuple) and isinstance(tree, tuple):
 *             for left in add_leaf(tree[0], label):
 */
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1649, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_label);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_label);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_cur_scope->__pyx_v_label)) __PYX_ERR(0, 1649, __pyx_L1_error);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_tree);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_tree);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_cur_scope->__pyx_v_tree)) __PYX_ERR(0, 1649, __pyx_L1_error);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  /* return from generator, yielding value */
  __pyx_generator->resume_label = 1;
  return __pyx_r;
  __pyx_L4_resume_from_yield:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1649, __pyx_L1_error)

  /* "ete4/core/tree.pyx":1650
 *         def add_leaf(tree, label):
 *           yield (label, tree)
 *           if not isinstance(tree, TipTuple) and isinstance(tree, tuple):             # <<<<<<<<<<<<<<
 *             for left in add_leaf(tree[0], label):
 *               yield (left, tree[1])
 */
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_TipTuple)) { __Pyx_RaiseClosureNameError("TipTuple"); __PYX_ERR(0, 1650, __pyx_L1_error) }
  __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_TipTuple;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_3 = PyObject_IsInstance(__pyx_cur_scope->__pyx_v_tree, __pyx_t_1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 1650, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = (!__pyx_t_3);
  if (__pyx_t_4) {
  } else {
    __pyx_t_2 = __pyx_t_4;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_4 = PyTuple_Check(__pyx_cur_scope->__pyx_v_tree); 
  __pyx_t_2 = __pyx_t_4;
  __pyx_L6_bool_binop_done:;
  if (__pyx_t_2) {

    /* "ete4/core/tree.pyx":1651
 *           yield (label, tree)
 *           if not isinstance(tree, TipTuple) and isinstance(tree, tuple):
 *             for left in add_leaf(tree[0], label):             # <<<<<<<<<<<<<<
 *               yield (left, tree[1])
 *             for right in add_leaf(tree[1], label):
 */
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_tree, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1651, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_add_leaf)) { __Pyx_RaiseClosureNameError("add_leaf"); __PYX_ERR(0, 1651, __pyx_L1_error) }
    __pyx_t_5 = __pyx_pf_4ete4_4core_4tree_4Tree_17expand_polytomies_add_leaf(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_add_leaf, __pyx_t_1, __pyx_cur_scope->__pyx_v_label); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1651, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
      __pyx_t_1 = __pyx_t_5; __Pyx_INCREF(__pyx_t_1);
      __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1651, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1651, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    for (;;) {
      if (likely(!__pyx_t_7)) {
        if (likely(PyList_CheckExact(__pyx_t_1))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1651, __pyx_L1_error)
            #endif
            if (__pyx_t_6 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 1651, __pyx_L1_error)
          #else
          __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1651, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          #endif
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1651, __pyx_L1_error)
            #endif
            if (__pyx_t_6 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 1651, __pyx_L1_error)
          #else
          __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1651, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          #endif
        }
      } else {
        __pyx_t_5 = __pyx_t_7(__pyx_t_1);
        if (unlikely(!__pyx_t_5)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 1651, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_5);
      }
      __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_left);
      __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_left, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      __pyx_t_5 = 0;

      /* "ete4/core/tree.pyx":1652
 *           if not isinstance(tree, TipTuple) and isinstance(tree, tuple):
 *             for left in add_leaf(tree[0], label):
 *               yield (left, tree[1])             # <<<<<<<<<<<<<<
 *             for right in add_leaf(tree[1], label):
 *               yield (tree[0], right)
 */
      __pyx_t_5 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_tree, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1652, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1652, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_left);
      __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_left);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_cur_scope->__pyx_v_left)) __PYX_ERR(0, 1652, __pyx_L1_error);
      __Pyx_GIVEREF(__pyx_t_5);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_5)) __PYX_ERR(0, 1652, __pyx_L1_error);
      __pyx_t_5 = 0;
      __pyx_r = __pyx_t_8;
      __pyx_t_8 = 0;
      __Pyx_XGIVEREF(__pyx_t_1);
      __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
      __pyx_cur_scope->__pyx_t_1 = __pyx_t_6;
      __pyx_cur_scope->__pyx_t_2 = __pyx_t_7;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
      /* return from generator, yielding value */
      __pyx_generator->resume_label = 2;
      return __pyx_r;
      __pyx_L10_resume_from_yield:;
      __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
      __pyx_cur_scope->__pyx_t_0 = 0;
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_6 = __pyx_cur_scope->__pyx_t_1;
      __pyx_t_7 = __pyx_cur_scope->__pyx_t_2;
      if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1652, __pyx_L1_error)

      /* "ete4/core/tree.pyx":1651
 *           yield (label, tree)
 *           if not isinstance(tree, TipTuple) and isinstance(tree, tuple):
 *             for left in add_leaf(tree[0], label):             # <<<<<<<<<<<<<<
 *               yield (left, tree[1])
 *             for right in add_leaf(tree[1], label):
 */
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "ete4/core/tree.pyx":1653
 *             for left in add_leaf(tree[0], label):
 *               yield (left, tree[1])
 *             for right in add_leaf(tree[1], label):             # <<<<<<<<<<<<<<
 *               yield (tree[0], right)
 * 
 */
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_tree, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1653, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_add_leaf)) { __Pyx_RaiseClosureNameError("add_leaf"); __PYX_ERR(0, 1653, __pyx_L1_error) }
    __pyx_t_8 = __pyx_pf_4ete4_4core_4tree_4Tree_17expand_polytomies_add_leaf(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_add_leaf, __pyx_t_1, __pyx_cur_scope->__pyx_v_label); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1653, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) {
      __pyx_t_1 = __pyx_t_8; __Pyx_INCREF(__pyx_t_1);
      __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1653, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1653, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    for (;;) {
      if (likely(!__pyx_t_7)) {
        if (likely(PyList_CheckExact(__pyx_t_1))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1653, __pyx_L1_error)
            #endif
            if (__pyx_t_6 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_8 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 1653, __pyx_L1_error)
          #else
          __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1653, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          #endif
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1653, __pyx_L1_error)
            #endif
            if (__pyx_t_6 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 1653, __pyx_L1_error)
          #else
          __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1653, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          #endif
        }
      } else {
        __pyx_t_8 = __pyx_t_7(__pyx_t_1);
        if (unlikely(!__pyx_t_8)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 1653, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_8);
      }
      __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_right);
      __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_right, __pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_8);
      __pyx_t_8 = 0;

      /* "ete4/core/tree.pyx":1654
 *               yield (left, tree[1])
 *             for right in add_leaf(tree[1], label):
 *               yield (tree[0], right)             # <<<<<<<<<<<<<<
 * 
 *         def enum_unordered(labels):
 */
      __pyx_t_8 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_tree, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1654, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1654, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_8);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_8)) __PYX_ERR(0, 1654, __pyx_L1_error);
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_right);
      __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_right);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_cur_scope->__pyx_v_right)) __PYX_ERR(0, 1654, __pyx_L1_error);
      __pyx_t_8 = 0;
      __pyx_r = __pyx_t_5;
      __pyx_t_5 = 0;
      __Pyx_XGIVEREF(__pyx_t_1);
      __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
      __pyx_cur_scope->__pyx_t_1 = __pyx_t_6;
      __pyx_cur_scope->__pyx_t_2 = __pyx_t_7;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
      /* return from generator, yielding value */
      __pyx_generator->resume_label = 3;
      return __pyx_r;
      __pyx_L14_resume_from_yield:;
      __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
      __pyx_cur_scope->__pyx_t_0 = 0;
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_6 = __pyx_cur_scope->__pyx_t_1;
      __pyx_t_7 = __pyx_cur_scope->__pyx_t_2;
      if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1654, __pyx_L1_error)

      /* "ete4/core/tree.pyx":1653
 *             for left in add_leaf(tree[0], label):
 *               yield (left, tree[1])
 *             for right in add_leaf(tree[1], label):             # <<<<<<<<<<<<<<
 *               yield (tree[0], right)
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "ete4/core/tree.pyx":1650
 *         def add_leaf(tree, label):
 *           yield (label, tree)
 *           if not isinstance(tree, TipTuple) and isinstance(tree, tuple):             # <<<<<<<<<<<<<<
 *             for left in add_leaf(tree[0], label):
 *               yield (left, tree[1])
 */
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "ete4/core/tree.pyx":1648
 *             pass
 * 
 *         def add_leaf(tree, label):             # <<<<<<<<<<<<<<
 *           yield (label, tree)
 *           if not isinstance(tree, TipTuple) and isinstance(tree, tuple):
 */

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

/* "ete4/core/tree.pyx":1656
 *               yield (tree[0], right)
 * 
 *         def enum_unordered(labels):             # <<<<<<<<<<<<<<
 *           if len(labels) == 1:
 *             yield labels[0]
 */

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

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

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_17expand_polytomies_3enum_unordered(PyObject *__pyx_self, PyObject *__pyx_v_labels) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_51_enum_unordered *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("enum_unordered", 0);
  __pyx_cur_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_51_enum_unordered *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_51_enum_unordered(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_51_enum_unordered, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_51_enum_unordered *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1656, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_49_expand_polytomies *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope);
  __pyx_cur_scope->__pyx_v_labels = __pyx_v_labels;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_labels);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_labels);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4ete4_4core_4tree_4Tree_17expand_polytomies_5generator38, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_enum_unordered, __pyx_n_s_expand_polytomies_locals_enum_un, __pyx_n_s_ete4_core_tree); if (unlikely(!gen)) __PYX_ERR(0, 1656, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("ete4.core.tree.Tree.expand_polytomies.enum_unordered", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_4ete4_4core_4tree_4Tree_17expand_polytomies_5generator38(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_51_enum_unordered *__pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_51_enum_unordered *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("enum_unordered", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L5_resume_from_yield;
    case 2: goto __pyx_L10_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1656, __pyx_L1_error)

  /* "ete4/core/tree.pyx":1657
 * 
 *         def enum_unordered(labels):
 *           if len(labels) == 1:             # <<<<<<<<<<<<<<
 *             yield labels[0]
 *           else:
 */
  __pyx_t_1 = PyObject_Length(__pyx_cur_scope->__pyx_v_labels); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1657, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_1 == 1);
  if (__pyx_t_2) {

    /* "ete4/core/tree.pyx":1658
 *         def enum_unordered(labels):
 *           if len(labels) == 1:
 *             yield labels[0]             # <<<<<<<<<<<<<<
 *           else:
 *             for tree in enum_unordered(labels[1:]):
 */
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_labels, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1658, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L5_resume_from_yield:;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1658, __pyx_L1_error)

    /* "ete4/core/tree.pyx":1657
 * 
 *         def enum_unordered(labels):
 *           if len(labels) == 1:             # <<<<<<<<<<<<<<
 *             yield labels[0]
 *           else:
 */
    goto __pyx_L4;
  }

  /* "ete4/core/tree.pyx":1660
 *             yield labels[0]
 *           else:
 *             for tree in enum_unordered(labels[1:]):             # <<<<<<<<<<<<<<
 *               for new_tree in add_leaf(tree, labels[0]):
 *                 yield new_tree
 */
  /*else*/ {
    __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_v_labels, 1, 0, NULL, NULL, &__pyx_slice__38, 1, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1660, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_enum_unordered)) { __Pyx_RaiseClosureNameError("enum_unordered"); __PYX_ERR(0, 1660, __pyx_L1_error) }
    __pyx_t_4 = __pyx_pf_4ete4_4core_4tree_4Tree_17expand_polytomies_3enum_unordered(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_enum_unordered, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1660, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
      __pyx_t_3 = __pyx_t_4; __Pyx_INCREF(__pyx_t_3);
      __pyx_t_1 = 0;
      __pyx_t_5 = NULL;
    } else {
      __pyx_t_1 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1660, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1660, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    for (;;) {
      if (likely(!__pyx_t_5)) {
        if (likely(PyList_CheckExact(__pyx_t_3))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1660, __pyx_L1_error)
            #endif
            if (__pyx_t_1 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_4); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(0, 1660, __pyx_L1_error)
          #else
          __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1660, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          #endif
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1660, __pyx_L1_error)
            #endif
            if (__pyx_t_1 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_4); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(0, 1660, __pyx_L1_error)
          #else
          __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1660, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          #endif
        }
      } else {
        __pyx_t_4 = __pyx_t_5(__pyx_t_3);
        if (unlikely(!__pyx_t_4)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 1660, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_4);
      }
      __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_tree);
      __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_tree, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      __pyx_t_4 = 0;

      /* "ete4/core/tree.pyx":1661
 *           else:
 *             for tree in enum_unordered(labels[1:]):
 *               for new_tree in add_leaf(tree, labels[0]):             # <<<<<<<<<<<<<<
 *                 yield new_tree
 * 
 */
      __pyx_t_4 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_labels, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1661, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_add_leaf)) { __Pyx_RaiseClosureNameError("add_leaf"); __PYX_ERR(0, 1661, __pyx_L1_error) }
      __pyx_t_6 = __pyx_pf_4ete4_4core_4tree_4Tree_17expand_polytomies_add_leaf(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_add_leaf, __pyx_cur_scope->__pyx_v_tree, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1661, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) {
        __pyx_t_4 = __pyx_t_6; __Pyx_INCREF(__pyx_t_4);
        __pyx_t_7 = 0;
        __pyx_t_8 = NULL;
      } else {
        __pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1661, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1661, __pyx_L1_error)
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      for (;;) {
        if (likely(!__pyx_t_8)) {
          if (likely(PyList_CheckExact(__pyx_t_4))) {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4);
              #if !CYTHON_ASSUME_SAFE_MACROS
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1661, __pyx_L1_error)
              #endif
              if (__pyx_t_7 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_6 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_6); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 1661, __pyx_L1_error)
            #else
            __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1661, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_6);
            #endif
          } else {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4);
              #if !CYTHON_ASSUME_SAFE_MACROS
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1661, __pyx_L1_error)
              #endif
              if (__pyx_t_7 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_6); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 1661, __pyx_L1_error)
            #else
            __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1661, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_6);
            #endif
          }
        } else {
          __pyx_t_6 = __pyx_t_8(__pyx_t_4);
          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, 1661, __pyx_L1_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_6);
        }
        __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_new_tree);
        __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_new_tree, __pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_6);
        __pyx_t_6 = 0;

        /* "ete4/core/tree.pyx":1662
 *             for tree in enum_unordered(labels[1:]):
 *               for new_tree in add_leaf(tree, labels[0]):
 *                 yield new_tree             # <<<<<<<<<<<<<<
 * 
 *         n2subtrees = {}
 */
        __Pyx_INCREF(__pyx_cur_scope->__pyx_v_new_tree);
        __pyx_r = __pyx_cur_scope->__pyx_v_new_tree;
        __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
        __Pyx_XGIVEREF(__pyx_t_3);
        __pyx_cur_scope->__pyx_t_1 = __pyx_t_3;
        __Pyx_XGIVEREF(__pyx_t_4);
        __pyx_cur_scope->__pyx_t_2 = __pyx_t_4;
        __pyx_cur_scope->__pyx_t_3 = __pyx_t_5;
        __pyx_cur_scope->__pyx_t_4 = __pyx_t_7;
        __pyx_cur_scope->__pyx_t_5 = __pyx_t_8;
        __Pyx_XGIVEREF(__pyx_r);
        __Pyx_RefNannyFinishContext();
        __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
        /* return from generator, yielding value */
        __pyx_generator->resume_label = 2;
        return __pyx_r;
        __pyx_L10_resume_from_yield:;
        __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
        __pyx_t_3 = __pyx_cur_scope->__pyx_t_1;
        __pyx_cur_scope->__pyx_t_1 = 0;
        __Pyx_XGOTREF(__pyx_t_3);
        __pyx_t_4 = __pyx_cur_scope->__pyx_t_2;
        __pyx_cur_scope->__pyx_t_2 = 0;
        __Pyx_XGOTREF(__pyx_t_4);
        __pyx_t_5 = __pyx_cur_scope->__pyx_t_3;
        __pyx_t_7 = __pyx_cur_scope->__pyx_t_4;
        __pyx_t_8 = __pyx_cur_scope->__pyx_t_5;
        if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1662, __pyx_L1_error)

        /* "ete4/core/tree.pyx":1661
 *           else:
 *             for tree in enum_unordered(labels[1:]):
 *               for new_tree in add_leaf(tree, labels[0]):             # <<<<<<<<<<<<<<
 *                 yield new_tree
 * 
 */
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ete4/core/tree.pyx":1660
 *             yield labels[0]
 *           else:
 *             for tree in enum_unordered(labels[1:]):             # <<<<<<<<<<<<<<
 *               for new_tree in add_leaf(tree, labels[0]):
 *                 yield new_tree
 */
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_L4:;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "ete4/core/tree.pyx":1656
 *               yield (tree[0], right)
 * 
 *         def enum_unordered(labels):             # <<<<<<<<<<<<<<
 *           if len(labels) == 1:
 *             yield labels[0]
 */

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

/* "ete4/core/tree.pyx":1625
 *         yield from self.leaves(is_leaf_fn=is_monophyletic)
 * 
 *     def expand_polytomies(self, map_prop="name", polytomy_size_limit=5,             # <<<<<<<<<<<<<<
 *                           skip_large_polytomies=False):
 *         """Return all combinations of solutions of the multifurcated nodes.
 */

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_155expand_polytomies(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_map_prop, PyObject *__pyx_v_polytomy_size_limit, PyObject *__pyx_v_skip_large_polytomies) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_49_expand_polytomies *__pyx_cur_scope;
  PyObject *__pyx_gb_4ete4_4core_4tree_4Tree_17expand_polytomies_2generator37 = 0;
  PyObject *__pyx_gb_4ete4_4core_4tree_4Tree_17expand_polytomies_5generator38 = 0;
  PyObject *__pyx_v_n2subtrees = NULL;
  PyObject *__pyx_v_n = NULL;
  PyObject *__pyx_v_subtrees = NULL;
  PyObject *__pyx_v_childtrees = NULL;
  PyObject *__pyx_9genexpr50__pyx_v_ch = NULL;
  PyObject *__pyx_9genexpr51__pyx_v_ch = NULL;
  PyObject *__pyx_9genexpr52__pyx_v_subtree = NULL;
  PyObject *__pyx_9genexpr53__pyx_v_nw = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  unsigned int __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  int __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *(*__pyx_t_11)(PyObject *);
  int __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  PyObject *(*__pyx_t_14)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("expand_polytomies", 0);
  __pyx_cur_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_49_expand_polytomies *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_49_expand_polytomies(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_49_expand_polytomies, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_49_expand_polytomies *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1625, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }

  /* "ete4/core/tree.pyx":1645
 *         """
 * 
 *         class TipTuple(tuple):             # <<<<<<<<<<<<<<
 *             pass
 * 
 */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1645, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF((PyObject *)(&PyTuple_Type));
  __Pyx_GIVEREF((PyObject *)(&PyTuple_Type));
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)(&PyTuple_Type)))) __PYX_ERR(0, 1645, __pyx_L1_error);
  __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1645, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1645, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_t_2, __pyx_n_s_TipTuple, __pyx_n_s_expand_polytomies_locals_TipTupl, (PyObject *) NULL, __pyx_n_s_ete4_core_tree, (PyObject *) NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1645, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__pyx_t_2 != __pyx_t_1) {
    if (unlikely((PyDict_SetItemString(__pyx_t_4, "__orig_bases__", __pyx_t_1) < 0))) __PYX_ERR(0, 1645, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_TipTuple, __pyx_t_2, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1645, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_TipTuple = __pyx_t_1;
  __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ete4/core/tree.pyx":1648
 *             pass
 * 
 *         def add_leaf(tree, label):             # <<<<<<<<<<<<<<
 *           yield (label, tree)
 *           if not isinstance(tree, TipTuple) and isinstance(tree, tuple):
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_17expand_polytomies_1add_leaf, 0, __pyx_n_s_expand_polytomies_locals_add_lea, ((PyObject*)__pyx_cur_scope), __pyx_n_s_ete4_core_tree, __pyx_d, ((PyObject *)__pyx_codeobj__40)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1648, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_cur_scope->__pyx_v_add_leaf = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "ete4/core/tree.pyx":1656
 *               yield (tree[0], right)
 * 
 *         def enum_unordered(labels):             # <<<<<<<<<<<<<<
 *           if len(labels) == 1:
 *             yield labels[0]
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_17expand_polytomies_4enum_unordered, 0, __pyx_n_s_expand_polytomies_locals_enum_un, ((PyObject*)__pyx_cur_scope), __pyx_n_s_ete4_core_tree, __pyx_d, ((PyObject *)__pyx_codeobj__42)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1656, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_cur_scope->__pyx_v_enum_unordered = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "ete4/core/tree.pyx":1664
 *                 yield new_tree
 * 
 *         n2subtrees = {}             # <<<<<<<<<<<<<<
 *         for n in self.traverse("postorder"):
 *             if n.is_leaf:
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1664, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_n2subtrees = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "ete4/core/tree.pyx":1665
 * 
 *         n2subtrees = {}
 *         for n in self.traverse("postorder"):             # <<<<<<<<<<<<<<
 *             if n.is_leaf:
 *                 subtrees = [n.props.get(map_prop)]
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_traverse); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1665, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_n_u_postorder};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1665, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3);
    __pyx_t_6 = 0;
    __pyx_t_7 = NULL;
  } else {
    __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1665, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1665, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_7)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1665, __pyx_L1_error)
          #endif
          if (__pyx_t_6 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 1665, __pyx_L1_error)
        #else
        __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1665, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1665, __pyx_L1_error)
          #endif
          if (__pyx_t_6 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 1665, __pyx_L1_error)
        #else
        __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1665, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_7(__pyx_t_3);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1665, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "ete4/core/tree.pyx":1666
 *         n2subtrees = {}
 *         for n in self.traverse("postorder"):
 *             if n.is_leaf:             # <<<<<<<<<<<<<<
 *                 subtrees = [n.props.get(map_prop)]
 *             else:
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_n, __pyx_n_s_is_leaf); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1666, __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, 1666, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_8) {

      /* "ete4/core/tree.pyx":1667
 *         for n in self.traverse("postorder"):
 *             if n.is_leaf:
 *                 subtrees = [n.props.get(map_prop)]             # <<<<<<<<<<<<<<
 *             else:
 *                 subtrees = []
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_n, __pyx_n_s_props); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1667, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_get); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1667, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
          __pyx_t_5 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_map_prop};
        __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1667, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
      __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1667, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_2);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_2)) __PYX_ERR(0, 1667, __pyx_L1_error);
      __pyx_t_2 = 0;
      __Pyx_XDECREF_SET(__pyx_v_subtrees, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "ete4/core/tree.pyx":1666
 *         n2subtrees = {}
 *         for n in self.traverse("postorder"):
 *             if n.is_leaf:             # <<<<<<<<<<<<<<
 *                 subtrees = [n.props.get(map_prop)]
 *             else:
 */
      goto __pyx_L5;
    }

    /* "ete4/core/tree.pyx":1669
 *                 subtrees = [n.props.get(map_prop)]
 *             else:
 *                 subtrees = []             # <<<<<<<<<<<<<<
 *                 if len(n.children) > polytomy_size_limit:
 *                     if skip_large_polytomies:
 */
    /*else*/ {
      __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1669, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_XDECREF_SET(__pyx_v_subtrees, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "ete4/core/tree.pyx":1670
 *             else:
 *                 subtrees = []
 *                 if len(n.children) > polytomy_size_limit:             # <<<<<<<<<<<<<<
 *                     if skip_large_polytomies:
 *                         for childtrees in itertools.product(*[n2subtrees[ch] for ch in n.children]):
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_n, __pyx_n_s_children); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1670, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_9 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1670, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1670, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_v_polytomy_size_limit, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1670, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1670, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (__pyx_t_8) {

        /* "ete4/core/tree.pyx":1671
 *                 subtrees = []
 *                 if len(n.children) > polytomy_size_limit:
 *                     if skip_large_polytomies:             # <<<<<<<<<<<<<<
 *                         for childtrees in itertools.product(*[n2subtrees[ch] for ch in n.children]):
 *                             subtrees.append(TipTuple(childtrees))
 */
        __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_skip_large_polytomies); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1671, __pyx_L1_error)
        if (likely(__pyx_t_8)) {

          /* "ete4/core/tree.pyx":1672
 *                 if len(n.children) > polytomy_size_limit:
 *                     if skip_large_polytomies:
 *                         for childtrees in itertools.product(*[n2subtrees[ch] for ch in n.children]):             # <<<<<<<<<<<<<<
 *                             subtrees.append(TipTuple(childtrees))
 *                     else:
 */
          __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_itertools); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1672, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_product); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1672, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          { /* enter inner scope */
            __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1672, __pyx_L12_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_n, __pyx_n_s_children); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1672, __pyx_L12_error)
            __Pyx_GOTREF(__pyx_t_4);
            if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
              __pyx_t_10 = __pyx_t_4; __Pyx_INCREF(__pyx_t_10);
              __pyx_t_9 = 0;
              __pyx_t_11 = NULL;
            } else {
              __pyx_t_9 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1672, __pyx_L12_error)
              __Pyx_GOTREF(__pyx_t_10);
              __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1672, __pyx_L12_error)
            }
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            for (;;) {
              if (likely(!__pyx_t_11)) {
                if (likely(PyList_CheckExact(__pyx_t_10))) {
                  {
                    Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_10);
                    #if !CYTHON_ASSUME_SAFE_MACROS
                    if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1672, __pyx_L12_error)
                    #endif
                    if (__pyx_t_9 >= __pyx_temp) break;
                  }
                  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                  __pyx_t_4 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_9); __Pyx_INCREF(__pyx_t_4); __pyx_t_9++; if (unlikely((0 < 0))) __PYX_ERR(0, 1672, __pyx_L12_error)
                  #else
                  __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_10, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1672, __pyx_L12_error)
                  __Pyx_GOTREF(__pyx_t_4);
                  #endif
                } else {
                  {
                    Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_10);
                    #if !CYTHON_ASSUME_SAFE_MACROS
                    if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1672, __pyx_L12_error)
                    #endif
                    if (__pyx_t_9 >= __pyx_temp) break;
                  }
                  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                  __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_9); __Pyx_INCREF(__pyx_t_4); __pyx_t_9++; if (unlikely((0 < 0))) __PYX_ERR(0, 1672, __pyx_L12_error)
                  #else
                  __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_10, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1672, __pyx_L12_error)
                  __Pyx_GOTREF(__pyx_t_4);
                  #endif
                }
              } else {
                __pyx_t_4 = __pyx_t_11(__pyx_t_10);
                if (unlikely(!__pyx_t_4)) {
                  PyObject* exc_type = PyErr_Occurred();
                  if (exc_type) {
                    if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                    else __PYX_ERR(0, 1672, __pyx_L12_error)
                  }
                  break;
                }
                __Pyx_GOTREF(__pyx_t_4);
              }
              __Pyx_XDECREF_SET(__pyx_9genexpr50__pyx_v_ch, __pyx_t_4);
              __pyx_t_4 = 0;
              __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_n2subtrees, __pyx_9genexpr50__pyx_v_ch); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1672, __pyx_L12_error)
              __Pyx_GOTREF(__pyx_t_4);
              if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 1672, __pyx_L12_error)
              __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            }
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_XDECREF(__pyx_9genexpr50__pyx_v_ch); __pyx_9genexpr50__pyx_v_ch = 0;
            goto __pyx_L16_exit_scope;
            __pyx_L12_error:;
            __Pyx_XDECREF(__pyx_9genexpr50__pyx_v_ch); __pyx_9genexpr50__pyx_v_ch = 0;
            goto __pyx_L1_error;
            __pyx_L16_exit_scope:;
          } /* exit inner scope */
          __pyx_t_10 = PySequence_Tuple(__pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1672, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1672, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
            __pyx_t_10 = __pyx_t_2; __Pyx_INCREF(__pyx_t_10);
            __pyx_t_9 = 0;
            __pyx_t_11 = NULL;
          } else {
            __pyx_t_9 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1672, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_10);
            __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1672, __pyx_L1_error)
          }
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          for (;;) {
            if (likely(!__pyx_t_11)) {
              if (likely(PyList_CheckExact(__pyx_t_10))) {
                {
                  Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_10);
                  #if !CYTHON_ASSUME_SAFE_MACROS
                  if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1672, __pyx_L1_error)
                  #endif
                  if (__pyx_t_9 >= __pyx_temp) break;
                }
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                __pyx_t_2 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_9); __Pyx_INCREF(__pyx_t_2); __pyx_t_9++; if (unlikely((0 < 0))) __PYX_ERR(0, 1672, __pyx_L1_error)
                #else
                __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_10, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1672, __pyx_L1_error)
                __Pyx_GOTREF(__pyx_t_2);
                #endif
              } else {
                {
                  Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_10);
                  #if !CYTHON_ASSUME_SAFE_MACROS
                  if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1672, __pyx_L1_error)
                  #endif
                  if (__pyx_t_9 >= __pyx_temp) break;
                }
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_9); __Pyx_INCREF(__pyx_t_2); __pyx_t_9++; if (unlikely((0 < 0))) __PYX_ERR(0, 1672, __pyx_L1_error)
                #else
                __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_10, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1672, __pyx_L1_error)
                __Pyx_GOTREF(__pyx_t_2);
                #endif
              }
            } else {
              __pyx_t_2 = __pyx_t_11(__pyx_t_10);
              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, 1672, __pyx_L1_error)
                }
                break;
              }
              __Pyx_GOTREF(__pyx_t_2);
            }
            __Pyx_XDECREF_SET(__pyx_v_childtrees, __pyx_t_2);
            __pyx_t_2 = 0;

            /* "ete4/core/tree.pyx":1673
 *                     if skip_large_polytomies:
 *                         for childtrees in itertools.product(*[n2subtrees[ch] for ch in n.children]):
 *                             subtrees.append(TipTuple(childtrees))             # <<<<<<<<<<<<<<
 *                     else:
 *                         raise TreeError("Found polytomy larger than current limit: %s" %n)
 */
            __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_cur_scope->__pyx_v_TipTuple, __pyx_v_childtrees); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1673, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_subtrees, __pyx_t_2); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 1673, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

            /* "ete4/core/tree.pyx":1672
 *                 if len(n.children) > polytomy_size_limit:
 *                     if skip_large_polytomies:
 *                         for childtrees in itertools.product(*[n2subtrees[ch] for ch in n.children]):             # <<<<<<<<<<<<<<
 *                             subtrees.append(TipTuple(childtrees))
 *                     else:
 */
          }
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

          /* "ete4/core/tree.pyx":1671
 *                 subtrees = []
 *                 if len(n.children) > polytomy_size_limit:
 *                     if skip_large_polytomies:             # <<<<<<<<<<<<<<
 *                         for childtrees in itertools.product(*[n2subtrees[ch] for ch in n.children]):
 *                             subtrees.append(TipTuple(childtrees))
 */
          goto __pyx_L7;
        }

        /* "ete4/core/tree.pyx":1675
 *                             subtrees.append(TipTuple(childtrees))
 *                     else:
 *                         raise TreeError("Found polytomy larger than current limit: %s" %n)             # <<<<<<<<<<<<<<
 *                 else:
 *                     for childtrees in itertools.product(*[n2subtrees[ch] for ch in n.children]):
 */
        /*else*/ {
          __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_TreeError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1675, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_1 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_Found_polytomy_larger_than_curre, __pyx_v_n); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1675, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_4 = NULL;
          __pyx_t_5 = 0;
          #if CYTHON_UNPACK_METHODS
          if (unlikely(PyMethod_Check(__pyx_t_2))) {
            __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
            if (likely(__pyx_t_4)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
              __Pyx_INCREF(__pyx_t_4);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_2, function);
              __pyx_t_5 = 1;
            }
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_1};
            __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1675, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_10);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          }
          __Pyx_Raise(__pyx_t_10, 0, 0, 0);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __PYX_ERR(0, 1675, __pyx_L1_error)
        }
        __pyx_L7:;

        /* "ete4/core/tree.pyx":1670
 *             else:
 *                 subtrees = []
 *                 if len(n.children) > polytomy_size_limit:             # <<<<<<<<<<<<<<
 *                     if skip_large_polytomies:
 *                         for childtrees in itertools.product(*[n2subtrees[ch] for ch in n.children]):
 */
        goto __pyx_L6;
      }

      /* "ete4/core/tree.pyx":1677
 *                         raise TreeError("Found polytomy larger than current limit: %s" %n)
 *                 else:
 *                     for childtrees in itertools.product(*[n2subtrees[ch] for ch in n.children]):             # <<<<<<<<<<<<<<
 *                         subtrees.extend([TipTuple(subtree) for subtree in enum_unordered(childtrees)])
 * 
 */
      /*else*/ {
        __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_itertools); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1677, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_product); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1677, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        { /* enter inner scope */
          __pyx_t_10 = PyList_New(0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1677, __pyx_L22_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_n, __pyx_n_s_children); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1677, __pyx_L22_error)
          __Pyx_GOTREF(__pyx_t_1);
          if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
            __pyx_t_4 = __pyx_t_1; __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_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1677, __pyx_L22_error)
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1677, __pyx_L22_error)
          }
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          for (;;) {
            if (likely(!__pyx_t_11)) {
              if (likely(PyList_CheckExact(__pyx_t_4))) {
                {
                  Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4);
                  #if !CYTHON_ASSUME_SAFE_MACROS
                  if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1677, __pyx_L22_error)
                  #endif
                  if (__pyx_t_9 >= __pyx_temp) 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, 1677, __pyx_L22_error)
                #else
                __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1677, __pyx_L22_error)
                __Pyx_GOTREF(__pyx_t_1);
                #endif
              } else {
                {
                  Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4);
                  #if !CYTHON_ASSUME_SAFE_MACROS
                  if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1677, __pyx_L22_error)
                  #endif
                  if (__pyx_t_9 >= __pyx_temp) break;
                }
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_9); __Pyx_INCREF(__pyx_t_1); __pyx_t_9++; if (unlikely((0 < 0))) __PYX_ERR(0, 1677, __pyx_L22_error)
                #else
                __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1677, __pyx_L22_error)
                __Pyx_GOTREF(__pyx_t_1);
                #endif
              }
            } else {
              __pyx_t_1 = __pyx_t_11(__pyx_t_4);
              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, 1677, __pyx_L22_error)
                }
                break;
              }
              __Pyx_GOTREF(__pyx_t_1);
            }
            __Pyx_XDECREF_SET(__pyx_9genexpr51__pyx_v_ch, __pyx_t_1);
            __pyx_t_1 = 0;
            __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_n2subtrees, __pyx_9genexpr51__pyx_v_ch); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1677, __pyx_L22_error)
            __Pyx_GOTREF(__pyx_t_1);
            if (unlikely(__Pyx_ListComp_Append(__pyx_t_10, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 1677, __pyx_L22_error)
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          }
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_XDECREF(__pyx_9genexpr51__pyx_v_ch); __pyx_9genexpr51__pyx_v_ch = 0;
          goto __pyx_L26_exit_scope;
          __pyx_L22_error:;
          __Pyx_XDECREF(__pyx_9genexpr51__pyx_v_ch); __pyx_9genexpr51__pyx_v_ch = 0;
          goto __pyx_L1_error;
          __pyx_L26_exit_scope:;
        } /* exit inner scope */
        __pyx_t_4 = PySequence_Tuple(__pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1677, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1677, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (likely(PyList_CheckExact(__pyx_t_10)) || PyTuple_CheckExact(__pyx_t_10)) {
          __pyx_t_4 = __pyx_t_10; __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_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1677, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1677, __pyx_L1_error)
        }
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        for (;;) {
          if (likely(!__pyx_t_11)) {
            if (likely(PyList_CheckExact(__pyx_t_4))) {
              {
                Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4);
                #if !CYTHON_ASSUME_SAFE_MACROS
                if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1677, __pyx_L1_error)
                #endif
                if (__pyx_t_9 >= __pyx_temp) break;
              }
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_10 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_9); __Pyx_INCREF(__pyx_t_10); __pyx_t_9++; if (unlikely((0 < 0))) __PYX_ERR(0, 1677, __pyx_L1_error)
              #else
              __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1677, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_10);
              #endif
            } else {
              {
                Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4);
                #if !CYTHON_ASSUME_SAFE_MACROS
                if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1677, __pyx_L1_error)
                #endif
                if (__pyx_t_9 >= __pyx_temp) break;
              }
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_9); __Pyx_INCREF(__pyx_t_10); __pyx_t_9++; if (unlikely((0 < 0))) __PYX_ERR(0, 1677, __pyx_L1_error)
              #else
              __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1677, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_10);
              #endif
            }
          } else {
            __pyx_t_10 = __pyx_t_11(__pyx_t_4);
            if (unlikely(!__pyx_t_10)) {
              PyObject* exc_type = PyErr_Occurred();
              if (exc_type) {
                if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                else __PYX_ERR(0, 1677, __pyx_L1_error)
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_10);
          }
          __Pyx_XDECREF_SET(__pyx_v_childtrees, __pyx_t_10);
          __pyx_t_10 = 0;

          /* "ete4/core/tree.pyx":1678
 *                 else:
 *                     for childtrees in itertools.product(*[n2subtrees[ch] for ch in n.children]):
 *                         subtrees.extend([TipTuple(subtree) for subtree in enum_unordered(childtrees)])             # <<<<<<<<<<<<<<
 * 
 *             n2subtrees[n] = subtrees
 */
          { /* enter inner scope */
            __pyx_t_10 = PyList_New(0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1678, __pyx_L29_error)
            __Pyx_GOTREF(__pyx_t_10);
            __pyx_t_2 = __pyx_pf_4ete4_4core_4tree_4Tree_17expand_polytomies_3enum_unordered(__pyx_cur_scope->__pyx_v_enum_unordered, __pyx_v_childtrees); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1678, __pyx_L29_error)
            __Pyx_GOTREF(__pyx_t_2);
            if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
              __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1);
              __pyx_t_13 = 0;
              __pyx_t_14 = NULL;
            } else {
              __pyx_t_13 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1678, __pyx_L29_error)
              __Pyx_GOTREF(__pyx_t_1);
              __pyx_t_14 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1678, __pyx_L29_error)
            }
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            for (;;) {
              if (likely(!__pyx_t_14)) {
                if (likely(PyList_CheckExact(__pyx_t_1))) {
                  {
                    Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
                    #if !CYTHON_ASSUME_SAFE_MACROS
                    if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1678, __pyx_L29_error)
                    #endif
                    if (__pyx_t_13 >= __pyx_temp) break;
                  }
                  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                  __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_13); __Pyx_INCREF(__pyx_t_2); __pyx_t_13++; if (unlikely((0 < 0))) __PYX_ERR(0, 1678, __pyx_L29_error)
                  #else
                  __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1678, __pyx_L29_error)
                  __Pyx_GOTREF(__pyx_t_2);
                  #endif
                } else {
                  {
                    Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
                    #if !CYTHON_ASSUME_SAFE_MACROS
                    if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1678, __pyx_L29_error)
                    #endif
                    if (__pyx_t_13 >= __pyx_temp) break;
                  }
                  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                  __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_13); __Pyx_INCREF(__pyx_t_2); __pyx_t_13++; if (unlikely((0 < 0))) __PYX_ERR(0, 1678, __pyx_L29_error)
                  #else
                  __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1678, __pyx_L29_error)
                  __Pyx_GOTREF(__pyx_t_2);
                  #endif
                }
              } else {
                __pyx_t_2 = __pyx_t_14(__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, 1678, __pyx_L29_error)
                  }
                  break;
                }
                __Pyx_GOTREF(__pyx_t_2);
              }
              __Pyx_XDECREF_SET(__pyx_9genexpr52__pyx_v_subtree, __pyx_t_2);
              __pyx_t_2 = 0;
              __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_cur_scope->__pyx_v_TipTuple, __pyx_9genexpr52__pyx_v_subtree); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1678, __pyx_L29_error)
              __Pyx_GOTREF(__pyx_t_2);
              if (unlikely(__Pyx_ListComp_Append(__pyx_t_10, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 1678, __pyx_L29_error)
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            }
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_XDECREF(__pyx_9genexpr52__pyx_v_subtree); __pyx_9genexpr52__pyx_v_subtree = 0;
            goto __pyx_L33_exit_scope;
            __pyx_L29_error:;
            __Pyx_XDECREF(__pyx_9genexpr52__pyx_v_subtree); __pyx_9genexpr52__pyx_v_subtree = 0;
            goto __pyx_L1_error;
            __pyx_L33_exit_scope:;
          } /* exit inner scope */
          __pyx_t_12 = __Pyx_PyList_Extend(__pyx_v_subtrees, __pyx_t_10); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 1678, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

          /* "ete4/core/tree.pyx":1677
 *                         raise TreeError("Found polytomy larger than current limit: %s" %n)
 *                 else:
 *                     for childtrees in itertools.product(*[n2subtrees[ch] for ch in n.children]):             # <<<<<<<<<<<<<<
 *                         subtrees.extend([TipTuple(subtree) for subtree in enum_unordered(childtrees)])
 * 
 */
        }
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      __pyx_L6:;
    }
    __pyx_L5:;

    /* "ete4/core/tree.pyx":1680
 *                         subtrees.extend([TipTuple(subtree) for subtree in enum_unordered(childtrees)])
 * 
 *             n2subtrees[n] = subtrees             # <<<<<<<<<<<<<<
 *         return ["%s;"%str(nw) for nw in n2subtrees[self]] # tuples are in newick format ^_^
 * 
 */
    if (unlikely((PyDict_SetItem(__pyx_v_n2subtrees, __pyx_v_n, __pyx_v_subtrees) < 0))) __PYX_ERR(0, 1680, __pyx_L1_error)

    /* "ete4/core/tree.pyx":1665
 * 
 *         n2subtrees = {}
 *         for n in self.traverse("postorder"):             # <<<<<<<<<<<<<<
 *             if n.is_leaf:
 *                 subtrees = [n.props.get(map_prop)]
 */
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "ete4/core/tree.pyx":1681
 * 
 *             n2subtrees[n] = subtrees
 *         return ["%s;"%str(nw) for nw in n2subtrees[self]] # tuples are in newick format ^_^             # <<<<<<<<<<<<<<
 * 
 *     def resolve_polytomy(self, descendants=True):
 */
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1681, __pyx_L38_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_n2subtrees, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1681, __pyx_L38_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
      __pyx_t_10 = __pyx_t_4; __Pyx_INCREF(__pyx_t_10);
      __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1681, __pyx_L38_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_10); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1681, __pyx_L38_error)
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    for (;;) {
      if (likely(!__pyx_t_7)) {
        if (likely(PyList_CheckExact(__pyx_t_10))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_10);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1681, __pyx_L38_error)
            #endif
            if (__pyx_t_6 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_4 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 1681, __pyx_L38_error)
          #else
          __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_10, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1681, __pyx_L38_error)
          __Pyx_GOTREF(__pyx_t_4);
          #endif
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_10);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1681, __pyx_L38_error)
            #endif
            if (__pyx_t_6 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 1681, __pyx_L38_error)
          #else
          __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_10, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1681, __pyx_L38_error)
          __Pyx_GOTREF(__pyx_t_4);
          #endif
        }
      } else {
        __pyx_t_4 = __pyx_t_7(__pyx_t_10);
        if (unlikely(!__pyx_t_4)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 1681, __pyx_L38_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_4);
      }
      __Pyx_XDECREF_SET(__pyx_9genexpr53__pyx_v_nw, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_Unicode(__pyx_9genexpr53__pyx_v_nw); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1681, __pyx_L38_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = PyUnicode_Format(__pyx_kp_u_s, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1681, __pyx_L38_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 1681, __pyx_L38_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_9genexpr53__pyx_v_nw); __pyx_9genexpr53__pyx_v_nw = 0;
    goto __pyx_L42_exit_scope;
    __pyx_L38_error:;
    __Pyx_XDECREF(__pyx_9genexpr53__pyx_v_nw); __pyx_9genexpr53__pyx_v_nw = 0;
    goto __pyx_L1_error;
    __pyx_L42_exit_scope:;
  } /* exit inner scope */
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "ete4/core/tree.pyx":1625
 *         yield from self.leaves(is_leaf_fn=is_monophyletic)
 * 
 *     def expand_polytomies(self, map_prop="name", polytomy_size_limit=5,             # <<<<<<<<<<<<<<
 *                           skip_large_polytomies=False):
 *         """Return all combinations of solutions of the multifurcated nodes.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("ete4.core.tree.Tree.expand_polytomies", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_gb_4ete4_4core_4tree_4Tree_17expand_polytomies_2generator37);
  __Pyx_XDECREF(__pyx_gb_4ete4_4core_4tree_4Tree_17expand_polytomies_5generator38);
  __Pyx_XDECREF(__pyx_v_n2subtrees);
  __Pyx_XDECREF(__pyx_v_n);
  __Pyx_XDECREF(__pyx_v_subtrees);
  __Pyx_XDECREF(__pyx_v_childtrees);
  __Pyx_XDECREF(__pyx_9genexpr50__pyx_v_ch);
  __Pyx_XDECREF(__pyx_9genexpr51__pyx_v_ch);
  __Pyx_XDECREF(__pyx_9genexpr52__pyx_v_subtree);
  __Pyx_XDECREF(__pyx_9genexpr53__pyx_v_nw);
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ete4/core/tree.pyx":1683
 *         return ["%s;"%str(nw) for nw in n2subtrees[self]] # tuples are in newick format ^_^
 * 
 *     def resolve_polytomy(self, descendants=True):             # <<<<<<<<<<<<<<
 *         """Convert node to a series of dicotomies if it is a polytomy.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_158resolve_polytomy(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_4ete4_4core_4tree_4Tree_157resolve_polytomy, "Tree.resolve_polytomy(self, descendants=True)\nConvert node to a series of dicotomies if it is a polytomy.\n\n        A polytomy is a node that has more than 2 children. This\n        function changes them to a ladderized series of dicotomic\n        branches. The tree topology modification is arbitrary (no\n        important results should depend on it!).\n\n        :param descendants: If True, resolve all polytomies under this\n             node too. Otherwise, do it only for the current node.\n        ");
static PyMethodDef __pyx_mdef_4ete4_4core_4tree_4Tree_158resolve_polytomy = {"resolve_polytomy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_158resolve_polytomy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_157resolve_polytomy};
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_158resolve_polytomy(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_descendants = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("resolve_polytomy (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_descendants,0};
    values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_True));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_descendants);
          if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1683, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "resolve_polytomy") < 0)) __PYX_ERR(0, 1683, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_descendants = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("resolve_polytomy", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 1683, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("ete4.core.tree.Tree.resolve_polytomy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_157resolve_polytomy(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self), __pyx_v_descendants);

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

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_157resolve_polytomy(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_descendants) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("resolve_polytomy", 1);

  /* "ete4/core/tree.pyx":1694
 *              node too. Otherwise, do it only for the current node.
 *         """
 *         ops.resolve_polytomy(self, descendants)             # <<<<<<<<<<<<<<
 * 
 *     def cophenetic_matrix(self):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ops); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1694, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_resolve_polytomy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1694, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_2, ((PyObject *)__pyx_v_self), __pyx_v_descendants};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1694, __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;

  /* "ete4/core/tree.pyx":1683
 *         return ["%s;"%str(nw) for nw in n2subtrees[self]] # tuples are in newick format ^_^
 * 
 *     def resolve_polytomy(self, descendants=True):             # <<<<<<<<<<<<<<
 *         """Convert node to a series of dicotomies if it is a polytomy.
 * 
 */

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

/* "ete4/core/tree.pyx":1696
 *         ops.resolve_polytomy(self, descendants)
 * 
 *     def cophenetic_matrix(self):             # <<<<<<<<<<<<<<
 *         """Return a cophenetic distance matrix of the tree.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_160cophenetic_matrix(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_4ete4_4core_4tree_4Tree_159cophenetic_matrix, "Tree.cophenetic_matrix(self)\nReturn a cophenetic distance matrix of the tree.\n\n        The `cophenetic matrix\n        <https://en.wikipedia.org/wiki/Cophenetic>`_ is a matrix\n        representation of the distance between each node.\n\n        If we have a tree like::\n\n                 \342\225\255\342\225\264A\n             \342\225\255\342\225\264y\342\225\266\342\224\244\n             \342\224\202   \342\225\260\342\225\264B\n          \342\225\264z\342\225\266\342\224\244\n             \342\224\202   \342\225\255\342\225\264C\n             \342\225\260\342\225\264x\342\225\266\342\224\244\n                 \342\224\202   \342\225\255\342\225\264D\n                 \342\225\260\342\225\264w\342\225\266\342\224\244\n                     \342\225\260\342\225\264E\n\n        where w, x, y, z are internal nodes, then::\n\n          d(A,B) = d(y,A) + d(y,B)\n\n        and::\n\n          d(A,E) = d(z,A) + d(z,E)\n                 = (d(z,y) + d(y,A)) + (d(z,x) + d(x,w) + d(w,E))\n\n        To compute it, we use an idea from\n        https://gist.github.com/jhcepas/279f9009f46bf675e3a890c19191158b\n\n        First, for each node we find its path to the root. For example::\n\n          A -> A, y, z\n          E -> E, w, x, z\n\n        and make these orderless sets. Then we XOR the two sets to\n        only find the elements that are in one or other sets but not\n        both. In this case A, E, y, x, w.\n\n        The distance between the two nodes is the sum of the distances\n        from each of those nodes to the parent\n\n        One more optimization: since the distances are symmetric, and\n        distance to itself is zero we user itertools.combinations\n        rather than itertools.permutations. This cuts our computes\n        from theta(n^2) 1/2n^2 - n (= O(n^2), which is still not\n        great, but in reality speeds things up for large trees).\n\n        For this tree, we will return the two dimensional array::\n\n                    A                ""B                C                D                E\n          A         0         d(A,y) + d(B,y)  d(A,z) + d(C,z)  d(A,z) + d(D,z)  d(A,z) + d(E,z)\n          B  d(B,y) + d(A,y)         0         d(B,z) + d(C,z)  d(B,z) + d(D,z)  d(B,z) + d(E,z)\n          C  d(C,z) + d(A,z)  d(C,z) + d(B,z)         0         d(C,x) + d(D,x)  d(C,x) + d(E,x)\n          D  d(D,z) + d(A,z)  d(D,z) + d(B,z)  d(D,x) + d(C,x)         0         d(D,w) + d(E,w)\n          E  d(E,z) + d(A,z)  d(E,z) + d(B,z)  d(E,x) + d(C,x)  d(E,w) + d(D,w)         0\n\n        We will also return the one dimensional array with the leaves\n        in the order in which they appear in the matrix (i.e. the\n        column and/or row headers).\n        ");
static PyMethodDef __pyx_mdef_4ete4_4core_4tree_4Tree_160cophenetic_matrix = {"cophenetic_matrix", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_160cophenetic_matrix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_159cophenetic_matrix};
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_160cophenetic_matrix(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cophenetic_matrix (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("cophenetic_matrix", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "cophenetic_matrix", 0))) return NULL;
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_159cophenetic_matrix(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_4ete4_4core_4tree_4Tree_17cophenetic_matrix_2generator39(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "ete4/core/tree.pyx":1779
 *             # figure out the unique nodes in the path
 *             uniquenodes = paths[leaf1] ^ paths[leaf2]
 *             distance = sum(x.dist for x in uniquenodes)             # <<<<<<<<<<<<<<
 *             leaf_distances[leaf1.name][leaf2.name] = leaf_distances[leaf2.name][leaf1.name] = distance
 * 
 */

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_17cophenetic_matrix_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_52_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_52_genexpr *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_52_genexpr(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_52_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_52_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1779, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4ete4_4core_4tree_4Tree_17cophenetic_matrix_2generator39, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_cophenetic_matrix_locals_genexpr, __pyx_n_s_ete4_core_tree); if (unlikely(!gen)) __PYX_ERR(0, 1779, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("ete4.core.tree.Tree.cophenetic_matrix.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

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

/* "ete4/core/tree.pyx":1696
 *         ops.resolve_polytomy(self, descendants)
 * 
 *     def cophenetic_matrix(self):             # <<<<<<<<<<<<<<
 *         """Return a cophenetic distance matrix of the tree.
 * 
 */

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_159cophenetic_matrix(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self) {
  PyObject *__pyx_v_leaves = NULL;
  PyObject *__pyx_v_paths = NULL;
  PyObject *__pyx_v_n = NULL;
  PyObject *__pyx_v_movingnode = NULL;
  PyObject *__pyx_v_leaf_distances = NULL;
  PyObject *__pyx_v_leaf1 = NULL;
  PyObject *__pyx_v_leaf2 = NULL;
  PyObject *__pyx_v_uniquenodes = NULL;
  PyObject *__pyx_v_distance = NULL;
  PyObject *__pyx_v_allleaves = NULL;
  PyObject *__pyx_v_output = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_m = NULL;
  PyObject *__pyx_9genexpr54__pyx_v_x = NULL;
  PyObject *__pyx_9genexpr55__pyx_v_x = NULL;
  PyObject *__pyx_gb_4ete4_4core_4tree_4Tree_17cophenetic_matrix_2generator39 = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *(*__pyx_t_9)(PyObject *);
  PyObject *__pyx_t_10 = NULL;
  PyObject *(*__pyx_t_11)(PyObject *);
  int __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cophenetic_matrix", 1);

  /* "ete4/core/tree.pyx":1758
 *         column and/or row headers).
 *         """
 *         leaves = list(self.leaves())             # <<<<<<<<<<<<<<
 *         paths = {x: set() for x in leaves}
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_leaves); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1758, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1758, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_t_2 = __Pyx_PySequence_ListKeepNew(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1758, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_leaves = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "ete4/core/tree.pyx":1759
 *         """
 *         leaves = list(self.leaves())
 *         paths = {x: set() for x in leaves}             # <<<<<<<<<<<<<<
 * 
 *         # get the paths going up the tree
 */
  { /* enter inner scope */
    __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1759, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __pyx_v_leaves; __Pyx_INCREF(__pyx_t_1);
    __pyx_t_5 = 0;
    for (;;) {
      {
        Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
        #if !CYTHON_ASSUME_SAFE_MACROS
        if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1759, __pyx_L5_error)
        #endif
        if (__pyx_t_5 >= __pyx_temp) break;
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 1759, __pyx_L5_error)
      #else
      __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1759, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_3);
      #endif
      __Pyx_XDECREF_SET(__pyx_9genexpr54__pyx_v_x, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_3 = PySet_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1759, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr54__pyx_v_x, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 1759, __pyx_L5_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_9genexpr54__pyx_v_x); __pyx_9genexpr54__pyx_v_x = 0;
    goto __pyx_L9_exit_scope;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_9genexpr54__pyx_v_x); __pyx_9genexpr54__pyx_v_x = 0;
    goto __pyx_L1_error;
    __pyx_L9_exit_scope:;
  } /* exit inner scope */
  __pyx_v_paths = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "ete4/core/tree.pyx":1764
 *         # we get all the nodes up to the last one and store them in a set
 * 
 *         for n in leaves:             # <<<<<<<<<<<<<<
 *             if n.is_root:
 *                 continue
 */
  __pyx_t_2 = __pyx_v_leaves; __Pyx_INCREF(__pyx_t_2);
  __pyx_t_5 = 0;
  for (;;) {
    {
      Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
      #if !CYTHON_ASSUME_SAFE_MACROS
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1764, __pyx_L1_error)
      #endif
      if (__pyx_t_5 >= __pyx_temp) 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, 1764, __pyx_L1_error)
    #else
    __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1764, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "ete4/core/tree.pyx":1765
 * 
 *         for n in leaves:
 *             if n.is_root:             # <<<<<<<<<<<<<<
 *                 continue
 *             movingnode = n
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_n, __pyx_n_s_is_root); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1765, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1765, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_6) {

      /* "ete4/core/tree.pyx":1766
 *         for n in leaves:
 *             if n.is_root:
 *                 continue             # <<<<<<<<<<<<<<
 *             movingnode = n
 *             while not movingnode.is_root:
 */
      goto __pyx_L10_continue;

      /* "ete4/core/tree.pyx":1765
 * 
 *         for n in leaves:
 *             if n.is_root:             # <<<<<<<<<<<<<<
 *                 continue
 *             movingnode = n
 */
    }

    /* "ete4/core/tree.pyx":1767
 *             if n.is_root:
 *                 continue
 *             movingnode = n             # <<<<<<<<<<<<<<
 *             while not movingnode.is_root:
 *                 paths[n].add(movingnode)
 */
    __Pyx_INCREF(__pyx_v_n);
    __Pyx_XDECREF_SET(__pyx_v_movingnode, __pyx_v_n);

    /* "ete4/core/tree.pyx":1768
 *                 continue
 *             movingnode = n
 *             while not movingnode.is_root:             # <<<<<<<<<<<<<<
 *                 paths[n].add(movingnode)
 *                 movingnode = movingnode.up
 */
    while (1) {
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_movingnode, __pyx_n_s_is_root); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1768, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1768, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_7 = (!__pyx_t_6);
      if (!__pyx_t_7) break;

      /* "ete4/core/tree.pyx":1769
 *             movingnode = n
 *             while not movingnode.is_root:
 *                 paths[n].add(movingnode)             # <<<<<<<<<<<<<<
 *                 movingnode = movingnode.up
 * 
 */
      __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_paths, __pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1769, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_add); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1769, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = NULL;
      __pyx_t_4 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_8))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_8);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_8, function);
          __pyx_t_4 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_movingnode};
        __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1769, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "ete4/core/tree.pyx":1770
 *             while not movingnode.is_root:
 *                 paths[n].add(movingnode)
 *                 movingnode = movingnode.up             # <<<<<<<<<<<<<<
 * 
 *         # now we want to get all pairs of nodes using itertools combinations. We need AB AC etc but don't need BA CA
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_movingnode, __pyx_n_s_up); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1770, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF_SET(__pyx_v_movingnode, __pyx_t_1);
      __pyx_t_1 = 0;
    }

    /* "ete4/core/tree.pyx":1764
 *         # we get all the nodes up to the last one and store them in a set
 * 
 *         for n in leaves:             # <<<<<<<<<<<<<<
 *             if n.is_root:
 *                 continue
 */
    __pyx_L10_continue:;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ete4/core/tree.pyx":1774
 *         # now we want to get all pairs of nodes using itertools combinations. We need AB AC etc but don't need BA CA
 * 
 *         leaf_distances = {x.name: {} for x in leaves}             # <<<<<<<<<<<<<<
 * 
 *         for (leaf1, leaf2) in itertools.combinations(leaves, 2):
 */
  { /* enter inner scope */
    __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1774, __pyx_L18_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __pyx_v_leaves; __Pyx_INCREF(__pyx_t_1);
    __pyx_t_5 = 0;
    for (;;) {
      {
        Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
        #if !CYTHON_ASSUME_SAFE_MACROS
        if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1774, __pyx_L18_error)
        #endif
        if (__pyx_t_5 >= __pyx_temp) break;
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_8 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_8); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 1774, __pyx_L18_error)
      #else
      __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1774, __pyx_L18_error)
      __Pyx_GOTREF(__pyx_t_8);
      #endif
      __Pyx_XDECREF_SET(__pyx_9genexpr55__pyx_v_x, __pyx_t_8);
      __pyx_t_8 = 0;
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr55__pyx_v_x, __pyx_n_s_name); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1774, __pyx_L18_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1774, __pyx_L18_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_t_8, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 1774, __pyx_L18_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_9genexpr55__pyx_v_x); __pyx_9genexpr55__pyx_v_x = 0;
    goto __pyx_L22_exit_scope;
    __pyx_L18_error:;
    __Pyx_XDECREF(__pyx_9genexpr55__pyx_v_x); __pyx_9genexpr55__pyx_v_x = 0;
    goto __pyx_L1_error;
    __pyx_L22_exit_scope:;
  } /* exit inner scope */
  __pyx_v_leaf_distances = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "ete4/core/tree.pyx":1776
 *         leaf_distances = {x.name: {} for x in leaves}
 * 
 *         for (leaf1, leaf2) in itertools.combinations(leaves, 2):             # <<<<<<<<<<<<<<
 *             # figure out the unique nodes in the path
 *             uniquenodes = paths[leaf1] ^ paths[leaf2]
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_itertools); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1776, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_combinations); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1776, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_v_leaves, __pyx_int_2};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1776, __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_5 = 0;
    __pyx_t_9 = NULL;
  } else {
    __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1776, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1776, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_9)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1776, __pyx_L1_error)
          #endif
          if (__pyx_t_5 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 1776, __pyx_L1_error)
        #else
        __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1776, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1776, __pyx_L1_error)
          #endif
          if (__pyx_t_5 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 1776, __pyx_L1_error)
        #else
        __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1776, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_9(__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, 1776, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
      PyObject* sequence = __pyx_t_2;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 1776, __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_8 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_8 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_8);
      #else
      __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1776, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1776, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      #endif
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_10 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1776, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_10);
      index = 0; __pyx_t_1 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_1)) goto __pyx_L25_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_1);
      index = 1; __pyx_t_8 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_8)) goto __pyx_L25_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_8);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < 0) __PYX_ERR(0, 1776, __pyx_L1_error)
      __pyx_t_11 = NULL;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L26_unpacking_done;
      __pyx_L25_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_11 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 1776, __pyx_L1_error)
      __pyx_L26_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_leaf1, __pyx_t_1);
    __pyx_t_1 = 0;
    __Pyx_XDECREF_SET(__pyx_v_leaf2, __pyx_t_8);
    __pyx_t_8 = 0;

    /* "ete4/core/tree.pyx":1778
 *         for (leaf1, leaf2) in itertools.combinations(leaves, 2):
 *             # figure out the unique nodes in the path
 *             uniquenodes = paths[leaf1] ^ paths[leaf2]             # <<<<<<<<<<<<<<
 *             distance = sum(x.dist for x in uniquenodes)
 *             leaf_distances[leaf1.name][leaf2.name] = leaf_distances[leaf2.name][leaf1.name] = distance
 */
    __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_paths, __pyx_v_leaf1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1778, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_8 = __Pyx_PyDict_GetItem(__pyx_v_paths, __pyx_v_leaf2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1778, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_1 = PyNumber_Xor(__pyx_t_2, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1778, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF_SET(__pyx_v_uniquenodes, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "ete4/core/tree.pyx":1779
 *             # figure out the unique nodes in the path
 *             uniquenodes = paths[leaf1] ^ paths[leaf2]
 *             distance = sum(x.dist for x in uniquenodes)             # <<<<<<<<<<<<<<
 *             leaf_distances[leaf1.name][leaf2.name] = leaf_distances[leaf2.name][leaf1.name] = distance
 * 
 */
    __pyx_t_1 = __pyx_pf_4ete4_4core_4tree_4Tree_17cophenetic_matrix_genexpr(NULL, __pyx_v_uniquenodes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1779, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1779, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF_SET(__pyx_v_distance, __pyx_t_8);
    __pyx_t_8 = 0;

    /* "ete4/core/tree.pyx":1780
 *             uniquenodes = paths[leaf1] ^ paths[leaf2]
 *             distance = sum(x.dist for x in uniquenodes)
 *             leaf_distances[leaf1.name][leaf2.name] = leaf_distances[leaf2.name][leaf1.name] = distance             # <<<<<<<<<<<<<<
 * 
 *         allleaves = sorted(leaf_distances.keys()) # the leaves in order that we will return
 */
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_leaf1, __pyx_n_s_name); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1780, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_leaf_distances, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1780, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_leaf2, __pyx_n_s_name); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1780, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    if (unlikely((PyObject_SetItem(__pyx_t_1, __pyx_t_8, __pyx_v_distance) < 0))) __PYX_ERR(0, 1780, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_leaf2, __pyx_n_s_name); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1780, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_leaf_distances, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1780, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_leaf1, __pyx_n_s_name); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1780, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    if (unlikely((PyObject_SetItem(__pyx_t_1, __pyx_t_8, __pyx_v_distance) < 0))) __PYX_ERR(0, 1780, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "ete4/core/tree.pyx":1776
 *         leaf_distances = {x.name: {} for x in leaves}
 * 
 *         for (leaf1, leaf2) in itertools.combinations(leaves, 2):             # <<<<<<<<<<<<<<
 *             # figure out the unique nodes in the path
 *             uniquenodes = paths[leaf1] ^ paths[leaf2]
 */
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "ete4/core/tree.pyx":1782
 *             leaf_distances[leaf1.name][leaf2.name] = leaf_distances[leaf2.name][leaf1.name] = distance
 * 
 *         allleaves = sorted(leaf_distances.keys()) # the leaves in order that we will return             # <<<<<<<<<<<<<<
 * 
 *         output = [] # the two dimensional array that we will return
 */
  __pyx_t_8 = __Pyx_PyDict_Keys(__pyx_v_leaf_distances); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1782, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_1 = PySequence_List(__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1782, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_3 = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_12 = PyList_Sort(__pyx_t_3); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 1782, __pyx_L1_error)
  __pyx_v_allleaves = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "ete4/core/tree.pyx":1784
 *         allleaves = sorted(leaf_distances.keys()) # the leaves in order that we will return
 * 
 *         output = [] # the two dimensional array that we will return             # <<<<<<<<<<<<<<
 * 
 *         for i, n in enumerate(allleaves):
 */
  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1784, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_output = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "ete4/core/tree.pyx":1786
 *         output = [] # the two dimensional array that we will return
 * 
 *         for i, n in enumerate(allleaves):             # <<<<<<<<<<<<<<
 *             output.append([])
 *             for m in allleaves:
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_t_3 = __pyx_int_0;
  __pyx_t_1 = __pyx_v_allleaves; __Pyx_INCREF(__pyx_t_1);
  __pyx_t_5 = 0;
  for (;;) {
    {
      Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
      #if !CYTHON_ASSUME_SAFE_MACROS
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1786, __pyx_L1_error)
      #endif
      if (__pyx_t_5 >= __pyx_temp) break;
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_8 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_8); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 1786, __pyx_L1_error)
    #else
    __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1786, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_8);
    __pyx_t_8 = 0;
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_3);
    __pyx_t_8 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1786, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_3);
    __pyx_t_3 = __pyx_t_8;
    __pyx_t_8 = 0;

    /* "ete4/core/tree.pyx":1787
 * 
 *         for i, n in enumerate(allleaves):
 *             output.append([])             # <<<<<<<<<<<<<<
 *             for m in allleaves:
 *                 if m == n:
 */
    __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1787, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_output, __pyx_t_8); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 1787, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "ete4/core/tree.pyx":1788
 *         for i, n in enumerate(allleaves):
 *             output.append([])
 *             for m in allleaves:             # <<<<<<<<<<<<<<
 *                 if m == n:
 *                     output[i].append(0) # distance to ourself = 0
 */
    __pyx_t_8 = __pyx_v_allleaves; __Pyx_INCREF(__pyx_t_8);
    __pyx_t_13 = 0;
    for (;;) {
      {
        Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_8);
        #if !CYTHON_ASSUME_SAFE_MACROS
        if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1788, __pyx_L1_error)
        #endif
        if (__pyx_t_13 >= __pyx_temp) break;
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_2 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_13); __Pyx_INCREF(__pyx_t_2); __pyx_t_13++; if (unlikely((0 < 0))) __PYX_ERR(0, 1788, __pyx_L1_error)
      #else
      __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1788, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      #endif
      __Pyx_XDECREF_SET(__pyx_v_m, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "ete4/core/tree.pyx":1789
 *             output.append([])
 *             for m in allleaves:
 *                 if m == n:             # <<<<<<<<<<<<<<
 *                     output[i].append(0) # distance to ourself = 0
 *                 else:
 */
      __pyx_t_2 = PyObject_RichCompare(__pyx_v_m, __pyx_v_n, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1789, __pyx_L1_error)
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1789, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (__pyx_t_7) {

        /* "ete4/core/tree.pyx":1790
 *             for m in allleaves:
 *                 if m == n:
 *                     output[i].append(0) # distance to ourself = 0             # <<<<<<<<<<<<<<
 *                 else:
 *                     output[i].append(leaf_distances[n][m])
 */
        __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_output, __pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1790, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_12 = __Pyx_PyObject_Append(__pyx_t_2, __pyx_int_0); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 1790, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "ete4/core/tree.pyx":1789
 *             output.append([])
 *             for m in allleaves:
 *                 if m == n:             # <<<<<<<<<<<<<<
 *                     output[i].append(0) # distance to ourself = 0
 *                 else:
 */
        goto __pyx_L32;
      }

      /* "ete4/core/tree.pyx":1792
 *                     output[i].append(0) # distance to ourself = 0
 *                 else:
 *                     output[i].append(leaf_distances[n][m])             # <<<<<<<<<<<<<<
 *         return output, allleaves
 * 
 */
      /*else*/ {
        __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_output, __pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1792, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_10 = __Pyx_PyDict_GetItem(__pyx_v_leaf_distances, __pyx_v_n); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1792, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_14 = __Pyx_PyObject_GetItem(__pyx_t_10, __pyx_v_m); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1792, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_12 = __Pyx_PyObject_Append(__pyx_t_2, __pyx_t_14); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 1792, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      }
      __pyx_L32:;

      /* "ete4/core/tree.pyx":1788
 *         for i, n in enumerate(allleaves):
 *             output.append([])
 *             for m in allleaves:             # <<<<<<<<<<<<<<
 *                 if m == n:
 *                     output[i].append(0) # distance to ourself = 0
 */
    }
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "ete4/core/tree.pyx":1786
 *         output = [] # the two dimensional array that we will return
 * 
 *         for i, n in enumerate(allleaves):             # <<<<<<<<<<<<<<
 *             output.append([])
 *             for m in allleaves:
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "ete4/core/tree.pyx":1793
 *                 else:
 *                     output[i].append(leaf_distances[n][m])
 *         return output, allleaves             # <<<<<<<<<<<<<<
 * 
 *     # TODO: The next two functions should really be parsers (which may
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1793, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_output);
  __Pyx_GIVEREF(__pyx_v_output);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_output)) __PYX_ERR(0, 1793, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_allleaves);
  __Pyx_GIVEREF(__pyx_v_allleaves);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_allleaves)) __PYX_ERR(0, 1793, __pyx_L1_error);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "ete4/core/tree.pyx":1696
 *         ops.resolve_polytomy(self, descendants)
 * 
 *     def cophenetic_matrix(self):             # <<<<<<<<<<<<<<
 *         """Return a cophenetic distance matrix of the tree.
 * 
 */

  /* 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_10);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_AddTraceback("ete4.core.tree.Tree.cophenetic_matrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_leaves);
  __Pyx_XDECREF(__pyx_v_paths);
  __Pyx_XDECREF(__pyx_v_n);
  __Pyx_XDECREF(__pyx_v_movingnode);
  __Pyx_XDECREF(__pyx_v_leaf_distances);
  __Pyx_XDECREF(__pyx_v_leaf1);
  __Pyx_XDECREF(__pyx_v_leaf2);
  __Pyx_XDECREF(__pyx_v_uniquenodes);
  __Pyx_XDECREF(__pyx_v_distance);
  __Pyx_XDECREF(__pyx_v_allleaves);
  __Pyx_XDECREF(__pyx_v_output);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_m);
  __Pyx_XDECREF(__pyx_9genexpr54__pyx_v_x);
  __Pyx_XDECREF(__pyx_9genexpr55__pyx_v_x);
  __Pyx_XDECREF(__pyx_gb_4ete4_4core_4tree_4Tree_17cophenetic_matrix_2generator39);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ete4/core/tree.pyx":1797
 *     # TODO: The next two functions should really be parsers (which may
 *     # be also used when calling __init__().
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_parent_child_table(parent_child_table):
 *         """Convert a parent-child table into an ETE Tree instance.
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_162from_parent_child_table(CYTHON_UNUSED PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_4ete4_4core_4tree_4Tree_161from_parent_child_table, "Tree.from_parent_child_table(parent_child_table)\nConvert a parent-child table into an ETE Tree instance.\n\n        :param parent_child_table: List of tuples containing\n            parent-child relationships. For example: [('A', 'B', 0.1),\n            ('A', 'C', 0.2), ('C', 'D', 1), ('C', 'E', 1.5)], where\n            each tuple represents: [parent, child, child-parent-dist]\n\n        Example::\n\n          t = Tree.from_parent_child_table([('A', 'B', 0.1),\n                                            ('A', 'C', 0.2),\n                                            ('C', 'D', 1),\n                                            ('C', 'E', 1.5)])\n          print(t.to_str(props=['name', 'dist']))\n          #      \342\225\255\342\225\264B,0.1\n          # \342\225\264A,\342\212\227\342\225\266\342\224\244\n          #      \342\224\202       \342\225\255\342\225\264D,1.0\n          #      \342\225\260\342\225\264C,0.2\342\225\266\342\224\244\n          #              \342\225\260\342\225\264E,1.5\n        ");
static PyMethodDef __pyx_mdef_4ete4_4core_4tree_4Tree_162from_parent_child_table = {"from_parent_child_table", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_162from_parent_child_table, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_161from_parent_child_table};
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_162from_parent_child_table(CYTHON_UNUSED PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_parent_child_table = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_parent_child_table (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_parent_child_table,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_parent_child_table)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1797, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "from_parent_child_table") < 0)) __PYX_ERR(0, 1797, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_parent_child_table = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_parent_child_table", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1797, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("ete4.core.tree.Tree.from_parent_child_table", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_161from_parent_child_table(__pyx_v_parent_child_table);

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

/* "ete4/core/tree.pyx":1819
 *           #              E,1.5
 *         """
 *         def get_node(nodename, dist=None):             # <<<<<<<<<<<<<<
 *             if nodename not in nodes_by_name:
 *                 data = {'name': nodename}
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_23from_parent_child_table_1get_node(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_4ete4_4core_4tree_4Tree_23from_parent_child_table_1get_node = {"get_node", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_23from_parent_child_table_1get_node, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_23from_parent_child_table_1get_node(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_nodename = 0;
  PyObject *__pyx_v_dist = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_node (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nodename,&__pyx_n_s_dist,0};
    values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_nodename)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1819, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dist);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1819, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_node") < 0)) __PYX_ERR(0, 1819, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_nodename = values[0];
    __pyx_v_dist = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_node", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 1819, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("ete4.core.tree.Tree.from_parent_child_table.get_node", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_23from_parent_child_table_get_node(__pyx_self, __pyx_v_nodename, __pyx_v_dist);

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

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_23from_parent_child_table_get_node(PyObject *__pyx_self, PyObject *__pyx_v_nodename, PyObject *__pyx_v_dist) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_53_from_parent_child_table *__pyx_cur_scope;
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_53_from_parent_child_table *__pyx_outer_scope;
  PyObject *__pyx_v_data = NULL;
  PyObject *__pyx_v_node = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_node", 1);
  __pyx_outer_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_53_from_parent_child_table *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "ete4/core/tree.pyx":1820
 *         """
 *         def get_node(nodename, dist=None):
 *             if nodename not in nodes_by_name:             # <<<<<<<<<<<<<<
 *                 data = {'name': nodename}
 *                 if dist is not None:
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_nodes_by_name)) { __Pyx_RaiseClosureNameError("nodes_by_name"); __PYX_ERR(0, 1820, __pyx_L1_error) }
  if (unlikely(__pyx_cur_scope->__pyx_v_nodes_by_name == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(0, 1820, __pyx_L1_error)
  }
  __pyx_t_1 = (__Pyx_PyDict_ContainsTF(__pyx_v_nodename, __pyx_cur_scope->__pyx_v_nodes_by_name, Py_NE)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1820, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "ete4/core/tree.pyx":1821
 *         def get_node(nodename, dist=None):
 *             if nodename not in nodes_by_name:
 *                 data = {'name': nodename}             # <<<<<<<<<<<<<<
 *                 if dist is not None:
 *                     data['dist'] = dist
 */
    __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1821, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_name, __pyx_v_nodename) < 0) __PYX_ERR(0, 1821, __pyx_L1_error)
    __pyx_v_data = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "ete4/core/tree.pyx":1822
 *             if nodename not in nodes_by_name:
 *                 data = {'name': nodename}
 *                 if dist is not None:             # <<<<<<<<<<<<<<
 *                     data['dist'] = dist
 *                 nodes_by_name[nodename] = Tree(data)
 */
    __pyx_t_1 = (__pyx_v_dist != Py_None);
    if (__pyx_t_1) {

      /* "ete4/core/tree.pyx":1823
 *                 data = {'name': nodename}
 *                 if dist is not None:
 *                     data['dist'] = dist             # <<<<<<<<<<<<<<
 *                 nodes_by_name[nodename] = Tree(data)
 *             node = nodes_by_name[nodename]
 */
      if (unlikely((PyDict_SetItem(__pyx_v_data, __pyx_n_u_dist, __pyx_v_dist) < 0))) __PYX_ERR(0, 1823, __pyx_L1_error)

      /* "ete4/core/tree.pyx":1822
 *             if nodename not in nodes_by_name:
 *                 data = {'name': nodename}
 *                 if dist is not None:             # <<<<<<<<<<<<<<
 *                     data['dist'] = dist
 *                 nodes_by_name[nodename] = Tree(data)
 */
    }

    /* "ete4/core/tree.pyx":1824
 *                 if dist is not None:
 *                     data['dist'] = dist
 *                 nodes_by_name[nodename] = Tree(data)             # <<<<<<<<<<<<<<
 *             node = nodes_by_name[nodename]
 *             if dist is not None:
 */
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree), __pyx_v_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1824, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (unlikely(!__pyx_cur_scope->__pyx_v_nodes_by_name)) { __Pyx_RaiseClosureNameError("nodes_by_name"); __PYX_ERR(0, 1824, __pyx_L1_error) }
    if (unlikely(__pyx_cur_scope->__pyx_v_nodes_by_name == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 1824, __pyx_L1_error)
    }
    if (unlikely((PyDict_SetItem(__pyx_cur_scope->__pyx_v_nodes_by_name, __pyx_v_nodename, __pyx_t_2) < 0))) __PYX_ERR(0, 1824, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "ete4/core/tree.pyx":1820
 *         """
 *         def get_node(nodename, dist=None):
 *             if nodename not in nodes_by_name:             # <<<<<<<<<<<<<<
 *                 data = {'name': nodename}
 *                 if dist is not None:
 */
  }

  /* "ete4/core/tree.pyx":1825
 *                     data['dist'] = dist
 *                 nodes_by_name[nodename] = Tree(data)
 *             node = nodes_by_name[nodename]             # <<<<<<<<<<<<<<
 *             if dist is not None:
 *                 node.dist = dist
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_nodes_by_name)) { __Pyx_RaiseClosureNameError("nodes_by_name"); __PYX_ERR(0, 1825, __pyx_L1_error) }
  if (unlikely(__pyx_cur_scope->__pyx_v_nodes_by_name == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(0, 1825, __pyx_L1_error)
  }
  __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_nodes_by_name, __pyx_v_nodename); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1825, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_node = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "ete4/core/tree.pyx":1826
 *                 nodes_by_name[nodename] = Tree(data)
 *             node = nodes_by_name[nodename]
 *             if dist is not None:             # <<<<<<<<<<<<<<
 *                 node.dist = dist
 *             node.name = nodename
 */
  __pyx_t_1 = (__pyx_v_dist != Py_None);
  if (__pyx_t_1) {

    /* "ete4/core/tree.pyx":1827
 *             node = nodes_by_name[nodename]
 *             if dist is not None:
 *                 node.dist = dist             # <<<<<<<<<<<<<<
 *             node.name = nodename
 *             return nodes_by_name[nodename]
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_node, __pyx_n_s_dist, __pyx_v_dist) < 0) __PYX_ERR(0, 1827, __pyx_L1_error)

    /* "ete4/core/tree.pyx":1826
 *                 nodes_by_name[nodename] = Tree(data)
 *             node = nodes_by_name[nodename]
 *             if dist is not None:             # <<<<<<<<<<<<<<
 *                 node.dist = dist
 *             node.name = nodename
 */
  }

  /* "ete4/core/tree.pyx":1828
 *             if dist is not None:
 *                 node.dist = dist
 *             node.name = nodename             # <<<<<<<<<<<<<<
 *             return nodes_by_name[nodename]
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_node, __pyx_n_s_name, __pyx_v_nodename) < 0) __PYX_ERR(0, 1828, __pyx_L1_error)

  /* "ete4/core/tree.pyx":1829
 *                 node.dist = dist
 *             node.name = nodename
 *             return nodes_by_name[nodename]             # <<<<<<<<<<<<<<
 * 
 *         nodes_by_name = {}
 */
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_nodes_by_name)) { __Pyx_RaiseClosureNameError("nodes_by_name"); __PYX_ERR(0, 1829, __pyx_L1_error) }
  if (unlikely(__pyx_cur_scope->__pyx_v_nodes_by_name == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(0, 1829, __pyx_L1_error)
  }
  __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_nodes_by_name, __pyx_v_nodename); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1829, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "ete4/core/tree.pyx":1819
 *           #              E,1.5
 *         """
 *         def get_node(nodename, dist=None):             # <<<<<<<<<<<<<<
 *             if nodename not in nodes_by_name:
 *                 data = {'name': nodename}
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("ete4.core.tree.Tree.from_parent_child_table.get_node", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_data);
  __Pyx_XDECREF(__pyx_v_node);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ete4/core/tree.pyx":1797
 *     # TODO: The next two functions should really be parsers (which may
 *     # be also used when calling __init__().
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_parent_child_table(parent_child_table):
 *         """Convert a parent-child table into an ETE Tree instance.
 */

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_161from_parent_child_table(PyObject *__pyx_v_parent_child_table) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_53_from_parent_child_table *__pyx_cur_scope;
  PyObject *__pyx_v_get_node = 0;
  PyObject *__pyx_v_columns = NULL;
  PyObject *__pyx_v_parent_name = NULL;
  PyObject *__pyx_v_child_name = NULL;
  PyObject *__pyx_v_distance = NULL;
  PyObject *__pyx_v_dist = NULL;
  PyObject *__pyx_v_parent = NULL;
  PyObject *__pyx_v_root = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *(*__pyx_t_10)(PyObject *);
  PyObject *__pyx_t_11 = NULL;
  unsigned int __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("from_parent_child_table", 0);
  __pyx_cur_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_53_from_parent_child_table *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_53_from_parent_child_table(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_53_from_parent_child_table, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_53_from_parent_child_table *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1797, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }

  /* "ete4/core/tree.pyx":1819
 *           #              E,1.5
 *         """
 *         def get_node(nodename, dist=None):             # <<<<<<<<<<<<<<
 *             if nodename not in nodes_by_name:
 *                 data = {'name': nodename}
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_23from_parent_child_table_1get_node, 0, __pyx_n_s_from_parent_child_table_locals_g, ((PyObject*)__pyx_cur_scope), __pyx_n_s_ete4_core_tree, __pyx_d, ((PyObject *)__pyx_codeobj__44)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1819, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__45);
  __pyx_v_get_node = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "ete4/core/tree.pyx":1831
 *             return nodes_by_name[nodename]
 * 
 *         nodes_by_name = {}             # <<<<<<<<<<<<<<
 *         for columns in parent_child_table:
 *             if len(columns) == 3:
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1831, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_nodes_by_name = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "ete4/core/tree.pyx":1832
 * 
 *         nodes_by_name = {}
 *         for columns in parent_child_table:             # <<<<<<<<<<<<<<
 *             if len(columns) == 3:
 *                 parent_name, child_name, distance = columns
 */
  if (likely(PyList_CheckExact(__pyx_v_parent_child_table)) || PyTuple_CheckExact(__pyx_v_parent_child_table)) {
    __pyx_t_1 = __pyx_v_parent_child_table; __Pyx_INCREF(__pyx_t_1);
    __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_parent_child_table); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1832, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1832, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1832, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 1832, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1832, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1832, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 1832, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1832, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1832, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_columns, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "ete4/core/tree.pyx":1833
 *         nodes_by_name = {}
 *         for columns in parent_child_table:
 *             if len(columns) == 3:             # <<<<<<<<<<<<<<
 *                 parent_name, child_name, distance = columns
 *                 dist = float(distance)
 */
    __pyx_t_5 = PyObject_Length(__pyx_v_columns); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1833, __pyx_L1_error)
    __pyx_t_6 = (__pyx_t_5 == 3);
    if (__pyx_t_6) {

      /* "ete4/core/tree.pyx":1834
 *         for columns in parent_child_table:
 *             if len(columns) == 3:
 *                 parent_name, child_name, distance = columns             # <<<<<<<<<<<<<<
 *                 dist = float(distance)
 *             else:
 */
      if ((likely(PyTuple_CheckExact(__pyx_v_columns))) || (PyList_CheckExact(__pyx_v_columns))) {
        PyObject* sequence = __pyx_v_columns;
        Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
        if (unlikely(size != 3)) {
          if (size > 3) __Pyx_RaiseTooManyValuesError(3);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          __PYX_ERR(0, 1834, __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); 
          __pyx_t_8 = PyTuple_GET_ITEM(sequence, 2); 
        } else {
          __pyx_t_4 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_7 = PyList_GET_ITEM(sequence, 1); 
          __pyx_t_8 = PyList_GET_ITEM(sequence, 2); 
        }
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_8);
        #else
        __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1834, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1834, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1834, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        #endif
      } else {
        Py_ssize_t index = -1;
        __pyx_t_9 = PyObject_GetIter(__pyx_v_columns); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1834, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_10 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_9);
        index = 0; __pyx_t_4 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_4)) goto __pyx_L6_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_4);
        index = 1; __pyx_t_7 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_7)) goto __pyx_L6_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_7);
        index = 2; __pyx_t_8 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L6_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_8);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 3) < 0) __PYX_ERR(0, 1834, __pyx_L1_error)
        __pyx_t_10 = NULL;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        goto __pyx_L7_unpacking_done;
        __pyx_L6_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_10 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(0, 1834, __pyx_L1_error)
        __pyx_L7_unpacking_done:;
      }
      __Pyx_XDECREF_SET(__pyx_v_parent_name, __pyx_t_4);
      __pyx_t_4 = 0;
      __Pyx_XDECREF_SET(__pyx_v_child_name, __pyx_t_7);
      __pyx_t_7 = 0;
      __Pyx_XDECREF_SET(__pyx_v_distance, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "ete4/core/tree.pyx":1835
 *             if len(columns) == 3:
 *                 parent_name, child_name, distance = columns
 *                 dist = float(distance)             # <<<<<<<<<<<<<<
 *             else:
 *                 parent_name, child_name = columns
 */
      __pyx_t_8 = __Pyx_PyNumber_Float(__pyx_v_distance); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1835, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_XDECREF_SET(__pyx_v_dist, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "ete4/core/tree.pyx":1833
 *         nodes_by_name = {}
 *         for columns in parent_child_table:
 *             if len(columns) == 3:             # <<<<<<<<<<<<<<
 *                 parent_name, child_name, distance = columns
 *                 dist = float(distance)
 */
      goto __pyx_L5;
    }

    /* "ete4/core/tree.pyx":1837
 *                 dist = float(distance)
 *             else:
 *                 parent_name, child_name = columns             # <<<<<<<<<<<<<<
 *                 dist = None
 *             parent = get_node(parent_name)
 */
    /*else*/ {
      if ((likely(PyTuple_CheckExact(__pyx_v_columns))) || (PyList_CheckExact(__pyx_v_columns))) {
        PyObject* sequence = __pyx_v_columns;
        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, 1837, __pyx_L1_error)
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_8 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_7 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_7);
        #else
        __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1837, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1837, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        #endif
      } else {
        Py_ssize_t index = -1;
        __pyx_t_4 = PyObject_GetIter(__pyx_v_columns); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1837, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_10 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4);
        index = 0; __pyx_t_8 = __pyx_t_10(__pyx_t_4); if (unlikely(!__pyx_t_8)) goto __pyx_L8_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_8);
        index = 1; __pyx_t_7 = __pyx_t_10(__pyx_t_4); if (unlikely(!__pyx_t_7)) goto __pyx_L8_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_7);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_4), 2) < 0) __PYX_ERR(0, 1837, __pyx_L1_error)
        __pyx_t_10 = NULL;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        goto __pyx_L9_unpacking_done;
        __pyx_L8_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_10 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(0, 1837, __pyx_L1_error)
        __pyx_L9_unpacking_done:;
      }
      __Pyx_XDECREF_SET(__pyx_v_parent_name, __pyx_t_8);
      __pyx_t_8 = 0;
      __Pyx_XDECREF_SET(__pyx_v_child_name, __pyx_t_7);
      __pyx_t_7 = 0;

      /* "ete4/core/tree.pyx":1838
 *             else:
 *                 parent_name, child_name = columns
 *                 dist = None             # <<<<<<<<<<<<<<
 *             parent = get_node(parent_name)
 *             parent.add_child(get_node(child_name, dist=dist))
 */
      __Pyx_INCREF(Py_None);
      __Pyx_XDECREF_SET(__pyx_v_dist, Py_None);
    }
    __pyx_L5:;

    /* "ete4/core/tree.pyx":1839
 *                 parent_name, child_name = columns
 *                 dist = None
 *             parent = get_node(parent_name)             # <<<<<<<<<<<<<<
 *             parent.add_child(get_node(child_name, dist=dist))
 * 
 */
    __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_v_get_node, __pyx_v_parent_name); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1839, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_XDECREF_SET(__pyx_v_parent, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "ete4/core/tree.pyx":1840
 *                 dist = None
 *             parent = get_node(parent_name)
 *             parent.add_child(get_node(child_name, dist=dist))             # <<<<<<<<<<<<<<
 * 
 *         root = parent.root
 */
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_parent, __pyx_n_s_add_child); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1840, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1840, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_child_name);
    __Pyx_GIVEREF(__pyx_v_child_name);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_child_name)) __PYX_ERR(0, 1840, __pyx_L1_error);
    __pyx_t_9 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1840, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_dist, __pyx_v_dist) < 0) __PYX_ERR(0, 1840, __pyx_L1_error)
    __pyx_t_11 = __Pyx_PyObject_Call(__pyx_v_get_node, __pyx_t_4, __pyx_t_9); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1840, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = NULL;
    __pyx_t_12 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
        __pyx_t_12 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_11};
      __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_12, 1+__pyx_t_12);
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1840, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "ete4/core/tree.pyx":1832
 * 
 *         nodes_by_name = {}
 *         for columns in parent_child_table:             # <<<<<<<<<<<<<<
 *             if len(columns) == 3:
 *                 parent_name, child_name, distance = columns
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ete4/core/tree.pyx":1842
 *             parent.add_child(get_node(child_name, dist=dist))
 * 
 *         root = parent.root             # <<<<<<<<<<<<<<
 *         return root
 * 
 */
  if (unlikely(!__pyx_v_parent)) { __Pyx_RaiseUnboundLocalError("parent"); __PYX_ERR(0, 1842, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_parent, __pyx_n_s_root); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1842, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_root = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "ete4/core/tree.pyx":1843
 * 
 *         root = parent.root
 *         return root             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_root);
  __pyx_r = __pyx_v_root;
  goto __pyx_L0;

  /* "ete4/core/tree.pyx":1797
 *     # TODO: The next two functions should really be parsers (which may
 *     # be also used when calling __init__().
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_parent_child_table(parent_child_table):
 *         """Convert a parent-child table into an ETE Tree instance.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("ete4.core.tree.Tree.from_parent_child_table", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_get_node);
  __Pyx_XDECREF(__pyx_v_columns);
  __Pyx_XDECREF(__pyx_v_parent_name);
  __Pyx_XDECREF(__pyx_v_child_name);
  __Pyx_XDECREF(__pyx_v_distance);
  __Pyx_XDECREF(__pyx_v_dist);
  __Pyx_XDECREF(__pyx_v_parent);
  __Pyx_XDECREF(__pyx_v_root);
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ete4/core/tree.pyx":1845
 *         return root
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_skbio(skbio_tree, map_attributes=None):
 *         """Convert a scikit-bio TreeNode object into ETE Tree object.
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_164from_skbio(CYTHON_UNUSED PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_4ete4_4core_4tree_4Tree_163from_skbio, "Tree.from_skbio(skbio_tree, map_attributes=None)\nConvert a scikit-bio TreeNode object into ETE Tree object.\n\n        :param skbio_tree: A scikit bio TreeNode instance\n        :param map_attributes: List of attribute names in the\n            scikit-bio tree that should be mapped into the ETE tree\n            instance. (name, id and branch length are always mapped)\n\n        Example::\n\n          t = Tree.from_skibio(skbioTree, map_attributes=['value'])\n        ");
static PyMethodDef __pyx_mdef_4ete4_4core_4tree_4Tree_164from_skbio = {"from_skbio", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_164from_skbio, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_163from_skbio};
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_164from_skbio(CYTHON_UNUSED PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_skbio_tree = 0;
  PyObject *__pyx_v_map_attributes = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_skbio (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_skbio_tree,&__pyx_n_s_map_attributes,0};

    /* "ete4/core/tree.pyx":1846
 * 
 *     @staticmethod
 *     def from_skbio(skbio_tree, map_attributes=None):             # <<<<<<<<<<<<<<
 *         """Convert a scikit-bio TreeNode object into ETE Tree object.
 * 
 */
    values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_skbio_tree)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1845, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_map_attributes);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1845, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "from_skbio") < 0)) __PYX_ERR(0, 1845, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_skbio_tree = values[0];
    __pyx_v_map_attributes = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_skbio", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 1845, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("ete4.core.tree.Tree.from_skbio", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_163from_skbio(__pyx_v_skbio_tree, __pyx_v_map_attributes);

  /* "ete4/core/tree.pyx":1845
 *         return root
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_skbio(skbio_tree, map_attributes=None):
 *         """Convert a scikit-bio TreeNode object into ETE Tree object.
 */

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

/* "ete4/core/tree.pyx":1860
 *         from skbio import TreeNode as skbioTreeNode
 * 
 *         def get_ete_node(skbio_node):             # <<<<<<<<<<<<<<
 *             ete_node = all_nodes.get(skbio_node, Tree())
 *             if skbio_node.props.get('length') is not None:
 */

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

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

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_10from_skbio_get_ete_node(PyObject *__pyx_self, PyObject *__pyx_v_skbio_node) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_54_from_skbio *__pyx_cur_scope;
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_54_from_skbio *__pyx_outer_scope;
  PyObject *__pyx_v_ete_node = NULL;
  PyObject *__pyx_v_a = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  PyObject *__pyx_t_10 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_ete_node", 1);
  __pyx_outer_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_54_from_skbio *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "ete4/core/tree.pyx":1861
 * 
 *         def get_ete_node(skbio_node):
 *             ete_node = all_nodes.get(skbio_node, Tree())             # <<<<<<<<<<<<<<
 *             if skbio_node.props.get('length') is not None:
 *                 ete_node.dist = float(skbio_node.props.get('length'))
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_all_nodes)) { __Pyx_RaiseClosureNameError("all_nodes"); __PYX_ERR(0, 1861, __pyx_L1_error) }
  if (unlikely(__pyx_cur_scope->__pyx_v_all_nodes == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
    __PYX_ERR(0, 1861, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1861, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyDict_GetItemDefault(__pyx_cur_scope->__pyx_v_all_nodes, __pyx_v_skbio_node, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1861, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_ete_node = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "ete4/core/tree.pyx":1862
 *         def get_ete_node(skbio_node):
 *             ete_node = all_nodes.get(skbio_node, Tree())
 *             if skbio_node.props.get('length') is not None:             # <<<<<<<<<<<<<<
 *                 ete_node.dist = float(skbio_node.props.get('length'))
 *             ete_node.name = skbio_node.name
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_skbio_node, __pyx_n_s_props); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1862, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_get); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1862, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_n_u_length};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1862, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_t_5 = (__pyx_t_2 != Py_None);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_5) {

    /* "ete4/core/tree.pyx":1863
 *             ete_node = all_nodes.get(skbio_node, Tree())
 *             if skbio_node.props.get('length') is not None:
 *                 ete_node.dist = float(skbio_node.props.get('length'))             # <<<<<<<<<<<<<<
 *             ete_node.name = skbio_node.name
 *             ete_node.add_props(id=skbio_node.props.get('id'))
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_skbio_node, __pyx_n_s_props); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1863, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_get); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1863, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    __pyx_t_4 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_4 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_n_u_length};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1863, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __pyx_t_1 = __Pyx_PyNumber_Float(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1863, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_ete_node, __pyx_n_s_dist, __pyx_t_1) < 0) __PYX_ERR(0, 1863, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "ete4/core/tree.pyx":1862
 *         def get_ete_node(skbio_node):
 *             ete_node = all_nodes.get(skbio_node, Tree())
 *             if skbio_node.props.get('length') is not None:             # <<<<<<<<<<<<<<
 *                 ete_node.dist = float(skbio_node.props.get('length'))
 *             ete_node.name = skbio_node.name
 */
  }

  /* "ete4/core/tree.pyx":1864
 *             if skbio_node.props.get('length') is not None:
 *                 ete_node.dist = float(skbio_node.props.get('length'))
 *             ete_node.name = skbio_node.name             # <<<<<<<<<<<<<<
 *             ete_node.add_props(id=skbio_node.props.get('id'))
 *             if map_attributes:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_skbio_node, __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1864, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_ete_node, __pyx_n_s_name, __pyx_t_1) < 0) __PYX_ERR(0, 1864, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ete4/core/tree.pyx":1865
 *                 ete_node.dist = float(skbio_node.props.get('length'))
 *             ete_node.name = skbio_node.name
 *             ete_node.add_props(id=skbio_node.props.get('id'))             # <<<<<<<<<<<<<<
 *             if map_attributes:
 *                 for a in map_attributes:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_ete_node, __pyx_n_s_add_props); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1865, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1865, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_skbio_node, __pyx_n_s_props); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1865, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_get); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1865, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_n_u_id};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1865, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_id, __pyx_t_3) < 0) __PYX_ERR(0, 1865, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1865, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "ete4/core/tree.pyx":1866
 *             ete_node.name = skbio_node.name
 *             ete_node.add_props(id=skbio_node.props.get('id'))
 *             if map_attributes:             # <<<<<<<<<<<<<<
 *                 for a in map_attributes:
 *                     ete_node.add_prop(a, skbio_node.props.get(a))
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_map_attributes)) { __Pyx_RaiseClosureNameError("map_attributes"); __PYX_ERR(0, 1866, __pyx_L1_error) }
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_map_attributes); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1866, __pyx_L1_error)
  if (__pyx_t_5) {

    /* "ete4/core/tree.pyx":1867
 *             ete_node.add_props(id=skbio_node.props.get('id'))
 *             if map_attributes:
 *                 for a in map_attributes:             # <<<<<<<<<<<<<<
 *                     ete_node.add_prop(a, skbio_node.props.get(a))
 *             return ete_node
 */
    if (unlikely(!__pyx_cur_scope->__pyx_v_map_attributes)) { __Pyx_RaiseClosureNameError("map_attributes"); __PYX_ERR(0, 1867, __pyx_L1_error) }
    if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_map_attributes)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_map_attributes)) {
      __pyx_t_3 = __pyx_cur_scope->__pyx_v_map_attributes; __Pyx_INCREF(__pyx_t_3);
      __pyx_t_8 = 0;
      __pyx_t_9 = NULL;
    } else {
      __pyx_t_8 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_map_attributes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1867, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1867, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_9)) {
        if (likely(PyList_CheckExact(__pyx_t_3))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1867, __pyx_L1_error)
            #endif
            if (__pyx_t_8 >= __pyx_temp) 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, 1867, __pyx_L1_error)
          #else
          __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1867, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1867, __pyx_L1_error)
            #endif
            if (__pyx_t_8 >= __pyx_temp) 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, 1867, __pyx_L1_error)
          #else
          __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1867, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        }
      } else {
        __pyx_t_2 = __pyx_t_9(__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, 1867, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_XDECREF_SET(__pyx_v_a, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "ete4/core/tree.pyx":1868
 *             if map_attributes:
 *                 for a in map_attributes:
 *                     ete_node.add_prop(a, skbio_node.props.get(a))             # <<<<<<<<<<<<<<
 *             return ete_node
 * 
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_ete_node, __pyx_n_s_add_prop); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1868, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_skbio_node, __pyx_n_s_props); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1868, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_get); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1868, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      __pyx_t_4 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_10))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_10);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_10, function);
          __pyx_t_4 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_a};
        __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1868, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      }
      __pyx_t_10 = NULL;
      __pyx_t_4 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_10)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
          __pyx_t_4 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_10, __pyx_v_a, __pyx_t_7};
        __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4);
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1868, __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;

      /* "ete4/core/tree.pyx":1867
 *             ete_node.add_props(id=skbio_node.props.get('id'))
 *             if map_attributes:
 *                 for a in map_attributes:             # <<<<<<<<<<<<<<
 *                     ete_node.add_prop(a, skbio_node.props.get(a))
 *             return ete_node
 */
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "ete4/core/tree.pyx":1866
 *             ete_node.name = skbio_node.name
 *             ete_node.add_props(id=skbio_node.props.get('id'))
 *             if map_attributes:             # <<<<<<<<<<<<<<
 *                 for a in map_attributes:
 *                     ete_node.add_prop(a, skbio_node.props.get(a))
 */
  }

  /* "ete4/core/tree.pyx":1869
 *                 for a in map_attributes:
 *                     ete_node.add_prop(a, skbio_node.props.get(a))
 *             return ete_node             # <<<<<<<<<<<<<<
 * 
 *         all_nodes = {}
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_ete_node);
  __pyx_r = __pyx_v_ete_node;
  goto __pyx_L0;

  /* "ete4/core/tree.pyx":1860
 *         from skbio import TreeNode as skbioTreeNode
 * 
 *         def get_ete_node(skbio_node):             # <<<<<<<<<<<<<<
 *             ete_node = all_nodes.get(skbio_node, Tree())
 *             if skbio_node.props.get('length') is not None:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("ete4.core.tree.Tree.from_skbio.get_ete_node", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ete_node);
  __Pyx_XDECREF(__pyx_v_a);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ete4/core/tree.pyx":1845
 *         return root
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_skbio(skbio_tree, map_attributes=None):
 *         """Convert a scikit-bio TreeNode object into ETE Tree object.
 */

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_163from_skbio(PyObject *__pyx_v_skbio_tree, PyObject *__pyx_v_map_attributes) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_54_from_skbio *__pyx_cur_scope;
  PyObject *__pyx_v_skbioTreeNode = NULL;
  PyObject *__pyx_v_get_ete_node = 0;
  PyObject *__pyx_v_node = NULL;
  PyObject *__pyx_v_ete_node = NULL;
  PyObject *__pyx_v_ch = NULL;
  PyObject *__pyx_v_ete_ch = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  Py_ssize_t __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  unsigned int __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("from_skbio", 0);
  __pyx_cur_scope = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_54_from_skbio *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_54_from_skbio(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_54_from_skbio, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_54_from_skbio *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1845, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_map_attributes = __pyx_v_map_attributes;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_map_attributes);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_map_attributes);

  /* "ete4/core/tree.pyx":1858
 *           t = Tree.from_skibio(skbioTree, map_attributes=['value'])
 *         """
 *         from skbio import TreeNode as skbioTreeNode             # <<<<<<<<<<<<<<
 * 
 *         def get_ete_node(skbio_node):
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1858, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_TreeNode);
  __Pyx_GIVEREF(__pyx_n_s_TreeNode);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_TreeNode)) __PYX_ERR(0, 1858, __pyx_L1_error);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_skbio, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1858, __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_TreeNode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1858, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_skbioTreeNode = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ete4/core/tree.pyx":1860
 *         from skbio import TreeNode as skbioTreeNode
 * 
 *         def get_ete_node(skbio_node):             # <<<<<<<<<<<<<<
 *             ete_node = all_nodes.get(skbio_node, Tree())
 *             if skbio_node.props.get('length') is not None:
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_10from_skbio_1get_ete_node, 0, __pyx_n_s_from_skbio_locals_get_ete_node, ((PyObject*)__pyx_cur_scope), __pyx_n_s_ete4_core_tree, __pyx_d, ((PyObject *)__pyx_codeobj__47)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1860, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_get_ete_node = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "ete4/core/tree.pyx":1871
 *             return ete_node
 * 
 *         all_nodes = {}             # <<<<<<<<<<<<<<
 *         if isinstance(skbio_tree, skbioTreeNode):
 *             for node in skbio_tree.preorder(include_self=True):
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1871, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_cur_scope->__pyx_v_all_nodes = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "ete4/core/tree.pyx":1872
 * 
 *         all_nodes = {}
 *         if isinstance(skbio_tree, skbioTreeNode):             # <<<<<<<<<<<<<<
 *             for node in skbio_tree.preorder(include_self=True):
 *                 all_nodes[node] = get_ete_node(node)
 */
  __pyx_t_3 = PyObject_IsInstance(__pyx_v_skbio_tree, __pyx_v_skbioTreeNode); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 1872, __pyx_L1_error)
  if (__pyx_t_3) {

    /* "ete4/core/tree.pyx":1873
 *         all_nodes = {}
 *         if isinstance(skbio_tree, skbioTreeNode):
 *             for node in skbio_tree.preorder(include_self=True):             # <<<<<<<<<<<<<<
 *                 all_nodes[node] = get_ete_node(node)
 *                 ete_node = all_nodes[node]
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_skbio_tree, __pyx_n_s_preorder); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1873, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1873, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_include_self, Py_True) < 0) __PYX_ERR(0, 1873, __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, 1873, __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(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
      __pyx_t_1 = __pyx_t_4; __Pyx_INCREF(__pyx_t_1);
      __pyx_t_5 = 0;
      __pyx_t_6 = NULL;
    } else {
      __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1873, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1873, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    for (;;) {
      if (likely(!__pyx_t_6)) {
        if (likely(PyList_CheckExact(__pyx_t_1))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1873, __pyx_L1_error)
            #endif
            if (__pyx_t_5 >= __pyx_temp) 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, 1873, __pyx_L1_error)
          #else
          __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1873, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          #endif
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1873, __pyx_L1_error)
            #endif
            if (__pyx_t_5 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 1873, __pyx_L1_error)
          #else
          __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1873, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          #endif
        }
      } else {
        __pyx_t_4 = __pyx_t_6(__pyx_t_1);
        if (unlikely(!__pyx_t_4)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 1873, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_4);
      }
      __Pyx_XDECREF_SET(__pyx_v_node, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "ete4/core/tree.pyx":1874
 *         if isinstance(skbio_tree, skbioTreeNode):
 *             for node in skbio_tree.preorder(include_self=True):
 *                 all_nodes[node] = get_ete_node(node)             # <<<<<<<<<<<<<<
 *                 ete_node = all_nodes[node]
 *                 for ch in node.children:
 */
      __pyx_t_4 = __pyx_pf_4ete4_4core_4tree_4Tree_10from_skbio_get_ete_node(__pyx_v_get_ete_node, __pyx_v_node); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1874, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (unlikely((PyDict_SetItem(__pyx_cur_scope->__pyx_v_all_nodes, __pyx_v_node, __pyx_t_4) < 0))) __PYX_ERR(0, 1874, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ete4/core/tree.pyx":1875
 *             for node in skbio_tree.preorder(include_self=True):
 *                 all_nodes[node] = get_ete_node(node)
 *                 ete_node = all_nodes[node]             # <<<<<<<<<<<<<<
 *                 for ch in node.children:
 *                     ete_ch = get_ete_node(ch)
 */
      __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_all_nodes, __pyx_v_node); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1875, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_XDECREF_SET(__pyx_v_ete_node, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "ete4/core/tree.pyx":1876
 *                 all_nodes[node] = get_ete_node(node)
 *                 ete_node = all_nodes[node]
 *                 for ch in node.children:             # <<<<<<<<<<<<<<
 *                     ete_ch = get_ete_node(ch)
 *                     ete_node.add_child(ete_ch)
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_node, __pyx_n_s_children); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1876, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
        __pyx_t_2 = __pyx_t_4; __Pyx_INCREF(__pyx_t_2);
        __pyx_t_7 = 0;
        __pyx_t_8 = NULL;
      } else {
        __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1876, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1876, __pyx_L1_error)
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      for (;;) {
        if (likely(!__pyx_t_8)) {
          if (likely(PyList_CheckExact(__pyx_t_2))) {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
              #if !CYTHON_ASSUME_SAFE_MACROS
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1876, __pyx_L1_error)
              #endif
              if (__pyx_t_7 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 1876, __pyx_L1_error)
            #else
            __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1876, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            #endif
          } else {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
              #if !CYTHON_ASSUME_SAFE_MACROS
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1876, __pyx_L1_error)
              #endif
              if (__pyx_t_7 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 1876, __pyx_L1_error)
            #else
            __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1876, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            #endif
          }
        } else {
          __pyx_t_4 = __pyx_t_8(__pyx_t_2);
          if (unlikely(!__pyx_t_4)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 1876, __pyx_L1_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_4);
        }
        __Pyx_XDECREF_SET(__pyx_v_ch, __pyx_t_4);
        __pyx_t_4 = 0;

        /* "ete4/core/tree.pyx":1877
 *                 ete_node = all_nodes[node]
 *                 for ch in node.children:
 *                     ete_ch = get_ete_node(ch)             # <<<<<<<<<<<<<<
 *                     ete_node.add_child(ete_ch)
 *                     all_nodes[ch] = ete_ch
 */
        __pyx_t_4 = __pyx_pf_4ete4_4core_4tree_4Tree_10from_skbio_get_ete_node(__pyx_v_get_ete_node, __pyx_v_ch); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1877, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_XDECREF_SET(__pyx_v_ete_ch, __pyx_t_4);
        __pyx_t_4 = 0;

        /* "ete4/core/tree.pyx":1878
 *                 for ch in node.children:
 *                     ete_ch = get_ete_node(ch)
 *                     ete_node.add_child(ete_ch)             # <<<<<<<<<<<<<<
 *                     all_nodes[ch] = ete_ch
 *             return ete_ch.root
 */
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_ete_node, __pyx_n_s_add_child); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1878, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_10 = NULL;
        __pyx_t_11 = 0;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_9))) {
          __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
          if (likely(__pyx_t_10)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
            __Pyx_INCREF(__pyx_t_10);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_9, function);
            __pyx_t_11 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_v_ete_ch};
          __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_11, 1+__pyx_t_11);
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1878, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "ete4/core/tree.pyx":1879
 *                     ete_ch = get_ete_node(ch)
 *                     ete_node.add_child(ete_ch)
 *                     all_nodes[ch] = ete_ch             # <<<<<<<<<<<<<<
 *             return ete_ch.root
 * 
 */
        if (unlikely((PyDict_SetItem(__pyx_cur_scope->__pyx_v_all_nodes, __pyx_v_ch, __pyx_v_ete_ch) < 0))) __PYX_ERR(0, 1879, __pyx_L1_error)

        /* "ete4/core/tree.pyx":1876
 *                 all_nodes[node] = get_ete_node(node)
 *                 ete_node = all_nodes[node]
 *                 for ch in node.children:             # <<<<<<<<<<<<<<
 *                     ete_ch = get_ete_node(ch)
 *                     ete_node.add_child(ete_ch)
 */
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "ete4/core/tree.pyx":1873
 *         all_nodes = {}
 *         if isinstance(skbio_tree, skbioTreeNode):
 *             for node in skbio_tree.preorder(include_self=True):             # <<<<<<<<<<<<<<
 *                 all_nodes[node] = get_ete_node(node)
 *                 ete_node = all_nodes[node]
 */
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "ete4/core/tree.pyx":1880
 *                     ete_node.add_child(ete_ch)
 *                     all_nodes[ch] = ete_ch
 *             return ete_ch.root             # <<<<<<<<<<<<<<
 * 
 *     # Functions used for treeview (qt visualization).
 */
    __Pyx_XDECREF(__pyx_r);
    if (unlikely(!__pyx_v_ete_ch)) { __Pyx_RaiseUnboundLocalError("ete_ch"); __PYX_ERR(0, 1880, __pyx_L1_error) }
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_ete_ch, __pyx_n_s_root); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1880, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "ete4/core/tree.pyx":1872
 * 
 *         all_nodes = {}
 *         if isinstance(skbio_tree, skbioTreeNode):             # <<<<<<<<<<<<<<
 *             for node in skbio_tree.preorder(include_self=True):
 *                 all_nodes[node] = get_ete_node(node)
 */
  }

  /* "ete4/core/tree.pyx":1845
 *         return root
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_skbio(skbio_tree, map_attributes=None):
 *         """Convert a scikit-bio TreeNode object into ETE Tree object.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("ete4.core.tree.Tree.from_skbio", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_skbioTreeNode);
  __Pyx_XDECREF(__pyx_v_get_ete_node);
  __Pyx_XDECREF(__pyx_v_node);
  __Pyx_XDECREF(__pyx_v_ete_node);
  __Pyx_XDECREF(__pyx_v_ch);
  __Pyx_XDECREF(__pyx_v_ete_ch);
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ete4/core/tree.pyx":1884
 *     # Functions used for treeview (qt visualization).
 * 
 *     def add_face(self, face, column, position='branch-right'):             # <<<<<<<<<<<<<<
 *         from ..treeview import Face, FaceContainer
 *         from ..treeview.main import _FaceAreas, FACE_POSITIONS
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_166add_face(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_4ete4_4core_4tree_4Tree_165add_face, "Tree.add_face(self, face, column, position=u'branch-right')");
static PyMethodDef __pyx_mdef_4ete4_4core_4tree_4Tree_166add_face = {"add_face", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_166add_face, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_165add_face};
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_166add_face(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_face = 0;
  PyObject *__pyx_v_column = 0;
  PyObject *__pyx_v_position = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add_face (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_face,&__pyx_n_s_column,&__pyx_n_s_position,0};
    values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_kp_u_branch_right));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_face)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1884, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_column)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1884, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("add_face", 0, 2, 3, 1); __PYX_ERR(0, 1884, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_position);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1884, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "add_face") < 0)) __PYX_ERR(0, 1884, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_face = values[0];
    __pyx_v_column = values[1];
    __pyx_v_position = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("add_face", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 1884, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("ete4.core.tree.Tree.add_face", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_165add_face(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self), __pyx_v_face, __pyx_v_column, __pyx_v_position);

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

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_165add_face(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_face, PyObject *__pyx_v_column, PyObject *__pyx_v_position) {
  PyObject *__pyx_v_Face = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_FaceContainer = NULL;
  PyObject *__pyx_v__FaceAreas = NULL;
  PyObject *__pyx_v_FACE_POSITIONS = NULL;
  PyObject *__pyx_v_face_area = NULL;
  PyObject *__pyx_v_e = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  unsigned int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  Py_UCS4 __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("add_face", 1);

  /* "ete4/core/tree.pyx":1885
 * 
 *     def add_face(self, face, column, position='branch-right'):
 *         from ..treeview import Face, FaceContainer             # <<<<<<<<<<<<<<
 *         from ..treeview.main import _FaceAreas, FACE_POSITIONS
 * 
 */
  __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1885, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_Face);
  __Pyx_GIVEREF(__pyx_n_s_Face);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Face)) __PYX_ERR(0, 1885, __pyx_L1_error);
  __Pyx_INCREF(__pyx_n_s_FaceContainer);
  __Pyx_GIVEREF(__pyx_n_s_FaceContainer);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_FaceContainer)) __PYX_ERR(0, 1885, __pyx_L1_error);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_treeview, __pyx_t_1, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1885, __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_Face); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1885, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_Face = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_FaceContainer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1885, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_FaceContainer = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ete4/core/tree.pyx":1886
 *     def add_face(self, face, column, position='branch-right'):
 *         from ..treeview import Face, FaceContainer
 *         from ..treeview.main import _FaceAreas, FACE_POSITIONS             # <<<<<<<<<<<<<<
 * 
 *         if '_faces' not in self.props:
 */
  __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1886, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_FaceAreas);
  __Pyx_GIVEREF(__pyx_n_s_FaceAreas);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_FaceAreas)) __PYX_ERR(0, 1886, __pyx_L1_error);
  __Pyx_INCREF(__pyx_n_s_FACE_POSITIONS);
  __Pyx_GIVEREF(__pyx_n_s_FACE_POSITIONS);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_FACE_POSITIONS)) __PYX_ERR(0, 1886, __pyx_L1_error);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_treeview_main, __pyx_t_2, 2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1886, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_FaceAreas); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1886, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_v__FaceAreas = __pyx_t_2;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_FACE_POSITIONS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1886, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_v_FACE_POSITIONS = __pyx_t_2;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ete4/core/tree.pyx":1888
 *         from ..treeview.main import _FaceAreas, FACE_POSITIONS
 * 
 *         if '_faces' not in self.props:             # <<<<<<<<<<<<<<
 *             self.props['_faces'] = _FaceAreas()
 * 
 */
  if (unlikely(__pyx_v_self->props == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(0, 1888, __pyx_L1_error)
  }
  __pyx_t_3 = (__Pyx_PyDict_ContainsTF(__pyx_n_u_faces, __pyx_v_self->props, Py_NE)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1888, __pyx_L1_error)
  if (__pyx_t_3) {

    /* "ete4/core/tree.pyx":1889
 * 
 *         if '_faces' not in self.props:
 *             self.props['_faces'] = _FaceAreas()             # <<<<<<<<<<<<<<
 * 
 *         try:
 */
    __Pyx_INCREF(__pyx_v__FaceAreas);
    __pyx_t_2 = __pyx_v__FaceAreas; __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1889, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    if (unlikely(__pyx_v_self->props == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 1889, __pyx_L1_error)
    }
    if (unlikely((PyDict_SetItem(__pyx_v_self->props, __pyx_n_u_faces, __pyx_t_1) < 0))) __PYX_ERR(0, 1889, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "ete4/core/tree.pyx":1888
 *         from ..treeview.main import _FaceAreas, FACE_POSITIONS
 * 
 *         if '_faces' not in self.props:             # <<<<<<<<<<<<<<
 *             self.props['_faces'] = _FaceAreas()
 * 
 */
  }

  /* "ete4/core/tree.pyx":1891
 *             self.props['_faces'] = _FaceAreas()
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             assert position in FACE_POSITIONS, f'position {position} not in {FACE_POSITIONS}'
 *             assert isinstance(face, Face), f'face {face} is not a Face instance'
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
    __Pyx_XGOTREF(__pyx_t_6);
    __Pyx_XGOTREF(__pyx_t_7);
    __Pyx_XGOTREF(__pyx_t_8);
    /*try:*/ {

      /* "ete4/core/tree.pyx":1892
 * 
 *         try:
 *             assert position in FACE_POSITIONS, f'position {position} not in {FACE_POSITIONS}'             # <<<<<<<<<<<<<<
 *             assert isinstance(face, Face), f'face {face} is not a Face instance'
 * 
 */
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      if (unlikely(__pyx_assertions_enabled())) {
        __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_v_position, __pyx_v_FACE_POSITIONS, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1892, __pyx_L4_error)
        if (unlikely(!__pyx_t_3)) {
          __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1892, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_9 = 0;
          __pyx_t_10 = 127;
          __Pyx_INCREF(__pyx_kp_u_position_2);
          __pyx_t_9 += 9;
          __Pyx_GIVEREF(__pyx_kp_u_position_2);
          PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_position_2);
          __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_position, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1892, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_10 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_10) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_10;
          __pyx_t_9 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
          __Pyx_GIVEREF(__pyx_t_2);
          PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
          __pyx_t_2 = 0;
          __Pyx_INCREF(__pyx_kp_u_not_in);
          __pyx_t_9 += 8;
          __Pyx_GIVEREF(__pyx_kp_u_not_in);
          PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_not_in);
          __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_FACE_POSITIONS, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1892, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_10 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_10) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_10;
          __pyx_t_9 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
          __Pyx_GIVEREF(__pyx_t_2);
          PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_2);
          __pyx_t_2 = 0;
          __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_1, 4, __pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1892, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_t_2, 0, 0);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __PYX_ERR(0, 1892, __pyx_L4_error)
        }
      }
      #else
      if ((1)); else __PYX_ERR(0, 1892, __pyx_L4_error)
      #endif

      /* "ete4/core/tree.pyx":1893
 *         try:
 *             assert position in FACE_POSITIONS, f'position {position} not in {FACE_POSITIONS}'
 *             assert isinstance(face, Face), f'face {face} is not a Face instance'             # <<<<<<<<<<<<<<
 * 
 *             face_area = getattr(self.props['_faces'], position)
 */
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      if (unlikely(__pyx_assertions_enabled())) {
        __pyx_t_3 = PyObject_IsInstance(__pyx_v_face, __pyx_v_Face); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 1893, __pyx_L4_error)
        if (unlikely(!__pyx_t_3)) {
          __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1893, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_9 = 0;
          __pyx_t_10 = 127;
          __Pyx_INCREF(__pyx_kp_u_face_2);
          __pyx_t_9 += 5;
          __Pyx_GIVEREF(__pyx_kp_u_face_2);
          PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_face_2);
          __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_v_face, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1893, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_10 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_10) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_10;
          __pyx_t_9 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
          __Pyx_GIVEREF(__pyx_t_1);
          PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
          __pyx_t_1 = 0;
          __Pyx_INCREF(__pyx_kp_u_is_not_a_Face_instance);
          __pyx_t_9 += 23;
          __Pyx_GIVEREF(__pyx_kp_u_is_not_a_Face_instance);
          PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u_is_not_a_Face_instance);
          __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_2, 3, __pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1893, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_t_1, 0, 0);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __PYX_ERR(0, 1893, __pyx_L4_error)
        }
      }
      #else
      if ((1)); else __PYX_ERR(0, 1893, __pyx_L4_error)
      #endif

      /* "ete4/core/tree.pyx":1895
 *             assert isinstance(face, Face), f'face {face} is not a Face instance'
 * 
 *             face_area = getattr(self.props['_faces'], position)             # <<<<<<<<<<<<<<
 *             face_area.add_face(face, column=column)
 * 
 */
      if (unlikely(__pyx_v_self->props == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(0, 1895, __pyx_L4_error)
      }
      __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_self->props, __pyx_n_u_faces); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1895, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_position); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1895, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_face_area = __pyx_t_2;
      __pyx_t_2 = 0;

      /* "ete4/core/tree.pyx":1896
 * 
 *             face_area = getattr(self.props['_faces'], position)
 *             face_area.add_face(face, column=column)             # <<<<<<<<<<<<<<
 * 
 *         except AssertionError as e:
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_face_area, __pyx_n_s_add_face); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1896, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1896, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_v_face);
      __Pyx_GIVEREF(__pyx_v_face);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_face)) __PYX_ERR(0, 1896, __pyx_L4_error);
      __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1896, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_column, __pyx_v_column) < 0) __PYX_ERR(0, 1896, __pyx_L4_error)
      __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1896, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

      /* "ete4/core/tree.pyx":1891
 *             self.props['_faces'] = _FaceAreas()
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             assert position in FACE_POSITIONS, f'position {position} not in {FACE_POSITIONS}'
 *             assert isinstance(face, Face), f'face {face} is not a Face instance'
 */
    }
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    goto __pyx_L9_try_end;
    __pyx_L4_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ete4/core/tree.pyx":1898
 *             face_area.add_face(face, column=column)
 * 
 *         except AssertionError as e:             # <<<<<<<<<<<<<<
 *             raise ValueError(e)
 * 
 */
    __pyx_t_12 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AssertionError);
    if (__pyx_t_12) {
      __Pyx_AddTraceback("ete4.core.tree.Tree.add_face", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_11, &__pyx_t_4, &__pyx_t_1) < 0) __PYX_ERR(0, 1898, __pyx_L6_except_error)
      __Pyx_XGOTREF(__pyx_t_11);
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_4);
      __pyx_v_e = __pyx_t_4;
      /*try:*/ {

        /* "ete4/core/tree.pyx":1899
 * 
 *         except AssertionError as e:
 *             raise ValueError(e)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_v_e); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1899, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_Raise(__pyx_t_2, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __PYX_ERR(0, 1899, __pyx_L15_error)
      }

      /* "ete4/core/tree.pyx":1898
 *             face_area.add_face(face, column=column)
 * 
 *         except AssertionError as e:             # <<<<<<<<<<<<<<
 *             raise ValueError(e)
 * 
 */
      /*finally:*/ {
        __pyx_L15_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_12 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
          }
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_12; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L6_except_error;
        }
      }
    }
    goto __pyx_L6_except_error;

    /* "ete4/core/tree.pyx":1891
 *             self.props['_faces'] = _FaceAreas()
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             assert position in FACE_POSITIONS, f'position {position} not in {FACE_POSITIONS}'
 *             assert isinstance(face, Face), f'face {face} is not a Face instance'
 */
    __pyx_L6_except_error:;
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
    goto __pyx_L1_error;
    __pyx_L9_try_end:;
  }

  /* "ete4/core/tree.pyx":1884
 *     # Functions used for treeview (qt visualization).
 * 
 *     def add_face(self, face, column, position='branch-right'):             # <<<<<<<<<<<<<<
 *         from ..treeview import Face, FaceContainer
 *         from ..treeview.main import _FaceAreas, FACE_POSITIONS
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("ete4.core.tree.Tree.add_face", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_Face);
  __Pyx_XDECREF(__pyx_v_FaceContainer);
  __Pyx_XDECREF(__pyx_v__FaceAreas);
  __Pyx_XDECREF(__pyx_v_FACE_POSITIONS);
  __Pyx_XDECREF(__pyx_v_face_area);
  __Pyx_XDECREF(__pyx_v_e);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ete4/core/tree.pyx":1901
 *             raise ValueError(e)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def img_style(self):
 *         from ..treeview.main import NodeStyle
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_9img_style_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_9img_style_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_9img_style___get__(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self));

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

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_9img_style___get__(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self) {
  PyObject *__pyx_v_NodeStyle = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  unsigned int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 1);

  /* "ete4/core/tree.pyx":1903
 *     @property
 *     def img_style(self):
 *         from ..treeview.main import NodeStyle             # <<<<<<<<<<<<<<
 * 
 *         if '_img_style' not in self.props:
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1903, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_NodeStyle);
  __Pyx_GIVEREF(__pyx_n_s_NodeStyle);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_NodeStyle)) __PYX_ERR(0, 1903, __pyx_L1_error);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_treeview_main, __pyx_t_1, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1903, __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_NodeStyle); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1903, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_NodeStyle = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ete4/core/tree.pyx":1905
 *         from ..treeview.main import NodeStyle
 * 
 *         if '_img_style' not in self.props:             # <<<<<<<<<<<<<<
 *             self.props['_img_style'] = NodeStyle()
 * 
 */
  if (unlikely(__pyx_v_self->props == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(0, 1905, __pyx_L1_error)
  }
  __pyx_t_3 = (__Pyx_PyDict_ContainsTF(__pyx_n_u_img_style, __pyx_v_self->props, Py_NE)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1905, __pyx_L1_error)
  if (__pyx_t_3) {

    /* "ete4/core/tree.pyx":1906
 * 
 *         if '_img_style' not in self.props:
 *             self.props['_img_style'] = NodeStyle()             # <<<<<<<<<<<<<<
 * 
 *         return self.props['_img_style']
 */
    __Pyx_INCREF(__pyx_v_NodeStyle);
    __pyx_t_1 = __pyx_v_NodeStyle; __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (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_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1906, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    if (unlikely(__pyx_v_self->props == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 1906, __pyx_L1_error)
    }
    if (unlikely((PyDict_SetItem(__pyx_v_self->props, __pyx_n_u_img_style, __pyx_t_2) < 0))) __PYX_ERR(0, 1906, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "ete4/core/tree.pyx":1905
 *         from ..treeview.main import NodeStyle
 * 
 *         if '_img_style' not in self.props:             # <<<<<<<<<<<<<<
 *             self.props['_img_style'] = NodeStyle()
 * 
 */
  }

  /* "ete4/core/tree.pyx":1908
 *             self.props['_img_style'] = NodeStyle()
 * 
 *         return self.props['_img_style']             # <<<<<<<<<<<<<<
 * 
 *     @img_style.setter
 */
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(__pyx_v_self->props == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(0, 1908, __pyx_L1_error)
  }
  __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_self->props, __pyx_n_u_img_style); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1908, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "ete4/core/tree.pyx":1901
 *             raise ValueError(e)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def img_style(self):
 *         from ..treeview.main import NodeStyle
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("ete4.core.tree.Tree.img_style.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_NodeStyle);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ete4/core/tree.pyx":1910
 *         return self.props['_img_style']
 * 
 *     @img_style.setter             # <<<<<<<<<<<<<<
 *     def img_style(self, value):
 *         self.props['_img_style'] = value
 */

/* Python wrapper */
static int __pyx_pw_4ete4_4core_4tree_4Tree_9img_style_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_4ete4_4core_4tree_4Tree_9img_style_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_9img_style_2__set__(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_4ete4_4core_4tree_4Tree_9img_style_2__set__(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "ete4/core/tree.pyx":1912
 *     @img_style.setter
 *     def img_style(self, value):
 *         self.props['_img_style'] = value             # <<<<<<<<<<<<<<
 * 
 *     def set_style(self, value):
 */
  if (unlikely(__pyx_v_self->props == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(0, 1912, __pyx_L1_error)
  }
  if (unlikely((PyDict_SetItem(__pyx_v_self->props, __pyx_n_u_img_style, __pyx_v_value) < 0))) __PYX_ERR(0, 1912, __pyx_L1_error)

  /* "ete4/core/tree.pyx":1910
 *         return self.props['_img_style']
 * 
 *     @img_style.setter             # <<<<<<<<<<<<<<
 *     def img_style(self, value):
 *         self.props['_img_style'] = value
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("ete4.core.tree.Tree.img_style.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "ete4/core/tree.pyx":1914
 *         self.props['_img_style'] = value
 * 
 *     def set_style(self, value):             # <<<<<<<<<<<<<<
 *         self.props['_img_style'] = value
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_168set_style(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_4ete4_4core_4tree_4Tree_167set_style, "Tree.set_style(self, value)");
static PyMethodDef __pyx_mdef_4ete4_4core_4tree_4Tree_168set_style = {"set_style", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_168set_style, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_167set_style};
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_168set_style(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_value = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_style (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_value,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1914, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_style") < 0)) __PYX_ERR(0, 1914, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_value = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_style", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1914, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("ete4.core.tree.Tree.set_style", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_167set_style(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self), __pyx_v_value);

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

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_167set_style(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_style", 1);

  /* "ete4/core/tree.pyx":1915
 * 
 *     def set_style(self, value):
 *         self.props['_img_style'] = value             # <<<<<<<<<<<<<<
 */
  if (unlikely(__pyx_v_self->props == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(0, 1915, __pyx_L1_error)
  }
  if (unlikely((PyDict_SetItem(__pyx_v_self->props, __pyx_n_u_img_style, __pyx_v_value) < 0))) __PYX_ERR(0, 1915, __pyx_L1_error)

  /* "ete4/core/tree.pyx":1914
 *         self.props['_img_style'] = value
 * 
 *     def set_style(self, value):             # <<<<<<<<<<<<<<
 *         self.props['_img_style'] = value
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("ete4.core.tree.Tree.set_style", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ete4/core/tree.pyx":36
 *     """
 * 
 *     cdef public Tree up  # parent             # <<<<<<<<<<<<<<
 *     cdef public dict props
 *     cdef public list _children
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_2up_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_2up_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_2up___get__(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self));

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

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_2up___get__(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 1);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->up);
  __pyx_r = ((PyObject *)__pyx_v_self->up);
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_4ete4_4core_4tree_4Tree_2up_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_4ete4_4core_4tree_4Tree_2up_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_2up_2__set__(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_4ete4_4core_4tree_4Tree_2up_2__set__(struct __pyx_obj_4ete4_4core_4tree_Tree *__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__", 1);
  if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_4ete4_4core_4tree_Tree))))) __PYX_ERR(0, 36, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->up);
  __Pyx_DECREF((PyObject *)__pyx_v_self->up);
  __pyx_v_self->up = ((struct __pyx_obj_4ete4_4core_4tree_Tree *)__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("ete4.core.tree.Tree.up.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_4ete4_4core_4tree_4Tree_2up_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_4ete4_4core_4tree_4Tree_2up_5__del__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_2up_4__del__(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self));

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

static int __pyx_pf_4ete4_4core_4tree_4Tree_2up_4__del__(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 1);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->up);
  __Pyx_DECREF((PyObject *)__pyx_v_self->up);
  __pyx_v_self->up = ((struct __pyx_obj_4ete4_4core_4tree_Tree *)Py_None);

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

/* "ete4/core/tree.pyx":37
 * 
 *     cdef public Tree up  # parent
 *     cdef public dict props             # <<<<<<<<<<<<<<
 *     cdef public list _children
 *     cdef public (double, double) size  # sum of lengths, number of leaves
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_5props_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_5props_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_5props___get__(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self));

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

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_5props___get__(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 1);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->props);
  __pyx_r = __pyx_v_self->props;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_4ete4_4core_4tree_4Tree_5props_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_4ete4_4core_4tree_4Tree_5props_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_5props_2__set__(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_4ete4_4core_4tree_4Tree_5props_2__set__(struct __pyx_obj_4ete4_4core_4tree_Tree *__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__", 1);
  if (!(likely(PyDict_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None) || __Pyx_RaiseUnexpectedTypeError("dict", __pyx_v_value))) __PYX_ERR(0, 37, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->props);
  __Pyx_DECREF(__pyx_v_self->props);
  __pyx_v_self->props = ((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("ete4.core.tree.Tree.props.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_4ete4_4core_4tree_4Tree_5props_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_4ete4_4core_4tree_4Tree_5props_5__del__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_5props_4__del__(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self));

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

static int __pyx_pf_4ete4_4core_4tree_4Tree_5props_4__del__(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 1);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->props);
  __Pyx_DECREF(__pyx_v_self->props);
  __pyx_v_self->props = ((PyObject*)Py_None);

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

/* "ete4/core/tree.pyx":38
 *     cdef public Tree up  # parent
 *     cdef public dict props
 *     cdef public list _children             # <<<<<<<<<<<<<<
 *     cdef public (double, double) size  # sum of lengths, number of leaves
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_9_children_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_9_children_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_9_children___get__(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self));

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

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_9_children___get__(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 1);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_children);
  __pyx_r = __pyx_v_self->_children;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_4ete4_4core_4tree_4Tree_9_children_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_4ete4_4core_4tree_4Tree_9_children_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_9_children_2__set__(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_4ete4_4core_4tree_4Tree_9_children_2__set__(struct __pyx_obj_4ete4_4core_4tree_Tree *__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__", 1);
  if (!(likely(PyList_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_v_value))) __PYX_ERR(0, 38, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->_children);
  __Pyx_DECREF(__pyx_v_self->_children);
  __pyx_v_self->_children = ((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("ete4.core.tree.Tree._children.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_4ete4_4core_4tree_4Tree_9_children_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_4ete4_4core_4tree_4Tree_9_children_5__del__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_9_children_4__del__(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self));

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

static int __pyx_pf_4ete4_4core_4tree_4Tree_9_children_4__del__(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 1);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_children);
  __Pyx_DECREF(__pyx_v_self->_children);
  __pyx_v_self->_children = ((PyObject*)Py_None);

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

/* "ete4/core/tree.pyx":39
 *     cdef public dict props
 *     cdef public list _children
 *     cdef public (double, double) size  # sum of lengths, number of leaves             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, data=None, children=None, parser=None):
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_4size_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_4size___get__(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self));

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

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_4size___get__(struct __pyx_obj_4ete4_4core_4tree_Tree *__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__", 1);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_convert__to_py___pyx_ctuple_double__and_double(__pyx_v_self->size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 39, __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("ete4.core.tree.Tree.size.__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_4ete4_4core_4tree_4Tree_4size_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_4ete4_4core_4tree_4Tree_4size_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_4size_2__set__(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_4ete4_4core_4tree_4Tree_4size_2__set__(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __pyx_ctuple_double__and_double __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __pyx_t_1 = __pyx_convert__from_py___pyx_ctuple_double__and_double(__pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 39, __pyx_L1_error)
  __pyx_v_self->size = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("ete4.core.tree.Tree.size.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_170__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_4ete4_4core_4tree_4Tree_169__reduce_cython__, "Tree.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_4ete4_4core_4tree_4Tree_170__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_170__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_169__reduce_cython__};
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_170__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_169__reduce_cython__(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self));

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

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

  /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     state = (self._children, self.props, self.size, self.up)             # <<<<<<<<<<<<<<
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 */
  __pyx_t_1 = __pyx_convert__to_py___pyx_ctuple_double__and_double(__pyx_v_self->size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_self->_children);
  __Pyx_GIVEREF(__pyx_v_self->_children);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self->_children)) __PYX_ERR(1, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->props);
  __Pyx_GIVEREF(__pyx_v_self->props);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_self->props)) __PYX_ERR(1, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->up);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->up);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 3, ((PyObject *)__pyx_v_self->up))) __PYX_ERR(1, 5, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_v_state = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     state = (self._children, self.props, self.size, self.up)
 *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None:
 *         state += (_dict,)
 */
  __pyx_t_2 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v__dict = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "(tree fragment)":7
 *     state = (self._children, self.props, self.size, self.up)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
  __pyx_t_3 = (__pyx_v__dict != Py_None);
  if (__pyx_t_3) {

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

    /* "(tree fragment)":9
 *     if _dict is not None:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = self._children is not None or self.props is not None or self.up is not None
 */
    __pyx_v_use_setstate = 1;

    /* "(tree fragment)":7
 *     state = (self._children, self.props, self.size, self.up)
 *     _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._children is not None or self.props is not None or self.up is not None             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle_Tree, (type(self), 0x9050475, None), state
 */
  /*else*/ {
    __pyx_t_4 = (__pyx_v_self->_children != ((PyObject*)Py_None));
    if (!__pyx_t_4) {
    } else {
      __pyx_t_3 = __pyx_t_4;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_4 = (__pyx_v_self->props != ((PyObject*)Py_None));
    if (!__pyx_t_4) {
    } else {
      __pyx_t_3 = __pyx_t_4;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_4 = (((PyObject *)__pyx_v_self->up) != Py_None);
    __pyx_t_3 = __pyx_t_4;
    __pyx_L4_bool_binop_done:;
    __pyx_v_use_setstate = __pyx_t_3;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = self._children is not None or self.props is not None or self.up is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_Tree, (type(self), 0x9050475, None), state
 *     else:
 */
  if (__pyx_v_use_setstate) {

    /* "(tree fragment)":13
 *         use_setstate = self._children is not None or self.props is not None or self.up is not None
 *     if use_setstate:
 *         return __pyx_unpickle_Tree, (type(self), 0x9050475, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_Tree, (type(self), 0x9050475, state)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_pyx_unpickle_Tree); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(1, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_int_151323765);
    __Pyx_GIVEREF(__pyx_int_151323765);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_151323765)) __PYX_ERR(1, 13, __pyx_L1_error);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, Py_None)) __PYX_ERR(1, 13, __pyx_L1_error);
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_2);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2)) __PYX_ERR(1, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state)) __PYX_ERR(1, 13, __pyx_L1_error);
    __pyx_t_1 = 0;
    __pyx_t_2 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;

    /* "(tree fragment)":12
 *     else:
 *         use_setstate = self._children is not None or self.props is not None or self.up is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_Tree, (type(self), 0x9050475, None), state
 *     else:
 */
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_Tree, (type(self), 0x9050475, None), state
 *     else:
 *         return __pyx_unpickle_Tree, (type(self), 0x9050475, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_Tree__set_state(self, __pyx_state)
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_Tree); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(1, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_int_151323765);
    __Pyx_GIVEREF(__pyx_int_151323765);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_151323765)) __PYX_ERR(1, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_state)) __PYX_ERR(1, 15, __pyx_L1_error);
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_5);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_2);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2)) __PYX_ERR(1, 15, __pyx_L1_error);
    __pyx_t_5 = 0;
    __pyx_t_2 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
  }

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("ete4.core.tree.Tree.__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_Tree, (type(self), 0x9050475, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_Tree__set_state(self, __pyx_state)
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_172__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_4ete4_4core_4tree_4Tree_171__setstate_cython__, "Tree.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_4ete4_4core_4tree_4Tree_172__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_172__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_171__setstate_cython__};
static PyObject *__pyx_pw_4ete4_4core_4tree_4Tree_172__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 16, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 16, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 16, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("ete4.core.tree.Tree.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ete4_4core_4tree_4Tree_171__setstate_cython__(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v_self), __pyx_v___pyx_state);

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

static PyObject *__pyx_pf_4ete4_4core_4tree_4Tree_171__setstate_cython__(struct __pyx_obj_4ete4_4core_4tree_Tree *__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__", 1);

  /* "(tree fragment)":17
 *         return __pyx_unpickle_Tree, (type(self), 0x9050475, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_Tree__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
 */
  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(1, 17, __pyx_L1_error)
  __pyx_t_1 = __pyx_f_4ete4_4core_4tree___pyx_unpickle_Tree__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_Tree, (type(self), 0x9050475, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_Tree__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("ete4.core.tree.Tree.__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_Tree(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ete4_4core_4tree_1__pyx_unpickle_Tree(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_4ete4_4core_4tree___pyx_unpickle_Tree, "__pyx_unpickle_Tree(__pyx_type, long __pyx_checksum, __pyx_state)");
static PyMethodDef __pyx_mdef_4ete4_4core_4tree_1__pyx_unpickle_Tree = {"__pyx_unpickle_Tree", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_1__pyx_unpickle_Tree, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree___pyx_unpickle_Tree};
static PyObject *__pyx_pw_4ete4_4core_4tree_1__pyx_unpickle_Tree(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle_Tree (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_type)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_checksum)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Tree", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Tree", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__pyx_unpickle_Tree") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
      values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
    }
    __pyx_v___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_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Tree", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 1, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("ete4.core.tree.__pyx_unpickle_Tree", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ete4_4core_4tree___pyx_unpickle_Tree(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

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

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

  /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum not in (0x9050475, 0x1a93b81, 0x290a31e):             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x9050475, 0x1a93b81, 0x290a31e) = (_children, props, size, up))" % __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__48, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "(tree fragment)":5
 *     cdef object __pyx_result
 *     if __pyx_checksum not in (0x9050475, 0x1a93b81, 0x290a31e):
 *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x9050475, 0x1a93b81, 0x290a31e) = (_children, props, size, up))" % __pyx_checksum
 *     __pyx_result = Tree.__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);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError)) __PYX_ERR(1, 5, __pyx_L1_error);
    __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_3, __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_3); __pyx_t_3 = 0;

    /* "(tree fragment)":6
 *     if __pyx_checksum not in (0x9050475, 0x1a93b81, 0x290a31e):
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x9050475, 0x1a93b81, 0x290a31e) = (_children, props, size, up))" % __pyx_checksum             # <<<<<<<<<<<<<<
 *     __pyx_result = Tree.__new__(__pyx_type)
 *     if __pyx_state is not None:
 */
    __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_v___pyx_PickleError, __pyx_t_1, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(1, 6, __pyx_L1_error)

    /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum not in (0x9050475, 0x1a93b81, 0x290a31e):             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x9050475, 0x1a93b81, 0x290a31e) = (_children, props, size, up))" % __pyx_checksum
 */
  }

  /* "(tree fragment)":7
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x9050475, 0x1a93b81, 0x290a31e) = (_children, props, size, up))" % __pyx_checksum
 *     __pyx_result = Tree.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_Tree__set_state(<Tree> __pyx_result, __pyx_state)
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree), __pyx_n_s_new); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v___pyx_type};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 7, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_v___pyx_result = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "(tree fragment)":8
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x9050475, 0x1a93b81, 0x290a31e) = (_children, props, size, up))" % __pyx_checksum
 *     __pyx_result = Tree.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_Tree__set_state(<Tree> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  __pyx_t_2 = (__pyx_v___pyx_state != Py_None);
  if (__pyx_t_2) {

    /* "(tree fragment)":9
 *     __pyx_result = Tree.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle_Tree__set_state(<Tree> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle_Tree__set_state(Tree __pyx_result, tuple __pyx_state):
 */
    if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(1, 9, __pyx_L1_error)
    __pyx_t_1 = __pyx_f_4ete4_4core_4tree___pyx_unpickle_Tree__set_state(((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "(tree fragment)":8
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x9050475, 0x1a93b81, 0x290a31e) = (_children, props, size, up))" % __pyx_checksum
 *     __pyx_result = Tree.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_Tree__set_state(<Tree> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle_Tree__set_state(<Tree> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle_Tree__set_state(Tree __pyx_result, tuple __pyx_state):
 *     __pyx_result._children = __pyx_state[0]; __pyx_result.props = __pyx_state[1]; __pyx_result.size = __pyx_state[2]; __pyx_result.up = __pyx_state[3]
 */
  __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_Tree(__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_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("ete4.core.tree.__pyx_unpickle_Tree", __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_Tree__set_state(<Tree> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_Tree__set_state(Tree __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result._children = __pyx_state[0]; __pyx_result.props = __pyx_state[1]; __pyx_result.size = __pyx_state[2]; __pyx_result.up = __pyx_state[3]
 *     if len(__pyx_state) > 4 and hasattr(__pyx_result, '__dict__'):
 */

static PyObject *__pyx_f_4ete4_4core_4tree___pyx_unpickle_Tree__set_state(struct __pyx_obj_4ete4_4core_4tree_Tree *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __pyx_ctuple_double__and_double __pyx_t_2;
  int __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  unsigned int __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_Tree__set_state", 1);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle_Tree__set_state(Tree __pyx_result, tuple __pyx_state):
 *     __pyx_result._children = __pyx_state[0]; __pyx_result.props = __pyx_state[1]; __pyx_result.size = __pyx_state[2]; __pyx_result.up = __pyx_state[3]             # <<<<<<<<<<<<<<
 *     if len(__pyx_state) > 4 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[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, 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(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_1))) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->_children);
  __Pyx_DECREF(__pyx_v___pyx_result->_children);
  __pyx_v___pyx_result->_children = ((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(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("dict", __pyx_t_1))) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->props);
  __Pyx_DECREF(__pyx_v___pyx_result->props);
  __pyx_v___pyx_result->props = ((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);
  __pyx_t_2 = __pyx_convert__from_py___pyx_ctuple_double__and_double(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->size = __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_4ete4_4core_4tree_Tree))))) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->up);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->up);
  __pyx_v___pyx_result->up = ((struct __pyx_obj_4ete4_4core_4tree_Tree *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "(tree fragment)":13
 * cdef __pyx_unpickle_Tree__set_state(Tree __pyx_result, tuple __pyx_state):
 *     __pyx_result._children = __pyx_state[0]; __pyx_result.props = __pyx_state[1]; __pyx_result.size = __pyx_state[2]; __pyx_result.up = __pyx_state[3]
 *     if len(__pyx_state) > 4 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[4])
 */
  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_4 = __Pyx_PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
  __pyx_t_5 = (__pyx_t_4 > 4);
  if (__pyx_t_5) {
  } else {
    __pyx_t_3 = __pyx_t_5;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_5 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
  __pyx_t_3 = __pyx_t_5;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_3) {

    /* "(tree fragment)":14
 *     __pyx_result._children = __pyx_state[0]; __pyx_result.props = __pyx_state[1]; __pyx_result.size = __pyx_state[2]; __pyx_result.up = __pyx_state[3]
 *     if len(__pyx_state) > 4 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[4])             # <<<<<<<<<<<<<<
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = NULL;
    __pyx_t_9 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
        __pyx_t_9 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_6};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "(tree fragment)":13
 * cdef __pyx_unpickle_Tree__set_state(Tree __pyx_result, tuple __pyx_state):
 *     __pyx_result._children = __pyx_state[0]; __pyx_result.props = __pyx_state[1]; __pyx_result.size = __pyx_state[2]; __pyx_result.up = __pyx_state[3]
 *     if len(__pyx_state) > 4 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[4])
 */
  }

  /* "(tree fragment)":11
 *         __pyx_unpickle_Tree__set_state(<Tree> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_Tree__set_state(Tree __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result._children = __pyx_state[0]; __pyx_result.props = __pyx_state[1]; __pyx_result.size = __pyx_state[2]; __pyx_result.up = __pyx_state[3]
 *     if len(__pyx_state) > 4 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_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("ete4.core.tree.__pyx_unpickle_Tree__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_tp_new_4ete4_4core_4tree_Tree(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_4ete4_4core_4tree_Tree *p;
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  #endif
  p = ((struct __pyx_obj_4ete4_4core_4tree_Tree *)o);
  p->up = ((struct __pyx_obj_4ete4_4core_4tree_Tree *)Py_None); Py_INCREF(Py_None);
  p->props = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->_children = ((PyObject*)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_4ete4_4core_4tree_Tree(PyObject *o) {
  struct __pyx_obj_4ete4_4core_4tree_Tree *p = (struct __pyx_obj_4ete4_4core_4tree_Tree *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4ete4_4core_4tree_Tree) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->up);
  Py_CLEAR(p->props);
  Py_CLEAR(p->_children);
  #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
  (*Py_TYPE(o)->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
}

static int __pyx_tp_traverse_4ete4_4core_4tree_Tree(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4ete4_4core_4tree_Tree *p = (struct __pyx_obj_4ete4_4core_4tree_Tree *)o;
  if (p->up) {
    e = (*v)(((PyObject *)p->up), a); if (e) return e;
  }
  if (p->props) {
    e = (*v)(p->props, a); if (e) return e;
  }
  if (p->_children) {
    e = (*v)(p->_children, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_4ete4_4core_4tree_Tree(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_4ete4_4core_4tree_Tree *p = (struct __pyx_obj_4ete4_4core_4tree_Tree *)o;
  tmp = ((PyObject*)p->up);
  p->up = ((struct __pyx_obj_4ete4_4core_4tree_Tree *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->props);
  p->props = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_children);
  p->_children = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}
static PyObject *__pyx_sq_item_4ete4_4core_4tree_Tree(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static CYTHON_INLINE PyObject *__pyx_nb_add_4ete4_4core_4tree_Tree_maybe_call_slot(PyTypeObject* type, PyObject *left, PyObject *right ) {
    binaryfunc slot;
#if CYTHON_USE_TYPE_SLOTS || PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY
    slot = type->tp_as_number ? type->tp_as_number->nb_add : NULL;
#else
    slot = (binaryfunc) PyType_GetSlot(type, Py_nb_add);
#endif
    return slot ? slot(left, right ) : __Pyx_NewRef(Py_NotImplemented);
}
static PyObject *__pyx_nb_add_4ete4_4core_4tree_Tree(PyObject *left, PyObject *right ) {
    int maybe_self_is_left, maybe_self_is_right = 0;
    maybe_self_is_left = Py_TYPE(left) == Py_TYPE(right)
#if CYTHON_USE_TYPE_SLOTS
            || (Py_TYPE(left)->tp_as_number && Py_TYPE(left)->tp_as_number->nb_add == &__pyx_nb_add_4ete4_4core_4tree_Tree)
#endif
            || __Pyx_TypeCheck(left, __pyx_ptype_4ete4_4core_4tree_Tree);
    if (maybe_self_is_left) {
        PyObject *res;
        res = __pyx_pw_4ete4_4core_4tree_4Tree_11__add__(left, right);
        if (res != Py_NotImplemented) return res;
        Py_DECREF(res);
    }
    maybe_self_is_right = Py_TYPE(left) == Py_TYPE(right)
#if CYTHON_USE_TYPE_SLOTS
            || (Py_TYPE(right)->tp_as_number && Py_TYPE(right)->tp_as_number->nb_add == &__pyx_nb_add_4ete4_4core_4tree_Tree)
#endif
            || PyType_IsSubtype(Py_TYPE(right), __pyx_ptype_4ete4_4core_4tree_Tree);
    if (maybe_self_is_right) {
        return __pyx_nb_add_4ete4_4core_4tree_Tree_maybe_call_slot(__Pyx_PyType_GetSlot(__pyx_ptype_4ete4_4core_4tree_Tree, tp_base, PyTypeObject*), left, right );
    }
    return __Pyx_NewRef(Py_NotImplemented);
}



static PyObject *__pyx_getprop_4ete4_4core_4tree_4Tree_name(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_4ete4_4core_4tree_4Tree_4name_1__get__(o);
}

static int __pyx_setprop_4ete4_4core_4tree_4Tree_name(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_4ete4_4core_4tree_4Tree_4name_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4ete4_4core_4tree_4Tree_dist(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_4ete4_4core_4tree_4Tree_4dist_1__get__(o);
}

static int __pyx_setprop_4ete4_4core_4tree_4Tree_dist(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_4ete4_4core_4tree_4Tree_4dist_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4ete4_4core_4tree_4Tree_support(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_4ete4_4core_4tree_4Tree_7support_1__get__(o);
}

static int __pyx_setprop_4ete4_4core_4tree_4Tree_support(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_4ete4_4core_4tree_4Tree_7support_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4ete4_4core_4tree_4Tree_children(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_4ete4_4core_4tree_4Tree_8children_1__get__(o);
}

static int __pyx_setprop_4ete4_4core_4tree_4Tree_children(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_4ete4_4core_4tree_4Tree_8children_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4ete4_4core_4tree_4Tree_is_leaf(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_4ete4_4core_4tree_4Tree_7is_leaf_1__get__(o);
}

static PyObject *__pyx_getprop_4ete4_4core_4tree_4Tree_is_root(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_4ete4_4core_4tree_4Tree_7is_root_1__get__(o);
}

static PyObject *__pyx_getprop_4ete4_4core_4tree_4Tree_root(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_4ete4_4core_4tree_4Tree_4root_1__get__(o);
}

static PyObject *__pyx_getprop_4ete4_4core_4tree_4Tree_id(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_4ete4_4core_4tree_4Tree_2id_1__get__(o);
}

static PyObject *__pyx_getprop_4ete4_4core_4tree_4Tree_level(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_4ete4_4core_4tree_4Tree_5level_1__get__(o);
}

static PyObject *__pyx_getprop_4ete4_4core_4tree_4Tree_img_style(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_4ete4_4core_4tree_4Tree_9img_style_1__get__(o);
}

static int __pyx_setprop_4ete4_4core_4tree_4Tree_img_style(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_4ete4_4core_4tree_4Tree_9img_style_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4ete4_4core_4tree_4Tree_up(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_4ete4_4core_4tree_4Tree_2up_1__get__(o);
}

static int __pyx_setprop_4ete4_4core_4tree_4Tree_up(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_4ete4_4core_4tree_4Tree_2up_3__set__(o, v);
  }
  else {
    return __pyx_pw_4ete4_4core_4tree_4Tree_2up_5__del__(o);
  }
}

static PyObject *__pyx_getprop_4ete4_4core_4tree_4Tree_props(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_4ete4_4core_4tree_4Tree_5props_1__get__(o);
}

static int __pyx_setprop_4ete4_4core_4tree_4Tree_props(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_4ete4_4core_4tree_4Tree_5props_3__set__(o, v);
  }
  else {
    return __pyx_pw_4ete4_4core_4tree_4Tree_5props_5__del__(o);
  }
}

static PyObject *__pyx_getprop_4ete4_4core_4tree_4Tree__children(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_4ete4_4core_4tree_4Tree_9_children_1__get__(o);
}

static int __pyx_setprop_4ete4_4core_4tree_4Tree__children(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_4ete4_4core_4tree_4Tree_9_children_3__set__(o, v);
  }
  else {
    return __pyx_pw_4ete4_4core_4tree_4Tree_9_children_5__del__(o);
  }
}

static PyObject *__pyx_getprop_4ete4_4core_4tree_4Tree_size(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_4ete4_4core_4tree_4Tree_4size_1__get__(o);
}

static int __pyx_setprop_4ete4_4core_4tree_4Tree_size(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_4ete4_4core_4tree_4Tree_4size_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_specialmethod___pyx_pw_4ete4_4core_4tree_4Tree_13__repr__(PyObject *self, CYTHON_UNUSED PyObject *arg) {
  return __pyx_pw_4ete4_4core_4tree_4Tree_13__repr__(self);
}

static PyMethodDef __pyx_methods_4ete4_4core_4tree_Tree[] = {
  {"get_prop", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_3get_prop, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_2get_prop},
  {"__repr__", (PyCFunction)__pyx_specialmethod___pyx_pw_4ete4_4core_4tree_4Tree_13__repr__, METH_NOARGS|METH_COEXIST, 0},
  {"to_str", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_17to_str, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_16to_str},
  {"add_prop", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_24add_prop, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_23add_prop},
  {"add_props", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_26add_props, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_25add_props},
  {"del_prop", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_28del_prop, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_27del_prop},
  {"add_child", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_30add_child, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_29add_child},
  {"add_children", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_32add_children, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_31add_children},
  {"pop_child", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_34pop_child, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_33pop_child},
  {"remove_child", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_36remove_child, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_35remove_child},
  {"remove_children", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_38remove_children, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_37remove_children},
  {"add_sister", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_40add_sister, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_39add_sister},
  {"remove_sister", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_42remove_sister, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_41remove_sister},
  {"delete", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_44delete, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_43delete},
  {"detach", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_46detach, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_45detach},
  {"prune", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_48prune, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_47prune},
  {"reverse_children", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_50reverse_children, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_49reverse_children},
  {"swap_children", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_52swap_children, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_51swap_children},
  {"get_children", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_54get_children, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_53get_children},
  {"get_sisters", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_56get_sisters, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_55get_sisters},
  {"leaves", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_58leaves, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_57leaves},
  {"leaf_names", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_61leaf_names, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_60leaf_names},
  {"descendants", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_64descendants, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_63descendants},
  {"traverse", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_67traverse, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_66traverse},
  {"iter_prepostorder", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_70iter_prepostorder, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_69iter_prepostorder},
  {"ancestors", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_73ancestors, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_72ancestors},
  {"lineage", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_76lineage, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_75lineage},
  {"_translate_nodes", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_79_translate_nodes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_78_translate_nodes},
  {"describe", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_81describe, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_80describe},
  {"write", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_83write, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_82write},
  {"common_ancestor", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_85common_ancestor, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_84common_ancestor},
  {"search_nodes", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_87search_nodes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_86search_nodes},
  {"search_descendants", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_90search_descendants, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_89search_descendants},
  {"search_ancestors", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_93search_ancestors, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_92search_ancestors},
  {"search_leaves_by_name", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_96search_leaves_by_name, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_95search_leaves_by_name},
  {"get_distance", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_98get_distance, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_97get_distance},
  {"get_farthest_node", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_100get_farthest_node, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_99get_farthest_node},
  {"_get_farthest_and_closest_leaves", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_102_get_farthest_and_closest_leaves, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_101_get_farthest_and_closest_leaves},
  {"get_farthest_leaf", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_104get_farthest_leaf, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_103get_farthest_leaf},
  {"get_closest_leaf", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_106get_closest_leaf, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_105get_closest_leaf},
  {"get_midpoint_outgroup", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_108get_midpoint_outgroup, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_107get_midpoint_outgroup},
  {"mean_distance", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_110mean_distance, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_109mean_distance},
  {"populate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_112populate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_111populate},
  {"set_outgroup", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_114set_outgroup, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_113set_outgroup},
  {"unroot", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_116unroot, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_115unroot},
  {"show", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_118show, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_117show},
  {"render", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_120render, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_119render},
  {"explore", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_122explore, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_121explore},
  {"render_sm", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_124render_sm, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_123render_sm},
  {"copy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_126copy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_125copy},
  {"ladderize", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_128ladderize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_127ladderize},
  {"sort_descendants", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_130sort_descendants, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_129sort_descendants},
  {"get_cached_content", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_132get_cached_content, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_131get_cached_content},
  {"robinson_foulds", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_134robinson_foulds, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_133robinson_foulds},
  {"compare", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_136compare, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_135compare},
  {"_diff", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_138_diff, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_137_diff},
  {"edges", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_140edges, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_139edges},
  {"standardize", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_143standardize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_142standardize},
  {"get_topology_id", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_145get_topology_id, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_144get_topology_id},
  {"to_ultrametric", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_147to_ultrametric, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_146to_ultrametric},
  {"is_monophyletic", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_149is_monophyletic, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_148is_monophyletic},
  {"check_monophyly", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_151check_monophyly, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_150check_monophyly},
  {"get_monophyletic", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_153get_monophyletic, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_152get_monophyletic},
  {"expand_polytomies", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_156expand_polytomies, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_155expand_polytomies},
  {"resolve_polytomy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_158resolve_polytomy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_157resolve_polytomy},
  {"cophenetic_matrix", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_160cophenetic_matrix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_159cophenetic_matrix},
  {"from_parent_child_table", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_162from_parent_child_table, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_161from_parent_child_table},
  {"from_skbio", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_164from_skbio, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_163from_skbio},
  {"add_face", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_166add_face, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_165add_face},
  {"set_style", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_168set_style, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_167set_style},
  {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_170__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_169__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ete4_4core_4tree_4Tree_172__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ete4_4core_4tree_4Tree_171__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_4ete4_4core_4tree_Tree[] = {
  {(char *)"name", __pyx_getprop_4ete4_4core_4tree_4Tree_name, __pyx_setprop_4ete4_4core_4tree_4Tree_name, (char *)0, 0},
  {(char *)"dist", __pyx_getprop_4ete4_4core_4tree_4Tree_dist, __pyx_setprop_4ete4_4core_4tree_4Tree_dist, (char *)0, 0},
  {(char *)"support", __pyx_getprop_4ete4_4core_4tree_4Tree_support, __pyx_setprop_4ete4_4core_4tree_4Tree_support, (char *)0, 0},
  {(char *)"children", __pyx_getprop_4ete4_4core_4tree_4Tree_children, __pyx_setprop_4ete4_4core_4tree_4Tree_children, (char *)0, 0},
  {(char *)"is_leaf", __pyx_getprop_4ete4_4core_4tree_4Tree_is_leaf, 0, (char *)PyDoc_STR("Return True if the current node is a leaf."), 0},
  {(char *)"is_root", __pyx_getprop_4ete4_4core_4tree_4Tree_is_root, 0, (char *)PyDoc_STR("Return True if the current node has no parent."), 0},
  {(char *)"root", __pyx_getprop_4ete4_4core_4tree_4Tree_root, 0, (char *)PyDoc_STR("Return the absolute root node of the current tree structure."), 0},
  {(char *)"id", __pyx_getprop_4ete4_4core_4tree_4Tree_id, 0, (char *)PyDoc_STR("Return node_id (list of relative hops from root to node)."), 0},
  {(char *)"level", __pyx_getprop_4ete4_4core_4tree_4Tree_level, 0, (char *)PyDoc_STR("Return the number of nodes between this node and the root."), 0},
  {(char *)"img_style", __pyx_getprop_4ete4_4core_4tree_4Tree_img_style, __pyx_setprop_4ete4_4core_4tree_4Tree_img_style, (char *)0, 0},
  {(char *)"up", __pyx_getprop_4ete4_4core_4tree_4Tree_up, __pyx_setprop_4ete4_4core_4tree_4Tree_up, (char *)PyDoc_STR("up: ete4.core.tree.Tree"), 0},
  {(char *)"props", __pyx_getprop_4ete4_4core_4tree_4Tree_props, __pyx_setprop_4ete4_4core_4tree_4Tree_props, (char *)PyDoc_STR("props: dict"), 0},
  {(char *)"_children", __pyx_getprop_4ete4_4core_4tree_4Tree__children, __pyx_setprop_4ete4_4core_4tree_4Tree__children, (char *)PyDoc_STR("_children: list"), 0},
  {(char *)"size", __pyx_getprop_4ete4_4core_4tree_4Tree_size, __pyx_setprop_4ete4_4core_4tree_4Tree_size, (char *)PyDoc_STR("size: '(double, double) '"), 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_4ete4_4core_4tree_Tree_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4ete4_4core_4tree_Tree},
  {Py_tp_repr, (void *)__pyx_pw_4ete4_4core_4tree_4Tree_13__repr__},
  {Py_nb_add, (void *)__pyx_nb_add_4ete4_4core_4tree_Tree},
  {Py_nb_bool, (void *)__pyx_pw_4ete4_4core_4tree_4Tree_5__bool__},
  {Py_sq_length, (void *)__pyx_pw_4ete4_4core_4tree_4Tree_7__len__},
  {Py_sq_item, (void *)__pyx_sq_item_4ete4_4core_4tree_Tree},
  {Py_sq_contains, (void *)__pyx_pw_4ete4_4core_4tree_4Tree_19__contains__},
  {Py_mp_length, (void *)__pyx_pw_4ete4_4core_4tree_4Tree_7__len__},
  {Py_mp_subscript, (void *)__pyx_pw_4ete4_4core_4tree_4Tree_9__getitem__},
  {Py_tp_str, (void *)__pyx_pw_4ete4_4core_4tree_4Tree_15__str__},
  {Py_tp_doc, (void *)PyDoc_STR("Tree(data=None, children=None, parser=None)\n\n    A Tree has a collection of Tree instances connected in a hierarchical way.\n    Trees can be loaded from their newick representation.\n    ")},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_4ete4_4core_4tree_Tree},
  {Py_tp_clear, (void *)__pyx_tp_clear_4ete4_4core_4tree_Tree},
  {Py_tp_iter, (void *)__pyx_pw_4ete4_4core_4tree_4Tree_21__iter__},
  {Py_tp_methods, (void *)__pyx_methods_4ete4_4core_4tree_Tree},
  {Py_tp_getset, (void *)__pyx_getsets_4ete4_4core_4tree_Tree},
  {Py_tp_init, (void *)__pyx_pw_4ete4_4core_4tree_4Tree_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_4ete4_4core_4tree_Tree},
  {0, 0},
};
static PyType_Spec __pyx_type_4ete4_4core_4tree_Tree_spec = {
  "ete4.core.tree.Tree",
  sizeof(struct __pyx_obj_4ete4_4core_4tree_Tree),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
  __pyx_type_4ete4_4core_4tree_Tree_slots,
};
#else

static PyNumberMethods __pyx_tp_as_number_Tree = {
  __pyx_nb_add_4ete4_4core_4tree_Tree, /*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*/
  __pyx_pw_4ete4_4core_4tree_4Tree_5__bool__, /*nb_bool*/
  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 PySequenceMethods __pyx_tp_as_sequence_Tree = {
  __pyx_pw_4ete4_4core_4tree_4Tree_7__len__, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_4ete4_4core_4tree_Tree, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  __pyx_pw_4ete4_4core_4tree_4Tree_19__contains__, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_Tree = {
  __pyx_pw_4ete4_4core_4tree_4Tree_7__len__, /*mp_length*/
  __pyx_pw_4ete4_4core_4tree_4Tree_9__getitem__, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_4ete4_4core_4tree_Tree = {
  PyVarObject_HEAD_INIT(0, 0)
  "ete4.core.tree.""Tree", /*tp_name*/
  sizeof(struct __pyx_obj_4ete4_4core_4tree_Tree), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4ete4_4core_4tree_Tree, /*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_4ete4_4core_4tree_4Tree_13__repr__, /*tp_repr*/
  &__pyx_tp_as_number_Tree, /*tp_as_number*/
  &__pyx_tp_as_sequence_Tree, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_Tree, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pw_4ete4_4core_4tree_4Tree_15__str__, /*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*/
  PyDoc_STR("Tree(data=None, children=None, parser=None)\n\n    A Tree has a collection of Tree instances connected in a hierarchical way.\n    Trees can be loaded from their newick representation.\n    "), /*tp_doc*/
  __pyx_tp_traverse_4ete4_4core_4tree_Tree, /*tp_traverse*/
  __pyx_tp_clear_4ete4_4core_4tree_Tree, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_4ete4_4core_4tree_4Tree_21__iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4ete4_4core_4tree_Tree, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_4ete4_4core_4tree_Tree, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_4ete4_4core_4tree_4Tree_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4ete4_4core_4tree_Tree, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct__genexpr *__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct__genexpr[8];
static int __pyx_freecount_4ete4_4core_4tree___pyx_scope_struct__genexpr = 0;
#endif

static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct__genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct__genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct__genexpr)))) {
    o = (PyObject*)__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct__genexpr[--__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct__genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct__genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct__genexpr(PyObject *o) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct__genexpr *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct__genexpr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct__genexpr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_genexpr_arg_0);
  Py_CLEAR(p->__pyx_v__);
  Py_CLEAR(p->__pyx_t_0);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct__genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct__genexpr)))) {
    __pyx_freelist_4ete4_4core_4tree___pyx_scope_struct__genexpr[__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct__genexpr++] = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct__genexpr *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct__genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct__genexpr *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct__genexpr *)o;
  if (p->__pyx_genexpr_arg_0) {
    e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e;
  }
  if (p->__pyx_v__) {
    e = (*v)(p->__pyx_v__, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_4ete4_4core_4tree___pyx_scope_struct__genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct__genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct__genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct__genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_4ete4_4core_4tree___pyx_scope_struct__genexpr_spec = {
  "ete4.core.tree.__pyx_scope_struct__genexpr",
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct__genexpr),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_4ete4_4core_4tree___pyx_scope_struct__genexpr_slots,
};
#else

static PyTypeObject __pyx_type_4ete4_4core_4tree___pyx_scope_struct__genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "ete4.core.tree.""__pyx_scope_struct__genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct__genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct__genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct__genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct__genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_1___getitem__ *__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_1___getitem__[8];
static int __pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_1___getitem__ = 0;
#endif

static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_1___getitem__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_1___getitem__ > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_1___getitem__)))) {
    o = (PyObject*)__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_1___getitem__[--__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_1___getitem__];
    memset(o, 0, sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_1___getitem__));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_1___getitem__(PyObject *o) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_1___getitem__ *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_1___getitem__ *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_1___getitem__) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_node_id);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_1___getitem__ < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_1___getitem__)))) {
    __pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_1___getitem__[__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_1___getitem__++] = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_1___getitem__ *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_1___getitem__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_1___getitem__ *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_1___getitem__ *)o;
  if (p->__pyx_v_node_id) {
    e = (*v)(p->__pyx_v_node_id, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_4ete4_4core_4tree___pyx_scope_struct_1___getitem__(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_1___getitem__ *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_1___getitem__ *)o;
  tmp = ((PyObject*)p->__pyx_v_node_id);
  p->__pyx_v_node_id = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_4ete4_4core_4tree___pyx_scope_struct_1___getitem___slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_1___getitem__},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_1___getitem__},
  {Py_tp_clear, (void *)__pyx_tp_clear_4ete4_4core_4tree___pyx_scope_struct_1___getitem__},
  {Py_tp_new, (void *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_1___getitem__},
  {0, 0},
};
static PyType_Spec __pyx_type_4ete4_4core_4tree___pyx_scope_struct_1___getitem___spec = {
  "ete4.core.tree.__pyx_scope_struct_1___getitem__",
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_1___getitem__),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_4ete4_4core_4tree___pyx_scope_struct_1___getitem___slots,
};
#else

static PyTypeObject __pyx_type_4ete4_4core_4tree___pyx_scope_struct_1___getitem__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "ete4.core.tree.""__pyx_scope_struct_1___getitem__", /*tp_name*/
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_1___getitem__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_1___getitem__, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_1___getitem__, /*tp_traverse*/
  __pyx_tp_clear_4ete4_4core_4tree___pyx_scope_struct_1___getitem__, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_1___getitem__, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_2_genexpr *__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_2_genexpr[8];
static int __pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_2_genexpr = 0;
#endif

static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_2_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_2_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_2_genexpr)))) {
    o = (PyObject*)__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_2_genexpr[--__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_2_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_2_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_2_genexpr(PyObject *o) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_2_genexpr *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_2_genexpr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_2_genexpr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_genexpr_arg_0);
  Py_CLEAR(p->__pyx_v_n);
  Py_CLEAR(p->__pyx_t_0);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_2_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_2_genexpr)))) {
    __pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_2_genexpr[__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_2_genexpr++] = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_2_genexpr *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_2_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_2_genexpr *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_2_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_genexpr_arg_0) {
    e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e;
  }
  if (p->__pyx_v_n) {
    e = (*v)(p->__pyx_v_n, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_4ete4_4core_4tree___pyx_scope_struct_2_genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_2_genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_2_genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_2_genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_4ete4_4core_4tree___pyx_scope_struct_2_genexpr_spec = {
  "ete4.core.tree.__pyx_scope_struct_2_genexpr",
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_2_genexpr),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_4ete4_4core_4tree___pyx_scope_struct_2_genexpr_slots,
};
#else

static PyTypeObject __pyx_type_4ete4_4core_4tree___pyx_scope_struct_2_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "ete4.core.tree.""__pyx_scope_struct_2_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_2_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_2_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_2_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_2_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_3___contains__ *__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_3___contains__[8];
static int __pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_3___contains__ = 0;
#endif

static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_3___contains__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_3___contains__ > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_3___contains__)))) {
    o = (PyObject*)__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_3___contains__[--__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_3___contains__];
    memset(o, 0, sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_3___contains__));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_3___contains__(PyObject *o) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_3___contains__ *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_3___contains__ *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_3___contains__) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_node);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_3___contains__ < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_3___contains__)))) {
    __pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_3___contains__[__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_3___contains__++] = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_3___contains__ *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_3___contains__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_3___contains__ *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_3___contains__ *)o;
  if (p->__pyx_v_node) {
    e = (*v)(p->__pyx_v_node, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_4ete4_4core_4tree___pyx_scope_struct_3___contains__(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_3___contains__ *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_3___contains__ *)o;
  tmp = ((PyObject*)p->__pyx_v_node);
  p->__pyx_v_node = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_4ete4_4core_4tree___pyx_scope_struct_3___contains___slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_3___contains__},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_3___contains__},
  {Py_tp_clear, (void *)__pyx_tp_clear_4ete4_4core_4tree___pyx_scope_struct_3___contains__},
  {Py_tp_new, (void *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_3___contains__},
  {0, 0},
};
static PyType_Spec __pyx_type_4ete4_4core_4tree___pyx_scope_struct_3___contains___spec = {
  "ete4.core.tree.__pyx_scope_struct_3___contains__",
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_3___contains__),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_4ete4_4core_4tree___pyx_scope_struct_3___contains___slots,
};
#else

static PyTypeObject __pyx_type_4ete4_4core_4tree___pyx_scope_struct_3___contains__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "ete4.core.tree.""__pyx_scope_struct_3___contains__", /*tp_name*/
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_3___contains__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_3___contains__, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_3___contains__, /*tp_traverse*/
  __pyx_tp_clear_4ete4_4core_4tree___pyx_scope_struct_3___contains__, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_3___contains__, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_4_genexpr *__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_4_genexpr[8];
static int __pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_4_genexpr = 0;
#endif

static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_4_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_4_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_4_genexpr)))) {
    o = (PyObject*)__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_4_genexpr[--__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_4_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_4_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_4_genexpr(PyObject *o) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_4_genexpr *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_4_genexpr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_4_genexpr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_genexpr_arg_0);
  Py_CLEAR(p->__pyx_v_n);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_4_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_4_genexpr)))) {
    __pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_4_genexpr[__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_4_genexpr++] = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_4_genexpr *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_4_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_4_genexpr *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_4_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_genexpr_arg_0) {
    e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e;
  }
  if (p->__pyx_v_n) {
    e = (*v)(p->__pyx_v_n, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_4ete4_4core_4tree___pyx_scope_struct_4_genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_4_genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_4_genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_4_genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_4ete4_4core_4tree___pyx_scope_struct_4_genexpr_spec = {
  "ete4.core.tree.__pyx_scope_struct_4_genexpr",
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_4_genexpr),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_4ete4_4core_4tree___pyx_scope_struct_4_genexpr_slots,
};
#else

static PyTypeObject __pyx_type_4ete4_4core_4tree___pyx_scope_struct_4_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "ete4.core.tree.""__pyx_scope_struct_4_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_4_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_4_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_4_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_4_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_5___iter__ *__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_5___iter__[8];
static int __pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_5___iter__ = 0;
#endif

static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_5___iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_5___iter__ > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_5___iter__)))) {
    o = (PyObject*)__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_5___iter__[--__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_5___iter__];
    memset(o, 0, sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_5___iter__));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_5___iter__(PyObject *o) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_5___iter__ *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_5___iter__ *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_5___iter__) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_self);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_5___iter__ < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_5___iter__)))) {
    __pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_5___iter__[__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_5___iter__++] = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_5___iter__ *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_5___iter__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_5___iter__ *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_5___iter__ *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_4ete4_4core_4tree___pyx_scope_struct_5___iter___slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_5___iter__},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_5___iter__},
  {Py_tp_new, (void *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_5___iter__},
  {0, 0},
};
static PyType_Spec __pyx_type_4ete4_4core_4tree___pyx_scope_struct_5___iter___spec = {
  "ete4.core.tree.__pyx_scope_struct_5___iter__",
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_5___iter__),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_4ete4_4core_4tree___pyx_scope_struct_5___iter___slots,
};
#else

static PyTypeObject __pyx_type_4ete4_4core_4tree___pyx_scope_struct_5___iter__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "ete4.core.tree.""__pyx_scope_struct_5___iter__", /*tp_name*/
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_5___iter__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_5___iter__, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_5___iter__, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_5___iter__, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_6_remove_child *__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_6_remove_child[8];
static int __pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_6_remove_child = 0;
#endif

static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_6_remove_child(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_6_remove_child > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_6_remove_child)))) {
    o = (PyObject*)__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_6_remove_child[--__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_6_remove_child];
    memset(o, 0, sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_6_remove_child));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_6_remove_child(PyObject *o) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_6_remove_child *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_6_remove_child *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_6_remove_child) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_child);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_6_remove_child < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_6_remove_child)))) {
    __pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_6_remove_child[__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_6_remove_child++] = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_6_remove_child *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_6_remove_child(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_6_remove_child *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_6_remove_child *)o;
  if (p->__pyx_v_child) {
    e = (*v)(p->__pyx_v_child, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_4ete4_4core_4tree___pyx_scope_struct_6_remove_child(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_6_remove_child *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_6_remove_child *)o;
  tmp = ((PyObject*)p->__pyx_v_child);
  p->__pyx_v_child = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_4ete4_4core_4tree___pyx_scope_struct_6_remove_child_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_6_remove_child},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_6_remove_child},
  {Py_tp_clear, (void *)__pyx_tp_clear_4ete4_4core_4tree___pyx_scope_struct_6_remove_child},
  {Py_tp_new, (void *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_6_remove_child},
  {0, 0},
};
static PyType_Spec __pyx_type_4ete4_4core_4tree___pyx_scope_struct_6_remove_child_spec = {
  "ete4.core.tree.__pyx_scope_struct_6_remove_child",
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_6_remove_child),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_4ete4_4core_4tree___pyx_scope_struct_6_remove_child_slots,
};
#else

static PyTypeObject __pyx_type_4ete4_4core_4tree___pyx_scope_struct_6_remove_child = {
  PyVarObject_HEAD_INIT(0, 0)
  "ete4.core.tree.""__pyx_scope_struct_6_remove_child", /*tp_name*/
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_6_remove_child), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_6_remove_child, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_6_remove_child, /*tp_traverse*/
  __pyx_tp_clear_4ete4_4core_4tree___pyx_scope_struct_6_remove_child, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_6_remove_child, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_7_genexpr *__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_7_genexpr[8];
static int __pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_7_genexpr = 0;
#endif

static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_7_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_7_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_7_genexpr)))) {
    o = (PyObject*)__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_7_genexpr[--__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_7_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_7_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_7_genexpr(PyObject *o) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_7_genexpr *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_7_genexpr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_7_genexpr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_genexpr_arg_0);
  Py_CLEAR(p->__pyx_v_n);
  Py_CLEAR(p->__pyx_t_0);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_7_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_7_genexpr)))) {
    __pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_7_genexpr[__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_7_genexpr++] = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_7_genexpr *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_7_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_7_genexpr *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_7_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_genexpr_arg_0) {
    e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e;
  }
  if (p->__pyx_v_n) {
    e = (*v)(p->__pyx_v_n, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_4ete4_4core_4tree___pyx_scope_struct_7_genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_7_genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_7_genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_7_genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_4ete4_4core_4tree___pyx_scope_struct_7_genexpr_spec = {
  "ete4.core.tree.__pyx_scope_struct_7_genexpr",
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_7_genexpr),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_4ete4_4core_4tree___pyx_scope_struct_7_genexpr_slots,
};
#else

static PyTypeObject __pyx_type_4ete4_4core_4tree___pyx_scope_struct_7_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "ete4.core.tree.""__pyx_scope_struct_7_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_7_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_7_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_7_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_7_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_8_prune *__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_8_prune[8];
static int __pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_8_prune = 0;
#endif

static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_8_prune(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_8_prune > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_8_prune)))) {
    o = (PyObject*)__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_8_prune[--__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_8_prune];
    memset(o, 0, sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_8_prune));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_8_prune(PyObject *o) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_8_prune *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_8_prune *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_8_prune) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_n2depth);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_8_prune < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_8_prune)))) {
    __pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_8_prune[__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_8_prune++] = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_8_prune *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_8_prune(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_8_prune *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_8_prune *)o;
  if (p->__pyx_v_n2depth) {
    e = (*v)(p->__pyx_v_n2depth, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_4ete4_4core_4tree___pyx_scope_struct_8_prune(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_8_prune *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_8_prune *)o;
  tmp = ((PyObject*)p->__pyx_v_n2depth);
  p->__pyx_v_n2depth = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_4ete4_4core_4tree___pyx_scope_struct_8_prune_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_8_prune},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_8_prune},
  {Py_tp_clear, (void *)__pyx_tp_clear_4ete4_4core_4tree___pyx_scope_struct_8_prune},
  {Py_tp_new, (void *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_8_prune},
  {0, 0},
};
static PyType_Spec __pyx_type_4ete4_4core_4tree___pyx_scope_struct_8_prune_spec = {
  "ete4.core.tree.__pyx_scope_struct_8_prune",
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_8_prune),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_4ete4_4core_4tree___pyx_scope_struct_8_prune_slots,
};
#else

static PyTypeObject __pyx_type_4ete4_4core_4tree___pyx_scope_struct_8_prune = {
  PyVarObject_HEAD_INIT(0, 0)
  "ete4.core.tree.""__pyx_scope_struct_8_prune", /*tp_name*/
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_8_prune), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_8_prune, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_8_prune, /*tp_traverse*/
  __pyx_tp_clear_4ete4_4core_4tree___pyx_scope_struct_8_prune, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_8_prune, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_9_leaves *__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_9_leaves[8];
static int __pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_9_leaves = 0;
#endif

static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_9_leaves(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_9_leaves > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_9_leaves)))) {
    o = (PyObject*)__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_9_leaves[--__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_9_leaves];
    memset(o, 0, sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_9_leaves));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_9_leaves(PyObject *o) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_9_leaves *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_9_leaves *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_9_leaves) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_is_leaf);
  Py_CLEAR(p->__pyx_v_is_leaf_fn);
  Py_CLEAR(p->__pyx_v_node);
  Py_CLEAR(p->__pyx_v_self);
  Py_CLEAR(p->__pyx_t_0);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_9_leaves < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_9_leaves)))) {
    __pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_9_leaves[__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_9_leaves++] = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_9_leaves *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_9_leaves(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_9_leaves *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_9_leaves *)o;
  if (p->__pyx_v_is_leaf) {
    e = (*v)(p->__pyx_v_is_leaf, a); if (e) return e;
  }
  if (p->__pyx_v_is_leaf_fn) {
    e = (*v)(p->__pyx_v_is_leaf_fn, a); if (e) return e;
  }
  if (p->__pyx_v_node) {
    e = (*v)(p->__pyx_v_node, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_4ete4_4core_4tree___pyx_scope_struct_9_leaves_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_9_leaves},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_9_leaves},
  {Py_tp_new, (void *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_9_leaves},
  {0, 0},
};
static PyType_Spec __pyx_type_4ete4_4core_4tree___pyx_scope_struct_9_leaves_spec = {
  "ete4.core.tree.__pyx_scope_struct_9_leaves",
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_9_leaves),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_4ete4_4core_4tree___pyx_scope_struct_9_leaves_slots,
};
#else

static PyTypeObject __pyx_type_4ete4_4core_4tree___pyx_scope_struct_9_leaves = {
  PyVarObject_HEAD_INIT(0, 0)
  "ete4.core.tree.""__pyx_scope_struct_9_leaves", /*tp_name*/
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_9_leaves), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_9_leaves, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_9_leaves, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_9_leaves, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_10_leaf_names *__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_10_leaf_names[8];
static int __pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_10_leaf_names = 0;
#endif

static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_10_leaf_names(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_10_leaf_names > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_10_leaf_names)))) {
    o = (PyObject*)__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_10_leaf_names[--__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_10_leaf_names];
    memset(o, 0, sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_10_leaf_names));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_10_leaf_names(PyObject *o) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_10_leaf_names *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_10_leaf_names *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_10_leaf_names) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_is_leaf_fn);
  Py_CLEAR(p->__pyx_v_leaf);
  Py_CLEAR(p->__pyx_v_self);
  Py_CLEAR(p->__pyx_t_0);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_10_leaf_names < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_10_leaf_names)))) {
    __pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_10_leaf_names[__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_10_leaf_names++] = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_10_leaf_names *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_10_leaf_names(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_10_leaf_names *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_10_leaf_names *)o;
  if (p->__pyx_v_is_leaf_fn) {
    e = (*v)(p->__pyx_v_is_leaf_fn, a); if (e) return e;
  }
  if (p->__pyx_v_leaf) {
    e = (*v)(p->__pyx_v_leaf, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_4ete4_4core_4tree___pyx_scope_struct_10_leaf_names_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_10_leaf_names},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_10_leaf_names},
  {Py_tp_new, (void *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_10_leaf_names},
  {0, 0},
};
static PyType_Spec __pyx_type_4ete4_4core_4tree___pyx_scope_struct_10_leaf_names_spec = {
  "ete4.core.tree.__pyx_scope_struct_10_leaf_names",
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_10_leaf_names),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_4ete4_4core_4tree___pyx_scope_struct_10_leaf_names_slots,
};
#else

static PyTypeObject __pyx_type_4ete4_4core_4tree___pyx_scope_struct_10_leaf_names = {
  PyVarObject_HEAD_INIT(0, 0)
  "ete4.core.tree.""__pyx_scope_struct_10_leaf_names", /*tp_name*/
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_10_leaf_names), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_10_leaf_names, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_10_leaf_names, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_10_leaf_names, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_11_descendants *__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_11_descendants[8];
static int __pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_11_descendants = 0;
#endif

static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_11_descendants(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_11_descendants > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_11_descendants)))) {
    o = (PyObject*)__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_11_descendants[--__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_11_descendants];
    memset(o, 0, sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_11_descendants));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_11_descendants(PyObject *o) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_11_descendants *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_11_descendants *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_11_descendants) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_is_leaf_fn);
  Py_CLEAR(p->__pyx_v_node);
  Py_CLEAR(p->__pyx_v_self);
  Py_CLEAR(p->__pyx_v_strategy);
  Py_CLEAR(p->__pyx_t_0);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_11_descendants < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_11_descendants)))) {
    __pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_11_descendants[__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_11_descendants++] = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_11_descendants *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_11_descendants(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_11_descendants *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_11_descendants *)o;
  if (p->__pyx_v_is_leaf_fn) {
    e = (*v)(p->__pyx_v_is_leaf_fn, a); if (e) return e;
  }
  if (p->__pyx_v_node) {
    e = (*v)(p->__pyx_v_node, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  if (p->__pyx_v_strategy) {
    e = (*v)(p->__pyx_v_strategy, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_4ete4_4core_4tree___pyx_scope_struct_11_descendants_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_11_descendants},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_11_descendants},
  {Py_tp_new, (void *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_11_descendants},
  {0, 0},
};
static PyType_Spec __pyx_type_4ete4_4core_4tree___pyx_scope_struct_11_descendants_spec = {
  "ete4.core.tree.__pyx_scope_struct_11_descendants",
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_11_descendants),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_4ete4_4core_4tree___pyx_scope_struct_11_descendants_slots,
};
#else

static PyTypeObject __pyx_type_4ete4_4core_4tree___pyx_scope_struct_11_descendants = {
  PyVarObject_HEAD_INIT(0, 0)
  "ete4.core.tree.""__pyx_scope_struct_11_descendants", /*tp_name*/
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_11_descendants), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_11_descendants, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_11_descendants, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_11_descendants, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_12_traverse *__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_12_traverse[8];
static int __pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_12_traverse = 0;
#endif

static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_12_traverse(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_12_traverse > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_12_traverse)))) {
    o = (PyObject*)__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_12_traverse[--__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_12_traverse];
    memset(o, 0, sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_12_traverse));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_12_traverse(PyObject *o) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_12_traverse *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_12_traverse *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_12_traverse) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_is_leaf_fn);
  Py_CLEAR(p->__pyx_v_self);
  Py_CLEAR(p->__pyx_v_strategy);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_12_traverse < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_12_traverse)))) {
    __pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_12_traverse[__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_12_traverse++] = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_12_traverse *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_12_traverse(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_12_traverse *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_12_traverse *)o;
  if (p->__pyx_v_is_leaf_fn) {
    e = (*v)(p->__pyx_v_is_leaf_fn, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  if (p->__pyx_v_strategy) {
    e = (*v)(p->__pyx_v_strategy, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_4ete4_4core_4tree___pyx_scope_struct_12_traverse_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_12_traverse},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_12_traverse},
  {Py_tp_new, (void *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_12_traverse},
  {0, 0},
};
static PyType_Spec __pyx_type_4ete4_4core_4tree___pyx_scope_struct_12_traverse_spec = {
  "ete4.core.tree.__pyx_scope_struct_12_traverse",
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_12_traverse),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_4ete4_4core_4tree___pyx_scope_struct_12_traverse_slots,
};
#else

static PyTypeObject __pyx_type_4ete4_4core_4tree___pyx_scope_struct_12_traverse = {
  PyVarObject_HEAD_INIT(0, 0)
  "ete4.core.tree.""__pyx_scope_struct_12_traverse", /*tp_name*/
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_12_traverse), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_12_traverse, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_12_traverse, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_12_traverse, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_13_iter_prepostorder *__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_13_iter_prepostorder[8];
static int __pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_13_iter_prepostorder = 0;
#endif

static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_13_iter_prepostorder(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_13_iter_prepostorder > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_13_iter_prepostorder)))) {
    o = (PyObject*)__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_13_iter_prepostorder[--__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_13_iter_prepostorder];
    memset(o, 0, sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_13_iter_prepostorder));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_13_iter_prepostorder(PyObject *o) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_13_iter_prepostorder *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_13_iter_prepostorder *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_13_iter_prepostorder) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_is_leaf_fn);
  Py_CLEAR(p->__pyx_v_node);
  Py_CLEAR(p->__pyx_v_path);
  Py_CLEAR(p->__pyx_v_seen);
  Py_CLEAR(p->__pyx_v_self);
  Py_CLEAR(p->__pyx_t_0);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_13_iter_prepostorder < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_13_iter_prepostorder)))) {
    __pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_13_iter_prepostorder[__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_13_iter_prepostorder++] = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_13_iter_prepostorder *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_13_iter_prepostorder(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_13_iter_prepostorder *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_13_iter_prepostorder *)o;
  if (p->__pyx_v_is_leaf_fn) {
    e = (*v)(p->__pyx_v_is_leaf_fn, a); if (e) return e;
  }
  if (p->__pyx_v_node) {
    e = (*v)(p->__pyx_v_node, a); if (e) return e;
  }
  if (p->__pyx_v_path) {
    e = (*v)(p->__pyx_v_path, a); if (e) return e;
  }
  if (p->__pyx_v_seen) {
    e = (*v)(p->__pyx_v_seen, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_4ete4_4core_4tree___pyx_scope_struct_13_iter_prepostorder_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_13_iter_prepostorder},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_13_iter_prepostorder},
  {Py_tp_new, (void *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_13_iter_prepostorder},
  {0, 0},
};
static PyType_Spec __pyx_type_4ete4_4core_4tree___pyx_scope_struct_13_iter_prepostorder_spec = {
  "ete4.core.tree.__pyx_scope_struct_13_iter_prepostorder",
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_13_iter_prepostorder),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_4ete4_4core_4tree___pyx_scope_struct_13_iter_prepostorder_slots,
};
#else

static PyTypeObject __pyx_type_4ete4_4core_4tree___pyx_scope_struct_13_iter_prepostorder = {
  PyVarObject_HEAD_INIT(0, 0)
  "ete4.core.tree.""__pyx_scope_struct_13_iter_prepostorder", /*tp_name*/
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_13_iter_prepostorder), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_13_iter_prepostorder, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_13_iter_prepostorder, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_13_iter_prepostorder, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_14_ancestors *__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_14_ancestors[8];
static int __pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_14_ancestors = 0;
#endif

static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_14_ancestors(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_14_ancestors > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_14_ancestors)))) {
    o = (PyObject*)__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_14_ancestors[--__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_14_ancestors];
    memset(o, 0, sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_14_ancestors));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_14_ancestors(PyObject *o) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_14_ancestors *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_14_ancestors *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_14_ancestors) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_include_root);
  Py_CLEAR(p->__pyx_v_node);
  Py_CLEAR(p->__pyx_v_root);
  Py_CLEAR(p->__pyx_v_self);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_14_ancestors < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_14_ancestors)))) {
    __pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_14_ancestors[__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_14_ancestors++] = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_14_ancestors *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_14_ancestors(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_14_ancestors *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_14_ancestors *)o;
  if (p->__pyx_v_include_root) {
    e = (*v)(p->__pyx_v_include_root, a); if (e) return e;
  }
  if (p->__pyx_v_node) {
    e = (*v)(((PyObject *)p->__pyx_v_node), a); if (e) return e;
  }
  if (p->__pyx_v_root) {
    e = (*v)(p->__pyx_v_root, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_4ete4_4core_4tree___pyx_scope_struct_14_ancestors_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_14_ancestors},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_14_ancestors},
  {Py_tp_new, (void *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_14_ancestors},
  {0, 0},
};
static PyType_Spec __pyx_type_4ete4_4core_4tree___pyx_scope_struct_14_ancestors_spec = {
  "ete4.core.tree.__pyx_scope_struct_14_ancestors",
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_14_ancestors),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_4ete4_4core_4tree___pyx_scope_struct_14_ancestors_slots,
};
#else

static PyTypeObject __pyx_type_4ete4_4core_4tree___pyx_scope_struct_14_ancestors = {
  PyVarObject_HEAD_INIT(0, 0)
  "ete4.core.tree.""__pyx_scope_struct_14_ancestors", /*tp_name*/
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_14_ancestors), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_14_ancestors, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_14_ancestors, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_14_ancestors, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_15_lineage *__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_15_lineage[8];
static int __pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_15_lineage = 0;
#endif

static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_15_lineage(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_15_lineage > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_15_lineage)))) {
    o = (PyObject*)__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_15_lineage[--__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_15_lineage];
    memset(o, 0, sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_15_lineage));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_15_lineage(PyObject *o) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_15_lineage *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_15_lineage *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_15_lineage) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_include_root);
  Py_CLEAR(p->__pyx_v_root);
  Py_CLEAR(p->__pyx_v_self);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_15_lineage < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_15_lineage)))) {
    __pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_15_lineage[__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_15_lineage++] = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_15_lineage *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_15_lineage(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_15_lineage *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_15_lineage *)o;
  if (p->__pyx_v_include_root) {
    e = (*v)(p->__pyx_v_include_root, a); if (e) return e;
  }
  if (p->__pyx_v_root) {
    e = (*v)(p->__pyx_v_root, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_4ete4_4core_4tree___pyx_scope_struct_15_lineage_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_15_lineage},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_15_lineage},
  {Py_tp_new, (void *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_15_lineage},
  {0, 0},
};
static PyType_Spec __pyx_type_4ete4_4core_4tree___pyx_scope_struct_15_lineage_spec = {
  "ete4.core.tree.__pyx_scope_struct_15_lineage",
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_15_lineage),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_4ete4_4core_4tree___pyx_scope_struct_15_lineage_slots,
};
#else

static PyTypeObject __pyx_type_4ete4_4core_4tree___pyx_scope_struct_15_lineage = {
  PyVarObject_HEAD_INIT(0, 0)
  "ete4.core.tree.""__pyx_scope_struct_15_lineage", /*tp_name*/
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_15_lineage), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_15_lineage, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_15_lineage, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_15_lineage, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_16_search_nodes *__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_16_search_nodes[8];
static int __pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_16_search_nodes = 0;
#endif

static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_16_search_nodes(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_16_search_nodes > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_16_search_nodes)))) {
    o = (PyObject*)__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_16_search_nodes[--__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_16_search_nodes];
    memset(o, 0, sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_16_search_nodes));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_16_search_nodes(PyObject *o) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_16_search_nodes *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_16_search_nodes *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_16_search_nodes) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_conditions);
  Py_CLEAR(p->__pyx_v_genexpr);
  Py_CLEAR(p->__pyx_v_node);
  Py_CLEAR(p->__pyx_v_self);
  Py_CLEAR(p->__pyx_t_0);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_16_search_nodes < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_16_search_nodes)))) {
    __pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_16_search_nodes[__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_16_search_nodes++] = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_16_search_nodes *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_16_search_nodes(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_16_search_nodes *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_16_search_nodes *)o;
  if (p->__pyx_v_conditions) {
    e = (*v)(p->__pyx_v_conditions, a); if (e) return e;
  }
  if (p->__pyx_v_genexpr) {
    e = (*v)(p->__pyx_v_genexpr, a); if (e) return e;
  }
  if (p->__pyx_v_node) {
    e = (*v)(p->__pyx_v_node, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_4ete4_4core_4tree___pyx_scope_struct_16_search_nodes_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_16_search_nodes},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_16_search_nodes},
  {Py_tp_new, (void *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_16_search_nodes},
  {0, 0},
};
static PyType_Spec __pyx_type_4ete4_4core_4tree___pyx_scope_struct_16_search_nodes_spec = {
  "ete4.core.tree.__pyx_scope_struct_16_search_nodes",
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_16_search_nodes),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_4ete4_4core_4tree___pyx_scope_struct_16_search_nodes_slots,
};
#else

static PyTypeObject __pyx_type_4ete4_4core_4tree___pyx_scope_struct_16_search_nodes = {
  PyVarObject_HEAD_INIT(0, 0)
  "ete4.core.tree.""__pyx_scope_struct_16_search_nodes", /*tp_name*/
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_16_search_nodes), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_16_search_nodes, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_16_search_nodes, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_16_search_nodes, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_17_genexpr *__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_17_genexpr[8];
static int __pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_17_genexpr = 0;
#endif

static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_17_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_17_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_17_genexpr)))) {
    o = (PyObject*)__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_17_genexpr[--__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_17_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_17_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_17_genexpr(PyObject *o) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_17_genexpr *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_17_genexpr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_17_genexpr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_genexpr_arg_0);
  Py_CLEAR(p->__pyx_v_k);
  Py_CLEAR(p->__pyx_v_v);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_17_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_17_genexpr)))) {
    __pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_17_genexpr[__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_17_genexpr++] = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_17_genexpr *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_17_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_17_genexpr *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_17_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_genexpr_arg_0) {
    e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e;
  }
  if (p->__pyx_v_k) {
    e = (*v)(p->__pyx_v_k, a); if (e) return e;
  }
  if (p->__pyx_v_v) {
    e = (*v)(p->__pyx_v_v, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_4ete4_4core_4tree___pyx_scope_struct_17_genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_17_genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_17_genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_17_genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_4ete4_4core_4tree___pyx_scope_struct_17_genexpr_spec = {
  "ete4.core.tree.__pyx_scope_struct_17_genexpr",
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_17_genexpr),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_4ete4_4core_4tree___pyx_scope_struct_17_genexpr_slots,
};
#else

static PyTypeObject __pyx_type_4ete4_4core_4tree___pyx_scope_struct_17_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "ete4.core.tree.""__pyx_scope_struct_17_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_17_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_17_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_17_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_17_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_18_search_descendants *__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_18_search_descendants[8];
static int __pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_18_search_descendants = 0;
#endif

static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_18_search_descendants(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_18_search_descendants > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_18_search_descendants)))) {
    o = (PyObject*)__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_18_search_descendants[--__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_18_search_descendants];
    memset(o, 0, sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_18_search_descendants));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_18_search_descendants(PyObject *o) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_18_search_descendants *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_18_search_descendants *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_18_search_descendants) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_conditions);
  Py_CLEAR(p->__pyx_v_node);
  Py_CLEAR(p->__pyx_v_self);
  Py_CLEAR(p->__pyx_t_0);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_18_search_descendants < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_18_search_descendants)))) {
    __pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_18_search_descendants[__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_18_search_descendants++] = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_18_search_descendants *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_18_search_descendants(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_18_search_descendants *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_18_search_descendants *)o;
  if (p->__pyx_v_conditions) {
    e = (*v)(p->__pyx_v_conditions, a); if (e) return e;
  }
  if (p->__pyx_v_node) {
    e = (*v)(p->__pyx_v_node, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_4ete4_4core_4tree___pyx_scope_struct_18_search_descendants_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_18_search_descendants},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_18_search_descendants},
  {Py_tp_new, (void *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_18_search_descendants},
  {0, 0},
};
static PyType_Spec __pyx_type_4ete4_4core_4tree___pyx_scope_struct_18_search_descendants_spec = {
  "ete4.core.tree.__pyx_scope_struct_18_search_descendants",
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_18_search_descendants),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_4ete4_4core_4tree___pyx_scope_struct_18_search_descendants_slots,
};
#else

static PyTypeObject __pyx_type_4ete4_4core_4tree___pyx_scope_struct_18_search_descendants = {
  PyVarObject_HEAD_INIT(0, 0)
  "ete4.core.tree.""__pyx_scope_struct_18_search_descendants", /*tp_name*/
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_18_search_descendants), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_18_search_descendants, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_18_search_descendants, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_18_search_descendants, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_19_search_ancestors *__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_19_search_ancestors[8];
static int __pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_19_search_ancestors = 0;
#endif

static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_19_search_ancestors(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_19_search_ancestors > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_19_search_ancestors)))) {
    o = (PyObject*)__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_19_search_ancestors[--__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_19_search_ancestors];
    memset(o, 0, sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_19_search_ancestors));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_19_search_ancestors(PyObject *o) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_19_search_ancestors *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_19_search_ancestors *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_19_search_ancestors) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_conditions);
  Py_CLEAR(p->__pyx_v_genexpr);
  Py_CLEAR(p->__pyx_v_node);
  Py_CLEAR(p->__pyx_v_self);
  Py_CLEAR(p->__pyx_t_0);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_19_search_ancestors < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_19_search_ancestors)))) {
    __pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_19_search_ancestors[__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_19_search_ancestors++] = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_19_search_ancestors *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_19_search_ancestors(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_19_search_ancestors *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_19_search_ancestors *)o;
  if (p->__pyx_v_conditions) {
    e = (*v)(p->__pyx_v_conditions, a); if (e) return e;
  }
  if (p->__pyx_v_genexpr) {
    e = (*v)(p->__pyx_v_genexpr, a); if (e) return e;
  }
  if (p->__pyx_v_node) {
    e = (*v)(p->__pyx_v_node, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_4ete4_4core_4tree___pyx_scope_struct_19_search_ancestors_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_19_search_ancestors},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_19_search_ancestors},
  {Py_tp_new, (void *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_19_search_ancestors},
  {0, 0},
};
static PyType_Spec __pyx_type_4ete4_4core_4tree___pyx_scope_struct_19_search_ancestors_spec = {
  "ete4.core.tree.__pyx_scope_struct_19_search_ancestors",
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_19_search_ancestors),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_4ete4_4core_4tree___pyx_scope_struct_19_search_ancestors_slots,
};
#else

static PyTypeObject __pyx_type_4ete4_4core_4tree___pyx_scope_struct_19_search_ancestors = {
  PyVarObject_HEAD_INIT(0, 0)
  "ete4.core.tree.""__pyx_scope_struct_19_search_ancestors", /*tp_name*/
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_19_search_ancestors), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_19_search_ancestors, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_19_search_ancestors, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_19_search_ancestors, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_20_genexpr *__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_20_genexpr[8];
static int __pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_20_genexpr = 0;
#endif

static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_20_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_20_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_20_genexpr)))) {
    o = (PyObject*)__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_20_genexpr[--__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_20_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_20_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_20_genexpr(PyObject *o) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_20_genexpr *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_20_genexpr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_20_genexpr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_genexpr_arg_0);
  Py_CLEAR(p->__pyx_v_k);
  Py_CLEAR(p->__pyx_v_v);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_20_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_20_genexpr)))) {
    __pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_20_genexpr[__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_20_genexpr++] = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_20_genexpr *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_20_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_20_genexpr *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_20_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_genexpr_arg_0) {
    e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e;
  }
  if (p->__pyx_v_k) {
    e = (*v)(p->__pyx_v_k, a); if (e) return e;
  }
  if (p->__pyx_v_v) {
    e = (*v)(p->__pyx_v_v, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_4ete4_4core_4tree___pyx_scope_struct_20_genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_20_genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_20_genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_20_genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_4ete4_4core_4tree___pyx_scope_struct_20_genexpr_spec = {
  "ete4.core.tree.__pyx_scope_struct_20_genexpr",
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_20_genexpr),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_4ete4_4core_4tree___pyx_scope_struct_20_genexpr_slots,
};
#else

static PyTypeObject __pyx_type_4ete4_4core_4tree___pyx_scope_struct_20_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "ete4.core.tree.""__pyx_scope_struct_20_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_20_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_20_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_20_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_20_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_21_get_distance *__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_21_get_distance[8];
static int __pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_21_get_distance = 0;
#endif

static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_21_get_distance(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_21_get_distance > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_21_get_distance)))) {
    o = (PyObject*)__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_21_get_distance[--__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_21_get_distance];
    memset(o, 0, sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_21_get_distance));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_21_get_distance(PyObject *o) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_21_get_distance *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_21_get_distance *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_21_get_distance) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_d);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_21_get_distance < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_21_get_distance)))) {
    __pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_21_get_distance[__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_21_get_distance++] = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_21_get_distance *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_21_get_distance(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_21_get_distance *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_21_get_distance *)o;
  if (p->__pyx_v_d) {
    e = (*v)(p->__pyx_v_d, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_4ete4_4core_4tree___pyx_scope_struct_21_get_distance(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_21_get_distance *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_21_get_distance *)o;
  tmp = ((PyObject*)p->__pyx_v_d);
  p->__pyx_v_d = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_4ete4_4core_4tree___pyx_scope_struct_21_get_distance_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_21_get_distance},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_21_get_distance},
  {Py_tp_clear, (void *)__pyx_tp_clear_4ete4_4core_4tree___pyx_scope_struct_21_get_distance},
  {Py_tp_new, (void *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_21_get_distance},
  {0, 0},
};
static PyType_Spec __pyx_type_4ete4_4core_4tree___pyx_scope_struct_21_get_distance_spec = {
  "ete4.core.tree.__pyx_scope_struct_21_get_distance",
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_21_get_distance),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_4ete4_4core_4tree___pyx_scope_struct_21_get_distance_slots,
};
#else

static PyTypeObject __pyx_type_4ete4_4core_4tree___pyx_scope_struct_21_get_distance = {
  PyVarObject_HEAD_INIT(0, 0)
  "ete4.core.tree.""__pyx_scope_struct_21_get_distance", /*tp_name*/
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_21_get_distance), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_21_get_distance, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_21_get_distance, /*tp_traverse*/
  __pyx_tp_clear_4ete4_4core_4tree___pyx_scope_struct_21_get_distance, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_21_get_distance, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_22_genexpr *__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_22_genexpr[8];
static int __pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_22_genexpr = 0;
#endif

static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_22_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_22_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_22_genexpr)))) {
    o = (PyObject*)__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_22_genexpr[--__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_22_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_22_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_22_genexpr(PyObject *o) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_22_genexpr *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_22_genexpr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_22_genexpr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_genexpr_arg_0);
  Py_CLEAR(p->__pyx_v_n);
  Py_CLEAR(p->__pyx_t_0);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_22_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_22_genexpr)))) {
    __pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_22_genexpr[__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_22_genexpr++] = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_22_genexpr *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_22_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_22_genexpr *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_22_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_genexpr_arg_0) {
    e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e;
  }
  if (p->__pyx_v_n) {
    e = (*v)(p->__pyx_v_n, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_4ete4_4core_4tree___pyx_scope_struct_22_genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_22_genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_22_genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_22_genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_4ete4_4core_4tree___pyx_scope_struct_22_genexpr_spec = {
  "ete4.core.tree.__pyx_scope_struct_22_genexpr",
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_22_genexpr),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_4ete4_4core_4tree___pyx_scope_struct_22_genexpr_slots,
};
#else

static PyTypeObject __pyx_type_4ete4_4core_4tree___pyx_scope_struct_22_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "ete4.core.tree.""__pyx_scope_struct_22_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_22_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_22_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_22_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_22_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_23_genexpr *__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_23_genexpr[8];
static int __pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_23_genexpr = 0;
#endif

static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_23_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_23_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_23_genexpr)))) {
    o = (PyObject*)__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_23_genexpr[--__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_23_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_23_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_23_genexpr(PyObject *o) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_23_genexpr *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_23_genexpr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_23_genexpr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_genexpr_arg_0);
  Py_CLEAR(p->__pyx_v_n);
  Py_CLEAR(p->__pyx_t_0);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_23_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_23_genexpr)))) {
    __pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_23_genexpr[__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_23_genexpr++] = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_23_genexpr *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_23_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_23_genexpr *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_23_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_genexpr_arg_0) {
    e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e;
  }
  if (p->__pyx_v_n) {
    e = (*v)(p->__pyx_v_n, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_4ete4_4core_4tree___pyx_scope_struct_23_genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_23_genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_23_genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_23_genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_4ete4_4core_4tree___pyx_scope_struct_23_genexpr_spec = {
  "ete4.core.tree.__pyx_scope_struct_23_genexpr",
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_23_genexpr),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_4ete4_4core_4tree___pyx_scope_struct_23_genexpr_slots,
};
#else

static PyTypeObject __pyx_type_4ete4_4core_4tree___pyx_scope_struct_23_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "ete4.core.tree.""__pyx_scope_struct_23_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_23_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_23_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_23_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_23_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_24_sort_descendants *__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_24_sort_descendants[8];
static int __pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_24_sort_descendants = 0;
#endif

static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_24_sort_descendants(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_24_sort_descendants > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_24_sort_descendants)))) {
    o = (PyObject*)__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_24_sort_descendants[--__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_24_sort_descendants];
    memset(o, 0, sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_24_sort_descendants));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_24_sort_descendants(PyObject *o) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_24_sort_descendants *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_24_sort_descendants *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_24_sort_descendants) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_leaf_values);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_24_sort_descendants < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_24_sort_descendants)))) {
    __pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_24_sort_descendants[__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_24_sort_descendants++] = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_24_sort_descendants *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_24_sort_descendants(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_24_sort_descendants *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_24_sort_descendants *)o;
  if (p->__pyx_v_leaf_values) {
    e = (*v)(p->__pyx_v_leaf_values, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_4ete4_4core_4tree___pyx_scope_struct_24_sort_descendants(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_24_sort_descendants *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_24_sort_descendants *)o;
  tmp = ((PyObject*)p->__pyx_v_leaf_values);
  p->__pyx_v_leaf_values = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_4ete4_4core_4tree___pyx_scope_struct_24_sort_descendants_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_24_sort_descendants},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_24_sort_descendants},
  {Py_tp_clear, (void *)__pyx_tp_clear_4ete4_4core_4tree___pyx_scope_struct_24_sort_descendants},
  {Py_tp_new, (void *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_24_sort_descendants},
  {0, 0},
};
static PyType_Spec __pyx_type_4ete4_4core_4tree___pyx_scope_struct_24_sort_descendants_spec = {
  "ete4.core.tree.__pyx_scope_struct_24_sort_descendants",
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_24_sort_descendants),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_4ete4_4core_4tree___pyx_scope_struct_24_sort_descendants_slots,
};
#else

static PyTypeObject __pyx_type_4ete4_4core_4tree___pyx_scope_struct_24_sort_descendants = {
  PyVarObject_HEAD_INIT(0, 0)
  "ete4.core.tree.""__pyx_scope_struct_24_sort_descendants", /*tp_name*/
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_24_sort_descendants), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_24_sort_descendants, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_24_sort_descendants, /*tp_traverse*/
  __pyx_tp_clear_4ete4_4core_4tree___pyx_scope_struct_24_sort_descendants, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_24_sort_descendants, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_25_get_cached_content *__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_25_get_cached_content[8];
static int __pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_25_get_cached_content = 0;
#endif

static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_25_get_cached_content(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_25_get_cached_content > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_25_get_cached_content)))) {
    o = (PyObject*)__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_25_get_cached_content[--__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_25_get_cached_content];
    memset(o, 0, sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_25_get_cached_content));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_25_get_cached_content(PyObject *o) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_25_get_cached_content *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_25_get_cached_content *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_25_get_cached_content) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_prop);
  Py_CLEAR(p->__pyx_v_self);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_25_get_cached_content < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_25_get_cached_content)))) {
    __pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_25_get_cached_content[__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_25_get_cached_content++] = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_25_get_cached_content *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_25_get_cached_content(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_25_get_cached_content *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_25_get_cached_content *)o;
  if (p->__pyx_v_prop) {
    e = (*v)(p->__pyx_v_prop, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_4ete4_4core_4tree___pyx_scope_struct_25_get_cached_content(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_25_get_cached_content *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_25_get_cached_content *)o;
  tmp = ((PyObject*)p->__pyx_v_prop);
  p->__pyx_v_prop = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_self);
  p->__pyx_v_self = ((struct __pyx_obj_4ete4_4core_4tree_Tree *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_4ete4_4core_4tree___pyx_scope_struct_25_get_cached_content_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_25_get_cached_content},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_25_get_cached_content},
  {Py_tp_clear, (void *)__pyx_tp_clear_4ete4_4core_4tree___pyx_scope_struct_25_get_cached_content},
  {Py_tp_new, (void *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_25_get_cached_content},
  {0, 0},
};
static PyType_Spec __pyx_type_4ete4_4core_4tree___pyx_scope_struct_25_get_cached_content_spec = {
  "ete4.core.tree.__pyx_scope_struct_25_get_cached_content",
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_25_get_cached_content),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_4ete4_4core_4tree___pyx_scope_struct_25_get_cached_content_slots,
};
#else

static PyTypeObject __pyx_type_4ete4_4core_4tree___pyx_scope_struct_25_get_cached_content = {
  PyVarObject_HEAD_INIT(0, 0)
  "ete4.core.tree.""__pyx_scope_struct_25_get_cached_content", /*tp_name*/
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_25_get_cached_content), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_25_get_cached_content, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_25_get_cached_content, /*tp_traverse*/
  __pyx_tp_clear_4ete4_4core_4tree___pyx_scope_struct_25_get_cached_content, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_25_get_cached_content, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds *__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds[8];
static int __pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds = 0;
#endif

static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds)))) {
    o = (PyObject*)__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds[--__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds];
    memset(o, 0, sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds(PyObject *o) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_common);
  Py_CLEAR(p->__pyx_v_discard_t1);
  Py_CLEAR(p->__pyx_v_discard_t2);
  Py_CLEAR(p->__pyx_v_edges1);
  Py_CLEAR(p->__pyx_v_edges2);
  Py_CLEAR(p->__pyx_v_from_common);
  Py_CLEAR(p->__pyx_v_has_prop);
  Py_CLEAR(p->__pyx_9genexpr23__pyx_v_leaves);
  Py_CLEAR(p->__pyx_9genexpr27__pyx_v_leaves);
  Py_CLEAR(p->__pyx_v_prop_t1);
  Py_CLEAR(p->__pyx_v_prop_t2);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds)))) {
    __pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds[__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds++] = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds *)o;
  if (p->__pyx_v_common) {
    e = (*v)(p->__pyx_v_common, a); if (e) return e;
  }
  if (p->__pyx_v_discard_t1) {
    e = (*v)(p->__pyx_v_discard_t1, a); if (e) return e;
  }
  if (p->__pyx_v_discard_t2) {
    e = (*v)(p->__pyx_v_discard_t2, a); if (e) return e;
  }
  if (p->__pyx_v_edges1) {
    e = (*v)(p->__pyx_v_edges1, a); if (e) return e;
  }
  if (p->__pyx_v_edges2) {
    e = (*v)(p->__pyx_v_edges2, a); if (e) return e;
  }
  if (p->__pyx_v_from_common) {
    e = (*v)(p->__pyx_v_from_common, a); if (e) return e;
  }
  if (p->__pyx_v_has_prop) {
    e = (*v)(p->__pyx_v_has_prop, a); if (e) return e;
  }
  if (p->__pyx_9genexpr23__pyx_v_leaves) {
    e = (*v)(p->__pyx_9genexpr23__pyx_v_leaves, a); if (e) return e;
  }
  if (p->__pyx_9genexpr27__pyx_v_leaves) {
    e = (*v)(p->__pyx_9genexpr27__pyx_v_leaves, a); if (e) return e;
  }
  if (p->__pyx_v_prop_t1) {
    e = (*v)(p->__pyx_v_prop_t1, a); if (e) return e;
  }
  if (p->__pyx_v_prop_t2) {
    e = (*v)(p->__pyx_v_prop_t2, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds *)o;
  tmp = ((PyObject*)p->__pyx_v_common);
  p->__pyx_v_common = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_discard_t1);
  p->__pyx_v_discard_t1 = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_discard_t2);
  p->__pyx_v_discard_t2 = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_edges1);
  p->__pyx_v_edges1 = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_edges2);
  p->__pyx_v_edges2 = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_from_common);
  p->__pyx_v_from_common = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_has_prop);
  p->__pyx_v_has_prop = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_9genexpr23__pyx_v_leaves);
  p->__pyx_9genexpr23__pyx_v_leaves = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_9genexpr27__pyx_v_leaves);
  p->__pyx_9genexpr27__pyx_v_leaves = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_prop_t1);
  p->__pyx_v_prop_t1 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_prop_t2);
  p->__pyx_v_prop_t2 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds},
  {Py_tp_clear, (void *)__pyx_tp_clear_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds},
  {Py_tp_new, (void *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds},
  {0, 0},
};
static PyType_Spec __pyx_type_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds_spec = {
  "ete4.core.tree.__pyx_scope_struct_26_robinson_foulds",
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds_slots,
};
#else

static PyTypeObject __pyx_type_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds = {
  PyVarObject_HEAD_INIT(0, 0)
  "ete4.core.tree.""__pyx_scope_struct_26_robinson_foulds", /*tp_name*/
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds, /*tp_traverse*/
  __pyx_tp_clear_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_27_genexpr *__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_27_genexpr[8];
static int __pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_27_genexpr = 0;
#endif

static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_27_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_27_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_27_genexpr)))) {
    o = (PyObject*)__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_27_genexpr[--__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_27_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_27_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_27_genexpr(PyObject *o) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_27_genexpr *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_27_genexpr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_27_genexpr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_genexpr_arg_0);
  Py_CLEAR(p->__pyx_v_n);
  Py_CLEAR(p->__pyx_t_0);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_27_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_27_genexpr)))) {
    __pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_27_genexpr[__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_27_genexpr++] = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_27_genexpr *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_27_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_27_genexpr *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_27_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_genexpr_arg_0) {
    e = (*v)(((PyObject *)p->__pyx_genexpr_arg_0), a); if (e) return e;
  }
  if (p->__pyx_v_n) {
    e = (*v)(p->__pyx_v_n, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_4ete4_4core_4tree___pyx_scope_struct_27_genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_27_genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_27_genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_27_genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_4ete4_4core_4tree___pyx_scope_struct_27_genexpr_spec = {
  "ete4.core.tree.__pyx_scope_struct_27_genexpr",
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_27_genexpr),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_4ete4_4core_4tree___pyx_scope_struct_27_genexpr_slots,
};
#else

static PyTypeObject __pyx_type_4ete4_4core_4tree___pyx_scope_struct_27_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "ete4.core.tree.""__pyx_scope_struct_27_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_27_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_27_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_27_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_27_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_28_genexpr *__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_28_genexpr[8];
static int __pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_28_genexpr = 0;
#endif

static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_28_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_28_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_28_genexpr)))) {
    o = (PyObject*)__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_28_genexpr[--__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_28_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_28_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_28_genexpr(PyObject *o) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_28_genexpr *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_28_genexpr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_28_genexpr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_genexpr_arg_0);
  Py_CLEAR(p->__pyx_v_n);
  Py_CLEAR(p->__pyx_t_0);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_28_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_28_genexpr)))) {
    __pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_28_genexpr[__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_28_genexpr++] = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_28_genexpr *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_28_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_28_genexpr *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_28_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_genexpr_arg_0) {
    e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e;
  }
  if (p->__pyx_v_n) {
    e = (*v)(p->__pyx_v_n, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_4ete4_4core_4tree___pyx_scope_struct_28_genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_28_genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_28_genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_28_genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_4ete4_4core_4tree___pyx_scope_struct_28_genexpr_spec = {
  "ete4.core.tree.__pyx_scope_struct_28_genexpr",
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_28_genexpr),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_4ete4_4core_4tree___pyx_scope_struct_28_genexpr_slots,
};
#else

static PyTypeObject __pyx_type_4ete4_4core_4tree___pyx_scope_struct_28_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "ete4.core.tree.""__pyx_scope_struct_28_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_28_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_28_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_28_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_28_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_29_genexpr *__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_29_genexpr[8];
static int __pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_29_genexpr = 0;
#endif

static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_29_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_29_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_29_genexpr)))) {
    o = (PyObject*)__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_29_genexpr[--__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_29_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_29_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_29_genexpr(PyObject *o) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_29_genexpr *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_29_genexpr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_29_genexpr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_genexpr_arg_0);
  Py_CLEAR(p->__pyx_v_n);
  Py_CLEAR(p->__pyx_t_0);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_29_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_29_genexpr)))) {
    __pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_29_genexpr[__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_29_genexpr++] = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_29_genexpr *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_29_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_29_genexpr *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_29_genexpr *)o;
  if (p->__pyx_genexpr_arg_0) {
    e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e;
  }
  if (p->__pyx_v_n) {
    e = (*v)(p->__pyx_v_n, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_4ete4_4core_4tree___pyx_scope_struct_29_genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_29_genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_29_genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_29_genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_4ete4_4core_4tree___pyx_scope_struct_29_genexpr_spec = {
  "ete4.core.tree.__pyx_scope_struct_29_genexpr",
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_29_genexpr),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_4ete4_4core_4tree___pyx_scope_struct_29_genexpr_slots,
};
#else

static PyTypeObject __pyx_type_4ete4_4core_4tree___pyx_scope_struct_29_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "ete4.core.tree.""__pyx_scope_struct_29_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_29_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_29_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_29_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_29_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_30_genexpr *__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_30_genexpr[8];
static int __pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_30_genexpr = 0;
#endif

static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_30_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_30_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_30_genexpr)))) {
    o = (PyObject*)__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_30_genexpr[--__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_30_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_30_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_30_genexpr(PyObject *o) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_30_genexpr *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_30_genexpr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_30_genexpr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_genexpr_arg_0);
  Py_CLEAR(p->__pyx_v_n);
  Py_CLEAR(p->__pyx_t_0);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_30_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_30_genexpr)))) {
    __pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_30_genexpr[__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_30_genexpr++] = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_30_genexpr *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_30_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_30_genexpr *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_30_genexpr *)o;
  if (p->__pyx_genexpr_arg_0) {
    e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e;
  }
  if (p->__pyx_v_n) {
    e = (*v)(p->__pyx_v_n, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_4ete4_4core_4tree___pyx_scope_struct_30_genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_30_genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_30_genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_30_genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_4ete4_4core_4tree___pyx_scope_struct_30_genexpr_spec = {
  "ete4.core.tree.__pyx_scope_struct_30_genexpr",
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_30_genexpr),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_4ete4_4core_4tree___pyx_scope_struct_30_genexpr_slots,
};
#else

static PyTypeObject __pyx_type_4ete4_4core_4tree___pyx_scope_struct_30_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "ete4.core.tree.""__pyx_scope_struct_30_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_30_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_30_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_30_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_30_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_31_from_common *__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_31_from_common[8];
static int __pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_31_from_common = 0;
#endif

static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_31_from_common(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_31_from_common > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_31_from_common)))) {
    o = (PyObject*)__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_31_from_common[--__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_31_from_common];
    memset(o, 0, sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_31_from_common));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_31_from_common(PyObject *o) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_31_from_common *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_31_from_common *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_31_from_common) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_node);
  Py_CLEAR(p->__pyx_v_nodes);
  Py_CLEAR(p->__pyx_v_prop);
  Py_CLEAR(p->__pyx_v_value);
  Py_CLEAR(p->__pyx_t_0);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_31_from_common < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_31_from_common)))) {
    __pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_31_from_common[__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_31_from_common++] = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_31_from_common *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_31_from_common(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_31_from_common *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_31_from_common *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_node) {
    e = (*v)(p->__pyx_v_node, a); if (e) return e;
  }
  if (p->__pyx_v_nodes) {
    e = (*v)(p->__pyx_v_nodes, a); if (e) return e;
  }
  if (p->__pyx_v_prop) {
    e = (*v)(p->__pyx_v_prop, a); if (e) return e;
  }
  if (p->__pyx_v_value) {
    e = (*v)(p->__pyx_v_value, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_4ete4_4core_4tree___pyx_scope_struct_31_from_common_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_31_from_common},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_31_from_common},
  {Py_tp_new, (void *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_31_from_common},
  {0, 0},
};
static PyType_Spec __pyx_type_4ete4_4core_4tree___pyx_scope_struct_31_from_common_spec = {
  "ete4.core.tree.__pyx_scope_struct_31_from_common",
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_31_from_common),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_4ete4_4core_4tree___pyx_scope_struct_31_from_common_slots,
};
#else

static PyTypeObject __pyx_type_4ete4_4core_4tree___pyx_scope_struct_31_from_common = {
  PyVarObject_HEAD_INIT(0, 0)
  "ete4.core.tree.""__pyx_scope_struct_31_from_common", /*tp_name*/
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_31_from_common), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_31_from_common, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_31_from_common, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_31_from_common, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_32_genexpr *__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_32_genexpr[8];
static int __pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_32_genexpr = 0;
#endif

static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_32_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_32_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_32_genexpr)))) {
    o = (PyObject*)__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_32_genexpr[--__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_32_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_32_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_32_genexpr(PyObject *o) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_32_genexpr *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_32_genexpr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_32_genexpr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_genexpr_arg_0);
  Py_CLEAR(p->__pyx_v_n);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_32_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_32_genexpr)))) {
    __pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_32_genexpr[__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_32_genexpr++] = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_32_genexpr *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_32_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_32_genexpr *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_32_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_genexpr_arg_0) {
    e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e;
  }
  if (p->__pyx_v_n) {
    e = (*v)(p->__pyx_v_n, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_4ete4_4core_4tree___pyx_scope_struct_32_genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_32_genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_32_genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_32_genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_4ete4_4core_4tree___pyx_scope_struct_32_genexpr_spec = {
  "ete4.core.tree.__pyx_scope_struct_32_genexpr",
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_32_genexpr),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_4ete4_4core_4tree___pyx_scope_struct_32_genexpr_slots,
};
#else

static PyTypeObject __pyx_type_4ete4_4core_4tree___pyx_scope_struct_32_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "ete4.core.tree.""__pyx_scope_struct_32_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_32_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_32_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_32_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_32_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_33_genexpr *__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_33_genexpr[8];
static int __pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_33_genexpr = 0;
#endif

static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_33_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_33_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_33_genexpr)))) {
    o = (PyObject*)__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_33_genexpr[--__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_33_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_33_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_33_genexpr(PyObject *o) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_33_genexpr *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_33_genexpr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_33_genexpr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_genexpr_arg_0);
  Py_CLEAR(p->__pyx_v_n);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_33_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_33_genexpr)))) {
    __pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_33_genexpr[__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_33_genexpr++] = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_33_genexpr *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_33_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_33_genexpr *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_33_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_genexpr_arg_0) {
    e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e;
  }
  if (p->__pyx_v_n) {
    e = (*v)(p->__pyx_v_n, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_4ete4_4core_4tree___pyx_scope_struct_33_genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_33_genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_33_genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_33_genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_4ete4_4core_4tree___pyx_scope_struct_33_genexpr_spec = {
  "ete4.core.tree.__pyx_scope_struct_33_genexpr",
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_33_genexpr),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_4ete4_4core_4tree___pyx_scope_struct_33_genexpr_slots,
};
#else

static PyTypeObject __pyx_type_4ete4_4core_4tree___pyx_scope_struct_33_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "ete4.core.tree.""__pyx_scope_struct_33_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_33_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_33_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_33_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_33_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_34_genexpr *__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_34_genexpr[8];
static int __pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_34_genexpr = 0;
#endif

static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_34_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_34_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_34_genexpr)))) {
    o = (PyObject*)__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_34_genexpr[--__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_34_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_34_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_34_genexpr(PyObject *o) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_34_genexpr *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_34_genexpr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_34_genexpr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_genexpr_arg_0);
  Py_CLEAR(p->__pyx_v_p);
  Py_CLEAR(p->__pyx_t_0);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_34_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_34_genexpr)))) {
    __pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_34_genexpr[__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_34_genexpr++] = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_34_genexpr *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_34_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_34_genexpr *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_34_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_genexpr_arg_0) {
    e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e;
  }
  if (p->__pyx_v_p) {
    e = (*v)(p->__pyx_v_p, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_4ete4_4core_4tree___pyx_scope_struct_34_genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_34_genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_34_genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_34_genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_4ete4_4core_4tree___pyx_scope_struct_34_genexpr_spec = {
  "ete4.core.tree.__pyx_scope_struct_34_genexpr",
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_34_genexpr),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_4ete4_4core_4tree___pyx_scope_struct_34_genexpr_slots,
};
#else

static PyTypeObject __pyx_type_4ete4_4core_4tree___pyx_scope_struct_34_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "ete4.core.tree.""__pyx_scope_struct_34_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_34_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_34_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_34_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_34_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_35_genexpr *__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_35_genexpr[8];
static int __pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_35_genexpr = 0;
#endif

static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_35_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_35_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_35_genexpr)))) {
    o = (PyObject*)__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_35_genexpr[--__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_35_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_35_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_35_genexpr(PyObject *o) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_35_genexpr *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_35_genexpr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_35_genexpr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_genexpr_arg_0);
  Py_CLEAR(p->__pyx_v_p);
  Py_CLEAR(p->__pyx_t_0);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_35_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_35_genexpr)))) {
    __pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_35_genexpr[__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_35_genexpr++] = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_35_genexpr *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_35_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_35_genexpr *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_35_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_genexpr_arg_0) {
    e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e;
  }
  if (p->__pyx_v_p) {
    e = (*v)(p->__pyx_v_p, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_4ete4_4core_4tree___pyx_scope_struct_35_genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_35_genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_35_genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_35_genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_4ete4_4core_4tree___pyx_scope_struct_35_genexpr_spec = {
  "ete4.core.tree.__pyx_scope_struct_35_genexpr",
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_35_genexpr),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_4ete4_4core_4tree___pyx_scope_struct_35_genexpr_slots,
};
#else

static PyTypeObject __pyx_type_4ete4_4core_4tree___pyx_scope_struct_35_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "ete4.core.tree.""__pyx_scope_struct_35_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_35_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_35_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_35_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_35_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_36_genexpr *__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_36_genexpr[8];
static int __pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_36_genexpr = 0;
#endif

static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_36_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_36_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_36_genexpr)))) {
    o = (PyObject*)__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_36_genexpr[--__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_36_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_36_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_36_genexpr(PyObject *o) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_36_genexpr *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_36_genexpr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_36_genexpr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_genexpr_arg_0);
  Py_CLEAR(p->__pyx_v_p);
  Py_CLEAR(p->__pyx_t_0);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_36_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_36_genexpr)))) {
    __pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_36_genexpr[__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_36_genexpr++] = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_36_genexpr *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_36_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_36_genexpr *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_36_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_genexpr_arg_0) {
    e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e;
  }
  if (p->__pyx_v_p) {
    e = (*v)(p->__pyx_v_p, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_4ete4_4core_4tree___pyx_scope_struct_36_genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_36_genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_36_genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_36_genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_4ete4_4core_4tree___pyx_scope_struct_36_genexpr_spec = {
  "ete4.core.tree.__pyx_scope_struct_36_genexpr",
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_36_genexpr),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_4ete4_4core_4tree___pyx_scope_struct_36_genexpr_slots,
};
#else

static PyTypeObject __pyx_type_4ete4_4core_4tree___pyx_scope_struct_36_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "ete4.core.tree.""__pyx_scope_struct_36_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_36_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_36_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_36_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_36_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_37_genexpr *__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_37_genexpr[8];
static int __pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_37_genexpr = 0;
#endif

static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_37_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_37_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_37_genexpr)))) {
    o = (PyObject*)__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_37_genexpr[--__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_37_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_37_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_37_genexpr(PyObject *o) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_37_genexpr *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_37_genexpr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_37_genexpr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_genexpr_arg_0);
  Py_CLEAR(p->__pyx_v_p);
  Py_CLEAR(p->__pyx_t_0);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_37_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_37_genexpr)))) {
    __pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_37_genexpr[__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_37_genexpr++] = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_37_genexpr *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_37_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_37_genexpr *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_37_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_genexpr_arg_0) {
    e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e;
  }
  if (p->__pyx_v_p) {
    e = (*v)(p->__pyx_v_p, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_4ete4_4core_4tree___pyx_scope_struct_37_genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_37_genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_37_genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_37_genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_4ete4_4core_4tree___pyx_scope_struct_37_genexpr_spec = {
  "ete4.core.tree.__pyx_scope_struct_37_genexpr",
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_37_genexpr),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_4ete4_4core_4tree___pyx_scope_struct_37_genexpr_slots,
};
#else

static PyTypeObject __pyx_type_4ete4_4core_4tree___pyx_scope_struct_37_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "ete4.core.tree.""__pyx_scope_struct_37_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_37_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_37_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_37_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_37_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_38_compare *__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_38_compare[8];
static int __pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_38_compare = 0;
#endif

static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_38_compare(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_38_compare > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_38_compare)))) {
    o = (PyObject*)__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_38_compare[--__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_38_compare];
    memset(o, 0, sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_38_compare));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_38_compare(PyObject *o) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_38_compare *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_38_compare *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_38_compare) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_expand_polytomies);
  Py_CLEAR(p->__pyx_v_min_support_ref);
  Py_CLEAR(p->__pyx_v_min_support_source);
  Py_CLEAR(p->__pyx_v_ref_tree_attr);
  Py_CLEAR(p->__pyx_v_source_tree_attr);
  Py_CLEAR(p->__pyx_v_unrooted);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_38_compare < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_38_compare)))) {
    __pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_38_compare[__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_38_compare++] = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_38_compare *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_38_compare(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_38_compare *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_38_compare *)o;
  if (p->__pyx_v_expand_polytomies) {
    e = (*v)(p->__pyx_v_expand_polytomies, a); if (e) return e;
  }
  if (p->__pyx_v_min_support_ref) {
    e = (*v)(p->__pyx_v_min_support_ref, a); if (e) return e;
  }
  if (p->__pyx_v_min_support_source) {
    e = (*v)(p->__pyx_v_min_support_source, a); if (e) return e;
  }
  if (p->__pyx_v_ref_tree_attr) {
    e = (*v)(p->__pyx_v_ref_tree_attr, a); if (e) return e;
  }
  if (p->__pyx_v_source_tree_attr) {
    e = (*v)(p->__pyx_v_source_tree_attr, a); if (e) return e;
  }
  if (p->__pyx_v_unrooted) {
    e = (*v)(p->__pyx_v_unrooted, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_4ete4_4core_4tree___pyx_scope_struct_38_compare(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_38_compare *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_38_compare *)o;
  tmp = ((PyObject*)p->__pyx_v_expand_polytomies);
  p->__pyx_v_expand_polytomies = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_min_support_ref);
  p->__pyx_v_min_support_ref = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_min_support_source);
  p->__pyx_v_min_support_source = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_ref_tree_attr);
  p->__pyx_v_ref_tree_attr = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_source_tree_attr);
  p->__pyx_v_source_tree_attr = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_unrooted);
  p->__pyx_v_unrooted = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_4ete4_4core_4tree___pyx_scope_struct_38_compare_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_38_compare},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_38_compare},
  {Py_tp_clear, (void *)__pyx_tp_clear_4ete4_4core_4tree___pyx_scope_struct_38_compare},
  {Py_tp_new, (void *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_38_compare},
  {0, 0},
};
static PyType_Spec __pyx_type_4ete4_4core_4tree___pyx_scope_struct_38_compare_spec = {
  "ete4.core.tree.__pyx_scope_struct_38_compare",
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_38_compare),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_4ete4_4core_4tree___pyx_scope_struct_38_compare_slots,
};
#else

static PyTypeObject __pyx_type_4ete4_4core_4tree___pyx_scope_struct_38_compare = {
  PyVarObject_HEAD_INIT(0, 0)
  "ete4.core.tree.""__pyx_scope_struct_38_compare", /*tp_name*/
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_38_compare), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_38_compare, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_38_compare, /*tp_traverse*/
  __pyx_tp_clear_4ete4_4core_4tree___pyx_scope_struct_38_compare, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_38_compare, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_39_edges *__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_39_edges[8];
static int __pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_39_edges = 0;
#endif

static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_39_edges(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_39_edges > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_39_edges)))) {
    o = (PyObject*)__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_39_edges[--__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_39_edges];
    memset(o, 0, sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_39_edges));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_39_edges(PyObject *o) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_39_edges *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_39_edges *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_39_edges) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_all_leaves);
  Py_CLEAR(p->__pyx_v_cached_content);
  Py_CLEAR(p->__pyx_v_leaves_descendant);
  Py_CLEAR(p->__pyx_v_self);
  Py_CLEAR(p->__pyx_t_0);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_39_edges < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_39_edges)))) {
    __pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_39_edges[__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_39_edges++] = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_39_edges *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_39_edges(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_39_edges *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_39_edges *)o;
  if (p->__pyx_v_all_leaves) {
    e = (*v)(p->__pyx_v_all_leaves, a); if (e) return e;
  }
  if (p->__pyx_v_cached_content) {
    e = (*v)(p->__pyx_v_cached_content, a); if (e) return e;
  }
  if (p->__pyx_v_leaves_descendant) {
    e = (*v)(p->__pyx_v_leaves_descendant, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_4ete4_4core_4tree___pyx_scope_struct_39_edges_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_39_edges},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_39_edges},
  {Py_tp_new, (void *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_39_edges},
  {0, 0},
};
static PyType_Spec __pyx_type_4ete4_4core_4tree___pyx_scope_struct_39_edges_spec = {
  "ete4.core.tree.__pyx_scope_struct_39_edges",
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_39_edges),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_4ete4_4core_4tree___pyx_scope_struct_39_edges_slots,
};
#else

static PyTypeObject __pyx_type_4ete4_4core_4tree___pyx_scope_struct_39_edges = {
  PyVarObject_HEAD_INIT(0, 0)
  "ete4.core.tree.""__pyx_scope_struct_39_edges", /*tp_name*/
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_39_edges), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_39_edges, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_39_edges, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_39_edges, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_40_get_topology_id *__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_40_get_topology_id[8];
static int __pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_40_get_topology_id = 0;
#endif

static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_40_get_topology_id(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_40_get_topology_id > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_40_get_topology_id)))) {
    o = (PyObject*)__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_40_get_topology_id[--__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_40_get_topology_id];
    memset(o, 0, sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_40_get_topology_id));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_40_get_topology_id(PyObject *o) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_40_get_topology_id *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_40_get_topology_id *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_40_get_topology_id) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_prop);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_40_get_topology_id < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_40_get_topology_id)))) {
    __pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_40_get_topology_id[__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_40_get_topology_id++] = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_40_get_topology_id *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_40_get_topology_id(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_40_get_topology_id *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_40_get_topology_id *)o;
  if (p->__pyx_v_prop) {
    e = (*v)(p->__pyx_v_prop, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_4ete4_4core_4tree___pyx_scope_struct_40_get_topology_id(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_40_get_topology_id *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_40_get_topology_id *)o;
  tmp = ((PyObject*)p->__pyx_v_prop);
  p->__pyx_v_prop = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_4ete4_4core_4tree___pyx_scope_struct_40_get_topology_id_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_40_get_topology_id},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_40_get_topology_id},
  {Py_tp_clear, (void *)__pyx_tp_clear_4ete4_4core_4tree___pyx_scope_struct_40_get_topology_id},
  {Py_tp_new, (void *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_40_get_topology_id},
  {0, 0},
};
static PyType_Spec __pyx_type_4ete4_4core_4tree___pyx_scope_struct_40_get_topology_id_spec = {
  "ete4.core.tree.__pyx_scope_struct_40_get_topology_id",
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_40_get_topology_id),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_4ete4_4core_4tree___pyx_scope_struct_40_get_topology_id_slots,
};
#else

static PyTypeObject __pyx_type_4ete4_4core_4tree___pyx_scope_struct_40_get_topology_id = {
  PyVarObject_HEAD_INIT(0, 0)
  "ete4.core.tree.""__pyx_scope_struct_40_get_topology_id", /*tp_name*/
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_40_get_topology_id), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_40_get_topology_id, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_40_get_topology_id, /*tp_traverse*/
  __pyx_tp_clear_4ete4_4core_4tree___pyx_scope_struct_40_get_topology_id, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_40_get_topology_id, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_41_genexpr *__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_41_genexpr[8];
static int __pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_41_genexpr = 0;
#endif

static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_41_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_41_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_41_genexpr)))) {
    o = (PyObject*)__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_41_genexpr[--__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_41_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_41_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_41_genexpr(PyObject *o) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_41_genexpr *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_41_genexpr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_41_genexpr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_genexpr_arg_0);
  Py_CLEAR(p->__pyx_v_e);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_41_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_41_genexpr)))) {
    __pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_41_genexpr[__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_41_genexpr++] = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_41_genexpr *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_41_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_41_genexpr *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_41_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_genexpr_arg_0) {
    e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e;
  }
  if (p->__pyx_v_e) {
    e = (*v)(p->__pyx_v_e, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_4ete4_4core_4tree___pyx_scope_struct_41_genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_41_genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_41_genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_41_genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_4ete4_4core_4tree___pyx_scope_struct_41_genexpr_spec = {
  "ete4.core.tree.__pyx_scope_struct_41_genexpr",
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_41_genexpr),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_4ete4_4core_4tree___pyx_scope_struct_41_genexpr_slots,
};
#else

static PyTypeObject __pyx_type_4ete4_4core_4tree___pyx_scope_struct_41_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "ete4.core.tree.""__pyx_scope_struct_41_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_41_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_41_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_41_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_41_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_42_genexpr *__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_42_genexpr[8];
static int __pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_42_genexpr = 0;
#endif

static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_42_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_42_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_42_genexpr)))) {
    o = (PyObject*)__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_42_genexpr[--__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_42_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_42_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_42_genexpr(PyObject *o) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_42_genexpr *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_42_genexpr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_42_genexpr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_genexpr_arg_0);
  Py_CLEAR(p->__pyx_v_e);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_42_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_42_genexpr)))) {
    __pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_42_genexpr[__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_42_genexpr++] = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_42_genexpr *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_42_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_42_genexpr *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_42_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_genexpr_arg_0) {
    e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e;
  }
  if (p->__pyx_v_e) {
    e = (*v)(p->__pyx_v_e, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_4ete4_4core_4tree___pyx_scope_struct_42_genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_42_genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_42_genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_42_genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_4ete4_4core_4tree___pyx_scope_struct_42_genexpr_spec = {
  "ete4.core.tree.__pyx_scope_struct_42_genexpr",
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_42_genexpr),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_4ete4_4core_4tree___pyx_scope_struct_42_genexpr_slots,
};
#else

static PyTypeObject __pyx_type_4ete4_4core_4tree___pyx_scope_struct_42_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "ete4.core.tree.""__pyx_scope_struct_42_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_42_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_42_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_42_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_42_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_43_is_monophyletic *__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_43_is_monophyletic[8];
static int __pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_43_is_monophyletic = 0;
#endif

static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_43_is_monophyletic(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_43_is_monophyletic > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_43_is_monophyletic)))) {
    o = (PyObject*)__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_43_is_monophyletic[--__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_43_is_monophyletic];
    memset(o, 0, sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_43_is_monophyletic));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_43_is_monophyletic(PyObject *o) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_43_is_monophyletic *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_43_is_monophyletic *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_43_is_monophyletic) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_nodes);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_43_is_monophyletic < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_43_is_monophyletic)))) {
    __pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_43_is_monophyletic[__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_43_is_monophyletic++] = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_43_is_monophyletic *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_43_is_monophyletic(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_43_is_monophyletic *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_43_is_monophyletic *)o;
  if (p->__pyx_v_nodes) {
    e = (*v)(p->__pyx_v_nodes, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_4ete4_4core_4tree___pyx_scope_struct_43_is_monophyletic(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_43_is_monophyletic *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_43_is_monophyletic *)o;
  tmp = ((PyObject*)p->__pyx_v_nodes);
  p->__pyx_v_nodes = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_4ete4_4core_4tree___pyx_scope_struct_43_is_monophyletic_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_43_is_monophyletic},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_43_is_monophyletic},
  {Py_tp_clear, (void *)__pyx_tp_clear_4ete4_4core_4tree___pyx_scope_struct_43_is_monophyletic},
  {Py_tp_new, (void *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_43_is_monophyletic},
  {0, 0},
};
static PyType_Spec __pyx_type_4ete4_4core_4tree___pyx_scope_struct_43_is_monophyletic_spec = {
  "ete4.core.tree.__pyx_scope_struct_43_is_monophyletic",
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_43_is_monophyletic),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_4ete4_4core_4tree___pyx_scope_struct_43_is_monophyletic_slots,
};
#else

static PyTypeObject __pyx_type_4ete4_4core_4tree___pyx_scope_struct_43_is_monophyletic = {
  PyVarObject_HEAD_INIT(0, 0)
  "ete4.core.tree.""__pyx_scope_struct_43_is_monophyletic", /*tp_name*/
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_43_is_monophyletic), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_43_is_monophyletic, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_43_is_monophyletic, /*tp_traverse*/
  __pyx_tp_clear_4ete4_4core_4tree___pyx_scope_struct_43_is_monophyletic, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_43_is_monophyletic, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_44_genexpr *__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_44_genexpr[8];
static int __pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_44_genexpr = 0;
#endif

static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_44_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_44_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_44_genexpr)))) {
    o = (PyObject*)__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_44_genexpr[--__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_44_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_44_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_44_genexpr(PyObject *o) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_44_genexpr *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_44_genexpr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_44_genexpr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_genexpr_arg_0);
  Py_CLEAR(p->__pyx_v_n);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_44_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_44_genexpr)))) {
    __pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_44_genexpr[__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_44_genexpr++] = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_44_genexpr *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_44_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_44_genexpr *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_44_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_genexpr_arg_0) {
    e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e;
  }
  if (p->__pyx_v_n) {
    e = (*v)(p->__pyx_v_n, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_4ete4_4core_4tree___pyx_scope_struct_44_genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_44_genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_44_genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_44_genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_4ete4_4core_4tree___pyx_scope_struct_44_genexpr_spec = {
  "ete4.core.tree.__pyx_scope_struct_44_genexpr",
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_44_genexpr),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_4ete4_4core_4tree___pyx_scope_struct_44_genexpr_slots,
};
#else

static PyTypeObject __pyx_type_4ete4_4core_4tree___pyx_scope_struct_44_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "ete4.core.tree.""__pyx_scope_struct_44_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_44_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_44_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_44_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_44_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_45_check_monophyly *__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_45_check_monophyly[8];
static int __pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_45_check_monophyly = 0;
#endif

static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_45_check_monophyly(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_45_check_monophyly > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_45_check_monophyly)))) {
    o = (PyObject*)__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_45_check_monophyly[--__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_45_check_monophyly];
    memset(o, 0, sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_45_check_monophyly));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_45_check_monophyly(PyObject *o) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_45_check_monophyly *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_45_check_monophyly *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_45_check_monophyly) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_prop);
  Py_CLEAR(p->__pyx_v_values);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_45_check_monophyly < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_45_check_monophyly)))) {
    __pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_45_check_monophyly[__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_45_check_monophyly++] = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_45_check_monophyly *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_45_check_monophyly(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_45_check_monophyly *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_45_check_monophyly *)o;
  if (p->__pyx_v_prop) {
    e = (*v)(p->__pyx_v_prop, a); if (e) return e;
  }
  if (p->__pyx_v_values) {
    e = (*v)(p->__pyx_v_values, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_4ete4_4core_4tree___pyx_scope_struct_45_check_monophyly(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_45_check_monophyly *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_45_check_monophyly *)o;
  tmp = ((PyObject*)p->__pyx_v_prop);
  p->__pyx_v_prop = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_values);
  p->__pyx_v_values = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_4ete4_4core_4tree___pyx_scope_struct_45_check_monophyly_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_45_check_monophyly},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_45_check_monophyly},
  {Py_tp_clear, (void *)__pyx_tp_clear_4ete4_4core_4tree___pyx_scope_struct_45_check_monophyly},
  {Py_tp_new, (void *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_45_check_monophyly},
  {0, 0},
};
static PyType_Spec __pyx_type_4ete4_4core_4tree___pyx_scope_struct_45_check_monophyly_spec = {
  "ete4.core.tree.__pyx_scope_struct_45_check_monophyly",
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_45_check_monophyly),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_4ete4_4core_4tree___pyx_scope_struct_45_check_monophyly_slots,
};
#else

static PyTypeObject __pyx_type_4ete4_4core_4tree___pyx_scope_struct_45_check_monophyly = {
  PyVarObject_HEAD_INIT(0, 0)
  "ete4.core.tree.""__pyx_scope_struct_45_check_monophyly", /*tp_name*/
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_45_check_monophyly), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_45_check_monophyly, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_45_check_monophyly, /*tp_traverse*/
  __pyx_tp_clear_4ete4_4core_4tree___pyx_scope_struct_45_check_monophyly, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_45_check_monophyly, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_46_genexpr *__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_46_genexpr[8];
static int __pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_46_genexpr = 0;
#endif

static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_46_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_46_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_46_genexpr)))) {
    o = (PyObject*)__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_46_genexpr[--__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_46_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_46_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_46_genexpr(PyObject *o) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_46_genexpr *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_46_genexpr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_46_genexpr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_genexpr_arg_0);
  Py_CLEAR(p->__pyx_v_n);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_46_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_46_genexpr)))) {
    __pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_46_genexpr[__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_46_genexpr++] = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_46_genexpr *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_46_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_46_genexpr *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_46_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_genexpr_arg_0) {
    e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e;
  }
  if (p->__pyx_v_n) {
    e = (*v)(p->__pyx_v_n, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_4ete4_4core_4tree___pyx_scope_struct_46_genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_46_genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_46_genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_46_genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_4ete4_4core_4tree___pyx_scope_struct_46_genexpr_spec = {
  "ete4.core.tree.__pyx_scope_struct_46_genexpr",
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_46_genexpr),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_4ete4_4core_4tree___pyx_scope_struct_46_genexpr_slots,
};
#else

static PyTypeObject __pyx_type_4ete4_4core_4tree___pyx_scope_struct_46_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "ete4.core.tree.""__pyx_scope_struct_46_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_46_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_46_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_46_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_46_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_47_genexpr *__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_47_genexpr[8];
static int __pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_47_genexpr = 0;
#endif

static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_47_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_47_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_47_genexpr)))) {
    o = (PyObject*)__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_47_genexpr[--__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_47_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_47_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_47_genexpr(PyObject *o) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_47_genexpr *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_47_genexpr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_47_genexpr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_genexpr_arg_0);
  Py_CLEAR(p->__pyx_v_n);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_47_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_47_genexpr)))) {
    __pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_47_genexpr[__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_47_genexpr++] = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_47_genexpr *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_47_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_47_genexpr *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_47_genexpr *)o;
  if (p->__pyx_genexpr_arg_0) {
    e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e;
  }
  if (p->__pyx_v_n) {
    e = (*v)(p->__pyx_v_n, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_4ete4_4core_4tree___pyx_scope_struct_47_genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_47_genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_47_genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_47_genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_4ete4_4core_4tree___pyx_scope_struct_47_genexpr_spec = {
  "ete4.core.tree.__pyx_scope_struct_47_genexpr",
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_47_genexpr),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_4ete4_4core_4tree___pyx_scope_struct_47_genexpr_slots,
};
#else

static PyTypeObject __pyx_type_4ete4_4core_4tree___pyx_scope_struct_47_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "ete4.core.tree.""__pyx_scope_struct_47_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_47_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_47_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_47_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_47_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_48_get_monophyletic *__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_48_get_monophyletic[8];
static int __pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_48_get_monophyletic = 0;
#endif

static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_48_get_monophyletic(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_48_get_monophyletic > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_48_get_monophyletic)))) {
    o = (PyObject*)__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_48_get_monophyletic[--__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_48_get_monophyletic];
    memset(o, 0, sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_48_get_monophyletic));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_48_get_monophyletic(PyObject *o) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_48_get_monophyletic *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_48_get_monophyletic *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_48_get_monophyletic) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_is_monophyletic);
  Py_CLEAR(p->__pyx_v_n2values);
  Py_CLEAR(p->__pyx_v_prop);
  Py_CLEAR(p->__pyx_v_self);
  Py_CLEAR(p->__pyx_v_values);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_48_get_monophyletic < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_48_get_monophyletic)))) {
    __pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_48_get_monophyletic[__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_48_get_monophyletic++] = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_48_get_monophyletic *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_48_get_monophyletic(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_48_get_monophyletic *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_48_get_monophyletic *)o;
  if (p->__pyx_v_is_monophyletic) {
    e = (*v)(p->__pyx_v_is_monophyletic, a); if (e) return e;
  }
  if (p->__pyx_v_n2values) {
    e = (*v)(p->__pyx_v_n2values, a); if (e) return e;
  }
  if (p->__pyx_v_prop) {
    e = (*v)(p->__pyx_v_prop, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  if (p->__pyx_v_values) {
    e = (*v)(p->__pyx_v_values, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_4ete4_4core_4tree___pyx_scope_struct_48_get_monophyletic_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_48_get_monophyletic},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_48_get_monophyletic},
  {Py_tp_new, (void *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_48_get_monophyletic},
  {0, 0},
};
static PyType_Spec __pyx_type_4ete4_4core_4tree___pyx_scope_struct_48_get_monophyletic_spec = {
  "ete4.core.tree.__pyx_scope_struct_48_get_monophyletic",
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_48_get_monophyletic),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_4ete4_4core_4tree___pyx_scope_struct_48_get_monophyletic_slots,
};
#else

static PyTypeObject __pyx_type_4ete4_4core_4tree___pyx_scope_struct_48_get_monophyletic = {
  PyVarObject_HEAD_INIT(0, 0)
  "ete4.core.tree.""__pyx_scope_struct_48_get_monophyletic", /*tp_name*/
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_48_get_monophyletic), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_48_get_monophyletic, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_48_get_monophyletic, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_48_get_monophyletic, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_49_expand_polytomies *__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_49_expand_polytomies[8];
static int __pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_49_expand_polytomies = 0;
#endif

static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_49_expand_polytomies(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_49_expand_polytomies > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_49_expand_polytomies)))) {
    o = (PyObject*)__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_49_expand_polytomies[--__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_49_expand_polytomies];
    memset(o, 0, sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_49_expand_polytomies));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_49_expand_polytomies(PyObject *o) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_49_expand_polytomies *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_49_expand_polytomies *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_49_expand_polytomies) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_TipTuple);
  Py_CLEAR(p->__pyx_v_add_leaf);
  Py_CLEAR(p->__pyx_v_enum_unordered);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_49_expand_polytomies < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_49_expand_polytomies)))) {
    __pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_49_expand_polytomies[__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_49_expand_polytomies++] = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_49_expand_polytomies *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_49_expand_polytomies(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_49_expand_polytomies *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_49_expand_polytomies *)o;
  if (p->__pyx_v_TipTuple) {
    e = (*v)(p->__pyx_v_TipTuple, a); if (e) return e;
  }
  if (p->__pyx_v_add_leaf) {
    e = (*v)(p->__pyx_v_add_leaf, a); if (e) return e;
  }
  if (p->__pyx_v_enum_unordered) {
    e = (*v)(p->__pyx_v_enum_unordered, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_4ete4_4core_4tree___pyx_scope_struct_49_expand_polytomies(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_49_expand_polytomies *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_49_expand_polytomies *)o;
  tmp = ((PyObject*)p->__pyx_v_TipTuple);
  p->__pyx_v_TipTuple = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_add_leaf);
  p->__pyx_v_add_leaf = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_enum_unordered);
  p->__pyx_v_enum_unordered = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_4ete4_4core_4tree___pyx_scope_struct_49_expand_polytomies_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_49_expand_polytomies},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_49_expand_polytomies},
  {Py_tp_clear, (void *)__pyx_tp_clear_4ete4_4core_4tree___pyx_scope_struct_49_expand_polytomies},
  {Py_tp_new, (void *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_49_expand_polytomies},
  {0, 0},
};
static PyType_Spec __pyx_type_4ete4_4core_4tree___pyx_scope_struct_49_expand_polytomies_spec = {
  "ete4.core.tree.__pyx_scope_struct_49_expand_polytomies",
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_49_expand_polytomies),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_4ete4_4core_4tree___pyx_scope_struct_49_expand_polytomies_slots,
};
#else

static PyTypeObject __pyx_type_4ete4_4core_4tree___pyx_scope_struct_49_expand_polytomies = {
  PyVarObject_HEAD_INIT(0, 0)
  "ete4.core.tree.""__pyx_scope_struct_49_expand_polytomies", /*tp_name*/
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_49_expand_polytomies), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_49_expand_polytomies, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_49_expand_polytomies, /*tp_traverse*/
  __pyx_tp_clear_4ete4_4core_4tree___pyx_scope_struct_49_expand_polytomies, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_49_expand_polytomies, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_50_add_leaf *__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_50_add_leaf[8];
static int __pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_50_add_leaf = 0;
#endif

static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_50_add_leaf(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_50_add_leaf > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_50_add_leaf)))) {
    o = (PyObject*)__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_50_add_leaf[--__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_50_add_leaf];
    memset(o, 0, sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_50_add_leaf));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_50_add_leaf(PyObject *o) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_50_add_leaf *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_50_add_leaf *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_50_add_leaf) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_label);
  Py_CLEAR(p->__pyx_v_left);
  Py_CLEAR(p->__pyx_v_right);
  Py_CLEAR(p->__pyx_v_tree);
  Py_CLEAR(p->__pyx_t_0);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_50_add_leaf < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_50_add_leaf)))) {
    __pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_50_add_leaf[__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_50_add_leaf++] = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_50_add_leaf *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_50_add_leaf(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_50_add_leaf *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_50_add_leaf *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_label) {
    e = (*v)(p->__pyx_v_label, a); if (e) return e;
  }
  if (p->__pyx_v_left) {
    e = (*v)(p->__pyx_v_left, a); if (e) return e;
  }
  if (p->__pyx_v_right) {
    e = (*v)(p->__pyx_v_right, a); if (e) return e;
  }
  if (p->__pyx_v_tree) {
    e = (*v)(p->__pyx_v_tree, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_4ete4_4core_4tree___pyx_scope_struct_50_add_leaf_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_50_add_leaf},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_50_add_leaf},
  {Py_tp_new, (void *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_50_add_leaf},
  {0, 0},
};
static PyType_Spec __pyx_type_4ete4_4core_4tree___pyx_scope_struct_50_add_leaf_spec = {
  "ete4.core.tree.__pyx_scope_struct_50_add_leaf",
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_50_add_leaf),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_4ete4_4core_4tree___pyx_scope_struct_50_add_leaf_slots,
};
#else

static PyTypeObject __pyx_type_4ete4_4core_4tree___pyx_scope_struct_50_add_leaf = {
  PyVarObject_HEAD_INIT(0, 0)
  "ete4.core.tree.""__pyx_scope_struct_50_add_leaf", /*tp_name*/
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_50_add_leaf), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_50_add_leaf, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_50_add_leaf, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_50_add_leaf, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_51_enum_unordered *__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_51_enum_unordered[8];
static int __pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_51_enum_unordered = 0;
#endif

static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_51_enum_unordered(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_51_enum_unordered > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_51_enum_unordered)))) {
    o = (PyObject*)__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_51_enum_unordered[--__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_51_enum_unordered];
    memset(o, 0, sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_51_enum_unordered));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_51_enum_unordered(PyObject *o) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_51_enum_unordered *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_51_enum_unordered *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_51_enum_unordered) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_labels);
  Py_CLEAR(p->__pyx_v_new_tree);
  Py_CLEAR(p->__pyx_v_tree);
  Py_CLEAR(p->__pyx_t_1);
  Py_CLEAR(p->__pyx_t_2);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_51_enum_unordered < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_51_enum_unordered)))) {
    __pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_51_enum_unordered[__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_51_enum_unordered++] = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_51_enum_unordered *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_51_enum_unordered(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_51_enum_unordered *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_51_enum_unordered *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_labels) {
    e = (*v)(p->__pyx_v_labels, a); if (e) return e;
  }
  if (p->__pyx_v_new_tree) {
    e = (*v)(p->__pyx_v_new_tree, a); if (e) return e;
  }
  if (p->__pyx_v_tree) {
    e = (*v)(p->__pyx_v_tree, a); if (e) return e;
  }
  if (p->__pyx_t_1) {
    e = (*v)(p->__pyx_t_1, a); if (e) return e;
  }
  if (p->__pyx_t_2) {
    e = (*v)(p->__pyx_t_2, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_4ete4_4core_4tree___pyx_scope_struct_51_enum_unordered_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_51_enum_unordered},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_51_enum_unordered},
  {Py_tp_new, (void *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_51_enum_unordered},
  {0, 0},
};
static PyType_Spec __pyx_type_4ete4_4core_4tree___pyx_scope_struct_51_enum_unordered_spec = {
  "ete4.core.tree.__pyx_scope_struct_51_enum_unordered",
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_51_enum_unordered),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_4ete4_4core_4tree___pyx_scope_struct_51_enum_unordered_slots,
};
#else

static PyTypeObject __pyx_type_4ete4_4core_4tree___pyx_scope_struct_51_enum_unordered = {
  PyVarObject_HEAD_INIT(0, 0)
  "ete4.core.tree.""__pyx_scope_struct_51_enum_unordered", /*tp_name*/
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_51_enum_unordered), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_51_enum_unordered, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_51_enum_unordered, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_51_enum_unordered, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_52_genexpr *__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_52_genexpr[8];
static int __pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_52_genexpr = 0;
#endif

static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_52_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_52_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_52_genexpr)))) {
    o = (PyObject*)__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_52_genexpr[--__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_52_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_52_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_52_genexpr(PyObject *o) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_52_genexpr *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_52_genexpr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_52_genexpr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_genexpr_arg_0);
  Py_CLEAR(p->__pyx_v_x);
  Py_CLEAR(p->__pyx_t_0);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_52_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_52_genexpr)))) {
    __pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_52_genexpr[__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_52_genexpr++] = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_52_genexpr *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_52_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_52_genexpr *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_52_genexpr *)o;
  if (p->__pyx_genexpr_arg_0) {
    e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e;
  }
  if (p->__pyx_v_x) {
    e = (*v)(p->__pyx_v_x, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_4ete4_4core_4tree___pyx_scope_struct_52_genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_52_genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_52_genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_52_genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_4ete4_4core_4tree___pyx_scope_struct_52_genexpr_spec = {
  "ete4.core.tree.__pyx_scope_struct_52_genexpr",
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_52_genexpr),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_4ete4_4core_4tree___pyx_scope_struct_52_genexpr_slots,
};
#else

static PyTypeObject __pyx_type_4ete4_4core_4tree___pyx_scope_struct_52_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "ete4.core.tree.""__pyx_scope_struct_52_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_52_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_52_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_52_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_52_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_53_from_parent_child_table *__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_53_from_parent_child_table[8];
static int __pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_53_from_parent_child_table = 0;
#endif

static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_53_from_parent_child_table(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_53_from_parent_child_table > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_53_from_parent_child_table)))) {
    o = (PyObject*)__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_53_from_parent_child_table[--__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_53_from_parent_child_table];
    memset(o, 0, sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_53_from_parent_child_table));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_53_from_parent_child_table(PyObject *o) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_53_from_parent_child_table *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_53_from_parent_child_table *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_53_from_parent_child_table) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_nodes_by_name);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_53_from_parent_child_table < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_53_from_parent_child_table)))) {
    __pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_53_from_parent_child_table[__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_53_from_parent_child_table++] = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_53_from_parent_child_table *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_53_from_parent_child_table(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_53_from_parent_child_table *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_53_from_parent_child_table *)o;
  if (p->__pyx_v_nodes_by_name) {
    e = (*v)(p->__pyx_v_nodes_by_name, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_4ete4_4core_4tree___pyx_scope_struct_53_from_parent_child_table(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_53_from_parent_child_table *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_53_from_parent_child_table *)o;
  tmp = ((PyObject*)p->__pyx_v_nodes_by_name);
  p->__pyx_v_nodes_by_name = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_4ete4_4core_4tree___pyx_scope_struct_53_from_parent_child_table_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_53_from_parent_child_table},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_53_from_parent_child_table},
  {Py_tp_clear, (void *)__pyx_tp_clear_4ete4_4core_4tree___pyx_scope_struct_53_from_parent_child_table},
  {Py_tp_new, (void *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_53_from_parent_child_table},
  {0, 0},
};
static PyType_Spec __pyx_type_4ete4_4core_4tree___pyx_scope_struct_53_from_parent_child_table_spec = {
  "ete4.core.tree.__pyx_scope_struct_53_from_parent_child_table",
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_53_from_parent_child_table),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_4ete4_4core_4tree___pyx_scope_struct_53_from_parent_child_table_slots,
};
#else

static PyTypeObject __pyx_type_4ete4_4core_4tree___pyx_scope_struct_53_from_parent_child_table = {
  PyVarObject_HEAD_INIT(0, 0)
  "ete4.core.tree.""__pyx_scope_struct_53_from_parent_child_table", /*tp_name*/
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_53_from_parent_child_table), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_53_from_parent_child_table, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_53_from_parent_child_table, /*tp_traverse*/
  __pyx_tp_clear_4ete4_4core_4tree___pyx_scope_struct_53_from_parent_child_table, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_53_from_parent_child_table, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_54_from_skbio *__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_54_from_skbio[8];
static int __pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_54_from_skbio = 0;
#endif

static PyObject *__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_54_from_skbio(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_54_from_skbio > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_54_from_skbio)))) {
    o = (PyObject*)__pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_54_from_skbio[--__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_54_from_skbio];
    memset(o, 0, sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_54_from_skbio));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_54_from_skbio(PyObject *o) {
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_54_from_skbio *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_54_from_skbio *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_54_from_skbio) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_all_nodes);
  Py_CLEAR(p->__pyx_v_map_attributes);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_54_from_skbio < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_54_from_skbio)))) {
    __pyx_freelist_4ete4_4core_4tree___pyx_scope_struct_54_from_skbio[__pyx_freecount_4ete4_4core_4tree___pyx_scope_struct_54_from_skbio++] = ((struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_54_from_skbio *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_54_from_skbio(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_54_from_skbio *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_54_from_skbio *)o;
  if (p->__pyx_v_all_nodes) {
    e = (*v)(p->__pyx_v_all_nodes, a); if (e) return e;
  }
  if (p->__pyx_v_map_attributes) {
    e = (*v)(p->__pyx_v_map_attributes, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_4ete4_4core_4tree___pyx_scope_struct_54_from_skbio(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_54_from_skbio *p = (struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_54_from_skbio *)o;
  tmp = ((PyObject*)p->__pyx_v_all_nodes);
  p->__pyx_v_all_nodes = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_map_attributes);
  p->__pyx_v_map_attributes = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_4ete4_4core_4tree___pyx_scope_struct_54_from_skbio_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_54_from_skbio},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_54_from_skbio},
  {Py_tp_clear, (void *)__pyx_tp_clear_4ete4_4core_4tree___pyx_scope_struct_54_from_skbio},
  {Py_tp_new, (void *)__pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_54_from_skbio},
  {0, 0},
};
static PyType_Spec __pyx_type_4ete4_4core_4tree___pyx_scope_struct_54_from_skbio_spec = {
  "ete4.core.tree.__pyx_scope_struct_54_from_skbio",
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_54_from_skbio),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_4ete4_4core_4tree___pyx_scope_struct_54_from_skbio_slots,
};
#else

static PyTypeObject __pyx_type_4ete4_4core_4tree___pyx_scope_struct_54_from_skbio = {
  PyVarObject_HEAD_INIT(0, 0)
  "ete4.core.tree.""__pyx_scope_struct_54_from_skbio", /*tp_name*/
  sizeof(struct __pyx_obj_4ete4_4core_4tree___pyx_scope_struct_54_from_skbio), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4ete4_4core_4tree___pyx_scope_struct_54_from_skbio, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4ete4_4core_4tree___pyx_scope_struct_54_from_skbio, /*tp_traverse*/
  __pyx_tp_clear_4ete4_4core_4tree___pyx_scope_struct_54_from_skbio, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4ete4_4core_4tree___pyx_scope_struct_54_from_skbio, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyMethodDef __pyx_methods[] = {
  {0, 0, 0, 0}
};
#ifndef CYTHON_SMALL_CODE
#if defined(__clang__)
    #define CYTHON_SMALL_CODE
#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
    #define CYTHON_SMALL_CODE __attribute__((cold))
#else
    #define CYTHON_SMALL_CODE
#endif
#endif
/* #### Code section: pystring_table ### */

static int __Pyx_CreateStringTabAndInitStrings(void) {
  __Pyx_StringTabEntry __pyx_string_tab[] = {
    {&__pyx_kp_u_127_0_0_1, __pyx_k_127_0_0_1, sizeof(__pyx_k_127_0_0_1), 0, 1, 0, 0},
    {&__pyx_kp_u_A_parent_node_is_required_to_add, __pyx_k_A_parent_node_is_required_to_add, sizeof(__pyx_k_A_parent_node_is_required_to_add), 0, 1, 0, 0},
    {&__pyx_kp_u_Ambiguous_node_name, __pyx_k_Ambiguous_node_name, sizeof(__pyx_k_Ambiguous_node_name), 0, 1, 0, 0},
    {&__pyx_n_s_AssertionError, __pyx_k_AssertionError, sizeof(__pyx_k_AssertionError), 0, 0, 1, 1},
    {&__pyx_kp_u_Both_trees_contain_polytomies_Tr, __pyx_k_Both_trees_contain_polytomies_Tr, sizeof(__pyx_k_Both_trees_contain_polytomies_Tr), 0, 1, 0, 0},
    {&__pyx_kp_u_Can_only_check_nodes_or_names_in, __pyx_k_Can_only_check_nodes_or_names_in, sizeof(__pyx_k_Can_only_check_nodes_or_names_in), 0, 1, 0, 0},
    {&__pyx_kp_u_Cannot_pop_child_not_found, __pyx_k_Cannot_pop_child_not_found, sizeof(__pyx_k_Cannot_pop_child_not_found), 0, 1, 0, 0},
    {&__pyx_kp_u_Cannot_remove_child_not_found, __pyx_k_Cannot_remove_child_not_found, sizeof(__pyx_k_Cannot_remove_child_not_found), 0, 1, 0, 0},
    {&__pyx_kp_u_Cannot_remove_sister_because_the, __pyx_k_Cannot_remove_sister_because_the, sizeof(__pyx_k_Cannot_remove_sister_because_the), 0, 1, 0, 0},
    {&__pyx_kp_u_Cannot_render_image_missing_modu, __pyx_k_Cannot_render_image_missing_modu, sizeof(__pyx_k_Cannot_render_image_missing_modu), 0, 1, 0, 0},
    {&__pyx_n_s_Chrome, __pyx_k_Chrome, sizeof(__pyx_k_Chrome), 0, 0, 1, 1},
    {&__pyx_kp_u_Duplicated_items_found_in_refere, __pyx_k_Duplicated_items_found_in_refere, sizeof(__pyx_k_Duplicated_items_found_in_refere), 0, 1, 0, 0},
    {&__pyx_kp_u_Duplicated_items_found_in_target, __pyx_k_Duplicated_items_found_in_target, sizeof(__pyx_k_Duplicated_items_found_in_target), 0, 1, 0, 0},
    {&__pyx_n_u_ETE, __pyx_k_ETE, sizeof(__pyx_k_ETE), 0, 1, 0, 1},
    {&__pyx_n_s_FACE_POSITIONS, __pyx_k_FACE_POSITIONS, sizeof(__pyx_k_FACE_POSITIONS), 0, 0, 1, 1},
    {&__pyx_n_s_Face, __pyx_k_Face, sizeof(__pyx_k_Face), 0, 0, 1, 1},
    {&__pyx_n_s_FaceAreas, __pyx_k_FaceAreas, sizeof(__pyx_k_FaceAreas), 0, 0, 1, 1},
    {&__pyx_n_s_FaceContainer, __pyx_k_FaceContainer, sizeof(__pyx_k_FaceContainer), 0, 0, 1, 1},
    {&__pyx_kp_u_Found_polytomy_larger_than_curre, __pyx_k_Found_polytomy_larger_than_curre, sizeof(__pyx_k_Found_polytomy_larger_than_curre), 0, 1, 0, 0},
    {&__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_u_Incorrect_child_type, __pyx_k_Incorrect_child_type, sizeof(__pyx_k_Incorrect_child_type), 0, 1, 0, 0},
    {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
    {&__pyx_kp_u_Invalid_copy_method, __pyx_k_Invalid_copy_method, sizeof(__pyx_k_Invalid_copy_method), 0, 1, 0, 0},
    {&__pyx_kp_u_Invalid_node_id, __pyx_k_Invalid_node_id, sizeof(__pyx_k_Invalid_node_id), 0, 1, 0, 0},
    {&__pyx_kp_u_Invalid_node_type, __pyx_k_Invalid_node_type, sizeof(__pyx_k_Invalid_node_type), 0, 1, 0, 0},
    {&__pyx_kp_u_Max_distance_g, __pyx_k_Max_distance_g, sizeof(__pyx_k_Max_distance_g), 0, 1, 0, 0},
    {&__pyx_n_s_ModuleNotFoundError, __pyx_k_ModuleNotFoundError, sizeof(__pyx_k_ModuleNotFoundError), 0, 0, 1, 1},
    {&__pyx_kp_u_Most_distant_node_s, __pyx_k_Most_distant_node_s, sizeof(__pyx_k_Most_distant_node_s), 0, 1, 0, 0},
    {&__pyx_n_u_NA, __pyx_k_NA, sizeof(__pyx_k_NA), 0, 1, 0, 1},
    {&__pyx_n_u_No, __pyx_k_No, sizeof(__pyx_k_No), 0, 1, 0, 1},
    {&__pyx_kp_u_No_children, __pyx_k_No_children, sizeof(__pyx_k_No_children), 0, 1, 0, 0},
    {&__pyx_kp_u_No_common_ancestor_for_nodes, __pyx_k_No_common_ancestor_for_nodes, sizeof(__pyx_k_No_common_ancestor_for_nodes), 0, 1, 0, 0},
    {&__pyx_kp_u_No_node_found_with_name, __pyx_k_No_node_found_with_name, sizeof(__pyx_k_No_node_found_with_name), 0, 1, 0, 0},
    {&__pyx_n_s_NodeStyle, __pyx_k_NodeStyle, sizeof(__pyx_k_NodeStyle), 0, 0, 1, 1},
    {&__pyx_kp_u_Node_has, __pyx_k_Node_has, sizeof(__pyx_k_Node_has), 0, 1, 0, 0},
    {&__pyx_kp_u_Number_of_leaf_nodes_d, __pyx_k_Number_of_leaf_nodes_d, sizeof(__pyx_k_Number_of_leaf_nodes_d), 0, 1, 0, 0},
    {&__pyx_n_s_Options, __pyx_k_Options, sizeof(__pyx_k_Options), 0, 0, 1, 1},
    {&__pyx_n_s_PARSERS, __pyx_k_PARSERS, sizeof(__pyx_k_PARSERS), 0, 0, 1, 1},
    {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
    {&__pyx_kp_u_Rooted_s, __pyx_k_Rooted_s, sizeof(__pyx_k_Rooted_s), 0, 1, 0, 0},
    {&__pyx_n_s_StopIteration, __pyx_k_StopIteration, sizeof(__pyx_k_StopIteration), 0, 0, 1, 1},
    {&__pyx_n_s_TipTuple, __pyx_k_TipTuple, sizeof(__pyx_k_TipTuple), 0, 0, 1, 1},
    {&__pyx_kp_u_Total_number_of_nodes_d, __pyx_k_Total_number_of_nodes_d, sizeof(__pyx_k_Total_number_of_nodes_d), 0, 1, 0, 0},
    {&__pyx_kp_u_Tree, __pyx_k_Tree, sizeof(__pyx_k_Tree), 0, 1, 0, 0},
    {&__pyx_n_s_TreeError, __pyx_k_TreeError, sizeof(__pyx_k_TreeError), 0, 0, 1, 1},
    {&__pyx_n_s_TreeNode, __pyx_k_TreeNode, sizeof(__pyx_k_TreeNode), 0, 0, 1, 1},
    {&__pyx_n_s_Tree_2, __pyx_k_Tree_2, sizeof(__pyx_k_Tree_2), 0, 0, 1, 1},
    {&__pyx_n_s_Tree___iter, __pyx_k_Tree___iter, sizeof(__pyx_k_Tree___iter), 0, 0, 1, 1},
    {&__pyx_n_s_Tree___reduce_cython, __pyx_k_Tree___reduce_cython, sizeof(__pyx_k_Tree___reduce_cython), 0, 0, 1, 1},
    {&__pyx_n_s_Tree___setstate_cython, __pyx_k_Tree___setstate_cython, sizeof(__pyx_k_Tree___setstate_cython), 0, 0, 1, 1},
    {&__pyx_n_s_Tree__diff, __pyx_k_Tree__diff, sizeof(__pyx_k_Tree__diff), 0, 0, 1, 1},
    {&__pyx_n_s_Tree__get_farthest_and_closest_l, __pyx_k_Tree__get_farthest_and_closest_l, sizeof(__pyx_k_Tree__get_farthest_and_closest_l), 0, 0, 1, 1},
    {&__pyx_n_s_Tree__translate_nodes, __pyx_k_Tree__translate_nodes, sizeof(__pyx_k_Tree__translate_nodes), 0, 0, 1, 1},
    {&__pyx_n_s_Tree_add_child, __pyx_k_Tree_add_child, sizeof(__pyx_k_Tree_add_child), 0, 0, 1, 1},
    {&__pyx_n_s_Tree_add_children, __pyx_k_Tree_add_children, sizeof(__pyx_k_Tree_add_children), 0, 0, 1, 1},
    {&__pyx_n_s_Tree_add_face, __pyx_k_Tree_add_face, sizeof(__pyx_k_Tree_add_face), 0, 0, 1, 1},
    {&__pyx_n_s_Tree_add_prop, __pyx_k_Tree_add_prop, sizeof(__pyx_k_Tree_add_prop), 0, 0, 1, 1},
    {&__pyx_n_s_Tree_add_props, __pyx_k_Tree_add_props, sizeof(__pyx_k_Tree_add_props), 0, 0, 1, 1},
    {&__pyx_n_s_Tree_add_sister, __pyx_k_Tree_add_sister, sizeof(__pyx_k_Tree_add_sister), 0, 0, 1, 1},
    {&__pyx_n_s_Tree_ancestors, __pyx_k_Tree_ancestors, sizeof(__pyx_k_Tree_ancestors), 0, 0, 1, 1},
    {&__pyx_n_s_Tree_check_monophyly, __pyx_k_Tree_check_monophyly, sizeof(__pyx_k_Tree_check_monophyly), 0, 0, 1, 1},
    {&__pyx_n_s_Tree_common_ancestor, __pyx_k_Tree_common_ancestor, sizeof(__pyx_k_Tree_common_ancestor), 0, 0, 1, 1},
    {&__pyx_n_s_Tree_compare, __pyx_k_Tree_compare, sizeof(__pyx_k_Tree_compare), 0, 0, 1, 1},
    {&__pyx_n_s_Tree_cophenetic_matrix, __pyx_k_Tree_cophenetic_matrix, sizeof(__pyx_k_Tree_cophenetic_matrix), 0, 0, 1, 1},
    {&__pyx_n_s_Tree_copy, __pyx_k_Tree_copy, sizeof(__pyx_k_Tree_copy), 0, 0, 1, 1},
    {&__pyx_n_s_Tree_del_prop, __pyx_k_Tree_del_prop, sizeof(__pyx_k_Tree_del_prop), 0, 0, 1, 1},
    {&__pyx_n_s_Tree_delete, __pyx_k_Tree_delete, sizeof(__pyx_k_Tree_delete), 0, 0, 1, 1},
    {&__pyx_n_s_Tree_descendants, __pyx_k_Tree_descendants, sizeof(__pyx_k_Tree_descendants), 0, 0, 1, 1},
    {&__pyx_n_s_Tree_describe, __pyx_k_Tree_describe, sizeof(__pyx_k_Tree_describe), 0, 0, 1, 1},
    {&__pyx_n_s_Tree_detach, __pyx_k_Tree_detach, sizeof(__pyx_k_Tree_detach), 0, 0, 1, 1},
    {&__pyx_n_s_Tree_edges, __pyx_k_Tree_edges, sizeof(__pyx_k_Tree_edges), 0, 0, 1, 1},
    {&__pyx_n_s_Tree_expand_polytomies, __pyx_k_Tree_expand_polytomies, sizeof(__pyx_k_Tree_expand_polytomies), 0, 0, 1, 1},
    {&__pyx_n_s_Tree_explore, __pyx_k_Tree_explore, sizeof(__pyx_k_Tree_explore), 0, 0, 1, 1},
    {&__pyx_n_s_Tree_from_parent_child_table, __pyx_k_Tree_from_parent_child_table, sizeof(__pyx_k_Tree_from_parent_child_table), 0, 0, 1, 1},
    {&__pyx_n_s_Tree_from_skbio, __pyx_k_Tree_from_skbio, sizeof(__pyx_k_Tree_from_skbio), 0, 0, 1, 1},
    {&__pyx_n_s_Tree_get_cached_content, __pyx_k_Tree_get_cached_content, sizeof(__pyx_k_Tree_get_cached_content), 0, 0, 1, 1},
    {&__pyx_n_s_Tree_get_children, __pyx_k_Tree_get_children, sizeof(__pyx_k_Tree_get_children), 0, 0, 1, 1},
    {&__pyx_n_s_Tree_get_closest_leaf, __pyx_k_Tree_get_closest_leaf, sizeof(__pyx_k_Tree_get_closest_leaf), 0, 0, 1, 1},
    {&__pyx_n_s_Tree_get_distance, __pyx_k_Tree_get_distance, sizeof(__pyx_k_Tree_get_distance), 0, 0, 1, 1},
    {&__pyx_n_s_Tree_get_farthest_leaf, __pyx_k_Tree_get_farthest_leaf, sizeof(__pyx_k_Tree_get_farthest_leaf), 0, 0, 1, 1},
    {&__pyx_n_s_Tree_get_farthest_node, __pyx_k_Tree_get_farthest_node, sizeof(__pyx_k_Tree_get_farthest_node), 0, 0, 1, 1},
    {&__pyx_n_s_Tree_get_midpoint_outgroup, __pyx_k_Tree_get_midpoint_outgroup, sizeof(__pyx_k_Tree_get_midpoint_outgroup), 0, 0, 1, 1},
    {&__pyx_n_s_Tree_get_monophyletic, __pyx_k_Tree_get_monophyletic, sizeof(__pyx_k_Tree_get_monophyletic), 0, 0, 1, 1},
    {&__pyx_n_s_Tree_get_prop, __pyx_k_Tree_get_prop, sizeof(__pyx_k_Tree_get_prop), 0, 0, 1, 1},
    {&__pyx_n_s_Tree_get_sisters, __pyx_k_Tree_get_sisters, sizeof(__pyx_k_Tree_get_sisters), 0, 0, 1, 1},
    {&__pyx_n_s_Tree_get_topology_id, __pyx_k_Tree_get_topology_id, sizeof(__pyx_k_Tree_get_topology_id), 0, 0, 1, 1},
    {&__pyx_n_s_Tree_is_monophyletic, __pyx_k_Tree_is_monophyletic, sizeof(__pyx_k_Tree_is_monophyletic), 0, 0, 1, 1},
    {&__pyx_n_s_Tree_iter_prepostorder, __pyx_k_Tree_iter_prepostorder, sizeof(__pyx_k_Tree_iter_prepostorder), 0, 0, 1, 1},
    {&__pyx_n_s_Tree_ladderize, __pyx_k_Tree_ladderize, sizeof(__pyx_k_Tree_ladderize), 0, 0, 1, 1},
    {&__pyx_n_s_Tree_leaf_names, __pyx_k_Tree_leaf_names, sizeof(__pyx_k_Tree_leaf_names), 0, 0, 1, 1},
    {&__pyx_n_s_Tree_leaves, __pyx_k_Tree_leaves, sizeof(__pyx_k_Tree_leaves), 0, 0, 1, 1},
    {&__pyx_n_s_Tree_lineage, __pyx_k_Tree_lineage, sizeof(__pyx_k_Tree_lineage), 0, 0, 1, 1},
    {&__pyx_n_s_Tree_mean_distance, __pyx_k_Tree_mean_distance, sizeof(__pyx_k_Tree_mean_distance), 0, 0, 1, 1},
    {&__pyx_n_s_Tree_pop_child, __pyx_k_Tree_pop_child, sizeof(__pyx_k_Tree_pop_child), 0, 0, 1, 1},
    {&__pyx_n_s_Tree_populate, __pyx_k_Tree_populate, sizeof(__pyx_k_Tree_populate), 0, 0, 1, 1},
    {&__pyx_n_s_Tree_prune, __pyx_k_Tree_prune, sizeof(__pyx_k_Tree_prune), 0, 0, 1, 1},
    {&__pyx_n_s_Tree_remove_child, __pyx_k_Tree_remove_child, sizeof(__pyx_k_Tree_remove_child), 0, 0, 1, 1},
    {&__pyx_n_s_Tree_remove_children, __pyx_k_Tree_remove_children, sizeof(__pyx_k_Tree_remove_children), 0, 0, 1, 1},
    {&__pyx_n_s_Tree_remove_sister, __pyx_k_Tree_remove_sister, sizeof(__pyx_k_Tree_remove_sister), 0, 0, 1, 1},
    {&__pyx_n_s_Tree_render, __pyx_k_Tree_render, sizeof(__pyx_k_Tree_render), 0, 0, 1, 1},
    {&__pyx_n_s_Tree_render_sm, __pyx_k_Tree_render_sm, sizeof(__pyx_k_Tree_render_sm), 0, 0, 1, 1},
    {&__pyx_n_s_Tree_resolve_polytomy, __pyx_k_Tree_resolve_polytomy, sizeof(__pyx_k_Tree_resolve_polytomy), 0, 0, 1, 1},
    {&__pyx_n_s_Tree_reverse_children, __pyx_k_Tree_reverse_children, sizeof(__pyx_k_Tree_reverse_children), 0, 0, 1, 1},
    {&__pyx_n_s_Tree_robinson_foulds, __pyx_k_Tree_robinson_foulds, sizeof(__pyx_k_Tree_robinson_foulds), 0, 0, 1, 1},
    {&__pyx_n_s_Tree_search_ancestors, __pyx_k_Tree_search_ancestors, sizeof(__pyx_k_Tree_search_ancestors), 0, 0, 1, 1},
    {&__pyx_n_s_Tree_search_descendants, __pyx_k_Tree_search_descendants, sizeof(__pyx_k_Tree_search_descendants), 0, 0, 1, 1},
    {&__pyx_n_s_Tree_search_leaves_by_name, __pyx_k_Tree_search_leaves_by_name, sizeof(__pyx_k_Tree_search_leaves_by_name), 0, 0, 1, 1},
    {&__pyx_n_s_Tree_search_nodes, __pyx_k_Tree_search_nodes, sizeof(__pyx_k_Tree_search_nodes), 0, 0, 1, 1},
    {&__pyx_n_s_Tree_set_outgroup, __pyx_k_Tree_set_outgroup, sizeof(__pyx_k_Tree_set_outgroup), 0, 0, 1, 1},
    {&__pyx_n_s_Tree_set_style, __pyx_k_Tree_set_style, sizeof(__pyx_k_Tree_set_style), 0, 0, 1, 1},
    {&__pyx_n_s_Tree_show, __pyx_k_Tree_show, sizeof(__pyx_k_Tree_show), 0, 0, 1, 1},
    {&__pyx_n_s_Tree_sort_descendants, __pyx_k_Tree_sort_descendants, sizeof(__pyx_k_Tree_sort_descendants), 0, 0, 1, 1},
    {&__pyx_n_s_Tree_standardize, __pyx_k_Tree_standardize, sizeof(__pyx_k_Tree_standardize), 0, 0, 1, 1},
    {&__pyx_n_s_Tree_swap_children, __pyx_k_Tree_swap_children, sizeof(__pyx_k_Tree_swap_children), 0, 0, 1, 1},
    {&__pyx_n_s_Tree_to_str, __pyx_k_Tree_to_str, sizeof(__pyx_k_Tree_to_str), 0, 0, 1, 1},
    {&__pyx_n_s_Tree_to_ultrametric, __pyx_k_Tree_to_ultrametric, sizeof(__pyx_k_Tree_to_ultrametric), 0, 0, 1, 1},
    {&__pyx_n_s_Tree_traverse, __pyx_k_Tree_traverse, sizeof(__pyx_k_Tree_traverse), 0, 0, 1, 1},
    {&__pyx_n_s_Tree_unroot, __pyx_k_Tree_unroot, sizeof(__pyx_k_Tree_unroot), 0, 0, 1, 1},
    {&__pyx_n_s_Tree_write, __pyx_k_Tree_write, sizeof(__pyx_k_Tree_write), 0, 0, 1, 1},
    {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
    {&__pyx_kp_u_Unknown_output_for_diff, __pyx_k_Unknown_output_for_diff, sizeof(__pyx_k_Unknown_output_for_diff), 0, 1, 0, 0},
    {&__pyx_kp_u_Unknown_strategy, __pyx_k_Unknown_strategy, sizeof(__pyx_k_Unknown_strategy), 0, 1, 0, 0},
    {&__pyx_kp_u_Unrooted_tree_found_You_may_want, __pyx_k_Unrooted_tree_found_You_may_want, sizeof(__pyx_k_Unrooted_tree_found_You_may_want), 0, 1, 0, 0},
    {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
    {&__pyx_kp_u_Wrote_file, __pyx_k_Wrote_file, sizeof(__pyx_k_Wrote_file), 0, 1, 0, 0},
    {&__pyx_n_u_Yes, __pyx_k_Yes, sizeof(__pyx_k_Yes), 0, 1, 0, 1},
    {&__pyx_n_s__121, __pyx_k__121, sizeof(__pyx_k__121), 0, 0, 1, 1},
    {&__pyx_kp_u__15, __pyx_k__15, sizeof(__pyx_k__15), 0, 1, 0, 0},
    {&__pyx_kp_u__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0, 0},
    {&__pyx_kp_u__20, __pyx_k__20, sizeof(__pyx_k__20), 0, 1, 0, 0},
    {&__pyx_n_s__203, __pyx_k__203, sizeof(__pyx_k__203), 0, 0, 1, 1},
    {&__pyx_n_s__21, __pyx_k__21, sizeof(__pyx_k__21), 0, 0, 1, 1},
    {&__pyx_kp_u__22, __pyx_k__22, sizeof(__pyx_k__22), 0, 1, 0, 0},
    {&__pyx_kp_u__23, __pyx_k__23, sizeof(__pyx_k__23), 0, 1, 0, 0},
    {&__pyx_n_s__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 0, 1, 1},
    {&__pyx_kp_u__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 1, 0, 0},
    {&__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_n_s_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 1, 1},
    {&__pyx_n_s_add, __pyx_k_add, sizeof(__pyx_k_add), 0, 0, 1, 1},
    {&__pyx_n_s_add_argument, __pyx_k_add_argument, sizeof(__pyx_k_add_argument), 0, 0, 1, 1},
    {&__pyx_n_s_add_child, __pyx_k_add_child, sizeof(__pyx_k_add_child), 0, 0, 1, 1},
    {&__pyx_n_s_add_children, __pyx_k_add_children, sizeof(__pyx_k_add_children), 0, 0, 1, 1},
    {&__pyx_n_s_add_face, __pyx_k_add_face, sizeof(__pyx_k_add_face), 0, 0, 1, 1},
    {&__pyx_n_s_add_leaf, __pyx_k_add_leaf, sizeof(__pyx_k_add_leaf), 0, 0, 1, 1},
    {&__pyx_n_s_add_prop, __pyx_k_add_prop, sizeof(__pyx_k_add_prop), 0, 0, 1, 1},
    {&__pyx_n_s_add_props, __pyx_k_add_props, sizeof(__pyx_k_add_props), 0, 0, 1, 1},
    {&__pyx_n_s_add_sister, __pyx_k_add_sister, sizeof(__pyx_k_add_sister), 0, 0, 1, 1},
    {&__pyx_n_s_add_tree, __pyx_k_add_tree, sizeof(__pyx_k_add_tree), 0, 0, 1, 1},
    {&__pyx_n_s_all_leaves, __pyx_k_all_leaves, sizeof(__pyx_k_all_leaves), 0, 0, 1, 1},
    {&__pyx_n_s_all_max_rf, __pyx_k_all_max_rf, sizeof(__pyx_k_all_max_rf), 0, 0, 1, 1},
    {&__pyx_n_s_all_nodes, __pyx_k_all_nodes, sizeof(__pyx_k_all_nodes), 0, 0, 1, 1},
    {&__pyx_n_s_all_rf, __pyx_k_all_rf, sizeof(__pyx_k_all_rf), 0, 0, 1, 1},
    {&__pyx_n_s_alld, __pyx_k_alld, sizeof(__pyx_k_alld), 0, 0, 1, 1},
    {&__pyx_n_s_allleaves, __pyx_k_allleaves, sizeof(__pyx_k_allleaves), 0, 0, 1, 1},
    {&__pyx_n_s_ancestors, __pyx_k_ancestors, sizeof(__pyx_k_ancestors), 0, 0, 1, 1},
    {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1},
    {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1},
    {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1},
    {&__pyx_kp_u_at, __pyx_k_at, sizeof(__pyx_k_at), 0, 1, 0, 0},
    {&__pyx_n_s_attr, __pyx_k_attr, sizeof(__pyx_k_attr), 0, 0, 1, 1},
    {&__pyx_n_s_autodetect_duplications, __pyx_k_autodetect_duplications, sizeof(__pyx_k_autodetect_duplications), 0, 0, 1, 1},
    {&__pyx_n_s_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 1, 1},
    {&__pyx_kp_u_bad_parser, __pyx_k_bad_parser, sizeof(__pyx_k_bad_parser), 0, 1, 0, 0},
    {&__pyx_n_s_bprops, __pyx_k_bprops, sizeof(__pyx_k_bprops), 0, 0, 1, 1},
    {&__pyx_n_s_branch, __pyx_k_branch, sizeof(__pyx_k_branch), 0, 0, 1, 1},
    {&__pyx_kp_u_branch_right, __pyx_k_branch_right, sizeof(__pyx_k_branch_right), 0, 1, 0, 0},
    {&__pyx_n_s_cached_content, __pyx_k_cached_content, sizeof(__pyx_k_cached_content), 0, 0, 1, 1},
    {&__pyx_n_s_cascade, __pyx_k_cascade, sizeof(__pyx_k_cascade), 0, 0, 1, 1},
    {&__pyx_n_s_cdist, __pyx_k_cdist, sizeof(__pyx_k_cdist), 0, 0, 1, 1},
    {&__pyx_n_s_ch, __pyx_k_ch, sizeof(__pyx_k_ch), 0, 0, 1, 1},
    {&__pyx_n_s_check_monophyly, __pyx_k_check_monophyly, sizeof(__pyx_k_check_monophyly), 0, 0, 1, 1},
    {&__pyx_n_s_check_monophyly_locals_genexpr, __pyx_k_check_monophyly_locals_genexpr, sizeof(__pyx_k_check_monophyly_locals_genexpr), 0, 0, 1, 1},
    {&__pyx_n_s_child, __pyx_k_child, sizeof(__pyx_k_child), 0, 0, 1, 1},
    {&__pyx_n_s_child_idx, __pyx_k_child_idx, sizeof(__pyx_k_child_idx), 0, 0, 1, 1},
    {&__pyx_n_s_child_name, __pyx_k_child_name, sizeof(__pyx_k_child_name), 0, 0, 1, 1},
    {&__pyx_n_s_children, __pyx_k_children, sizeof(__pyx_k_children), 0, 0, 1, 1},
    {&__pyx_kp_u_children_Use_reverse_children_i, __pyx_k_children_Use_reverse_children_i, sizeof(__pyx_k_children_Use_reverse_children_i), 0, 1, 0, 0},
    {&__pyx_n_s_childtrees, __pyx_k_childtrees, sizeof(__pyx_k_childtrees), 0, 0, 1, 1},
    {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
    {&__pyx_n_s_class_getitem, __pyx_k_class_getitem, sizeof(__pyx_k_class_getitem), 0, 0, 1, 1},
    {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
    {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1},
    {&__pyx_n_s_cmp_nodes, __pyx_k_cmp_nodes, sizeof(__pyx_k_cmp_nodes), 0, 0, 1, 1},
    {&__pyx_n_s_cmp_to_key, __pyx_k_cmp_to_key, sizeof(__pyx_k_cmp_to_key), 0, 0, 1, 1},
    {&__pyx_n_s_color, __pyx_k_color, sizeof(__pyx_k_color), 0, 0, 1, 1},
    {&__pyx_n_s_column, __pyx_k_column, sizeof(__pyx_k_column), 0, 0, 1, 1},
    {&__pyx_n_s_columns, __pyx_k_columns, sizeof(__pyx_k_columns), 0, 0, 1, 1},
    {&__pyx_n_s_combinations, __pyx_k_combinations, sizeof(__pyx_k_combinations), 0, 0, 1, 1},
    {&__pyx_n_s_common, __pyx_k_common, sizeof(__pyx_k_common), 0, 0, 1, 1},
    {&__pyx_n_s_common_ancestor, __pyx_k_common_ancestor, sizeof(__pyx_k_common_ancestor), 0, 0, 1, 1},
    {&__pyx_n_s_common_edges, __pyx_k_common_edges, sizeof(__pyx_k_common_edges), 0, 0, 1, 1},
    {&__pyx_n_u_common_edges, __pyx_k_common_edges, sizeof(__pyx_k_common_edges), 0, 1, 0, 1},
    {&__pyx_n_s_common_names, __pyx_k_common_names, sizeof(__pyx_k_common_names), 0, 0, 1, 1},
    {&__pyx_n_s_compact, __pyx_k_compact, sizeof(__pyx_k_compact), 0, 0, 1, 1},
    {&__pyx_n_s_compare, __pyx_k_compare, sizeof(__pyx_k_compare), 0, 0, 1, 1},
    {&__pyx_n_s_compare_2, __pyx_k_compare_2, sizeof(__pyx_k_compare_2), 0, 0, 1, 1},
    {&__pyx_n_s_compare_locals__compare, __pyx_k_compare_locals__compare, sizeof(__pyx_k_compare_locals__compare), 0, 0, 1, 1},
    {&__pyx_n_s_compare_locals__safe_div, __pyx_k_compare_locals__safe_div, sizeof(__pyx_k_compare_locals__safe_div), 0, 0, 1, 1},
    {&__pyx_n_s_compress, __pyx_k_compress, sizeof(__pyx_k_compress), 0, 0, 1, 1},
    {&__pyx_n_s_conditions, __pyx_k_conditions, sizeof(__pyx_k_conditions), 0, 0, 1, 1},
    {&__pyx_n_s_container_type, __pyx_k_container_type, sizeof(__pyx_k_container_type), 0, 0, 1, 1},
    {&__pyx_n_s_contains___locals_genexpr, __pyx_k_contains___locals_genexpr, sizeof(__pyx_k_contains___locals_genexpr), 0, 0, 1, 1},
    {&__pyx_n_s_cophenetic_matrix, __pyx_k_cophenetic_matrix, sizeof(__pyx_k_cophenetic_matrix), 0, 0, 1, 1},
    {&__pyx_n_s_cophenetic_matrix_locals_genexpr, __pyx_k_cophenetic_matrix_locals_genexpr, sizeof(__pyx_k_cophenetic_matrix_locals_genexpr), 0, 0, 1, 1},
    {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1},
    {&__pyx_n_s_corr1, __pyx_k_corr1, sizeof(__pyx_k_corr1), 0, 0, 1, 1},
    {&__pyx_n_s_corr2, __pyx_k_corr2, sizeof(__pyx_k_corr2), 0, 0, 1, 1},
    {&__pyx_n_s_correct_by_polytomy_size, __pyx_k_correct_by_polytomy_size, sizeof(__pyx_k_correct_by_polytomy_size), 0, 0, 1, 1},
    {&__pyx_n_u_cpickle, __pyx_k_cpickle, sizeof(__pyx_k_cpickle), 0, 1, 0, 1},
    {&__pyx_n_s_current, __pyx_k_current, sizeof(__pyx_k_current), 0, 0, 1, 1},
    {&__pyx_n_s_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 0, 1, 1},
    {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1},
    {&__pyx_n_s_deepcopy, __pyx_k_deepcopy, sizeof(__pyx_k_deepcopy), 0, 0, 1, 1},
    {&__pyx_n_u_deepcopy, __pyx_k_deepcopy, sizeof(__pyx_k_deepcopy), 0, 1, 0, 1},
    {&__pyx_n_s_default, __pyx_k_default, sizeof(__pyx_k_default), 0, 0, 1, 1},
    {&__pyx_n_s_del_prop, __pyx_k_del_prop, sizeof(__pyx_k_del_prop), 0, 0, 1, 1},
    {&__pyx_n_s_delete, __pyx_k_delete, sizeof(__pyx_k_delete), 0, 0, 1, 1},
    {&__pyx_n_s_delete_orphan, __pyx_k_delete_orphan, sizeof(__pyx_k_delete_orphan), 0, 0, 1, 1},
    {&__pyx_n_s_depth, __pyx_k_depth, sizeof(__pyx_k_depth), 0, 0, 1, 1},
    {&__pyx_n_s_descendants, __pyx_k_descendants, sizeof(__pyx_k_descendants), 0, 0, 1, 1},
    {&__pyx_n_s_describe, __pyx_k_describe, sizeof(__pyx_k_describe), 0, 0, 1, 1},
    {&__pyx_n_s_detach, __pyx_k_detach, sizeof(__pyx_k_detach), 0, 0, 1, 1},
    {&__pyx_n_s_diameter, __pyx_k_diameter, sizeof(__pyx_k_diameter), 0, 0, 1, 1},
    {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
    {&__pyx_n_s_dict_2, __pyx_k_dict_2, sizeof(__pyx_k_dict_2), 0, 0, 1, 1},
    {&__pyx_n_s_diff, __pyx_k_diff, sizeof(__pyx_k_diff), 0, 0, 1, 1},
    {&__pyx_n_u_diffs, __pyx_k_diffs, sizeof(__pyx_k_diffs), 0, 1, 0, 1},
    {&__pyx_n_u_diffs_tab, __pyx_k_diffs_tab, sizeof(__pyx_k_diffs_tab), 0, 1, 0, 1},
    {&__pyx_n_s_difftable, __pyx_k_difftable, sizeof(__pyx_k_difftable), 0, 0, 1, 1},
    {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0},
    {&__pyx_kp_u_disable_breakpad, __pyx_k_disable_breakpad, sizeof(__pyx_k_disable_breakpad), 0, 1, 0, 0},
    {&__pyx_kp_u_disable_logging, __pyx_k_disable_logging, sizeof(__pyx_k_disable_logging), 0, 1, 0, 0},
    {&__pyx_n_s_discard_t1, __pyx_k_discard_t1, sizeof(__pyx_k_discard_t1), 0, 0, 1, 1},
    {&__pyx_n_s_discard_t2, __pyx_k_discard_t2, sizeof(__pyx_k_discard_t2), 0, 0, 1, 1},
    {&__pyx_n_s_dist, __pyx_k_dist, sizeof(__pyx_k_dist), 0, 0, 1, 1},
    {&__pyx_n_u_dist, __pyx_k_dist, sizeof(__pyx_k_dist), 0, 1, 0, 1},
    {&__pyx_n_s_dist_fn, __pyx_k_dist_fn, sizeof(__pyx_k_dist_fn), 0, 0, 1, 1},
    {&__pyx_n_s_distance, __pyx_k_distance, sizeof(__pyx_k_distance), 0, 0, 1, 1},
    {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
    {&__pyx_n_s_dpi, __pyx_k_dpi, sizeof(__pyx_k_dpi), 0, 0, 1, 1},
    {&__pyx_n_s_drawer, __pyx_k_drawer, sizeof(__pyx_k_drawer), 0, 0, 1, 1},
    {&__pyx_n_s_driver, __pyx_k_driver, sizeof(__pyx_k_driver), 0, 0, 1, 1},
    {&__pyx_n_s_dump, __pyx_k_dump, sizeof(__pyx_k_dump), 0, 0, 1, 1},
    {&__pyx_n_s_dumps, __pyx_k_dumps, sizeof(__pyx_k_dumps), 0, 0, 1, 1},
    {&__pyx_n_s_e, __pyx_k_e, sizeof(__pyx_k_e), 0, 0, 1, 1},
    {&__pyx_n_s_edge_keys, __pyx_k_edge_keys, sizeof(__pyx_k_edge_keys), 0, 0, 1, 1},
    {&__pyx_n_s_edges, __pyx_k_edges, sizeof(__pyx_k_edges), 0, 0, 1, 1},
    {&__pyx_n_s_edges1, __pyx_k_edges1, sizeof(__pyx_k_edges1), 0, 0, 1, 1},
    {&__pyx_n_s_edges2, __pyx_k_edges2, sizeof(__pyx_k_edges2), 0, 0, 1, 1},
    {&__pyx_n_u_effective_tree_size, __pyx_k_effective_tree_size, sizeof(__pyx_k_effective_tree_size), 0, 1, 0, 1},
    {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0},
    {&__pyx_n_s_enter, __pyx_k_enter, sizeof(__pyx_k_enter), 0, 0, 1, 1},
    {&__pyx_n_s_enum_unordered, __pyx_k_enum_unordered, sizeof(__pyx_k_enum_unordered), 0, 0, 1, 1},
    {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
    {&__pyx_n_u_ete, __pyx_k_ete, sizeof(__pyx_k_ete), 0, 1, 0, 1},
    {&__pyx_n_s_ete4_core_tree, __pyx_k_ete4_core_tree, sizeof(__pyx_k_ete4_core_tree), 0, 0, 1, 1},
    {&__pyx_kp_s_ete4_core_tree_pyx, __pyx_k_ete4_core_tree_pyx, sizeof(__pyx_k_ete4_core_tree_pyx), 0, 0, 1, 0},
    {&__pyx_n_s_ete_ch, __pyx_k_ete_ch, sizeof(__pyx_k_ete_ch), 0, 0, 1, 1},
    {&__pyx_n_s_ete_diff, __pyx_k_ete_diff, sizeof(__pyx_k_ete_diff), 0, 0, 1, 1},
    {&__pyx_n_s_ete_format, __pyx_k_ete_format, sizeof(__pyx_k_ete_format), 0, 0, 1, 1},
    {&__pyx_n_s_ete_node, __pyx_k_ete_node, sizeof(__pyx_k_ete_node), 0, 0, 1, 1},
    {&__pyx_n_s_exit, __pyx_k_exit, sizeof(__pyx_k_exit), 0, 0, 1, 1},
    {&__pyx_n_s_expand_polytomies, __pyx_k_expand_polytomies, sizeof(__pyx_k_expand_polytomies), 0, 0, 1, 1},
    {&__pyx_kp_u_expand_polytomies_and_correct_by, __pyx_k_expand_polytomies_and_correct_by, sizeof(__pyx_k_expand_polytomies_and_correct_by), 0, 1, 0, 0},
    {&__pyx_kp_u_expand_polytomies_and_unrooted_t, __pyx_k_expand_polytomies_and_unrooted_t, sizeof(__pyx_k_expand_polytomies_and_unrooted_t), 0, 1, 0, 0},
    {&__pyx_n_s_expand_polytomies_locals_TipTupl, __pyx_k_expand_polytomies_locals_TipTupl, sizeof(__pyx_k_expand_polytomies_locals_TipTupl), 0, 0, 1, 1},
    {&__pyx_n_s_expand_polytomies_locals_add_lea, __pyx_k_expand_polytomies_locals_add_lea, sizeof(__pyx_k_expand_polytomies_locals_add_lea), 0, 0, 1, 1},
    {&__pyx_n_s_expand_polytomies_locals_enum_un, __pyx_k_expand_polytomies_locals_enum_un, sizeof(__pyx_k_expand_polytomies_locals_enum_un), 0, 0, 1, 1},
    {&__pyx_n_s_explore, __pyx_k_explore, sizeof(__pyx_k_explore), 0, 0, 1, 1},
    {&__pyx_n_s_explorer, __pyx_k_explorer, sizeof(__pyx_k_explorer), 0, 0, 1, 1},
    {&__pyx_n_s_extract_data_parser, __pyx_k_extract_data_parser, sizeof(__pyx_k_extract_data_parser), 0, 0, 1, 1},
    {&__pyx_n_s_face, __pyx_k_face, sizeof(__pyx_k_face), 0, 0, 1, 1},
    {&__pyx_kp_u_face_2, __pyx_k_face_2, sizeof(__pyx_k_face_2), 0, 1, 0, 0},
    {&__pyx_n_s_face_area, __pyx_k_face_area, sizeof(__pyx_k_face_area), 0, 0, 1, 1},
    {&__pyx_n_u_faces, __pyx_k_faces, sizeof(__pyx_k_faces), 0, 1, 0, 1},
    {&__pyx_n_s_farthest_dist, __pyx_k_farthest_dist, sizeof(__pyx_k_farthest_dist), 0, 0, 1, 1},
    {&__pyx_n_s_farthest_node, __pyx_k_farthest_node, sizeof(__pyx_k_farthest_node), 0, 0, 1, 1},
    {&__pyx_n_s_fdist, __pyx_k_fdist, sizeof(__pyx_k_fdist), 0, 0, 1, 1},
    {&__pyx_n_s_file_name, __pyx_k_file_name, sizeof(__pyx_k_file_name), 0, 0, 1, 1},
    {&__pyx_n_s_fnode, __pyx_k_fnode, sizeof(__pyx_k_fnode), 0, 0, 1, 1},
    {&__pyx_n_s_format_root_node, __pyx_k_format_root_node, sizeof(__pyx_k_format_root_node), 0, 0, 1, 1},
    {&__pyx_n_s_fp, __pyx_k_fp, sizeof(__pyx_k_fp), 0, 0, 1, 1},
    {&__pyx_n_s_from_common, __pyx_k_from_common, sizeof(__pyx_k_from_common), 0, 0, 1, 1},
    {&__pyx_n_s_from_parent_child_table, __pyx_k_from_parent_child_table, sizeof(__pyx_k_from_parent_child_table), 0, 0, 1, 1},
    {&__pyx_n_s_from_parent_child_table_locals_g, __pyx_k_from_parent_child_table_locals_g, sizeof(__pyx_k_from_parent_child_table_locals_g), 0, 0, 1, 1},
    {&__pyx_n_s_from_skbio, __pyx_k_from_skbio, sizeof(__pyx_k_from_skbio), 0, 0, 1, 1},
    {&__pyx_n_s_from_skbio_locals_get_ete_node, __pyx_k_from_skbio_locals_get_ete_node, sizeof(__pyx_k_from_skbio_locals_get_ete_node), 0, 0, 1, 1},
    {&__pyx_n_s_functools, __pyx_k_functools, sizeof(__pyx_k_functools), 0, 0, 1, 1},
    {&__pyx_kp_u_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0},
    {&__pyx_n_s_genexpr, __pyx_k_genexpr, sizeof(__pyx_k_genexpr), 0, 0, 1, 1},
    {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1},
    {&__pyx_n_s_get_cached_content, __pyx_k_get_cached_content, sizeof(__pyx_k_get_cached_content), 0, 0, 1, 1},
    {&__pyx_n_s_get_cached_content_locals_get_co, __pyx_k_get_cached_content_locals_get_co, sizeof(__pyx_k_get_cached_content_locals_get_co), 0, 0, 1, 1},
    {&__pyx_n_s_get_children, __pyx_k_get_children, sizeof(__pyx_k_get_children), 0, 0, 1, 1},
    {&__pyx_n_s_get_closest_leaf, __pyx_k_get_closest_leaf, sizeof(__pyx_k_get_closest_leaf), 0, 0, 1, 1},
    {&__pyx_n_s_get_content, __pyx_k_get_content, sizeof(__pyx_k_get_content), 0, 0, 1, 1},
    {&__pyx_n_s_get_distance, __pyx_k_get_distance, sizeof(__pyx_k_get_distance), 0, 0, 1, 1},
    {&__pyx_n_s_get_distance_fn, __pyx_k_get_distance_fn, sizeof(__pyx_k_get_distance_fn), 0, 0, 1, 1},
    {&__pyx_n_s_get_distance_locals_genexpr, __pyx_k_get_distance_locals_genexpr, sizeof(__pyx_k_get_distance_locals_genexpr), 0, 0, 1, 1},
    {&__pyx_n_s_get_ete_node, __pyx_k_get_ete_node, sizeof(__pyx_k_get_ete_node), 0, 0, 1, 1},
    {&__pyx_n_s_get_farthest_and_closest_leaves, __pyx_k_get_farthest_and_closest_leaves, sizeof(__pyx_k_get_farthest_and_closest_leaves), 0, 0, 1, 1},
    {&__pyx_n_s_get_farthest_and_closest_leaves_2, __pyx_k_get_farthest_and_closest_leaves_2, sizeof(__pyx_k_get_farthest_and_closest_leaves_2), 0, 0, 1, 1},
    {&__pyx_n_s_get_farthest_leaf, __pyx_k_get_farthest_leaf, sizeof(__pyx_k_get_farthest_leaf), 0, 0, 1, 1},
    {&__pyx_n_s_get_farthest_node, __pyx_k_get_farthest_node, sizeof(__pyx_k_get_farthest_node), 0, 0, 1, 1},
    {&__pyx_n_s_get_farthest_node_locals_lambda, __pyx_k_get_farthest_node_locals_lambda, sizeof(__pyx_k_get_farthest_node_locals_lambda), 0, 0, 1, 1},
    {&__pyx_n_s_get_img, __pyx_k_get_img, sizeof(__pyx_k_get_img), 0, 0, 1, 1},
    {&__pyx_n_s_get_midpoint_outgroup, __pyx_k_get_midpoint_outgroup, sizeof(__pyx_k_get_midpoint_outgroup), 0, 0, 1, 1},
    {&__pyx_n_s_get_monophyletic, __pyx_k_get_monophyletic, sizeof(__pyx_k_get_monophyletic), 0, 0, 1, 1},
    {&__pyx_n_s_get_monophyletic_locals_lambda, __pyx_k_get_monophyletic_locals_lambda, sizeof(__pyx_k_get_monophyletic_locals_lambda), 0, 0, 1, 1},
    {&__pyx_n_s_get_node, __pyx_k_get_node, sizeof(__pyx_k_get_node), 0, 0, 1, 1},
    {&__pyx_n_s_get_prop, __pyx_k_get_prop, sizeof(__pyx_k_get_prop), 0, 0, 1, 1},
    {&__pyx_n_s_get_sisters, __pyx_k_get_sisters, sizeof(__pyx_k_get_sisters), 0, 0, 1, 1},
    {&__pyx_n_s_get_speciation_trees, __pyx_k_get_speciation_trees, sizeof(__pyx_k_get_speciation_trees), 0, 0, 1, 1},
    {&__pyx_n_s_get_topology_id, __pyx_k_get_topology_id, sizeof(__pyx_k_get_topology_id), 0, 0, 1, 1},
    {&__pyx_n_s_get_topology_id_locals_genexpr, __pyx_k_get_topology_id_locals_genexpr, sizeof(__pyx_k_get_topology_id_locals_genexpr), 0, 0, 1, 1},
    {&__pyx_n_s_getitem___locals_genexpr, __pyx_k_getitem___locals_genexpr, sizeof(__pyx_k_getitem___locals_genexpr), 0, 0, 1, 1},
    {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
    {&__pyx_n_s_h, __pyx_k_h, sizeof(__pyx_k_h), 0, 0, 1, 1},
    {&__pyx_n_s_has_duplications, __pyx_k_has_duplications, sizeof(__pyx_k_has_duplications), 0, 0, 1, 1},
    {&__pyx_n_s_has_prop, __pyx_k_has_prop, sizeof(__pyx_k_has_prop), 0, 0, 1, 1},
    {&__pyx_n_s_hash, __pyx_k_hash, sizeof(__pyx_k_hash), 0, 0, 1, 1},
    {&__pyx_n_s_hashlib, __pyx_k_hashlib, sizeof(__pyx_k_hashlib), 0, 0, 1, 1},
    {&__pyx_kp_u_headless, __pyx_k_headless, sizeof(__pyx_k_headless), 0, 1, 0, 0},
    {&__pyx_n_s_hex, __pyx_k_hex, sizeof(__pyx_k_hex), 0, 0, 1, 1},
    {&__pyx_n_s_hexdigest, __pyx_k_hexdigest, sizeof(__pyx_k_hexdigest), 0, 0, 1, 1},
    {&__pyx_n_s_host, __pyx_k_host, sizeof(__pyx_k_host), 0, 0, 1, 1},
    {&__pyx_kp_u_http, __pyx_k_http, sizeof(__pyx_k_http), 0, 1, 0, 0},
    {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
    {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
    {&__pyx_n_u_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 1, 0, 1},
    {&__pyx_n_u_img_style, __pyx_k_img_style, sizeof(__pyx_k_img_style), 0, 1, 0, 1},
    {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
    {&__pyx_n_s_include_root, __pyx_k_include_root, sizeof(__pyx_k_include_root), 0, 0, 1, 1},
    {&__pyx_n_s_include_self, __pyx_k_include_self, sizeof(__pyx_k_include_self), 0, 0, 1, 1},
    {&__pyx_n_s_indent, __pyx_k_indent, sizeof(__pyx_k_indent), 0, 0, 1, 1},
    {&__pyx_n_u_indent, __pyx_k_indent, sizeof(__pyx_k_indent), 0, 1, 0, 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_kp_u_init_from_dict_data_should_not_u, __pyx_k_init_from_dict_data_should_not_u, sizeof(__pyx_k_init_from_dict_data_should_not_u), 0, 1, 0, 0},
    {&__pyx_kp_u_init_from_empty_data_should_not, __pyx_k_init_from_empty_data_should_not, sizeof(__pyx_k_init_from_empty_data_should_not), 0, 1, 0, 0},
    {&__pyx_kp_u_init_from_parsed_content_cannot, __pyx_k_init_from_parsed_content_cannot, sizeof(__pyx_k_init_from_parsed_content_cannot), 0, 1, 0, 0},
    {&__pyx_n_s_init_subclass, __pyx_k_init_subclass, sizeof(__pyx_k_init_subclass), 0, 0, 1, 1},
    {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1},
    {&__pyx_kp_u_inline, __pyx_k_inline, sizeof(__pyx_k_inline), 0, 1, 0, 0},
    {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1},
    {&__pyx_n_s_is_leaf, __pyx_k_is_leaf, sizeof(__pyx_k_is_leaf), 0, 0, 1, 1},
    {&__pyx_n_s_is_leaf_fn, __pyx_k_is_leaf_fn, sizeof(__pyx_k_is_leaf_fn), 0, 0, 1, 1},
    {&__pyx_n_s_is_monophyletic, __pyx_k_is_monophyletic, sizeof(__pyx_k_is_monophyletic), 0, 0, 1, 1},
    {&__pyx_n_s_is_monophyletic_locals_genexpr, __pyx_k_is_monophyletic_locals_genexpr, sizeof(__pyx_k_is_monophyletic_locals_genexpr), 0, 0, 1, 1},
    {&__pyx_kp_u_is_not_a_Face_instance, __pyx_k_is_not_a_Face_instance, sizeof(__pyx_k_is_not_a_Face_instance), 0, 1, 0, 0},
    {&__pyx_n_s_is_root, __pyx_k_is_root, sizeof(__pyx_k_is_root), 0, 0, 1, 1},
    {&__pyx_kp_u_isenabled, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0},
    {&__pyx_n_s_issubset, __pyx_k_issubset, sizeof(__pyx_k_issubset), 0, 0, 1, 1},
    {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1},
    {&__pyx_n_s_iter, __pyx_k_iter, sizeof(__pyx_k_iter), 0, 0, 1, 1},
    {&__pyx_n_s_iter_prepostorder, __pyx_k_iter_prepostorder, sizeof(__pyx_k_iter_prepostorder), 0, 0, 1, 1},
    {&__pyx_n_s_itertools, __pyx_k_itertools, sizeof(__pyx_k_itertools), 0, 0, 1, 1},
    {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1},
    {&__pyx_n_s_k1, __pyx_k_k1, sizeof(__pyx_k_k1), 0, 0, 1, 1},
    {&__pyx_n_s_k2, __pyx_k_k2, sizeof(__pyx_k_k2), 0, 0, 1, 1},
    {&__pyx_n_s_keep_server, __pyx_k_keep_server, sizeof(__pyx_k_keep_server), 0, 0, 1, 1},
    {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1},
    {&__pyx_n_s_keys, __pyx_k_keys, sizeof(__pyx_k_keys), 0, 0, 1, 1},
    {&__pyx_n_s_kwargs, __pyx_k_kwargs, sizeof(__pyx_k_kwargs), 0, 0, 1, 1},
    {&__pyx_n_s_label, __pyx_k_label, sizeof(__pyx_k_label), 0, 0, 1, 1},
    {&__pyx_n_s_labels, __pyx_k_labels, sizeof(__pyx_k_labels), 0, 0, 1, 1},
    {&__pyx_n_s_ladderize, __pyx_k_ladderize, sizeof(__pyx_k_ladderize), 0, 0, 1, 1},
    {&__pyx_n_s_layout, __pyx_k_layout, sizeof(__pyx_k_layout), 0, 0, 1, 1},
    {&__pyx_n_s_layouts, __pyx_k_layouts, sizeof(__pyx_k_layouts), 0, 0, 1, 1},
    {&__pyx_n_s_leaf, __pyx_k_leaf, sizeof(__pyx_k_leaf), 0, 0, 1, 1},
    {&__pyx_n_s_leaf1, __pyx_k_leaf1, sizeof(__pyx_k_leaf1), 0, 0, 1, 1},
    {&__pyx_n_s_leaf2, __pyx_k_leaf2, sizeof(__pyx_k_leaf2), 0, 0, 1, 1},
    {&__pyx_n_s_leaf_distances, __pyx_k_leaf_distances, sizeof(__pyx_k_leaf_distances), 0, 0, 1, 1},
    {&__pyx_n_s_leaf_names, __pyx_k_leaf_names, sizeof(__pyx_k_leaf_names), 0, 0, 1, 1},
    {&__pyx_n_s_leaf_values, __pyx_k_leaf_values, sizeof(__pyx_k_leaf_values), 0, 0, 1, 1},
    {&__pyx_n_s_leaves, __pyx_k_leaves, sizeof(__pyx_k_leaves), 0, 0, 1, 1},
    {&__pyx_n_s_leaves_descendant, __pyx_k_leaves_descendant, sizeof(__pyx_k_leaves_descendant), 0, 0, 1, 1},
    {&__pyx_n_s_leaves_extra, __pyx_k_leaves_extra, sizeof(__pyx_k_leaves_extra), 0, 0, 1, 1},
    {&__pyx_n_s_leaves_from_ancestor, __pyx_k_leaves_from_ancestor, sizeof(__pyx_k_leaves_from_ancestor), 0, 0, 1, 1},
    {&__pyx_n_s_leaves_locals_lambda, __pyx_k_leaves_locals_lambda, sizeof(__pyx_k_leaves_locals_lambda), 0, 0, 1, 1},
    {&__pyx_n_s_leaves_only, __pyx_k_leaves_only, sizeof(__pyx_k_leaves_only), 0, 0, 1, 1},
    {&__pyx_n_s_left, __pyx_k_left, sizeof(__pyx_k_left), 0, 0, 1, 1},
    {&__pyx_n_s_len___locals_genexpr, __pyx_k_len___locals_genexpr, sizeof(__pyx_k_len___locals_genexpr), 0, 0, 1, 1},
    {&__pyx_n_u_length, __pyx_k_length, sizeof(__pyx_k_length), 0, 1, 0, 1},
    {&__pyx_n_u_levelorder, __pyx_k_levelorder, sizeof(__pyx_k_levelorder), 0, 1, 0, 1},
    {&__pyx_n_s_lineage, __pyx_k_lineage, sizeof(__pyx_k_lineage), 0, 0, 1, 1},
    {&__pyx_n_s_loads, __pyx_k_loads, sizeof(__pyx_k_loads), 0, 0, 1, 1},
    {&__pyx_n_s_lower, __pyx_k_lower, sizeof(__pyx_k_lower), 0, 0, 1, 1},
    {&__pyx_n_s_m, __pyx_k_m, sizeof(__pyx_k_m), 0, 0, 1, 1},
    {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
    {&__pyx_n_s_map_attributes, __pyx_k_map_attributes, sizeof(__pyx_k_map_attributes), 0, 0, 1, 1},
    {&__pyx_n_s_map_prop, __pyx_k_map_prop, sizeof(__pyx_k_map_prop), 0, 0, 1, 1},
    {&__pyx_n_s_map_properties, __pyx_k_map_properties, sizeof(__pyx_k_map_properties), 0, 0, 1, 1},
    {&__pyx_n_s_math, __pyx_k_math, sizeof(__pyx_k_math), 0, 0, 1, 1},
    {&__pyx_n_s_max, __pyx_k_max, sizeof(__pyx_k_max), 0, 0, 1, 1},
    {&__pyx_n_s_max_dist, __pyx_k_max_dist, sizeof(__pyx_k_max_dist), 0, 0, 1, 1},
    {&__pyx_n_s_max_node, __pyx_k_max_node, sizeof(__pyx_k_max_node), 0, 0, 1, 1},
    {&__pyx_n_s_max_parts, __pyx_k_max_parts, sizeof(__pyx_k_max_parts), 0, 0, 1, 1},
    {&__pyx_n_s_max_rf, __pyx_k_max_rf, sizeof(__pyx_k_max_rf), 0, 0, 1, 1},
    {&__pyx_n_u_max_rf, __pyx_k_max_rf, sizeof(__pyx_k_max_rf), 0, 1, 0, 1},
    {&__pyx_n_s_max_treeko_splits_to_be_artifact, __pyx_k_max_treeko_splits_to_be_artifact, sizeof(__pyx_k_max_treeko_splits_to_be_artifact), 0, 0, 1, 1},
    {&__pyx_n_s_maxrf, __pyx_k_maxrf, sizeof(__pyx_k_maxrf), 0, 0, 1, 1},
    {&__pyx_n_s_md5, __pyx_k_md5, sizeof(__pyx_k_md5), 0, 0, 1, 1},
    {&__pyx_n_s_mean, __pyx_k_mean, sizeof(__pyx_k_mean), 0, 0, 1, 1},
    {&__pyx_n_s_mean_distance, __pyx_k_mean_distance, sizeof(__pyx_k_mean_distance), 0, 0, 1, 1},
    {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
    {&__pyx_n_s_method, __pyx_k_method, sizeof(__pyx_k_method), 0, 0, 1, 1},
    {&__pyx_kp_u_metrics_recording_only, __pyx_k_metrics_recording_only, sizeof(__pyx_k_metrics_recording_only), 0, 1, 0, 0},
    {&__pyx_n_s_min_comparison, __pyx_k_min_comparison, sizeof(__pyx_k_min_comparison), 0, 0, 1, 1},
    {&__pyx_n_s_min_dist, __pyx_k_min_dist, sizeof(__pyx_k_min_dist), 0, 0, 1, 1},
    {&__pyx_n_s_min_node, __pyx_k_min_node, sizeof(__pyx_k_min_node), 0, 0, 1, 1},
    {&__pyx_n_s_min_support_ref, __pyx_k_min_support_ref, sizeof(__pyx_k_min_support_ref), 0, 0, 1, 1},
    {&__pyx_n_s_min_support_source, __pyx_k_min_support_source, sizeof(__pyx_k_min_support_source), 0, 0, 1, 1},
    {&__pyx_n_s_min_support_t1, __pyx_k_min_support_t1, sizeof(__pyx_k_min_support_t1), 0, 0, 1, 1},
    {&__pyx_n_s_min_support_t2, __pyx_k_min_support_t2, sizeof(__pyx_k_min_support_t2), 0, 0, 1, 1},
    {&__pyx_n_s_model, __pyx_k_model, sizeof(__pyx_k_model), 0, 0, 1, 1},
    {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
    {&__pyx_n_u_monophyletic, __pyx_k_monophyletic, sizeof(__pyx_k_monophyletic), 0, 1, 0, 1},
    {&__pyx_n_s_movingnode, __pyx_k_movingnode, sizeof(__pyx_k_movingnode), 0, 0, 1, 1},
    {&__pyx_n_s_mro_entries, __pyx_k_mro_entries, sizeof(__pyx_k_mro_entries), 0, 0, 1, 1},
    {&__pyx_kp_u_multiple_trees_use_nexus_load_in, __pyx_k_multiple_trees_use_nexus_load_in, sizeof(__pyx_k_multiple_trees_use_nexus_load_in), 0, 1, 0, 0},
    {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1},
    {&__pyx_n_s_n2count, __pyx_k_n2count, sizeof(__pyx_k_n2count), 0, 0, 1, 1},
    {&__pyx_n_s_n2depth, __pyx_k_n2depth, sizeof(__pyx_k_n2depth), 0, 0, 1, 1},
    {&__pyx_n_s_n2subtrees, __pyx_k_n2subtrees, sizeof(__pyx_k_n2subtrees), 0, 0, 1, 1},
    {&__pyx_n_s_n2values, __pyx_k_n2values, sizeof(__pyx_k_n2values), 0, 0, 1, 1},
    {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
    {&__pyx_n_u_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 1, 0, 1},
    {&__pyx_n_s_name2node, __pyx_k_name2node, sizeof(__pyx_k_name2node), 0, 0, 1, 1},
    {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
    {&__pyx_n_s_names, __pyx_k_names, sizeof(__pyx_k_names), 0, 0, 1, 1},
    {&__pyx_n_s_ncommon, __pyx_k_ncommon, sizeof(__pyx_k_ncommon), 0, 0, 1, 1},
    {&__pyx_n_s_ndups, __pyx_k_ndups, sizeof(__pyx_k_ndups), 0, 0, 1, 1},
    {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
    {&__pyx_n_s_new_node, __pyx_k_new_node, sizeof(__pyx_k_new_node), 0, 0, 1, 1},
    {&__pyx_n_s_new_tree, __pyx_k_new_tree, sizeof(__pyx_k_new_tree), 0, 0, 1, 1},
    {&__pyx_n_s_newick, __pyx_k_newick, sizeof(__pyx_k_newick), 0, 0, 1, 1},
    {&__pyx_n_u_newick, __pyx_k_newick, sizeof(__pyx_k_newick), 0, 1, 0, 1},
    {&__pyx_kp_u_newick_extended, __pyx_k_newick_extended, sizeof(__pyx_k_newick_extended), 0, 1, 0, 0},
    {&__pyx_n_s_newick_only, __pyx_k_newick_only, sizeof(__pyx_k_newick_only), 0, 0, 1, 1},
    {&__pyx_n_s_nexus, __pyx_k_nexus, sizeof(__pyx_k_nexus), 0, 0, 1, 1},
    {&__pyx_n_u_nexus, __pyx_k_nexus, sizeof(__pyx_k_nexus), 0, 1, 0, 1},
    {&__pyx_n_s_node, __pyx_k_node, sizeof(__pyx_k_node), 0, 0, 1, 1},
    {&__pyx_n_s_node1, __pyx_k_node1, sizeof(__pyx_k_node1), 0, 0, 1, 1},
    {&__pyx_n_s_node2, __pyx_k_node2, sizeof(__pyx_k_node2), 0, 0, 1, 1},
    {&__pyx_n_s_node2path, __pyx_k_node2path, sizeof(__pyx_k_node2path), 0, 0, 1, 1},
    {&__pyx_n_s_node_leaves, __pyx_k_node_leaves, sizeof(__pyx_k_node_leaves), 0, 0, 1, 1},
    {&__pyx_n_s_nodename, __pyx_k_nodename, sizeof(__pyx_k_nodename), 0, 0, 1, 1},
    {&__pyx_n_s_nodes, __pyx_k_nodes, sizeof(__pyx_k_nodes), 0, 0, 1, 1},
    {&__pyx_n_s_nodes_by_name, __pyx_k_nodes_by_name, sizeof(__pyx_k_nodes_by_name), 0, 0, 1, 1},
    {&__pyx_n_u_norm_rf, __pyx_k_norm_rf, sizeof(__pyx_k_norm_rf), 0, 1, 0, 1},
    {&__pyx_kp_u_not_in, __pyx_k_not_in, sizeof(__pyx_k_not_in), 0, 1, 0, 0},
    {&__pyx_n_s_ntrees, __pyx_k_ntrees, sizeof(__pyx_k_ntrees), 0, 0, 1, 1},
    {&__pyx_n_s_nw, __pyx_k_nw, sizeof(__pyx_k_nw), 0, 0, 1, 1},
    {&__pyx_n_s_open, __pyx_k_open, sizeof(__pyx_k_open), 0, 0, 1, 1},
    {&__pyx_n_s_open_browser, __pyx_k_open_browser, sizeof(__pyx_k_open_browser), 0, 0, 1, 1},
    {&__pyx_n_s_operations, __pyx_k_operations, sizeof(__pyx_k_operations), 0, 0, 1, 1},
    {&__pyx_n_s_ops, __pyx_k_ops, sizeof(__pyx_k_ops), 0, 0, 1, 1},
    {&__pyx_n_s_options, __pyx_k_options, sizeof(__pyx_k_options), 0, 0, 1, 1},
    {&__pyx_n_s_order, __pyx_k_order, sizeof(__pyx_k_order), 0, 0, 1, 1},
    {&__pyx_n_s_orig_target_size, __pyx_k_orig_target_size, sizeof(__pyx_k_orig_target_size), 0, 0, 1, 1},
    {&__pyx_n_s_origin_t, __pyx_k_origin_t, sizeof(__pyx_k_origin_t), 0, 0, 1, 1},
    {&__pyx_n_s_origin_trees, __pyx_k_origin_trees, sizeof(__pyx_k_origin_trees), 0, 0, 1, 1},
    {&__pyx_n_s_outfile, __pyx_k_outfile, sizeof(__pyx_k_outfile), 0, 0, 1, 1},
    {&__pyx_n_s_output, __pyx_k_output, sizeof(__pyx_k_output), 0, 0, 1, 1},
    {&__pyx_n_s_p, __pyx_k_p, sizeof(__pyx_k_p), 0, 0, 1, 1},
    {&__pyx_n_u_paraphyletic, __pyx_k_paraphyletic, sizeof(__pyx_k_paraphyletic), 0, 1, 0, 1},
    {&__pyx_n_s_parent, __pyx_k_parent, sizeof(__pyx_k_parent), 0, 0, 1, 1},
    {&__pyx_n_s_parent_child_table, __pyx_k_parent_child_table, sizeof(__pyx_k_parent_child_table), 0, 0, 1, 1},
    {&__pyx_n_s_parent_name, __pyx_k_parent_name, sizeof(__pyx_k_parent_name), 0, 0, 1, 1},
    {&__pyx_n_s_parser, __pyx_k_parser, sizeof(__pyx_k_parser), 0, 0, 1, 1},
    {&__pyx_n_s_parser_extract, __pyx_k_parser_extract, sizeof(__pyx_k_parser_extract), 0, 0, 1, 1},
    {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1},
    {&__pyx_n_s_paths, __pyx_k_paths, sizeof(__pyx_k_paths), 0, 0, 1, 1},
    {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
    {&__pyx_n_u_polyphyletic, __pyx_k_polyphyletic, sizeof(__pyx_k_polyphyletic), 0, 1, 0, 1},
    {&__pyx_n_s_polytomy_correction, __pyx_k_polytomy_correction, sizeof(__pyx_k_polytomy_correction), 0, 0, 1, 1},
    {&__pyx_n_s_polytomy_size_limit, __pyx_k_polytomy_size_limit, sizeof(__pyx_k_polytomy_size_limit), 0, 0, 1, 1},
    {&__pyx_n_s_pop, __pyx_k_pop, sizeof(__pyx_k_pop), 0, 0, 1, 1},
    {&__pyx_n_s_pop_child, __pyx_k_pop_child, sizeof(__pyx_k_pop_child), 0, 0, 1, 1},
    {&__pyx_n_s_popitem, __pyx_k_popitem, sizeof(__pyx_k_popitem), 0, 0, 1, 1},
    {&__pyx_n_s_populate, __pyx_k_populate, sizeof(__pyx_k_populate), 0, 0, 1, 1},
    {&__pyx_n_s_port, __pyx_k_port, sizeof(__pyx_k_port), 0, 0, 1, 1},
    {&__pyx_n_s_position, __pyx_k_position, sizeof(__pyx_k_position), 0, 0, 1, 1},
    {&__pyx_kp_u_position_2, __pyx_k_position_2, sizeof(__pyx_k_position_2), 0, 1, 0, 0},
    {&__pyx_n_s_post, __pyx_k_post, sizeof(__pyx_k_post), 0, 0, 1, 1},
    {&__pyx_n_u_postorder, __pyx_k_postorder, sizeof(__pyx_k_postorder), 0, 1, 0, 1},
    {&__pyx_n_s_preorder, __pyx_k_preorder, sizeof(__pyx_k_preorder), 0, 0, 1, 1},
    {&__pyx_n_u_preorder, __pyx_k_preorder, sizeof(__pyx_k_preorder), 0, 1, 0, 1},
    {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1},
    {&__pyx_n_s_preserve_branch_length, __pyx_k_preserve_branch_length, sizeof(__pyx_k_preserve_branch_length), 0, 0, 1, 1},
    {&__pyx_n_s_prev, __pyx_k_prev, sizeof(__pyx_k_prev), 0, 0, 1, 1},
    {&__pyx_n_s_prevent_nondicotomic, __pyx_k_prevent_nondicotomic, sizeof(__pyx_k_prevent_nondicotomic), 0, 0, 1, 1},
    {&__pyx_n_s_print, __pyx_k_print, sizeof(__pyx_k_print), 0, 0, 1, 1},
    {&__pyx_n_s_product, __pyx_k_product, sizeof(__pyx_k_product), 0, 0, 1, 1},
    {&__pyx_n_s_prop, __pyx_k_prop, sizeof(__pyx_k_prop), 0, 0, 1, 1},
    {&__pyx_n_s_prop1, __pyx_k_prop1, sizeof(__pyx_k_prop1), 0, 0, 1, 1},
    {&__pyx_n_s_prop2, __pyx_k_prop2, sizeof(__pyx_k_prop2), 0, 0, 1, 1},
    {&__pyx_n_s_prop_t1, __pyx_k_prop_t1, sizeof(__pyx_k_prop_t1), 0, 0, 1, 1},
    {&__pyx_n_s_prop_t2, __pyx_k_prop_t2, sizeof(__pyx_k_prop_t2), 0, 0, 1, 1},
    {&__pyx_n_s_props, __pyx_k_props, sizeof(__pyx_k_props), 0, 0, 1, 1},
    {&__pyx_n_s_prune, __pyx_k_prune, sizeof(__pyx_k_prune), 0, 0, 1, 1},
    {&__pyx_n_s_prune_locals_cmp_nodes, __pyx_k_prune_locals_cmp_nodes, sizeof(__pyx_k_prune_locals_cmp_nodes), 0, 0, 1, 1},
    {&__pyx_n_s_px, __pyx_k_px, sizeof(__pyx_k_px), 0, 0, 1, 1},
    {&__pyx_n_u_px, __pyx_k_px, sizeof(__pyx_k_px), 0, 1, 0, 1},
    {&__pyx_n_s_px0, __pyx_k_px0, sizeof(__pyx_k_px0), 0, 0, 1, 1},
    {&__pyx_n_s_py, __pyx_k_py, sizeof(__pyx_k_py), 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_Tree, __pyx_k_pyx_unpickle_Tree, sizeof(__pyx_k_pyx_unpickle_Tree), 0, 0, 1, 1},
    {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1},
    {&__pyx_n_s_quit, __pyx_k_quit, sizeof(__pyx_k_quit), 0, 0, 1, 1},
    {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
    {&__pyx_n_u_raw, __pyx_k_raw, sizeof(__pyx_k_raw), 0, 1, 0, 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_ref_disc, __pyx_k_ref_disc, sizeof(__pyx_k_ref_disc), 0, 0, 1, 1},
    {&__pyx_n_u_ref_edges, __pyx_k_ref_edges, sizeof(__pyx_k_ref_edges), 0, 1, 0, 1},
    {&__pyx_n_u_ref_edges_in_source, __pyx_k_ref_edges_in_source, sizeof(__pyx_k_ref_edges_in_source), 0, 1, 0, 1},
    {&__pyx_n_s_ref_found, __pyx_k_ref_found, sizeof(__pyx_k_ref_found), 0, 0, 1, 1},
    {&__pyx_n_s_ref_found_in_src, __pyx_k_ref_found_in_src, sizeof(__pyx_k_ref_found_in_src), 0, 0, 1, 1},
    {&__pyx_n_s_ref_p, __pyx_k_ref_p, sizeof(__pyx_k_ref_p), 0, 0, 1, 1},
    {&__pyx_n_s_ref_tree, __pyx_k_ref_tree, sizeof(__pyx_k_ref_tree), 0, 0, 1, 1},
    {&__pyx_n_s_ref_tree_attr, __pyx_k_ref_tree_attr, sizeof(__pyx_k_ref_tree_attr), 0, 0, 1, 1},
    {&__pyx_n_s_remove, __pyx_k_remove, sizeof(__pyx_k_remove), 0, 0, 1, 1},
    {&__pyx_n_s_remove_child, __pyx_k_remove_child, sizeof(__pyx_k_remove_child), 0, 0, 1, 1},
    {&__pyx_n_s_remove_child_locals_genexpr, __pyx_k_remove_child_locals_genexpr, sizeof(__pyx_k_remove_child_locals_genexpr), 0, 0, 1, 1},
    {&__pyx_n_s_remove_children, __pyx_k_remove_children, sizeof(__pyx_k_remove_children), 0, 0, 1, 1},
    {&__pyx_n_s_remove_sister, __pyx_k_remove_sister, sizeof(__pyx_k_remove_sister), 0, 0, 1, 1},
    {&__pyx_n_s_remove_tree, __pyx_k_remove_tree, sizeof(__pyx_k_remove_tree), 0, 0, 1, 1},
    {&__pyx_n_s_render, __pyx_k_render, sizeof(__pyx_k_render), 0, 0, 1, 1},
    {&__pyx_n_s_render_sm, __pyx_k_render_sm, sizeof(__pyx_k_render_sm), 0, 0, 1, 1},
    {&__pyx_n_s_render_tree, __pyx_k_render_tree, sizeof(__pyx_k_render_tree), 0, 0, 1, 1},
    {&__pyx_n_s_resolve_polytomy, __pyx_k_resolve_polytomy, sizeof(__pyx_k_resolve_polytomy), 0, 0, 1, 1},
    {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1},
    {&__pyx_kp_u_return, __pyx_k_return, sizeof(__pyx_k_return), 0, 1, 0, 0},
    {&__pyx_n_s_return_format, __pyx_k_return_format, sizeof(__pyx_k_return_format), 0, 0, 1, 1},
    {&__pyx_n_s_reverse, __pyx_k_reverse, sizeof(__pyx_k_reverse), 0, 0, 1, 1},
    {&__pyx_n_s_reverse_children, __pyx_k_reverse_children, sizeof(__pyx_k_reverse_children), 0, 0, 1, 1},
    {&__pyx_n_s_rf, __pyx_k_rf, sizeof(__pyx_k_rf), 0, 0, 1, 1},
    {&__pyx_n_u_rf, __pyx_k_rf, sizeof(__pyx_k_rf), 0, 1, 0, 1},
    {&__pyx_n_s_rf_max, __pyx_k_rf_max, sizeof(__pyx_k_rf_max), 0, 0, 1, 1},
    {&__pyx_n_s_right, __pyx_k_right, sizeof(__pyx_k_right), 0, 0, 1, 1},
    {&__pyx_n_s_robinson_foulds, __pyx_k_robinson_foulds, sizeof(__pyx_k_robinson_foulds), 0, 0, 1, 1},
    {&__pyx_n_s_robinson_foulds_locals_from_comm, __pyx_k_robinson_foulds_locals_from_comm, sizeof(__pyx_k_robinson_foulds_locals_from_comm), 0, 0, 1, 1},
    {&__pyx_n_s_robinson_foulds_locals_genexpr, __pyx_k_robinson_foulds_locals_genexpr, sizeof(__pyx_k_robinson_foulds_locals_genexpr), 0, 0, 1, 1},
    {&__pyx_n_s_robinson_foulds_locals_has_prop, __pyx_k_robinson_foulds_locals_has_prop, sizeof(__pyx_k_robinson_foulds_locals_has_prop), 0, 0, 1, 1},
    {&__pyx_n_s_root, __pyx_k_root, sizeof(__pyx_k_root), 0, 0, 1, 1},
    {&__pyx_n_s_rooting, __pyx_k_rooting, sizeof(__pyx_k_rooting), 0, 0, 1, 1},
    {&__pyx_kp_u_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 1, 0, 0},
    {&__pyx_n_s_s1, __pyx_k_s1, sizeof(__pyx_k_s1), 0, 0, 1, 1},
    {&__pyx_n_s_s2, __pyx_k_s2, sizeof(__pyx_k_s2), 0, 0, 1, 1},
    {&__pyx_n_s_safe_div, __pyx_k_safe_div, sizeof(__pyx_k_safe_div), 0, 0, 1, 1},
    {&__pyx_n_s_save_screenshot, __pyx_k_save_screenshot, sizeof(__pyx_k_save_screenshot), 0, 0, 1, 1},
    {&__pyx_n_s_search_ancestors, __pyx_k_search_ancestors, sizeof(__pyx_k_search_ancestors), 0, 0, 1, 1},
    {&__pyx_n_s_search_ancestors_locals_genexpr, __pyx_k_search_ancestors_locals_genexpr, sizeof(__pyx_k_search_ancestors_locals_genexpr), 0, 0, 1, 1},
    {&__pyx_n_s_search_descendants, __pyx_k_search_descendants, sizeof(__pyx_k_search_descendants), 0, 0, 1, 1},
    {&__pyx_n_s_search_leaves_by_name, __pyx_k_search_leaves_by_name, sizeof(__pyx_k_search_leaves_by_name), 0, 0, 1, 1},
    {&__pyx_n_s_search_nodes, __pyx_k_search_nodes, sizeof(__pyx_k_search_nodes), 0, 0, 1, 1},
    {&__pyx_n_s_search_nodes_locals_genexpr, __pyx_k_search_nodes_locals_genexpr, sizeof(__pyx_k_search_nodes_locals_genexpr), 0, 0, 1, 1},
    {&__pyx_n_s_seed, __pyx_k_seed, sizeof(__pyx_k_seed), 0, 0, 1, 1},
    {&__pyx_n_s_seen, __pyx_k_seen, sizeof(__pyx_k_seen), 0, 0, 1, 1},
    {&__pyx_n_s_selenium, __pyx_k_selenium, sizeof(__pyx_k_selenium), 0, 0, 1, 1},
    {&__pyx_n_s_selenium_webdriver_chrome_option, __pyx_k_selenium_webdriver_chrome_option, sizeof(__pyx_k_selenium_webdriver_chrome_option), 0, 0, 1, 1},
    {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
    {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 0, 0, 1, 1},
    {&__pyx_n_s_server, __pyx_k_server, sizeof(__pyx_k_server), 0, 0, 1, 1},
    {&__pyx_n_s_server_address, __pyx_k_server_address, sizeof(__pyx_k_server_address), 0, 0, 1, 1},
    {&__pyx_n_s_server_close, __pyx_k_server_close, sizeof(__pyx_k_server_close), 0, 0, 1, 1},
    {&__pyx_n_s_set_name, __pyx_k_set_name, sizeof(__pyx_k_set_name), 0, 0, 1, 1},
    {&__pyx_n_s_set_outgroup, __pyx_k_set_outgroup, sizeof(__pyx_k_set_outgroup), 0, 0, 1, 1},
    {&__pyx_n_s_set_style, __pyx_k_set_style, sizeof(__pyx_k_set_style), 0, 0, 1, 1},
    {&__pyx_n_s_setdefault, __pyx_k_setdefault, sizeof(__pyx_k_setdefault), 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_show, __pyx_k_show, sizeof(__pyx_k_show), 0, 0, 1, 1},
    {&__pyx_n_s_show_difftable, __pyx_k_show_difftable, sizeof(__pyx_k_show_difftable), 0, 0, 1, 1},
    {&__pyx_n_s_show_difftable_summary, __pyx_k_show_difftable_summary, sizeof(__pyx_k_show_difftable_summary), 0, 0, 1, 1},
    {&__pyx_n_s_show_difftable_tab, __pyx_k_show_difftable_tab, sizeof(__pyx_k_show_difftable_tab), 0, 0, 1, 1},
    {&__pyx_n_s_show_difftable_topo, __pyx_k_show_difftable_topo, sizeof(__pyx_k_show_difftable_topo), 0, 0, 1, 1},
    {&__pyx_n_s_show_internal, __pyx_k_show_internal, sizeof(__pyx_k_show_internal), 0, 0, 1, 1},
    {&__pyx_n_s_show_tree, __pyx_k_show_tree, sizeof(__pyx_k_show_tree), 0, 0, 1, 1},
    {&__pyx_n_s_shutdown, __pyx_k_shutdown, sizeof(__pyx_k_shutdown), 0, 0, 1, 1},
    {&__pyx_n_s_side1, __pyx_k_side1, sizeof(__pyx_k_side1), 0, 0, 1, 1},
    {&__pyx_n_s_side2, __pyx_k_side2, sizeof(__pyx_k_side2), 0, 0, 1, 1},
    {&__pyx_n_s_sister, __pyx_k_sister, sizeof(__pyx_k_sister), 0, 0, 1, 1},
    {&__pyx_n_s_sisters, __pyx_k_sisters, sizeof(__pyx_k_sisters), 0, 0, 1, 1},
    {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
    {&__pyx_n_s_size1, __pyx_k_size1, sizeof(__pyx_k_size1), 0, 0, 1, 1},
    {&__pyx_n_s_size2, __pyx_k_size2, sizeof(__pyx_k_size2), 0, 0, 1, 1},
    {&__pyx_n_s_skbio, __pyx_k_skbio, sizeof(__pyx_k_skbio), 0, 0, 1, 1},
    {&__pyx_n_s_skbioTreeNode, __pyx_k_skbioTreeNode, sizeof(__pyx_k_skbioTreeNode), 0, 0, 1, 1},
    {&__pyx_n_s_skbio_node, __pyx_k_skbio_node, sizeof(__pyx_k_skbio_node), 0, 0, 1, 1},
    {&__pyx_n_s_skbio_tree, __pyx_k_skbio_tree, sizeof(__pyx_k_skbio_tree), 0, 0, 1, 1},
    {&__pyx_n_s_skip_large_polytomies, __pyx_k_skip_large_polytomies, sizeof(__pyx_k_skip_large_polytomies), 0, 0, 1, 1},
    {&__pyx_n_s_sleep, __pyx_k_sleep, sizeof(__pyx_k_sleep), 0, 0, 1, 1},
    {&__pyx_n_s_smallest, __pyx_k_smallest, sizeof(__pyx_k_smallest), 0, 0, 1, 1},
    {&__pyx_n_s_smartview, __pyx_k_smartview, sizeof(__pyx_k_smartview), 0, 0, 1, 1},
    {&__pyx_n_s_sort, __pyx_k_sort, sizeof(__pyx_k_sort), 0, 0, 1, 1},
    {&__pyx_n_s_sort_descendants, __pyx_k_sort_descendants, sizeof(__pyx_k_sort_descendants), 0, 0, 1, 1},
    {&__pyx_n_s_sort_descendants_locals_lambda, __pyx_k_sort_descendants_locals_lambda, sizeof(__pyx_k_sort_descendants_locals_lambda), 0, 0, 1, 1},
    {&__pyx_n_s_sorted, __pyx_k_sorted, sizeof(__pyx_k_sorted), 0, 0, 1, 1},
    {&__pyx_n_s_sorted_nodes, __pyx_k_sorted_nodes, sizeof(__pyx_k_sorted_nodes), 0, 0, 1, 1},
    {&__pyx_n_u_source_edges, __pyx_k_source_edges, sizeof(__pyx_k_source_edges), 0, 1, 0, 1},
    {&__pyx_n_u_source_edges_in_ref, __pyx_k_source_edges_in_ref, sizeof(__pyx_k_source_edges_in_ref), 0, 1, 0, 1},
    {&__pyx_n_u_source_subtrees, __pyx_k_source_subtrees, sizeof(__pyx_k_source_subtrees), 0, 1, 0, 1},
    {&__pyx_n_s_source_tree, __pyx_k_source_tree, sizeof(__pyx_k_source_tree), 0, 0, 1, 1},
    {&__pyx_n_s_source_tree_attr, __pyx_k_source_tree_attr, sizeof(__pyx_k_source_tree_attr), 0, 0, 1, 1},
    {&__pyx_n_s_sp_naming_function, __pyx_k_sp_naming_function, sizeof(__pyx_k_sp_naming_function), 0, 0, 1, 1},
    {&__pyx_n_s_sp_trees, __pyx_k_sp_trees, sizeof(__pyx_k_sp_trees), 0, 0, 1, 1},
    {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1},
    {&__pyx_n_u_speciesFunction, __pyx_k_speciesFunction, sizeof(__pyx_k_speciesFunction), 0, 1, 0, 1},
    {&__pyx_n_s_src_disc, __pyx_k_src_disc, sizeof(__pyx_k_src_disc), 0, 0, 1, 1},
    {&__pyx_n_s_src_found, __pyx_k_src_found, sizeof(__pyx_k_src_found), 0, 0, 1, 1},
    {&__pyx_n_s_src_found_in_ref, __pyx_k_src_found_in_ref, sizeof(__pyx_k_src_found_in_ref), 0, 0, 1, 1},
    {&__pyx_n_s_src_p, __pyx_k_src_p, sizeof(__pyx_k_src_p), 0, 0, 1, 1},
    {&__pyx_n_s_src_tree, __pyx_k_src_tree, sizeof(__pyx_k_src_tree), 0, 0, 1, 1},
    {&__pyx_n_s_standardize, __pyx_k_standardize, sizeof(__pyx_k_standardize), 0, 0, 1, 1},
    {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
    {&__pyx_n_s_start_server, __pyx_k_start_server, sizeof(__pyx_k_start_server), 0, 0, 1, 1},
    {&__pyx_n_s_startswith, __pyx_k_startswith, sizeof(__pyx_k_startswith), 0, 0, 1, 1},
    {&__pyx_n_s_state, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1},
    {&__pyx_kp_u_static_gui_html_tree, __pyx_k_static_gui_html_tree, sizeof(__pyx_k_static_gui_html_tree), 0, 1, 0, 0},
    {&__pyx_n_s_staticmethod, __pyx_k_staticmethod, sizeof(__pyx_k_staticmethod), 0, 0, 1, 1},
    {&__pyx_n_s_strategy, __pyx_k_strategy, sizeof(__pyx_k_strategy), 0, 0, 1, 1},
    {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
    {&__pyx_n_s_subtree, __pyx_k_subtree, sizeof(__pyx_k_subtree), 0, 0, 1, 1},
    {&__pyx_n_s_subtree_content, __pyx_k_subtree_content, sizeof(__pyx_k_subtree_content), 0, 0, 1, 1},
    {&__pyx_n_s_subtree_nw, __pyx_k_subtree_nw, sizeof(__pyx_k_subtree_nw), 0, 0, 1, 1},
    {&__pyx_n_s_subtrees, __pyx_k_subtrees, sizeof(__pyx_k_subtrees), 0, 0, 1, 1},
    {&__pyx_n_s_sum, __pyx_k_sum, sizeof(__pyx_k_sum), 0, 0, 1, 1},
    {&__pyx_n_s_super, __pyx_k_super, sizeof(__pyx_k_super), 0, 0, 1, 1},
    {&__pyx_n_s_support, __pyx_k_support, sizeof(__pyx_k_support), 0, 0, 1, 1},
    {&__pyx_n_u_support, __pyx_k_support, sizeof(__pyx_k_support), 0, 1, 0, 1},
    {&__pyx_n_s_support_fn, __pyx_k_support_fn, sizeof(__pyx_k_support_fn), 0, 0, 1, 1},
    {&__pyx_n_s_support_t1, __pyx_k_support_t1, sizeof(__pyx_k_support_t1), 0, 0, 1, 1},
    {&__pyx_n_s_support_t2, __pyx_k_support_t2, sizeof(__pyx_k_support_t2), 0, 0, 1, 1},
    {&__pyx_n_s_swap_children, __pyx_k_swap_children, sizeof(__pyx_k_swap_children), 0, 0, 1, 1},
    {&__pyx_n_s_t1, __pyx_k_t1, sizeof(__pyx_k_t1), 0, 0, 1, 1},
    {&__pyx_n_s_t1_leaves, __pyx_k_t1_leaves, sizeof(__pyx_k_t1_leaves), 0, 0, 1, 1},
    {&__pyx_n_s_t1_leaves_all, __pyx_k_t1_leaves_all, sizeof(__pyx_k_t1_leaves_all), 0, 0, 1, 1},
    {&__pyx_n_s_t2, __pyx_k_t2, sizeof(__pyx_k_t2), 0, 0, 1, 1},
    {&__pyx_n_s_t2_leaves, __pyx_k_t2_leaves, sizeof(__pyx_k_t2_leaves), 0, 0, 1, 1},
    {&__pyx_n_s_t2_leaves_all, __pyx_k_t2_leaves_all, sizeof(__pyx_k_t2_leaves_all), 0, 0, 1, 1},
    {&__pyx_n_u_table, __pyx_k_table, sizeof(__pyx_k_table), 0, 1, 0, 1},
    {&__pyx_n_s_target_t, __pyx_k_target_t, sizeof(__pyx_k_target_t), 0, 0, 1, 1},
    {&__pyx_n_s_target_trees, __pyx_k_target_trees, sizeof(__pyx_k_target_trees), 0, 0, 1, 1},
    {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
    {&__pyx_n_s_text_viz, __pyx_k_text_viz, sizeof(__pyx_k_text_viz), 0, 0, 1, 1},
    {&__pyx_n_s_thread, __pyx_k_thread, sizeof(__pyx_k_thread), 0, 0, 1, 1},
    {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1},
    {&__pyx_n_s_time, __pyx_k_time, sizeof(__pyx_k_time), 0, 0, 1, 1},
    {&__pyx_n_s_to_keep, __pyx_k_to_keep, sizeof(__pyx_k_to_keep), 0, 0, 1, 1},
    {&__pyx_n_s_to_str, __pyx_k_to_str, sizeof(__pyx_k_to_str), 0, 0, 1, 1},
    {&__pyx_n_s_to_ultrametric, __pyx_k_to_ultrametric, sizeof(__pyx_k_to_ultrametric), 0, 0, 1, 1},
    {&__pyx_n_s_tools, __pyx_k_tools, sizeof(__pyx_k_tools), 0, 0, 1, 1},
    {&__pyx_n_s_topological, __pyx_k_topological, sizeof(__pyx_k_topological), 0, 0, 1, 1},
    {&__pyx_n_u_topology, __pyx_k_topology, sizeof(__pyx_k_topology), 0, 1, 0, 1},
    {&__pyx_n_s_total_d, __pyx_k_total_d, sizeof(__pyx_k_total_d), 0, 0, 1, 1},
    {&__pyx_n_s_total_rf, __pyx_k_total_rf, sizeof(__pyx_k_total_rf), 0, 0, 1, 1},
    {&__pyx_n_s_total_valid_ref_edges, __pyx_k_total_valid_ref_edges, sizeof(__pyx_k_total_valid_ref_edges), 0, 0, 1, 1},
    {&__pyx_n_s_translate_nodes, __pyx_k_translate_nodes, sizeof(__pyx_k_translate_nodes), 0, 0, 1, 1},
    {&__pyx_n_s_traverse, __pyx_k_traverse, sizeof(__pyx_k_traverse), 0, 0, 1, 1},
    {&__pyx_n_s_traverse_bfs, __pyx_k_traverse_bfs, sizeof(__pyx_k_traverse_bfs), 0, 0, 1, 1},
    {&__pyx_n_s_tree, __pyx_k_tree, sizeof(__pyx_k_tree), 0, 0, 1, 1},
    {&__pyx_n_s_tree_sizes, __pyx_k_tree_sizes, sizeof(__pyx_k_tree_sizes), 0, 0, 1, 1},
    {&__pyx_n_s_tree_style, __pyx_k_tree_style, sizeof(__pyx_k_tree_style), 0, 0, 1, 1},
    {&__pyx_n_s_treediff, __pyx_k_treediff, sizeof(__pyx_k_treediff), 0, 0, 1, 1},
    {&__pyx_n_s_treeko_d, __pyx_k_treeko_d, sizeof(__pyx_k_treeko_d), 0, 0, 1, 1},
    {&__pyx_n_u_treeko_dist, __pyx_k_treeko_dist, sizeof(__pyx_k_treeko_dist), 0, 1, 0, 1},
    {&__pyx_n_s_treeview, __pyx_k_treeview, sizeof(__pyx_k_treeview), 0, 0, 1, 1},
    {&__pyx_n_s_treeview_main, __pyx_k_treeview_main, sizeof(__pyx_k_treeview_main), 0, 0, 1, 1},
    {&__pyx_n_s_uniquenodes, __pyx_k_uniquenodes, sizeof(__pyx_k_uniquenodes), 0, 0, 1, 1},
    {&__pyx_n_s_units, __pyx_k_units, sizeof(__pyx_k_units), 0, 0, 1, 1},
    {&__pyx_n_s_unroot, __pyx_k_unroot, sizeof(__pyx_k_unroot), 0, 0, 1, 1},
    {&__pyx_n_s_unrooted, __pyx_k_unrooted, sizeof(__pyx_k_unrooted), 0, 0, 1, 1},
    {&__pyx_n_s_unrooted_trees, __pyx_k_unrooted_trees, sizeof(__pyx_k_unrooted_trees), 0, 0, 1, 1},
    {&__pyx_n_s_up, __pyx_k_up, sizeof(__pyx_k_up), 0, 0, 1, 1},
    {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
    {&__pyx_n_s_use_collateral, __pyx_k_use_collateral, sizeof(__pyx_k_use_collateral), 0, 0, 1, 1},
    {&__pyx_n_s_use_setstate, __pyx_k_use_setstate, sizeof(__pyx_k_use_setstate), 0, 0, 1, 1},
    {&__pyx_n_s_usecolor, __pyx_k_usecolor, sizeof(__pyx_k_usecolor), 0, 0, 1, 1},
    {&__pyx_n_s_utils, __pyx_k_utils, sizeof(__pyx_k_utils), 0, 0, 1, 1},
    {&__pyx_n_s_valid_ref_edges, __pyx_k_valid_ref_edges, sizeof(__pyx_k_valid_ref_edges), 0, 0, 1, 1},
    {&__pyx_n_s_valid_src_edges, __pyx_k_valid_src_edges, sizeof(__pyx_k_valid_src_edges), 0, 0, 1, 1},
    {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1},
    {&__pyx_n_s_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 1, 1},
    {&__pyx_n_s_verbose, __pyx_k_verbose, sizeof(__pyx_k_verbose), 0, 0, 1, 1},
    {&__pyx_n_s_visited_node, __pyx_k_visited_node, sizeof(__pyx_k_visited_node), 0, 0, 1, 1},
    {&__pyx_n_s_visitor_key, __pyx_k_visitor_key, sizeof(__pyx_k_visitor_key), 0, 0, 1, 1},
    {&__pyx_n_s_visitors, __pyx_k_visitors, sizeof(__pyx_k_visitors), 0, 0, 1, 1},
    {&__pyx_n_s_visitors2nodes, __pyx_k_visitors2nodes, sizeof(__pyx_k_visitors2nodes), 0, 0, 1, 1},
    {&__pyx_n_s_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 0, 1, 1},
    {&__pyx_n_u_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 1, 0, 1},
    {&__pyx_n_s_warn, __pyx_k_warn, sizeof(__pyx_k_warn), 0, 0, 1, 1},
    {&__pyx_n_s_warnings, __pyx_k_warnings, sizeof(__pyx_k_warnings), 0, 0, 1, 1},
    {&__pyx_n_s_webdriver, __pyx_k_webdriver, sizeof(__pyx_k_webdriver), 0, 0, 1, 1},
    {&__pyx_n_s_weight_fn, __pyx_k_weight_fn, sizeof(__pyx_k_weight_fn), 0, 0, 1, 1},
    {&__pyx_n_s_win_name, __pyx_k_win_name, sizeof(__pyx_k_win_name), 0, 0, 1, 1},
    {&__pyx_kp_u_window_size, __pyx_k_window_size, sizeof(__pyx_k_window_size), 0, 1, 0, 0},
    {&__pyx_n_s_write, __pyx_k_write, sizeof(__pyx_k_write), 0, 0, 1, 1},
    {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1},
    {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1},
    {&__pyx_n_u_yule, __pyx_k_yule, sizeof(__pyx_k_yule), 0, 1, 0, 1},
    {0, 0, 0, 0, 0, 0, 0}
  };
  return __Pyx_InitStrings(__pyx_string_tab);
}
/* #### Code section: cached_builtins ### */
static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_staticmethod = __Pyx_GetBuiltinName(__pyx_n_s_staticmethod); if (!__pyx_builtin_staticmethod) __PYX_ERR(0, 1797, __pyx_L1_error)
  __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_n_s_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(0, 66, __pyx_L1_error)
  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 96, __pyx_L1_error)
  __pyx_builtin_sum = __Pyx_GetBuiltinName(__pyx_n_s_sum); if (!__pyx_builtin_sum) __PYX_ERR(0, 192, __pyx_L1_error)
  __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_n_s_StopIteration); if (!__pyx_builtin_StopIteration) __PYX_ERR(0, 206, __pyx_L1_error)
  __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(0, 208, __pyx_L1_error)
  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 208, __pyx_L1_error)
  __pyx_builtin_hex = __Pyx_GetBuiltinName(__pyx_n_s_hex); if (!__pyx_builtin_hex) __PYX_ERR(0, 224, __pyx_L1_error)
  __pyx_builtin_sorted = __Pyx_GetBuiltinName(__pyx_n_s_sorted); if (!__pyx_builtin_sorted) __PYX_ERR(0, 528, __pyx_L1_error)
  __pyx_builtin_open = __Pyx_GetBuiltinName(__pyx_n_s_open); if (!__pyx_builtin_open) __PYX_ERR(0, 703, __pyx_L1_error)
  __pyx_builtin_print = __Pyx_GetBuiltinName(__pyx_n_s_print); if (!__pyx_builtin_print) __PYX_ERR(0, 998, __pyx_L1_error)
  __pyx_builtin_max = __Pyx_GetBuiltinName(__pyx_n_s_max); if (!__pyx_builtin_max) __PYX_ERR(0, 1447, __pyx_L1_error)
  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 1440, __pyx_L1_error)
  __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 1786, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}
/* #### Code section: cached_constants ### */

static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);

  /* "ete4/core/tree.pyx":169
 *             reversed_id.append(node.up.children.index(node))
 *             node = node.up
 *         return tuple(reversed_id[::-1])  # will look like  (0, 0, 1, 0)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __pyx_slice_ = PySlice_New(Py_None, Py_None, __pyx_int_neg_1); if (unlikely(!__pyx_slice_)) __PYX_ERR(0, 169, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice_);
  __Pyx_GIVEREF(__pyx_slice_);

  /* "ete4/core/tree.pyx":487
 *           #               B
 *         """
 *         def cmp_nodes(x, y):             # <<<<<<<<<<<<<<
 *             # if several nodes are in the same path of two kept nodes,
 *             # only one should be maintained. This prioritize internal
 */
  __pyx_tuple__6 = PyTuple_Pack(2, __pyx_n_s_x, __pyx_n_s_y); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 487, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__6);
  __Pyx_GIVEREF(__pyx_tuple__6);
  __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ete4_core_tree_pyx, __pyx_n_s_cmp_nodes, 487, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 487, __pyx_L1_error)

  /* "ete4/core/tree.pyx":703
 *             return newick.dumps(self, props, parser, format_root_node, is_leaf_fn)
 *         else:
 *             with open(outfile, 'w') as fp:             # <<<<<<<<<<<<<<
 *                 newick.dump(self, fp, props, parser, format_root_node, is_leaf_fn)
 * 
 */
  __pyx_tuple__16 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 703, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__16);
  __Pyx_GIVEREF(__pyx_tuple__16);

  /* "ete4/core/tree.pyx":1136
 *             descendant nodes, not only its leaves.
 *         """
 *         def get_content():  # return the node itself, or its requested prop             # <<<<<<<<<<<<<<
 *             return self if prop is None else self.get_prop(prop)
 * 
 */
  __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ete4_core_tree_pyx, __pyx_n_s_get_content, 1136, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(0, 1136, __pyx_L1_error)

  /* "ete4/core/tree.pyx":1199
 * 
 *         # Some helper functions to access properties.
 *         def has_prop(node, prop):             # <<<<<<<<<<<<<<
 *             return hasattr(node, prop) or prop in node.props
 * 
 */
  __pyx_tuple__26 = PyTuple_Pack(2, __pyx_n_s_node, __pyx_n_s_prop); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 1199, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__26);
  __Pyx_GIVEREF(__pyx_tuple__26);
  __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__26, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ete4_core_tree_pyx, __pyx_n_s_has_prop, 1199, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(0, 1199, __pyx_L1_error)

  /* "ete4/core/tree.pyx":1239
 *             polytomy_correction = max(corr1, corr2)
 * 
 *         def from_common(nodes, prop):  # helper function             # <<<<<<<<<<<<<<
 *             """Yield values (if existing in both trees) for property prop."""
 *             for node in nodes:
 */
  __pyx_tuple__28 = PyTuple_Pack(4, __pyx_n_s_nodes, __pyx_n_s_prop, __pyx_n_s_node, __pyx_n_s_value); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 1239, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__28);
  __Pyx_GIVEREF(__pyx_tuple__28);
  __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ete4_core_tree_pyx, __pyx_n_s_from_common, 1239, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(0, 1239, __pyx_L1_error)

  /* "ete4/core/tree.pyx":1258
 *                         tuple(sorted(from_common(t1_leaves_all - leaves, prop_t1)))]))
 *                     for leaves in t1_leaves.values()}
 *                 edges1.discard(((), ()))  # probably unnecessary             # <<<<<<<<<<<<<<
 *             else:
 *                 edges1 = {tuple(sorted(from_common(leaves, prop_t1)))
 */
  __pyx_tuple__30 = PyTuple_Pack(2, __pyx_empty_tuple, __pyx_empty_tuple); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 1258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__30);
  __Pyx_GIVEREF(__pyx_tuple__30);

  /* "ete4/core/tree.pyx":1334
 *         source_tree = self
 * 
 *         def _safe_div(a, b):             # <<<<<<<<<<<<<<
 *             if a != 0:
 *                 return a / float(b)
 */
  __pyx_tuple__31 = PyTuple_Pack(2, __pyx_n_s_a, __pyx_n_s_b); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 1334, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__31);
  __Pyx_GIVEREF(__pyx_tuple__31);
  __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ete4_core_tree_pyx, __pyx_n_s_safe_div, 1334, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 1334, __pyx_L1_error)

  /* "ete4/core/tree.pyx":1339
 *             else: return 0.0
 * 
 *         def _compare(src_tree, ref_tree):             # <<<<<<<<<<<<<<
 *             # calculate partitions and rf distances
 *             rf, maxrf, common, ref_p, src_p, ref_disc, src_disc  = ref_tree.robinson_foulds(src_tree,
 */
  __pyx_tuple__33 = PyTuple_Pack(16, __pyx_n_s_src_tree, __pyx_n_s_ref_tree, __pyx_n_s_rf, __pyx_n_s_maxrf, __pyx_n_s_common, __pyx_n_s_ref_p, __pyx_n_s_src_p, __pyx_n_s_ref_disc, __pyx_n_s_src_disc, __pyx_n_s_valid_ref_edges, __pyx_n_s_valid_src_edges, __pyx_n_s_common_edges, __pyx_n_s_p, __pyx_n_s_p, __pyx_n_s_p, __pyx_n_s_p); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 1339, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__33);
  __Pyx_GIVEREF(__pyx_tuple__33);
  __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 16, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ete4_core_tree_pyx, __pyx_n_s_compare, 1339, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 1339, __pyx_L1_error)

  /* "ete4/core/tree.pyx":1499
 *             ete_diff.show_difftable_tab(difftable)
 *         elif output == 'table':
 *             rf, rf_max, _, _, _, _, _ = self.robinson_foulds(t2, prop_t1=prop_t1, prop_t2=prop_t2)[:2]             # <<<<<<<<<<<<<<
 *             ete_diff.show_difftable_summary(difftable, rf, rf_max)
 *         elif output == 'raw':
 */
  __pyx_slice__35 = PySlice_New(Py_None, __pyx_int_2, Py_None); if (unlikely(!__pyx_slice__35)) __PYX_ERR(0, 1499, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__35);
  __Pyx_GIVEREF(__pyx_slice__35);

  /* "ete4/core/tree.pyx":1660
 *             yield labels[0]
 *           else:
 *             for tree in enum_unordered(labels[1:]):             # <<<<<<<<<<<<<<
 *               for new_tree in add_leaf(tree, labels[0]):
 *                 yield new_tree
 */
  __pyx_slice__38 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__38)) __PYX_ERR(0, 1660, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__38);
  __Pyx_GIVEREF(__pyx_slice__38);

  /* "ete4/core/tree.pyx":1648
 *             pass
 * 
 *         def add_leaf(tree, label):             # <<<<<<<<<<<<<<
 *           yield (label, tree)
 *           if not isinstance(tree, TipTuple) and isinstance(tree, tuple):
 */
  __pyx_tuple__39 = PyTuple_Pack(4, __pyx_n_s_tree, __pyx_n_s_label, __pyx_n_s_left, __pyx_n_s_right); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 1648, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__39);
  __Pyx_GIVEREF(__pyx_tuple__39);
  __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ete4_core_tree_pyx, __pyx_n_s_add_leaf, 1648, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(0, 1648, __pyx_L1_error)

  /* "ete4/core/tree.pyx":1656
 *               yield (tree[0], right)
 * 
 *         def enum_unordered(labels):             # <<<<<<<<<<<<<<
 *           if len(labels) == 1:
 *             yield labels[0]
 */
  __pyx_tuple__41 = PyTuple_Pack(3, __pyx_n_s_labels, __pyx_n_s_tree, __pyx_n_s_new_tree); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 1656, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__41);
  __Pyx_GIVEREF(__pyx_tuple__41);
  __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ete4_core_tree_pyx, __pyx_n_s_enum_unordered, 1656, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(0, 1656, __pyx_L1_error)

  /* "ete4/core/tree.pyx":1819
 *           #              E,1.5
 *         """
 *         def get_node(nodename, dist=None):             # <<<<<<<<<<<<<<
 *             if nodename not in nodes_by_name:
 *                 data = {'name': nodename}
 */
  __pyx_tuple__43 = PyTuple_Pack(4, __pyx_n_s_nodename, __pyx_n_s_dist, __pyx_n_s_data, __pyx_n_s_node); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 1819, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__43);
  __Pyx_GIVEREF(__pyx_tuple__43);
  __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ete4_core_tree_pyx, __pyx_n_s_get_node, 1819, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(0, 1819, __pyx_L1_error)
  __pyx_tuple__45 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 1819, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__45);
  __Pyx_GIVEREF(__pyx_tuple__45);

  /* "ete4/core/tree.pyx":1860
 *         from skbio import TreeNode as skbioTreeNode
 * 
 *         def get_ete_node(skbio_node):             # <<<<<<<<<<<<<<
 *             ete_node = all_nodes.get(skbio_node, Tree())
 *             if skbio_node.props.get('length') is not None:
 */
  __pyx_tuple__46 = PyTuple_Pack(3, __pyx_n_s_skbio_node, __pyx_n_s_ete_node, __pyx_n_s_a); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 1860, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__46);
  __Pyx_GIVEREF(__pyx_tuple__46);
  __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ete4_core_tree_pyx, __pyx_n_s_get_ete_node, 1860, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__47)) __PYX_ERR(0, 1860, __pyx_L1_error)

  /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum not in (0x9050475, 0x1a93b81, 0x290a31e):             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x9050475, 0x1a93b81, 0x290a31e) = (_children, props, size, up))" % __pyx_checksum
 */
  __pyx_tuple__48 = PyTuple_Pack(3, __pyx_int_151323765, __pyx_int_27868033, __pyx_int_43033374); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__48);
  __Pyx_GIVEREF(__pyx_tuple__48);

  /* "ete4/core/tree.pyx":181
 *         return n
 * 
 *     def get_prop(self, prop, default=None):             # <<<<<<<<<<<<<<
 *         """Return the node's property prop (an attribute or in self.props)."""
 *         attr = getattr(self, prop, None)
 */
  __pyx_tuple__49 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_prop, __pyx_n_s_default, __pyx_n_s_attr); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 181, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__49);
  __Pyx_GIVEREF(__pyx_tuple__49);
  __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ete4_core_tree_pyx, __pyx_n_s_get_prop, 181, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(0, 181, __pyx_L1_error)

  /* "ete4/core/tree.pyx":230
 *         return self.to_str(show_internal=False, compact=True, props=['name'])
 * 
 *     def to_str(self, show_internal=True, compact=False, props=None,             # <<<<<<<<<<<<<<
 *                px=None, py=None, px0=0, cascade=False):
 *         """Return a string containing an ascii drawing of the tree.
 */
  __pyx_tuple__51 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_show_internal, __pyx_n_s_compact, __pyx_n_s_props, __pyx_n_s_px, __pyx_n_s_py, __pyx_n_s_px0, __pyx_n_s_cascade); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(0, 230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__51);
  __Pyx_GIVEREF(__pyx_tuple__51);
  __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(8, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ete4_core_tree_pyx, __pyx_n_s_to_str, 230, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__52)) __PYX_ERR(0, 230, __pyx_L1_error)
  __pyx_tuple__53 = PyTuple_Pack(7, Py_True, Py_False, Py_None, Py_None, Py_None, __pyx_int_0, Py_False); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(0, 230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__53);
  __Pyx_GIVEREF(__pyx_tuple__53);

  /* "ete4/core/tree.pyx":260
 *         yield from self.leaves()
 * 
 *     def add_prop(self, name, value):             # <<<<<<<<<<<<<<
 *         """Add or update node's property to the given value."""
 *         self.props[name] = value
 */
  __pyx_tuple__54 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_name, __pyx_n_s_value); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 260, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__54);
  __Pyx_GIVEREF(__pyx_tuple__54);
  __pyx_codeobj__55 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__54, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ete4_core_tree_pyx, __pyx_n_s_add_prop, 260, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__55)) __PYX_ERR(0, 260, __pyx_L1_error)

  /* "ete4/core/tree.pyx":264
 *         self.props[name] = value
 * 
 *     def add_props(self, **props):             # <<<<<<<<<<<<<<
 *         """Add or update several properties."""
 *         for name, value in props.items():
 */
  __pyx_tuple__56 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_props, __pyx_n_s_name, __pyx_n_s_value); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(0, 264, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__56);
  __Pyx_GIVEREF(__pyx_tuple__56);
  __pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__56, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ete4_core_tree_pyx, __pyx_n_s_add_props, 264, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__57)) __PYX_ERR(0, 264, __pyx_L1_error)

  /* "ete4/core/tree.pyx":269
 *             self.props[name] = value
 * 
 *     def del_prop(self, name):             # <<<<<<<<<<<<<<
 *         """Delete a node's property."""
 *         self.props.pop(name, None)
 */
  __pyx_tuple__58 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_name); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(0, 269, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__58);
  __Pyx_GIVEREF(__pyx_tuple__58);
  __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__58, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ete4_core_tree_pyx, __pyx_n_s_del_prop, 269, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__59)) __PYX_ERR(0, 269, __pyx_L1_error)

  /* "ete4/core/tree.pyx":274
 * 
 *     # Topology management
 *     def add_child(self, child=None, name=None, dist=None, support=None):             # <<<<<<<<<<<<<<
 *         """Add a new child to this node and return it.
 * 
 */
  __pyx_tuple__60 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_child, __pyx_n_s_name, __pyx_n_s_dist, __pyx_n_s_support); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(0, 274, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__60);
  __Pyx_GIVEREF(__pyx_tuple__60);
  __pyx_codeobj__61 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__60, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ete4_core_tree_pyx, __pyx_n_s_add_child, 274, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__61)) __PYX_ERR(0, 274, __pyx_L1_error)
  __pyx_tuple__62 = PyTuple_Pack(4, Py_None, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(0, 274, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__62);
  __Pyx_GIVEREF(__pyx_tuple__62);

  /* "ete4/core/tree.pyx":302
 *         return child
 * 
 *     def add_children(self, nodes):             # <<<<<<<<<<<<<<
 *         """Set the given nodes as children of this node."""
 *         for node in nodes:
 */
  __pyx_tuple__63 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_nodes, __pyx_n_s_node); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(0, 302, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__63);
  __Pyx_GIVEREF(__pyx_tuple__63);
  __pyx_codeobj__64 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__63, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ete4_core_tree_pyx, __pyx_n_s_add_children, 302, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__64)) __PYX_ERR(0, 302, __pyx_L1_error)

  /* "ete4/core/tree.pyx":308
 *         return nodes
 * 
 *     def pop_child(self, child_idx=-1):             # <<<<<<<<<<<<<<
 *         try:
 *             child = self.children.pop(child_idx)  # parent removes child
 */
  __pyx_tuple__65 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_child_idx, __pyx_n_s_child, __pyx_n_s_e); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(0, 308, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__65);
  __Pyx_GIVEREF(__pyx_tuple__65);
  __pyx_codeobj__66 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ete4_core_tree_pyx, __pyx_n_s_pop_child, 308, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__66)) __PYX_ERR(0, 308, __pyx_L1_error)
  __pyx_tuple__67 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(0, 308, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__67);
  __Pyx_GIVEREF(__pyx_tuple__67);

  /* "ete4/core/tree.pyx":319
 *             raise TreeError(f'Cannot pop child: not found ({e})')
 * 
 *     def remove_child(self, child):             # <<<<<<<<<<<<<<
 *         """Remove child from this node and return it.
 * 
 */
  __pyx_tuple__68 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_child, __pyx_n_s_e, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(0, 319, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__68);
  __Pyx_GIVEREF(__pyx_tuple__68);
  __pyx_codeobj__69 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__68, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ete4_core_tree_pyx, __pyx_n_s_remove_child, 319, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__69)) __PYX_ERR(0, 319, __pyx_L1_error)

  /* "ete4/core/tree.pyx":338
 *             raise TreeError(f'Cannot remove child: not found ({e})')
 * 
 *     def remove_children(self):             # <<<<<<<<<<<<<<
 *         """Remove all children from this node and return a list with them."""
 *         children = list(self.children)  # we need to make a copy of the list!
 */
  __pyx_tuple__70 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_children, __pyx_n_s_node); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(0, 338, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__70);
  __Pyx_GIVEREF(__pyx_tuple__70);
  __pyx_codeobj__71 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__70, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ete4_core_tree_pyx, __pyx_n_s_remove_children, 338, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__71)) __PYX_ERR(0, 338, __pyx_L1_error)

  /* "ete4/core/tree.pyx":343
 *         return [self.remove_child(node) for node in children]
 * 
 *     def add_sister(self, sister=None, name=None, dist=None):             # <<<<<<<<<<<<<<
 *         """Add a sister to this node and return it.
 * 
 */
  __pyx_tuple__72 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_sister, __pyx_n_s_name, __pyx_n_s_dist); if (unlikely(!__pyx_tuple__72)) __PYX_ERR(0, 343, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__72);
  __Pyx_GIVEREF(__pyx_tuple__72);
  __pyx_codeobj__73 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__72, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ete4_core_tree_pyx, __pyx_n_s_add_sister, 343, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__73)) __PYX_ERR(0, 343, __pyx_L1_error)

  /* "ete4/core/tree.pyx":353
 *         return self.up.add_child(child=sister, name=name, dist=dist)
 * 
 *     def remove_sister(self, sister=None):             # <<<<<<<<<<<<<<
 *         """Remove a sister node and return it.
 * 
 */
  __pyx_tuple__74 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_sister, __pyx_n_s_sisters); if (unlikely(!__pyx_tuple__74)) __PYX_ERR(0, 353, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__74);
  __Pyx_GIVEREF(__pyx_tuple__74);
  __pyx_codeobj__75 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__74, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ete4_core_tree_pyx, __pyx_n_s_remove_sister, 353, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__75)) __PYX_ERR(0, 353, __pyx_L1_error)

  /* "ete4/core/tree.pyx":367
 *         return self.up.remove_child(sister or sisters[0])
 * 
 *     def delete(self, prevent_nondicotomic=True, preserve_branch_length=False):             # <<<<<<<<<<<<<<
 *         """Delete node from the tree structure, keeping its children.
 * 
 */
  __pyx_tuple__76 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_prevent_nondicotomic, __pyx_n_s_preserve_branch_length, __pyx_n_s_parent, __pyx_n_s_ch); if (unlikely(!__pyx_tuple__76)) __PYX_ERR(0, 367, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__76);
  __Pyx_GIVEREF(__pyx_tuple__76);
  __pyx_codeobj__77 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__76, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ete4_core_tree_pyx, __pyx_n_s_delete, 367, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__77)) __PYX_ERR(0, 367, __pyx_L1_error)
  __pyx_tuple__78 = PyTuple_Pack(2, Py_True, Py_False); if (unlikely(!__pyx_tuple__78)) __PYX_ERR(0, 367, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__78);
  __Pyx_GIVEREF(__pyx_tuple__78);

  /* "ete4/core/tree.pyx":416
 *                           preserve_branch_length=preserve_branch_length)
 * 
 *     def detach(self):             # <<<<<<<<<<<<<<
 *         """Detach this node (and descendants) from its parent and return itself.
 * 
 */
  __pyx_tuple__79 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__79)) __PYX_ERR(0, 416, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__79);
  __Pyx_GIVEREF(__pyx_tuple__79);
  __pyx_codeobj__80 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__79, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ete4_core_tree_pyx, __pyx_n_s_detach, 416, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__80)) __PYX_ERR(0, 416, __pyx_L1_error)

  /* "ete4/core/tree.pyx":429
 *         return self
 * 
 *     def prune(self, nodes, preserve_branch_length=False):             # <<<<<<<<<<<<<<
 *         """Prune the topology conserving only the given nodes.
 * 
 */
  __pyx_tuple__81 = PyTuple_Pack(21, __pyx_n_s_self, __pyx_n_s_nodes, __pyx_n_s_preserve_branch_length, __pyx_n_s_cmp_nodes, __pyx_n_s_cmp_nodes, __pyx_n_s_to_keep, __pyx_n_s_start, __pyx_n_s_node2path, __pyx_n_s_n2count, __pyx_n_s_n2depth, __pyx_n_s_seed, __pyx_n_s_path, __pyx_n_s_visited_node, __pyx_n_s_depth, __pyx_n_s_visitors2nodes, __pyx_n_s_node, __pyx_n_s_visitors, __pyx_n_s_visitor_key, __pyx_n_s_sorted_nodes, __pyx_n_s_n, __pyx_n_s_n); if (unlikely(!__pyx_tuple__81)) __PYX_ERR(0, 429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__81);
  __Pyx_GIVEREF(__pyx_tuple__81);
  __pyx_codeobj__82 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 21, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__81, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ete4_core_tree_pyx, __pyx_n_s_prune, 429, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__82)) __PYX_ERR(0, 429, __pyx_L1_error)
  __pyx_tuple__83 = PyTuple_Pack(1, Py_False); if (unlikely(!__pyx_tuple__83)) __PYX_ERR(0, 429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__83);
  __Pyx_GIVEREF(__pyx_tuple__83);

  /* "ete4/core/tree.pyx":542
 *                 n.delete(prevent_nondicotomic=False)
 * 
 *     def reverse_children(self):             # <<<<<<<<<<<<<<
 *         """Reverse current children order."""
 *         self.children.reverse()
 */
  __pyx_codeobj__84 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__79, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ete4_core_tree_pyx, __pyx_n_s_reverse_children, 542, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__84)) __PYX_ERR(0, 542, __pyx_L1_error)

  /* "ete4/core/tree.pyx":546
 *         self.children.reverse()
 * 
 *     def swap_children(self):             # <<<<<<<<<<<<<<
 *         """Like reverse, but if there are only two children."""
 *         n = len(self.children)
 */
  __pyx_tuple__85 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_n); if (unlikely(!__pyx_tuple__85)) __PYX_ERR(0, 546, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__85);
  __Pyx_GIVEREF(__pyx_tuple__85);
  __pyx_codeobj__86 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ete4_core_tree_pyx, __pyx_n_s_swap_children, 546, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__86)) __PYX_ERR(0, 546, __pyx_L1_error)

  /* "ete4/core/tree.pyx":553
 *         self.children.reverse()
 * 
 *     def get_children(self):             # <<<<<<<<<<<<<<
 *         """Return an independent list of the node's children."""
 *         # The returned list can be changed without affecting self.children.
 */
  __pyx_codeobj__87 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__79, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ete4_core_tree_pyx, __pyx_n_s_get_children, 553, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__87)) __PYX_ERR(0, 553, __pyx_L1_error)

  /* "ete4/core/tree.pyx":558
 *         return self.children.copy()
 * 
 *     def get_sisters(self):             # <<<<<<<<<<<<<<
 *         """Return a list of sister nodes (siblings)."""
 *         return ([node for node in self.up.children if node is not self]
 */
  __pyx_tuple__88 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_node); if (unlikely(!__pyx_tuple__88)) __PYX_ERR(0, 558, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__88);
  __Pyx_GIVEREF(__pyx_tuple__88);
  __pyx_codeobj__89 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__88, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ete4_core_tree_pyx, __pyx_n_s_get_sisters, 558, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__89)) __PYX_ERR(0, 558, __pyx_L1_error)

  /* "ete4/core/tree.pyx":563
 *                 if not self.is_root else [])
 * 
 *     def leaves(self, is_leaf_fn=None):             # <<<<<<<<<<<<<<
 *         """Yield the terminal nodes (leaves) under this node."""
 *         is_leaf = is_leaf_fn or (lambda n: n.is_leaf)
 */
  __pyx_tuple__90 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_is_leaf_fn, __pyx_n_s_is_leaf, __pyx_n_s_node); if (unlikely(!__pyx_tuple__90)) __PYX_ERR(0, 563, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__90);
  __Pyx_GIVEREF(__pyx_tuple__90);
  __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__90, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ete4_core_tree_pyx, __pyx_n_s_leaves, 563, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 563, __pyx_L1_error)

  /* "ete4/core/tree.pyx":570
 *                 yield node
 * 
 *     def leaf_names(self, is_leaf_fn=None):             # <<<<<<<<<<<<<<
 *         """Yield the leaf names under this node."""
 *         for leaf in self.leaves(is_leaf_fn):
 */
  __pyx_tuple__91 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_is_leaf_fn, __pyx_n_s_leaf); if (unlikely(!__pyx_tuple__91)) __PYX_ERR(0, 570, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__91);
  __Pyx_GIVEREF(__pyx_tuple__91);
  __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__91, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ete4_core_tree_pyx, __pyx_n_s_leaf_names, 570, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 570, __pyx_L1_error)

  /* "ete4/core/tree.pyx":575
 *             yield leaf.name
 * 
 *     def descendants(self, strategy='levelorder', is_leaf_fn=None):             # <<<<<<<<<<<<<<
 *         """Yield all descendant nodes."""
 *         for node in self.traverse(strategy, is_leaf_fn):
 */
  __pyx_tuple__92 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_strategy, __pyx_n_s_is_leaf_fn, __pyx_n_s_node); if (unlikely(!__pyx_tuple__92)) __PYX_ERR(0, 575, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__92);
  __Pyx_GIVEREF(__pyx_tuple__92);
  __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__92, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ete4_core_tree_pyx, __pyx_n_s_descendants, 575, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 575, __pyx_L1_error)
  __pyx_tuple__93 = PyTuple_Pack(2, __pyx_n_u_levelorder, Py_None); if (unlikely(!__pyx_tuple__93)) __PYX_ERR(0, 575, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__93);
  __Pyx_GIVEREF(__pyx_tuple__93);

  /* "ete4/core/tree.pyx":581
 *                 yield node
 * 
 *     def traverse(self, strategy='levelorder', is_leaf_fn=None):             # <<<<<<<<<<<<<<
 *         """Traverse the tree structure under this node and yield the nodes.
 * 
 */
  __pyx_tuple__94 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_strategy, __pyx_n_s_is_leaf_fn); if (unlikely(!__pyx_tuple__94)) __PYX_ERR(0, 581, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__94);
  __Pyx_GIVEREF(__pyx_tuple__94);
  __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__94, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ete4_core_tree_pyx, __pyx_n_s_traverse, 581, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 581, __pyx_L1_error)

  /* "ete4/core/tree.pyx":606
 *             raise TreeError(f'Unknown strategy: {strategy}')
 * 
 *     def iter_prepostorder(self, is_leaf_fn=None):             # <<<<<<<<<<<<<<
 *         """Yield all nodes in a tree in both pre and post order.
 * 
 */
  __pyx_tuple__95 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_is_leaf_fn, __pyx_n_s_path, __pyx_n_s_node, __pyx_n_s_seen); if (unlikely(!__pyx_tuple__95)) __PYX_ERR(0, 606, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__95);
  __Pyx_GIVEREF(__pyx_tuple__95);
  __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__95, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ete4_core_tree_pyx, __pyx_n_s_iter_prepostorder, 606, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 606, __pyx_L1_error)

  /* "ete4/core/tree.pyx":621
 *                 path.append(node)
 * 
 *     def ancestors(self, root=None, include_root=True):             # <<<<<<<<<<<<<<
 *         """Yield all ancestor nodes of this node (up to the root if given)."""
 *         # root === n1 === n2 === .. === nN === node  ->  [nN, .., n2, n1, root]
 */
  __pyx_tuple__96 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_root, __pyx_n_s_include_root, __pyx_n_s_node); if (unlikely(!__pyx_tuple__96)) __PYX_ERR(0, 621, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__96);
  __Pyx_GIVEREF(__pyx_tuple__96);
  __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__96, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ete4_core_tree_pyx, __pyx_n_s_ancestors, 621, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 621, __pyx_L1_error)
  __pyx_tuple__97 = PyTuple_Pack(2, Py_None, Py_True); if (unlikely(!__pyx_tuple__97)) __PYX_ERR(0, 621, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__97);
  __Pyx_GIVEREF(__pyx_tuple__97);

  /* "ete4/core/tree.pyx":636
 *             yield root
 * 
 *     def lineage(self, root=None, include_root=True):             # <<<<<<<<<<<<<<
 *         """Yield all nodes in the lineage of this node (up to root if given)."""
 *         if not include_root and self is root:
 */
  __pyx_tuple__98 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_root, __pyx_n_s_include_root); if (unlikely(!__pyx_tuple__98)) __PYX_ERR(0, 636, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__98);
  __Pyx_GIVEREF(__pyx_tuple__98);
  __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__98, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ete4_core_tree_pyx, __pyx_n_s_lineage, 636, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 636, __pyx_L1_error)

  /* "ete4/core/tree.pyx":645
 *         yield from self.ancestors(root, include_root)
 * 
 *     def _translate_nodes(self, nodes):             # <<<<<<<<<<<<<<
 *         """Return a list of nodes that correspond to the given names or nodes."""
 *         # ['A', self['B'], 'C'] -> [self['A'], self['B'], self['C']]
 */
  __pyx_tuple__99 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_nodes, __pyx_n_s_names, __pyx_n_s_name2node, __pyx_n_s_node, __pyx_n_s_n, __pyx_n_s_n); if (unlikely(!__pyx_tuple__99)) __PYX_ERR(0, 645, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__99);
  __Pyx_GIVEREF(__pyx_tuple__99);
  __pyx_codeobj__100 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__99, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ete4_core_tree_pyx, __pyx_n_s_translate_nodes, 645, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__100)) __PYX_ERR(0, 645, __pyx_L1_error)

  /* "ete4/core/tree.pyx":663
 *         return [name2node[n] if type(n) == str else n for n in nodes]
 * 
 *     def describe(self):             # <<<<<<<<<<<<<<
 *         """Return a string with information on this node and its connections."""
 *         if len(self.root.children) == 2:
 */
  __pyx_tuple__101 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_rooting, __pyx_n_s_max_node, __pyx_n_s_max_dist, __pyx_n_s_cached_content); if (unlikely(!__pyx_tuple__101)) __PYX_ERR(0, 663, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__101);
  __Pyx_GIVEREF(__pyx_tuple__101);
  __pyx_codeobj__102 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__101, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ete4_core_tree_pyx, __pyx_n_s_describe, 663, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__102)) __PYX_ERR(0, 663, __pyx_L1_error)

  /* "ete4/core/tree.pyx":682
 *             'Max. distance: %g' % max_dist])
 * 
 *     def write(self, outfile=None, props=(), parser=None,             # <<<<<<<<<<<<<<
 *               format_root_node=False, is_leaf_fn=None):
 *         """Return or write to file the newick representation.
 */
  __pyx_tuple__103 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_outfile, __pyx_n_s_props, __pyx_n_s_parser, __pyx_n_s_format_root_node, __pyx_n_s_is_leaf_fn, __pyx_n_s_fp); if (unlikely(!__pyx_tuple__103)) __PYX_ERR(0, 682, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__103);
  __Pyx_GIVEREF(__pyx_tuple__103);
  __pyx_codeobj__104 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__103, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ete4_core_tree_pyx, __pyx_n_s_write, 682, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__104)) __PYX_ERR(0, 682, __pyx_L1_error)
  __pyx_tuple__105 = PyTuple_Pack(5, Py_None, __pyx_empty_tuple, Py_None, Py_False, Py_None); if (unlikely(!__pyx_tuple__105)) __PYX_ERR(0, 682, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__105);
  __Pyx_GIVEREF(__pyx_tuple__105);

  /* "ete4/core/tree.pyx":706
 *                 newick.dump(self, fp, props, parser, format_root_node, is_leaf_fn)
 * 
 *     def common_ancestor(self, *nodes):             # <<<<<<<<<<<<<<
 *         """Return the last node common to the lineages of the given nodes.
 * 
 */
  __pyx_tuple__106 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_nodes, __pyx_n_s_root); if (unlikely(!__pyx_tuple__106)) __PYX_ERR(0, 706, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__106);
  __Pyx_GIVEREF(__pyx_tuple__106);
  __pyx_codeobj__107 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__106, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ete4_core_tree_pyx, __pyx_n_s_common_ancestor, 706, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__107)) __PYX_ERR(0, 706, __pyx_L1_error)

  /* "ete4/core/tree.pyx":728
 *         return root
 * 
 *     def search_nodes(self, **conditions):             # <<<<<<<<<<<<<<
 *         """Yield nodes matching the given conditions.
 * 
 */
  __pyx_tuple__108 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_conditions, __pyx_n_s_node, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__108)) __PYX_ERR(0, 728, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__108);
  __Pyx_GIVEREF(__pyx_tuple__108);
  __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS|CO_GENERATOR, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__108, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ete4_core_tree_pyx, __pyx_n_s_search_nodes, 728, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 728, __pyx_L1_error)

  /* "ete4/core/tree.pyx":740
 *                 yield node
 * 
 *     def search_descendants(self, **conditions):             # <<<<<<<<<<<<<<
 *         """Yield descendant nodes matching the given conditions."""
 *         for node in self.search_nodes(**conditions):
 */
  __pyx_tuple__109 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_conditions, __pyx_n_s_node); if (unlikely(!__pyx_tuple__109)) __PYX_ERR(0, 740, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__109);
  __Pyx_GIVEREF(__pyx_tuple__109);
  __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS|CO_GENERATOR, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__109, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ete4_core_tree_pyx, __pyx_n_s_search_descendants, 740, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 740, __pyx_L1_error)

  /* "ete4/core/tree.pyx":746
 *                 yield node
 * 
 *     def search_ancestors(self, **conditions):             # <<<<<<<<<<<<<<
 *         """Yield ancestor nodes matching the given conditions."""
 *         for node in self.ancestors():
 */
  __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS|CO_GENERATOR, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__108, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ete4_core_tree_pyx, __pyx_n_s_search_ancestors, 746, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 746, __pyx_L1_error)

  /* "ete4/core/tree.pyx":752
 *                 yield node
 * 
 *     def search_leaves_by_name(self, name):             # <<<<<<<<<<<<<<
 *         """Yield leaf nodes matching the given name."""
 *         return self.search_nodes(name=name, children=[])
 */
  __pyx_codeobj__110 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__58, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ete4_core_tree_pyx, __pyx_n_s_search_leaves_by_name, 752, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__110)) __PYX_ERR(0, 752, __pyx_L1_error)

  /* "ete4/core/tree.pyx":760
 *     # ###########################
 * 
 *     def get_distance(self, node1, node2, topological=False):             # <<<<<<<<<<<<<<
 *         """Return the distance between the given nodes.
 * 
 */
  __pyx_tuple__111 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_node1, __pyx_n_s_node2, __pyx_n_s_topological, __pyx_n_s_d, __pyx_n_s_root, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__111)) __PYX_ERR(0, 760, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__111);
  __Pyx_GIVEREF(__pyx_tuple__111);
  __pyx_codeobj__112 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__111, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ete4_core_tree_pyx, __pyx_n_s_get_distance, 760, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__112)) __PYX_ERR(0, 760, __pyx_L1_error)

  /* "ete4/core/tree.pyx":777
 *                 sum(d(n) for n in node2.lineage(root, include_root=False)))
 * 
 *     def get_farthest_node(self, topological=False):             # <<<<<<<<<<<<<<
 *         """Returns the farthest descendant or ancestor node, and its distance.
 * 
 */
  __pyx_tuple__113 = PyTuple_Pack(11, __pyx_n_s_self, __pyx_n_s_topological, __pyx_n_s_farthest_node, __pyx_n_s_farthest_dist, __pyx_n_s_dist, __pyx_n_s_prev, __pyx_n_s_cdist, __pyx_n_s_current, __pyx_n_s_ch, __pyx_n_s_fnode, __pyx_n_s_fdist); if (unlikely(!__pyx_tuple__113)) __PYX_ERR(0, 777, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__113);
  __Pyx_GIVEREF(__pyx_tuple__113);
  __pyx_codeobj__114 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__113, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ete4_core_tree_pyx, __pyx_n_s_get_farthest_node, 777, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__114)) __PYX_ERR(0, 777, __pyx_L1_error)

  /* "ete4/core/tree.pyx":814
 *         return farthest_node, farthest_dist
 * 
 *     def _get_farthest_and_closest_leaves(self, topological=False, is_leaf_fn=None):             # <<<<<<<<<<<<<<
 *         # if called from a leaf node, no necessary to compute
 *         if (is_leaf_fn and is_leaf_fn(self)) or self.is_leaf:
 */
  __pyx_tuple__115 = PyTuple_Pack(12, __pyx_n_s_self, __pyx_n_s_topological, __pyx_n_s_is_leaf_fn, __pyx_n_s_dist, __pyx_n_s_min_dist, __pyx_n_s_min_node, __pyx_n_s_max_dist, __pyx_n_s_max_node, __pyx_n_s_d, __pyx_n_s_post, __pyx_n_s_n, __pyx_n_s_total_d); if (unlikely(!__pyx_tuple__115)) __PYX_ERR(0, 814, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__115);
  __Pyx_GIVEREF(__pyx_tuple__115);
  __pyx_codeobj__116 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__115, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ete4_core_tree_pyx, __pyx_n_s_get_farthest_and_closest_leaves_2, 814, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__116)) __PYX_ERR(0, 814, __pyx_L1_error)
  __pyx_tuple__117 = PyTuple_Pack(2, Py_False, Py_None); if (unlikely(!__pyx_tuple__117)) __PYX_ERR(0, 814, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__117);
  __Pyx_GIVEREF(__pyx_tuple__117);

  /* "ete4/core/tree.pyx":845
 * 
 * 
 *     def get_farthest_leaf(self, topological=False, is_leaf_fn=None):             # <<<<<<<<<<<<<<
 *         """Return the node's farthest descendant (a leaf), and its distance.
 * 
 */
  __pyx_tuple__118 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_topological, __pyx_n_s_is_leaf_fn, __pyx_n_s_min_node, __pyx_n_s_min_dist, __pyx_n_s_max_node, __pyx_n_s_max_dist); if (unlikely(!__pyx_tuple__118)) __PYX_ERR(0, 845, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__118);
  __Pyx_GIVEREF(__pyx_tuple__118);
  __pyx_codeobj__119 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__118, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ete4_core_tree_pyx, __pyx_n_s_get_farthest_leaf, 845, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__119)) __PYX_ERR(0, 845, __pyx_L1_error)

  /* "ete4/core/tree.pyx":856
 *         return max_node, max_dist
 * 
 *     def get_closest_leaf(self, topological=False, is_leaf_fn=None):             # <<<<<<<<<<<<<<
 *         """Return the node's closest descendant leaf, and its distance.
 * 
 */
  __pyx_codeobj__120 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__118, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ete4_core_tree_pyx, __pyx_n_s_get_closest_leaf, 856, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__120)) __PYX_ERR(0, 856, __pyx_L1_error)

  /* "ete4/core/tree.pyx":867
 *         return min_node, min_dist
 * 
 *     def get_midpoint_outgroup(self, topological=False):             # <<<<<<<<<<<<<<
 *         """Return the node dividing into two distance-balanced partitions.
 * 
 */
  __pyx_tuple__122 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_topological, __pyx_n_s_current, __pyx_n_s__121, __pyx_n_s_diameter, __pyx_n_s_dist); if (unlikely(!__pyx_tuple__122)) __PYX_ERR(0, 867, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__122);
  __Pyx_GIVEREF(__pyx_tuple__122);
  __pyx_codeobj__123 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__122, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ete4_core_tree_pyx, __pyx_n_s_get_midpoint_outgroup, 867, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__123)) __PYX_ERR(0, 867, __pyx_L1_error)

  /* "ete4/core/tree.pyx":888
 *         return current  # the midpoint was the root (we went back to it)
 * 
 *     def mean_distance(self, weight_fn=None, leaf=None, topological=False):             # <<<<<<<<<<<<<<
 *         """Return the weighted mean distance between leaves, or from leaf.
 * 
 */
  __pyx_tuple__124 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_weight_fn, __pyx_n_s_leaf, __pyx_n_s_topological); if (unlikely(!__pyx_tuple__124)) __PYX_ERR(0, 888, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__124);
  __Pyx_GIVEREF(__pyx_tuple__124);
  __pyx_codeobj__125 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__124, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ete4_core_tree_pyx, __pyx_n_s_mean_distance, 888, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__125)) __PYX_ERR(0, 888, __pyx_L1_error)
  __pyx_tuple__126 = PyTuple_Pack(3, Py_None, Py_None, Py_False); if (unlikely(!__pyx_tuple__126)) __PYX_ERR(0, 888, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__126);
  __Pyx_GIVEREF(__pyx_tuple__126);

  /* "ete4/core/tree.pyx":911
 *         return ops.mean_distance(self, weight_fn, leaf, topological)
 * 
 *     def populate(self, size, names=None, model='yule',             # <<<<<<<<<<<<<<
 *                  dist_fn=None, support_fn=None):
 *         """Populate current node with a dichotomic random topology.
 */
  __pyx_tuple__127 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_size, __pyx_n_s_names, __pyx_n_s_model, __pyx_n_s_dist_fn, __pyx_n_s_support_fn); if (unlikely(!__pyx_tuple__127)) __PYX_ERR(0, 911, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__127);
  __Pyx_GIVEREF(__pyx_tuple__127);
  __pyx_codeobj__128 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__127, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ete4_core_tree_pyx, __pyx_n_s_populate, 911, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__128)) __PYX_ERR(0, 911, __pyx_L1_error)
  __pyx_tuple__129 = PyTuple_Pack(4, Py_None, __pyx_n_u_yule, Py_None, Py_None); if (unlikely(!__pyx_tuple__129)) __PYX_ERR(0, 911, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__129);
  __Pyx_GIVEREF(__pyx_tuple__129);

  /* "ete4/core/tree.pyx":940
 *         ops.populate(self, size, names, model, dist_fn, support_fn)
 * 
 *     def set_outgroup(self, node, bprops=None, dist=None):             # <<<<<<<<<<<<<<
 *         """Change tree so the given node is set as outgroup.
 * 
 */
  __pyx_tuple__130 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_node, __pyx_n_s_bprops, __pyx_n_s_dist); if (unlikely(!__pyx_tuple__130)) __PYX_ERR(0, 940, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__130);
  __Pyx_GIVEREF(__pyx_tuple__130);
  __pyx_codeobj__131 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__130, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ete4_core_tree_pyx, __pyx_n_s_set_outgroup, 940, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__131)) __PYX_ERR(0, 940, __pyx_L1_error)
  __pyx_tuple__132 = PyTuple_Pack(2, Py_None, Py_None); if (unlikely(!__pyx_tuple__132)) __PYX_ERR(0, 940, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__132);
  __Pyx_GIVEREF(__pyx_tuple__132);

  /* "ete4/core/tree.pyx":953
 *         ops.set_outgroup(node, bprops, dist)
 * 
 *     def unroot(self, bprops=None):             # <<<<<<<<<<<<<<
 *         """Unroot the tree, that is, make the root not have 2 children.
 * 
 */
  __pyx_tuple__133 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_bprops); if (unlikely(!__pyx_tuple__133)) __PYX_ERR(0, 953, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__133);
  __Pyx_GIVEREF(__pyx_tuple__133);
  __pyx_codeobj__134 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__133, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ete4_core_tree_pyx, __pyx_n_s_unroot, 953, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__134)) __PYX_ERR(0, 953, __pyx_L1_error)

  /* "ete4/core/tree.pyx":963
 *         ops.unroot(self, bprops)
 * 
 *     def show(self, layout=None, tree_style=None, name="ETE"):             # <<<<<<<<<<<<<<
 *         """Start an interactive session to visualize the current node."""
 *         from ..treeview import drawer
 */
  __pyx_tuple__135 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_layout, __pyx_n_s_tree_style, __pyx_n_s_name, __pyx_n_s_drawer); if (unlikely(!__pyx_tuple__135)) __PYX_ERR(0, 963, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__135);
  __Pyx_GIVEREF(__pyx_tuple__135);
  __pyx_codeobj__136 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__135, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ete4_core_tree_pyx, __pyx_n_s_show, 963, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__136)) __PYX_ERR(0, 963, __pyx_L1_error)
  __pyx_tuple__137 = PyTuple_Pack(3, Py_None, Py_None, __pyx_n_u_ETE); if (unlikely(!__pyx_tuple__137)) __PYX_ERR(0, 963, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__137);
  __Pyx_GIVEREF(__pyx_tuple__137);

  /* "ete4/core/tree.pyx":969
 *                          tree_style=tree_style, win_name=name)
 * 
 *     def render(self, file_name, layout=None, w=None, h=None,             # <<<<<<<<<<<<<<
 *                tree_style=None, units='px', dpi=90):
 *         """Render the tree as an image.
 */
  __pyx_tuple__138 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_file_name, __pyx_n_s_layout, __pyx_n_s_w, __pyx_n_s_h, __pyx_n_s_tree_style, __pyx_n_s_units, __pyx_n_s_dpi, __pyx_n_s_drawer); if (unlikely(!__pyx_tuple__138)) __PYX_ERR(0, 969, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__138);
  __Pyx_GIVEREF(__pyx_tuple__138);
  __pyx_codeobj__139 = (PyObject*)__Pyx_PyCode_New(8, 0, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__138, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ete4_core_tree_pyx, __pyx_n_s_render, 969, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__139)) __PYX_ERR(0, 969, __pyx_L1_error)
  __pyx_tuple__140 = PyTuple_Pack(6, Py_None, Py_None, Py_None, Py_None, __pyx_n_u_px, __pyx_int_90); if (unlikely(!__pyx_tuple__140)) __PYX_ERR(0, 969, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__140);
  __Pyx_GIVEREF(__pyx_tuple__140);

  /* "ete4/core/tree.pyx":1000
 *             print('Wrote file:', file_name)
 * 
 *     def explore(self, name=None, layouts=None,             # <<<<<<<<<<<<<<
 *                 host='127.0.0.1', port=None, verbose=False,
 *                 compress=False, keep_server=False, open_browser=True,
 */
  __pyx_tuple__141 = PyTuple_Pack(11, __pyx_n_s_self, __pyx_n_s_name, __pyx_n_s_layouts, __pyx_n_s_host, __pyx_n_s_port, __pyx_n_s_verbose, __pyx_n_s_compress, __pyx_n_s_keep_server, __pyx_n_s_open_browser, __pyx_n_s_kwargs, __pyx_n_s_explorer); if (unlikely(!__pyx_tuple__141)) __PYX_ERR(0, 1000, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__141);
  __Pyx_GIVEREF(__pyx_tuple__141);
  __pyx_codeobj__142 = (PyObject*)__Pyx_PyCode_New(9, 0, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__141, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ete4_core_tree_pyx, __pyx_n_s_explore, 1000, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__142)) __PYX_ERR(0, 1000, __pyx_L1_error)
  __pyx_tuple__143 = PyTuple_Pack(8, Py_None, Py_None, __pyx_kp_u_127_0_0_1, Py_None, Py_False, Py_False, Py_False, Py_True); if (unlikely(!__pyx_tuple__143)) __PYX_ERR(0, 1000, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__143);
  __Pyx_GIVEREF(__pyx_tuple__143);

  /* "ete4/core/tree.pyx":1018
 *                          **kwargs)
 * 
 *     def render_sm(self, file_name, layouts=None, w=None, h=None):             # <<<<<<<<<<<<<<
 *         """Save an image with the contents of the tree."""
 *         import time
 */
  __pyx_tuple__144 = PyTuple_Pack(17, __pyx_n_s_self, __pyx_n_s_file_name, __pyx_n_s_layouts, __pyx_n_s_w, __pyx_n_s_h, __pyx_n_s_time, __pyx_n_s_explorer, __pyx_n_s_webdriver, __pyx_n_s_Options, __pyx_n_s_warn, __pyx_n_s_name, __pyx_n_s_thread, __pyx_n_s_server, __pyx_n_s_options, __pyx_n_s_driver, __pyx_n_s_host, __pyx_n_s_port); if (unlikely(!__pyx_tuple__144)) __PYX_ERR(0, 1018, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__144);
  __Pyx_GIVEREF(__pyx_tuple__144);
  __pyx_codeobj__145 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 17, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__144, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ete4_core_tree_pyx, __pyx_n_s_render_sm, 1018, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__145)) __PYX_ERR(0, 1018, __pyx_L1_error)

  /* "ete4/core/tree.pyx":1065
 *         explorer.remove_tree(name)
 * 
 *     def copy(self, method="cpickle"):             # <<<<<<<<<<<<<<
 *         """Return a copy of the current node.
 * 
 */
  __pyx_tuple__146 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_method, __pyx_n_s_new_node, __pyx_n_s_parent); if (unlikely(!__pyx_tuple__146)) __PYX_ERR(0, 1065, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__146);
  __Pyx_GIVEREF(__pyx_tuple__146);
  __pyx_codeobj__147 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__146, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ete4_core_tree_pyx, __pyx_n_s_copy, 1065, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__147)) __PYX_ERR(0, 1065, __pyx_L1_error)
  __pyx_tuple__148 = PyTuple_Pack(1, __pyx_n_u_cpickle); if (unlikely(!__pyx_tuple__148)) __PYX_ERR(0, 1065, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__148);
  __Pyx_GIVEREF(__pyx_tuple__148);

  /* "ete4/core/tree.pyx":1110
 *         return new_node
 * 
 *     def ladderize(self, topological=False, reverse=False):             # <<<<<<<<<<<<<<
 *         """Sort branches according to the size of each partition."""
 *         ops.ladderize(self, topological, reverse)
 */
  __pyx_tuple__149 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_topological, __pyx_n_s_reverse); if (unlikely(!__pyx_tuple__149)) __PYX_ERR(0, 1110, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__149);
  __Pyx_GIVEREF(__pyx_tuple__149);
  __pyx_codeobj__150 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__149, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ete4_core_tree_pyx, __pyx_n_s_ladderize, 1110, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__150)) __PYX_ERR(0, 1110, __pyx_L1_error)
  __pyx_tuple__151 = PyTuple_Pack(2, Py_False, Py_False); if (unlikely(!__pyx_tuple__151)) __PYX_ERR(0, 1110, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__151);
  __Pyx_GIVEREF(__pyx_tuple__151);

  /* "ete4/core/tree.pyx":1114
 *         ops.ladderize(self, topological, reverse)
 * 
 *     def sort_descendants(self, prop='name'):             # <<<<<<<<<<<<<<
 *         """Sort branches by leaf node values (names or any other given prop)."""
 *         leaf_values = self.get_cached_content(prop, container_type=list)
 */
  __pyx_tuple__152 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_prop, __pyx_n_s_leaf_values); if (unlikely(!__pyx_tuple__152)) __PYX_ERR(0, 1114, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__152);
  __Pyx_GIVEREF(__pyx_tuple__152);
  __pyx_codeobj__153 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__152, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ete4_core_tree_pyx, __pyx_n_s_sort_descendants, 1114, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__153)) __PYX_ERR(0, 1114, __pyx_L1_error)
  __pyx_tuple__154 = PyTuple_Pack(1, __pyx_n_u_name); if (unlikely(!__pyx_tuple__154)) __PYX_ERR(0, 1114, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__154);
  __Pyx_GIVEREF(__pyx_tuple__154);

  /* "ete4/core/tree.pyx":1119
 *         ops.sort(self, key=lambda node: tuple(sorted(leaf_values[node])))
 * 
 *     def get_cached_content(self, prop=None, container_type=set,             # <<<<<<<<<<<<<<
 *                            leaves_only=True):
 *         """Return dict that assigns to each node a set of its leaves.
 */
  __pyx_tuple__155 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_prop, __pyx_n_s_container_type, __pyx_n_s_leaves_only, __pyx_n_s_get_content, __pyx_n_s_get_content, __pyx_n_s_leaves, __pyx_n_s_node, __pyx_n_s_node_leaves); if (unlikely(!__pyx_tuple__155)) __PYX_ERR(0, 1119, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__155);
  __Pyx_GIVEREF(__pyx_tuple__155);
  __pyx_codeobj__156 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__155, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ete4_core_tree_pyx, __pyx_n_s_get_cached_content, 1119, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__156)) __PYX_ERR(0, 1119, __pyx_L1_error)

  /* "ete4/core/tree.pyx":1158
 *         return leaves
 * 
 *     def robinson_foulds(self, t2, prop_t1='name', prop_t2='name',             # <<<<<<<<<<<<<<
 *                         unrooted_trees=False, expand_polytomies=False,
 *                         polytomy_size_limit=5, skip_large_polytomies=False,
 */
  __pyx_tuple__157 = PyTuple_Pack(66, __pyx_n_s_self, __pyx_n_s_t2, __pyx_n_s_prop_t1, __pyx_n_s_prop_t2, __pyx_n_s_unrooted_trees, __pyx_n_s_expand_polytomies, __pyx_n_s_polytomy_size_limit, __pyx_n_s_skip_large_polytomies, __pyx_n_s_correct_by_polytomy_size, __pyx_n_s_min_support_t1, __pyx_n_s_min_support_t2, __pyx_n_s_origin_t, __pyx_n_s_target_t, __pyx_n_s_has_prop, __pyx_n_s_has_prop, __pyx_n_s_common, __pyx_n_s_size1, __pyx_n_s_size2, __pyx_n_s_origin_trees, __pyx_n_s_target_trees, __pyx_n_s_polytomy_correction, __pyx_n_s_corr1, __pyx_n_s_corr2, __pyx_n_s_from_common, __pyx_n_s_from_common, __pyx_n_s_min_comparison, __pyx_n_s_t1, __pyx_n_s_t1_leaves, __pyx_n_s_t1_leaves_all, __pyx_n_s_edges1, __pyx_n_s_support_t1, __pyx_n_s_t2_leaves, __pyx_n_s_t2_leaves_all, __pyx_n_s_edges2, __pyx_n_s_support_t2, __pyx_n_s_discard_t1, __pyx_n_s_discard_t2, __pyx_n_s_rf, __pyx_n_s_max_parts, __pyx_n_s_n, __pyx_n_s_n, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_nw, __pyx_n_s_nw, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_leaves, __pyx_n_s_leaves, __pyx_n_s_branch, __pyx_n_s_leaves, __pyx_n_s_genexpr, __pyx_n_s_leaves, __pyx_n_s_leaves, __pyx_n_s_branch, __pyx_n_s_leaves, __pyx_n_s_genexpr, __pyx_n_s_p, __pyx_n_s_p, __pyx_n_s_p, __pyx_n_s_p, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__157)) __PYX_ERR(0, 1158, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__157);
  __Pyx_GIVEREF(__pyx_tuple__157);
  __pyx_codeobj__158 = (PyObject*)__Pyx_PyCode_New(11, 0, 0, 66, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__157, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ete4_core_tree_pyx, __pyx_n_s_robinson_foulds, 1158, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__158)) __PYX_ERR(0, 1158, __pyx_L1_error)
  __pyx_tuple__159 = PyTuple_Pack(9, __pyx_n_u_name, __pyx_n_u_name, Py_False, Py_False, __pyx_int_5, Py_False, Py_False, __pyx_float_0_0, __pyx_float_0_0); if (unlikely(!__pyx_tuple__159)) __PYX_ERR(0, 1158, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__159);
  __Pyx_GIVEREF(__pyx_tuple__159);

  /* "ete4/core/tree.pyx":1321
 *         return min_comparison
 * 
 *     def compare(self, ref_tree, use_collateral=False, min_support_source=0.0, min_support_ref=0.0,             # <<<<<<<<<<<<<<
 *                 has_duplications=False, expand_polytomies=False, unrooted=False,
 *                 max_treeko_splits_to_be_artifact=1000, ref_tree_attr='name', source_tree_attr='name'):
 */
  __pyx_tuple__160 = PyTuple_Pack(48, __pyx_n_s_self, __pyx_n_s_ref_tree, __pyx_n_s_use_collateral, __pyx_n_s_min_support_source, __pyx_n_s_min_support_ref, __pyx_n_s_has_duplications, __pyx_n_s_expand_polytomies, __pyx_n_s_unrooted, __pyx_n_s_max_treeko_splits_to_be_artifact, __pyx_n_s_ref_tree_attr, __pyx_n_s_source_tree_attr, __pyx_n_s_source_tree, __pyx_n_s_safe_div, __pyx_n_s_safe_div, __pyx_n_s_compare, __pyx_n_s_compare, __pyx_n_s_total_valid_ref_edges, __pyx_n_s_result, __pyx_n_s_orig_target_size, __pyx_n_s_ntrees, __pyx_n_s_ndups, __pyx_n_s_sp_trees, __pyx_n_s_all_rf, __pyx_n_s_ref_found, __pyx_n_s_src_found, __pyx_n_s_tree_sizes, __pyx_n_s_all_max_rf, __pyx_n_s_common_names, __pyx_n_s_subtree_nw, __pyx_n_s_subtree, __pyx_n_s_subtree_content, __pyx_n_s_n, __pyx_n_s_total_rf, __pyx_n_s_max_rf, __pyx_n_s_ncommon, __pyx_n_s_valid_ref_edges, __pyx_n_s_valid_src_edges, __pyx_n_s_common_edges, __pyx_n_s_ref_found_in_src, __pyx_n_s_src_found_in_ref, __pyx_n_s_alld, __pyx_n_s_a, __pyx_n_s_b, __pyx_n_s_treeko_d, __pyx_n_s_n, __pyx_n_s_i, __pyx_n_s_i, __pyx_n_s_i); if (unlikely(!__pyx_tuple__160)) __PYX_ERR(0, 1321, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__160);
  __Pyx_GIVEREF(__pyx_tuple__160);
  __pyx_codeobj__161 = (PyObject*)__Pyx_PyCode_New(11, 0, 0, 48, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__160, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ete4_core_tree_pyx, __pyx_n_s_compare_2, 1321, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__161)) __PYX_ERR(0, 1321, __pyx_L1_error)
  __pyx_tuple__162 = PyTuple_Pack(9, Py_False, __pyx_float_0_0, __pyx_float_0_0, Py_False, Py_False, Py_False, __pyx_int_1000, __pyx_n_u_name, __pyx_n_u_name); if (unlikely(!__pyx_tuple__162)) __PYX_ERR(0, 1321, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__162);
  __Pyx_GIVEREF(__pyx_tuple__162);

  /* "ete4/core/tree.pyx":1482
 *         return result
 * 
 *     def _diff(self, t2, output='topology', prop_t1='name', prop_t2='name', color=True):             # <<<<<<<<<<<<<<
 *         """Return the difference between two tree topologies.
 * 
 */
  __pyx_tuple__163 = PyTuple_Pack(11, __pyx_n_s_self, __pyx_n_s_t2, __pyx_n_s_output, __pyx_n_s_prop_t1, __pyx_n_s_prop_t2, __pyx_n_s_color, __pyx_n_s_ete_diff, __pyx_n_s_difftable, __pyx_n_s_rf, __pyx_n_s_rf_max, __pyx_n_s__121); if (unlikely(!__pyx_tuple__163)) __PYX_ERR(0, 1482, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__163);
  __Pyx_GIVEREF(__pyx_tuple__163);
  __pyx_codeobj__164 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__163, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ete4_core_tree_pyx, __pyx_n_s_diff, 1482, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__164)) __PYX_ERR(0, 1482, __pyx_L1_error)
  __pyx_tuple__165 = PyTuple_Pack(4, __pyx_n_u_topology, __pyx_n_u_name, __pyx_n_u_name, Py_True); if (unlikely(!__pyx_tuple__165)) __PYX_ERR(0, 1482, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__165);
  __Pyx_GIVEREF(__pyx_tuple__165);

  /* "ete4/core/tree.pyx":1506
 *             raise TreeError(f'Unknown output for diff: {output}')
 * 
 *     def edges(self, cached_content=None):             # <<<<<<<<<<<<<<
 *         """Yield a pair of sets of leafs for every partition of the tree.
 * 
 */
  __pyx_tuple__166 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_cached_content, __pyx_n_s_all_leaves, __pyx_n_s_leaves_descendant); if (unlikely(!__pyx_tuple__166)) __PYX_ERR(0, 1506, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__166);
  __Pyx_GIVEREF(__pyx_tuple__166);
  __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__166, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ete4_core_tree_pyx, __pyx_n_s_edges, 1506, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 1506, __pyx_L1_error)

  /* "ete4/core/tree.pyx":1524
 *             yield (leaves_descendant, all_leaves - leaves_descendant)
 * 
 *     def standardize(self, delete_orphan=True, preserve_branch_length=True):             # <<<<<<<<<<<<<<
 *         """Resolve multifurcations and remove single-child nodes.
 * 
 */
  __pyx_tuple__167 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_delete_orphan, __pyx_n_s_preserve_branch_length, __pyx_n_s_n); if (unlikely(!__pyx_tuple__167)) __PYX_ERR(0, 1524, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__167);
  __Pyx_GIVEREF(__pyx_tuple__167);
  __pyx_codeobj__168 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__167, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ete4_core_tree_pyx, __pyx_n_s_standardize, 1524, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__168)) __PYX_ERR(0, 1524, __pyx_L1_error)
  __pyx_tuple__169 = PyTuple_Pack(2, Py_True, Py_True); if (unlikely(!__pyx_tuple__169)) __PYX_ERR(0, 1524, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__169);
  __Pyx_GIVEREF(__pyx_tuple__169);

  /* "ete4/core/tree.pyx":1538
 *                          preserve_branch_length=preserve_branch_length)
 * 
 *     def get_topology_id(self, prop='name'):             # <<<<<<<<<<<<<<
 *         """Return a unique ID representing the topology of the tree.
 * 
 */
  __pyx_tuple__170 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_prop, __pyx_n_s_edge_keys, __pyx_n_s_s1, __pyx_n_s_s2, __pyx_n_s_k1, __pyx_n_s_k2, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__170)) __PYX_ERR(0, 1538, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__170);
  __Pyx_GIVEREF(__pyx_tuple__170);
  __pyx_codeobj__171 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__170, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ete4_core_tree_pyx, __pyx_n_s_get_topology_id, 1538, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__171)) __PYX_ERR(0, 1538, __pyx_L1_error)

  /* "ete4/core/tree.pyx":1561
 *         return md5(str(sorted(edge_keys)).encode('utf-8')).hexdigest()
 * 
 *     def to_ultrametric(self, topological=False):             # <<<<<<<<<<<<<<
 *         """Convert tree to ultrametric (all leaves equidistant from root)."""
 *         ops.to_ultrametric(self, topological)
 */
  __pyx_tuple__172 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_topological); if (unlikely(!__pyx_tuple__172)) __PYX_ERR(0, 1561, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__172);
  __Pyx_GIVEREF(__pyx_tuple__172);
  __pyx_codeobj__173 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__172, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ete4_core_tree_pyx, __pyx_n_s_to_ultrametric, 1561, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__173)) __PYX_ERR(0, 1561, __pyx_L1_error)

  /* "ete4/core/tree.pyx":1565
 *         ops.to_ultrametric(self, topological)
 * 
 *     def is_monophyletic(self, nodes):             # <<<<<<<<<<<<<<
 *         """Return True if the nodes form a monophyletic group."""
 *         nodes = set(nodes)  # in case it is not a set already
 */
  __pyx_tuple__174 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_nodes, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__174)) __PYX_ERR(0, 1565, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__174);
  __Pyx_GIVEREF(__pyx_tuple__174);
  __pyx_codeobj__175 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__174, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ete4_core_tree_pyx, __pyx_n_s_is_monophyletic, 1565, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__175)) __PYX_ERR(0, 1565, __pyx_L1_error)

  /* "ete4/core/tree.pyx":1570
 *         return all(n in nodes for n in self.common_ancestor(nodes).leaves())
 * 
 *     def check_monophyly(self, values, prop='name', unrooted=False):             # <<<<<<<<<<<<<<
 *         """Return tuple (is_monophyletic, clade_type, leaves_extra).
 * 
 */
  __pyx_tuple__176 = PyTuple_Pack(13, __pyx_n_s_self, __pyx_n_s_values, __pyx_n_s_prop, __pyx_n_s_unrooted, __pyx_n_s_nodes, __pyx_n_s_leaves_from_ancestor, __pyx_n_s_leaves_extra, __pyx_n_s_smallest, __pyx_n_s_side1, __pyx_n_s_side2, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__176)) __PYX_ERR(0, 1570, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__176);
  __Pyx_GIVEREF(__pyx_tuple__176);
  __pyx_codeobj__177 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__176, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ete4_core_tree_pyx, __pyx_n_s_check_monophyly, 1570, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__177)) __PYX_ERR(0, 1570, __pyx_L1_error)
  __pyx_tuple__178 = PyTuple_Pack(2, __pyx_n_u_name, Py_False); if (unlikely(!__pyx_tuple__178)) __PYX_ERR(0, 1570, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__178);
  __Pyx_GIVEREF(__pyx_tuple__178);

  /* "ete4/core/tree.pyx":1607
 *             return False, 'polyphyletic', leaves_extra
 * 
 *     def get_monophyletic(self, values, prop='name'):             # <<<<<<<<<<<<<<
 *         """Yield nodes matching the provided monophyly criteria.
 * 
 */
  __pyx_tuple__179 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_values, __pyx_n_s_prop, __pyx_n_s_n2values, __pyx_n_s_is_monophyletic); if (unlikely(!__pyx_tuple__179)) __PYX_ERR(0, 1607, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__179);
  __Pyx_GIVEREF(__pyx_tuple__179);
  __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__179, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ete4_core_tree_pyx, __pyx_n_s_get_monophyletic, 1607, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 1607, __pyx_L1_error)

  /* "ete4/core/tree.pyx":1625
 *         yield from self.leaves(is_leaf_fn=is_monophyletic)
 * 
 *     def expand_polytomies(self, map_prop="name", polytomy_size_limit=5,             # <<<<<<<<<<<<<<
 *                           skip_large_polytomies=False):
 *         """Return all combinations of solutions of the multifurcated nodes.
 */
  __pyx_tuple__180 = PyTuple_Pack(17, __pyx_n_s_self, __pyx_n_s_map_prop, __pyx_n_s_polytomy_size_limit, __pyx_n_s_skip_large_polytomies, __pyx_n_s_TipTuple, __pyx_n_s_add_leaf, __pyx_n_s_add_leaf, __pyx_n_s_enum_unordered, __pyx_n_s_enum_unordered, __pyx_n_s_n2subtrees, __pyx_n_s_n, __pyx_n_s_subtrees, __pyx_n_s_childtrees, __pyx_n_s_ch, __pyx_n_s_ch, __pyx_n_s_subtree, __pyx_n_s_nw); if (unlikely(!__pyx_tuple__180)) __PYX_ERR(0, 1625, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__180);
  __Pyx_GIVEREF(__pyx_tuple__180);
  __pyx_codeobj__181 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 17, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__180, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ete4_core_tree_pyx, __pyx_n_s_expand_polytomies, 1625, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__181)) __PYX_ERR(0, 1625, __pyx_L1_error)
  __pyx_tuple__182 = PyTuple_Pack(3, __pyx_n_u_name, __pyx_int_5, Py_False); if (unlikely(!__pyx_tuple__182)) __PYX_ERR(0, 1625, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__182);
  __Pyx_GIVEREF(__pyx_tuple__182);

  /* "ete4/core/tree.pyx":1683
 *         return ["%s;"%str(nw) for nw in n2subtrees[self]] # tuples are in newick format ^_^
 * 
 *     def resolve_polytomy(self, descendants=True):             # <<<<<<<<<<<<<<
 *         """Convert node to a series of dicotomies if it is a polytomy.
 * 
 */
  __pyx_tuple__183 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_descendants); if (unlikely(!__pyx_tuple__183)) __PYX_ERR(0, 1683, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__183);
  __Pyx_GIVEREF(__pyx_tuple__183);
  __pyx_codeobj__184 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__183, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ete4_core_tree_pyx, __pyx_n_s_resolve_polytomy, 1683, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__184)) __PYX_ERR(0, 1683, __pyx_L1_error)
  __pyx_tuple__185 = PyTuple_Pack(1, Py_True); if (unlikely(!__pyx_tuple__185)) __PYX_ERR(0, 1683, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__185);
  __Pyx_GIVEREF(__pyx_tuple__185);

  /* "ete4/core/tree.pyx":1696
 *         ops.resolve_polytomy(self, descendants)
 * 
 *     def cophenetic_matrix(self):             # <<<<<<<<<<<<<<
 *         """Return a cophenetic distance matrix of the tree.
 * 
 */
  __pyx_tuple__186 = PyTuple_Pack(18, __pyx_n_s_self, __pyx_n_s_leaves, __pyx_n_s_paths, __pyx_n_s_n, __pyx_n_s_movingnode, __pyx_n_s_leaf_distances, __pyx_n_s_leaf1, __pyx_n_s_leaf2, __pyx_n_s_uniquenodes, __pyx_n_s_distance, __pyx_n_s_allleaves, __pyx_n_s_output, __pyx_n_s_i, __pyx_n_s_m, __pyx_n_s_x, __pyx_n_s_x, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__186)) __PYX_ERR(0, 1696, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__186);
  __Pyx_GIVEREF(__pyx_tuple__186);
  __pyx_codeobj__187 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 18, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__186, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ete4_core_tree_pyx, __pyx_n_s_cophenetic_matrix, 1696, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__187)) __PYX_ERR(0, 1696, __pyx_L1_error)

  /* "ete4/core/tree.pyx":1797
 *     # TODO: The next two functions should really be parsers (which may
 *     # be also used when calling __init__().
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_parent_child_table(parent_child_table):
 *         """Convert a parent-child table into an ETE Tree instance.
 */
  __pyx_tuple__188 = PyTuple_Pack(11, __pyx_n_s_parent_child_table, __pyx_n_s_get_node, __pyx_n_s_get_node, __pyx_n_s_nodes_by_name, __pyx_n_s_columns, __pyx_n_s_parent_name, __pyx_n_s_child_name, __pyx_n_s_distance, __pyx_n_s_dist, __pyx_n_s_parent, __pyx_n_s_root); if (unlikely(!__pyx_tuple__188)) __PYX_ERR(0, 1797, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__188);
  __Pyx_GIVEREF(__pyx_tuple__188);
  __pyx_codeobj__189 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__188, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ete4_core_tree_pyx, __pyx_n_s_from_parent_child_table, 1797, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__189)) __PYX_ERR(0, 1797, __pyx_L1_error)

  /* "ete4/core/tree.pyx":1845
 *         return root
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_skbio(skbio_tree, map_attributes=None):
 *         """Convert a scikit-bio TreeNode object into ETE Tree object.
 */
  __pyx_tuple__190 = PyTuple_Pack(10, __pyx_n_s_skbio_tree, __pyx_n_s_map_attributes, __pyx_n_s_skbioTreeNode, __pyx_n_s_get_ete_node, __pyx_n_s_get_ete_node, __pyx_n_s_all_nodes, __pyx_n_s_node, __pyx_n_s_ete_node, __pyx_n_s_ch, __pyx_n_s_ete_ch); if (unlikely(!__pyx_tuple__190)) __PYX_ERR(0, 1845, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__190);
  __Pyx_GIVEREF(__pyx_tuple__190);
  __pyx_codeobj__191 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__190, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ete4_core_tree_pyx, __pyx_n_s_from_skbio, 1845, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__191)) __PYX_ERR(0, 1845, __pyx_L1_error)

  /* "ete4/core/tree.pyx":1884
 *     # Functions used for treeview (qt visualization).
 * 
 *     def add_face(self, face, column, position='branch-right'):             # <<<<<<<<<<<<<<
 *         from ..treeview import Face, FaceContainer
 *         from ..treeview.main import _FaceAreas, FACE_POSITIONS
 */
  __pyx_tuple__192 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_face, __pyx_n_s_column, __pyx_n_s_position, __pyx_n_s_Face, __pyx_n_s_FaceContainer, __pyx_n_s_FaceAreas, __pyx_n_s_FACE_POSITIONS, __pyx_n_s_face_area, __pyx_n_s_e); if (unlikely(!__pyx_tuple__192)) __PYX_ERR(0, 1884, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__192);
  __Pyx_GIVEREF(__pyx_tuple__192);
  __pyx_codeobj__193 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__192, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ete4_core_tree_pyx, __pyx_n_s_add_face, 1884, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__193)) __PYX_ERR(0, 1884, __pyx_L1_error)
  __pyx_tuple__194 = PyTuple_Pack(1, __pyx_kp_u_branch_right); if (unlikely(!__pyx_tuple__194)) __PYX_ERR(0, 1884, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__194);
  __Pyx_GIVEREF(__pyx_tuple__194);

  /* "ete4/core/tree.pyx":1914
 *         self.props['_img_style'] = value
 * 
 *     def set_style(self, value):             # <<<<<<<<<<<<<<
 *         self.props['_img_style'] = value
 */
  __pyx_tuple__195 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_value); if (unlikely(!__pyx_tuple__195)) __PYX_ERR(0, 1914, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__195);
  __Pyx_GIVEREF(__pyx_tuple__195);
  __pyx_codeobj__196 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__195, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ete4_core_tree_pyx, __pyx_n_s_set_style, 1914, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__196)) __PYX_ERR(0, 1914, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */
  __pyx_tuple__197 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_state, __pyx_n_s_dict_2, __pyx_n_s_use_setstate); if (unlikely(!__pyx_tuple__197)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__197);
  __Pyx_GIVEREF(__pyx_tuple__197);
  __pyx_codeobj__198 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__197, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__198)) __PYX_ERR(1, 1, __pyx_L1_error)

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_Tree, (type(self), 0x9050475, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_Tree__set_state(self, __pyx_state)
 */
  __pyx_tuple__199 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__199)) __PYX_ERR(1, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__199);
  __Pyx_GIVEREF(__pyx_tuple__199);
  __pyx_codeobj__200 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__199, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__200)) __PYX_ERR(1, 16, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __pyx_unpickle_Tree(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */
  __pyx_tuple__201 = 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__201)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__201);
  __Pyx_GIVEREF(__pyx_tuple__201);
  __pyx_codeobj__202 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__201, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Tree, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__202)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}
/* #### Code section: init_constants ### */

static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) {
  __pyx_umethod_PyDict_Type_get.type = (PyObject*)&PyDict_Type;
  __pyx_umethod_PyDict_Type_get.method_name = &__pyx_n_s_get;
  __pyx_umethod_PyDict_Type_keys.type = (PyObject*)&PyDict_Type;
  __pyx_umethod_PyDict_Type_keys.method_name = &__pyx_n_s_keys;
  __pyx_umethod_PyDict_Type_pop.type = (PyObject*)&PyDict_Type;
  __pyx_umethod_PyDict_Type_pop.method_name = &__pyx_n_s_pop;
  __pyx_umethod_PyDict_Type_setdefault.type = (PyObject*)&PyDict_Type;
  __pyx_umethod_PyDict_Type_setdefault.method_name = &__pyx_n_s_setdefault;
  __pyx_umethod_PyDict_Type_update.type = (PyObject*)&PyDict_Type;
  __pyx_umethod_PyDict_Type_update.method_name = &__pyx_n_s_update;
  __pyx_umethod_PyList_Type_pop.type = (PyObject*)&PyList_Type;
  __pyx_umethod_PyList_Type_pop.method_name = &__pyx_n_s_pop;
  __pyx_umethod_PySet_Type_issubset.type = (PyObject*)&PySet_Type;
  __pyx_umethod_PySet_Type_issubset.method_name = &__pyx_n_s_issubset;
  if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  __pyx_float_0_0 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_float_0_0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_float_1_0 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_float_1_0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_90 = PyInt_FromLong(90); if (unlikely(!__pyx_int_90)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_1000 = PyInt_FromLong(1000); if (unlikely(!__pyx_int_1000)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_27868033 = PyInt_FromLong(27868033L); if (unlikely(!__pyx_int_27868033)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_43033374 = PyInt_FromLong(43033374L); if (unlikely(!__pyx_int_43033374)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_151323765 = PyInt_FromLong(151323765L); if (unlikely(!__pyx_int_151323765)) __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;
}
/* #### Code section: init_globals ### */

static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
  /* AssertionsEnabled.init */
  if (likely(__Pyx_init_assertions_enabled() == 0)); else

if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)

  return 0;
  __pyx_L1_error:;
  return -1;
}
/* #### Code section: init_module ### */

static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/

static int __Pyx_modinit_global_init_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
  /*--- Global init code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_variable_export_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
  /*--- Variable export code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_function_export_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
  /*--- Function export code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_type_init_code(void) {
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
  /*--- Type init code ---*/
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_4ete4_4core_4tree_Tree = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4ete4_4core_4tree_Tree_spec, NULL); if (unlikely(!__pyx_ptype_4ete4_4core_4tree_Tree)) __PYX_ERR(0, 30, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4ete4_4core_4tree_Tree_spec, __pyx_ptype_4ete4_4core_4tree_Tree) < 0) __PYX_ERR(0, 30, __pyx_L1_error)
  #else
  __pyx_ptype_4ete4_4core_4tree_Tree = &__pyx_type_4ete4_4core_4tree_Tree;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_4ete4_4core_4tree_Tree) < 0) __PYX_ERR(0, 30, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_4ete4_4core_4tree_Tree->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4ete4_4core_4tree_Tree->tp_dictoffset && __pyx_ptype_4ete4_4core_4tree_Tree->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_4ete4_4core_4tree_Tree->tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_UPDATE_DESCRIPTOR_DOC
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 30, __pyx_L1_error)
    if (__Pyx_IS_TYPE(wrapper, &PyWrapperDescr_Type)) {
      __pyx_wrapperbase_4ete4_4core_4tree_4Tree___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_4ete4_4core_4tree_4Tree___init__.doc = __pyx_doc_4ete4_4core_4tree_4Tree___init__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_4ete4_4core_4tree_4Tree___init__;
    }
  }
  #endif
  #if CYTHON_UPDATE_DESCRIPTOR_DOC
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree, "__len__"); if (unlikely(!wrapper)) __PYX_ERR(0, 30, __pyx_L1_error)
    if (__Pyx_IS_TYPE(wrapper, &PyWrapperDescr_Type)) {
      __pyx_wrapperbase_4ete4_4core_4tree_4Tree_6__len__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_4ete4_4core_4tree_4Tree_6__len__.doc = __pyx_doc_4ete4_4core_4tree_4Tree_6__len__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_4ete4_4core_4tree_4Tree_6__len__;
    }
  }
  #endif
  #if CYTHON_UPDATE_DESCRIPTOR_DOC
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree, "__getitem__"); if (unlikely(!wrapper)) __PYX_ERR(0, 30, __pyx_L1_error)
    if (__Pyx_IS_TYPE(wrapper, &PyWrapperDescr_Type)) {
      __pyx_wrapperbase_4ete4_4core_4tree_4Tree_8__getitem__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_4ete4_4core_4tree_4Tree_8__getitem__.doc = __pyx_doc_4ete4_4core_4tree_4Tree_8__getitem__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_4ete4_4core_4tree_4Tree_8__getitem__;
    }
  }
  #endif
  #if CYTHON_UPDATE_DESCRIPTOR_DOC
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree, "__add__"); if (unlikely(!wrapper)) __PYX_ERR(0, 30, __pyx_L1_error)
    if (__Pyx_IS_TYPE(wrapper, &PyWrapperDescr_Type)) {
      __pyx_wrapperbase_4ete4_4core_4tree_4Tree_10__add__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_4ete4_4core_4tree_4Tree_10__add__.doc = __pyx_doc_4ete4_4core_4tree_4Tree_10__add__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_4ete4_4core_4tree_4Tree_10__add__;
    }
  }
  #endif
  #if CYTHON_UPDATE_DESCRIPTOR_DOC
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree, "__str__"); if (unlikely(!wrapper)) __PYX_ERR(0, 30, __pyx_L1_error)
    if (__Pyx_IS_TYPE(wrapper, &PyWrapperDescr_Type)) {
      __pyx_wrapperbase_4ete4_4core_4tree_4Tree_14__str__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_4ete4_4core_4tree_4Tree_14__str__.doc = __pyx_doc_4ete4_4core_4tree_4Tree_14__str__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_4ete4_4core_4tree_4Tree_14__str__;
    }
  }
  #endif
  #if CYTHON_UPDATE_DESCRIPTOR_DOC
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree, "__contains__"); if (unlikely(!wrapper)) __PYX_ERR(0, 30, __pyx_L1_error)
    if (__Pyx_IS_TYPE(wrapper, &PyWrapperDescr_Type)) {
      __pyx_wrapperbase_4ete4_4core_4tree_4Tree_18__contains__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_4ete4_4core_4tree_4Tree_18__contains__.doc = __pyx_doc_4ete4_4core_4tree_4Tree_18__contains__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_4ete4_4core_4tree_4Tree_18__contains__;
    }
  }
  #endif
  #if CYTHON_UPDATE_DESCRIPTOR_DOC
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree, "__iter__"); if (unlikely(!wrapper)) __PYX_ERR(0, 30, __pyx_L1_error)
    if (__Pyx_IS_TYPE(wrapper, &PyWrapperDescr_Type)) {
      __pyx_wrapperbase_4ete4_4core_4tree_4Tree_20__iter__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_4ete4_4core_4tree_4Tree_20__iter__.doc = __pyx_doc_4ete4_4core_4tree_4Tree_20__iter__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_4ete4_4core_4tree_4Tree_20__iter__;
    }
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Tree_2, (PyObject *) __pyx_ptype_4ete4_4core_4tree_Tree) < 0) __PYX_ERR(0, 30, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_4ete4_4core_4tree_Tree) < 0) __PYX_ERR(0, 30, __pyx_L1_error)
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct__genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4ete4_4core_4tree___pyx_scope_struct__genexpr_spec, NULL); if (unlikely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct__genexpr)) __PYX_ERR(0, 192, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4ete4_4core_4tree___pyx_scope_struct__genexpr_spec, __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct__genexpr) < 0) __PYX_ERR(0, 192, __pyx_L1_error)
  #else
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct__genexpr = &__pyx_type_4ete4_4core_4tree___pyx_scope_struct__genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct__genexpr) < 0) __PYX_ERR(0, 192, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct__genexpr->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct__genexpr->tp_dictoffset && __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct__genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct__genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_1___getitem__ = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_1___getitem___spec, NULL); if (unlikely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_1___getitem__)) __PYX_ERR(0, 194, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4ete4_4core_4tree___pyx_scope_struct_1___getitem___spec, __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_1___getitem__) < 0) __PYX_ERR(0, 194, __pyx_L1_error)
  #else
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_1___getitem__ = &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_1___getitem__;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_1___getitem__) < 0) __PYX_ERR(0, 194, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_1___getitem__->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_1___getitem__->tp_dictoffset && __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_1___getitem__->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_1___getitem__->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_2_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_2_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_2_genexpr)) __PYX_ERR(0, 198, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4ete4_4core_4tree___pyx_scope_struct_2_genexpr_spec, __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_2_genexpr) < 0) __PYX_ERR(0, 198, __pyx_L1_error)
  #else
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_2_genexpr = &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_2_genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_2_genexpr) < 0) __PYX_ERR(0, 198, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_2_genexpr->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_2_genexpr->tp_dictoffset && __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_2_genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_2_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_3___contains__ = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_3___contains___spec, NULL); if (unlikely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_3___contains__)) __PYX_ERR(0, 244, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4ete4_4core_4tree___pyx_scope_struct_3___contains___spec, __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_3___contains__) < 0) __PYX_ERR(0, 244, __pyx_L1_error)
  #else
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_3___contains__ = &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_3___contains__;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_3___contains__) < 0) __PYX_ERR(0, 244, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_3___contains__->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_3___contains__->tp_dictoffset && __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_3___contains__->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_3___contains__->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_4_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_4_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_4_genexpr)) __PYX_ERR(0, 252, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4ete4_4core_4tree___pyx_scope_struct_4_genexpr_spec, __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_4_genexpr) < 0) __PYX_ERR(0, 252, __pyx_L1_error)
  #else
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_4_genexpr = &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_4_genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_4_genexpr) < 0) __PYX_ERR(0, 252, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_4_genexpr->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_4_genexpr->tp_dictoffset && __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_4_genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_4_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_5___iter__ = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_5___iter___spec, NULL); if (unlikely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_5___iter__)) __PYX_ERR(0, 256, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4ete4_4core_4tree___pyx_scope_struct_5___iter___spec, __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_5___iter__) < 0) __PYX_ERR(0, 256, __pyx_L1_error)
  #else
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_5___iter__ = &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_5___iter__;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_5___iter__) < 0) __PYX_ERR(0, 256, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_5___iter__->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_5___iter__->tp_dictoffset && __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_5___iter__->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_5___iter__->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_6_remove_child = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_6_remove_child_spec, NULL); if (unlikely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_6_remove_child)) __PYX_ERR(0, 319, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4ete4_4core_4tree___pyx_scope_struct_6_remove_child_spec, __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_6_remove_child) < 0) __PYX_ERR(0, 319, __pyx_L1_error)
  #else
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_6_remove_child = &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_6_remove_child;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_6_remove_child) < 0) __PYX_ERR(0, 319, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_6_remove_child->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_6_remove_child->tp_dictoffset && __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_6_remove_child->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_6_remove_child->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_7_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_7_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_7_genexpr)) __PYX_ERR(0, 327, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4ete4_4core_4tree___pyx_scope_struct_7_genexpr_spec, __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_7_genexpr) < 0) __PYX_ERR(0, 327, __pyx_L1_error)
  #else
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_7_genexpr = &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_7_genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_7_genexpr) < 0) __PYX_ERR(0, 327, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_7_genexpr->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_7_genexpr->tp_dictoffset && __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_7_genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_7_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_8_prune = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_8_prune_spec, NULL); if (unlikely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_8_prune)) __PYX_ERR(0, 429, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4ete4_4core_4tree___pyx_scope_struct_8_prune_spec, __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_8_prune) < 0) __PYX_ERR(0, 429, __pyx_L1_error)
  #else
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_8_prune = &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_8_prune;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_8_prune) < 0) __PYX_ERR(0, 429, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_8_prune->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_8_prune->tp_dictoffset && __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_8_prune->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_8_prune->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_9_leaves = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_9_leaves_spec, NULL); if (unlikely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_9_leaves)) __PYX_ERR(0, 563, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4ete4_4core_4tree___pyx_scope_struct_9_leaves_spec, __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_9_leaves) < 0) __PYX_ERR(0, 563, __pyx_L1_error)
  #else
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_9_leaves = &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_9_leaves;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_9_leaves) < 0) __PYX_ERR(0, 563, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_9_leaves->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_9_leaves->tp_dictoffset && __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_9_leaves->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_9_leaves->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_10_leaf_names = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_10_leaf_names_spec, NULL); if (unlikely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_10_leaf_names)) __PYX_ERR(0, 570, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4ete4_4core_4tree___pyx_scope_struct_10_leaf_names_spec, __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_10_leaf_names) < 0) __PYX_ERR(0, 570, __pyx_L1_error)
  #else
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_10_leaf_names = &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_10_leaf_names;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_10_leaf_names) < 0) __PYX_ERR(0, 570, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_10_leaf_names->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_10_leaf_names->tp_dictoffset && __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_10_leaf_names->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_10_leaf_names->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_11_descendants = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_11_descendants_spec, NULL); if (unlikely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_11_descendants)) __PYX_ERR(0, 575, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4ete4_4core_4tree___pyx_scope_struct_11_descendants_spec, __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_11_descendants) < 0) __PYX_ERR(0, 575, __pyx_L1_error)
  #else
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_11_descendants = &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_11_descendants;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_11_descendants) < 0) __PYX_ERR(0, 575, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_11_descendants->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_11_descendants->tp_dictoffset && __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_11_descendants->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_11_descendants->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_12_traverse = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_12_traverse_spec, NULL); if (unlikely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_12_traverse)) __PYX_ERR(0, 581, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4ete4_4core_4tree___pyx_scope_struct_12_traverse_spec, __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_12_traverse) < 0) __PYX_ERR(0, 581, __pyx_L1_error)
  #else
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_12_traverse = &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_12_traverse;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_12_traverse) < 0) __PYX_ERR(0, 581, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_12_traverse->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_12_traverse->tp_dictoffset && __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_12_traverse->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_12_traverse->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_13_iter_prepostorder = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_13_iter_prepostorder_spec, NULL); if (unlikely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_13_iter_prepostorder)) __PYX_ERR(0, 606, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4ete4_4core_4tree___pyx_scope_struct_13_iter_prepostorder_spec, __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_13_iter_prepostorder) < 0) __PYX_ERR(0, 606, __pyx_L1_error)
  #else
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_13_iter_prepostorder = &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_13_iter_prepostorder;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_13_iter_prepostorder) < 0) __PYX_ERR(0, 606, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_13_iter_prepostorder->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_13_iter_prepostorder->tp_dictoffset && __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_13_iter_prepostorder->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_13_iter_prepostorder->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_14_ancestors = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_14_ancestors_spec, NULL); if (unlikely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_14_ancestors)) __PYX_ERR(0, 621, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4ete4_4core_4tree___pyx_scope_struct_14_ancestors_spec, __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_14_ancestors) < 0) __PYX_ERR(0, 621, __pyx_L1_error)
  #else
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_14_ancestors = &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_14_ancestors;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_14_ancestors) < 0) __PYX_ERR(0, 621, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_14_ancestors->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_14_ancestors->tp_dictoffset && __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_14_ancestors->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_14_ancestors->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_15_lineage = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_15_lineage_spec, NULL); if (unlikely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_15_lineage)) __PYX_ERR(0, 636, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4ete4_4core_4tree___pyx_scope_struct_15_lineage_spec, __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_15_lineage) < 0) __PYX_ERR(0, 636, __pyx_L1_error)
  #else
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_15_lineage = &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_15_lineage;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_15_lineage) < 0) __PYX_ERR(0, 636, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_15_lineage->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_15_lineage->tp_dictoffset && __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_15_lineage->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_15_lineage->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_16_search_nodes = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_16_search_nodes_spec, NULL); if (unlikely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_16_search_nodes)) __PYX_ERR(0, 728, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4ete4_4core_4tree___pyx_scope_struct_16_search_nodes_spec, __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_16_search_nodes) < 0) __PYX_ERR(0, 728, __pyx_L1_error)
  #else
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_16_search_nodes = &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_16_search_nodes;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_16_search_nodes) < 0) __PYX_ERR(0, 728, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_16_search_nodes->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_16_search_nodes->tp_dictoffset && __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_16_search_nodes->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_16_search_nodes->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_17_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_17_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_17_genexpr)) __PYX_ERR(0, 737, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4ete4_4core_4tree___pyx_scope_struct_17_genexpr_spec, __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_17_genexpr) < 0) __PYX_ERR(0, 737, __pyx_L1_error)
  #else
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_17_genexpr = &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_17_genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_17_genexpr) < 0) __PYX_ERR(0, 737, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_17_genexpr->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_17_genexpr->tp_dictoffset && __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_17_genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_17_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_18_search_descendants = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_18_search_descendants_spec, NULL); if (unlikely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_18_search_descendants)) __PYX_ERR(0, 740, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4ete4_4core_4tree___pyx_scope_struct_18_search_descendants_spec, __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_18_search_descendants) < 0) __PYX_ERR(0, 740, __pyx_L1_error)
  #else
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_18_search_descendants = &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_18_search_descendants;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_18_search_descendants) < 0) __PYX_ERR(0, 740, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_18_search_descendants->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_18_search_descendants->tp_dictoffset && __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_18_search_descendants->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_18_search_descendants->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_19_search_ancestors = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_19_search_ancestors_spec, NULL); if (unlikely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_19_search_ancestors)) __PYX_ERR(0, 746, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4ete4_4core_4tree___pyx_scope_struct_19_search_ancestors_spec, __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_19_search_ancestors) < 0) __PYX_ERR(0, 746, __pyx_L1_error)
  #else
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_19_search_ancestors = &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_19_search_ancestors;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_19_search_ancestors) < 0) __PYX_ERR(0, 746, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_19_search_ancestors->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_19_search_ancestors->tp_dictoffset && __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_19_search_ancestors->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_19_search_ancestors->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_20_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_20_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_20_genexpr)) __PYX_ERR(0, 749, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4ete4_4core_4tree___pyx_scope_struct_20_genexpr_spec, __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_20_genexpr) < 0) __PYX_ERR(0, 749, __pyx_L1_error)
  #else
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_20_genexpr = &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_20_genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_20_genexpr) < 0) __PYX_ERR(0, 749, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_20_genexpr->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_20_genexpr->tp_dictoffset && __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_20_genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_20_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_21_get_distance = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_21_get_distance_spec, NULL); if (unlikely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_21_get_distance)) __PYX_ERR(0, 760, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4ete4_4core_4tree___pyx_scope_struct_21_get_distance_spec, __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_21_get_distance) < 0) __PYX_ERR(0, 760, __pyx_L1_error)
  #else
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_21_get_distance = &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_21_get_distance;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_21_get_distance) < 0) __PYX_ERR(0, 760, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_21_get_distance->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_21_get_distance->tp_dictoffset && __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_21_get_distance->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_21_get_distance->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_22_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_22_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_22_genexpr)) __PYX_ERR(0, 774, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4ete4_4core_4tree___pyx_scope_struct_22_genexpr_spec, __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_22_genexpr) < 0) __PYX_ERR(0, 774, __pyx_L1_error)
  #else
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_22_genexpr = &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_22_genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_22_genexpr) < 0) __PYX_ERR(0, 774, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_22_genexpr->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_22_genexpr->tp_dictoffset && __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_22_genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_22_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_23_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_23_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_23_genexpr)) __PYX_ERR(0, 775, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4ete4_4core_4tree___pyx_scope_struct_23_genexpr_spec, __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_23_genexpr) < 0) __PYX_ERR(0, 775, __pyx_L1_error)
  #else
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_23_genexpr = &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_23_genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_23_genexpr) < 0) __PYX_ERR(0, 775, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_23_genexpr->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_23_genexpr->tp_dictoffset && __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_23_genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_23_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_24_sort_descendants = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_24_sort_descendants_spec, NULL); if (unlikely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_24_sort_descendants)) __PYX_ERR(0, 1114, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4ete4_4core_4tree___pyx_scope_struct_24_sort_descendants_spec, __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_24_sort_descendants) < 0) __PYX_ERR(0, 1114, __pyx_L1_error)
  #else
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_24_sort_descendants = &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_24_sort_descendants;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_24_sort_descendants) < 0) __PYX_ERR(0, 1114, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_24_sort_descendants->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_24_sort_descendants->tp_dictoffset && __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_24_sort_descendants->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_24_sort_descendants->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_25_get_cached_content = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_25_get_cached_content_spec, NULL); if (unlikely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_25_get_cached_content)) __PYX_ERR(0, 1119, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4ete4_4core_4tree___pyx_scope_struct_25_get_cached_content_spec, __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_25_get_cached_content) < 0) __PYX_ERR(0, 1119, __pyx_L1_error)
  #else
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_25_get_cached_content = &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_25_get_cached_content;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_25_get_cached_content) < 0) __PYX_ERR(0, 1119, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_25_get_cached_content->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_25_get_cached_content->tp_dictoffset && __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_25_get_cached_content->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_25_get_cached_content->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds_spec, NULL); if (unlikely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds)) __PYX_ERR(0, 1158, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds_spec, __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds) < 0) __PYX_ERR(0, 1158, __pyx_L1_error)
  #else
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds = &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds) < 0) __PYX_ERR(0, 1158, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds->tp_dictoffset && __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_26_robinson_foulds->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_27_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_27_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_27_genexpr)) __PYX_ERR(0, 1207, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4ete4_4core_4tree___pyx_scope_struct_27_genexpr_spec, __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_27_genexpr) < 0) __PYX_ERR(0, 1207, __pyx_L1_error)
  #else
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_27_genexpr = &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_27_genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_27_genexpr) < 0) __PYX_ERR(0, 1207, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_27_genexpr->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_27_genexpr->tp_dictoffset && __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_27_genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_27_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_28_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_28_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_28_genexpr)) __PYX_ERR(0, 1208, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4ete4_4core_4tree___pyx_scope_struct_28_genexpr_spec, __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_28_genexpr) < 0) __PYX_ERR(0, 1208, __pyx_L1_error)
  #else
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_28_genexpr = &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_28_genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_28_genexpr) < 0) __PYX_ERR(0, 1208, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_28_genexpr->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_28_genexpr->tp_dictoffset && __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_28_genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_28_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_29_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_29_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_29_genexpr)) __PYX_ERR(0, 1231, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4ete4_4core_4tree___pyx_scope_struct_29_genexpr_spec, __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_29_genexpr) < 0) __PYX_ERR(0, 1231, __pyx_L1_error)
  #else
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_29_genexpr = &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_29_genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_29_genexpr) < 0) __PYX_ERR(0, 1231, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_29_genexpr->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_29_genexpr->tp_dictoffset && __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_29_genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_29_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_30_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_30_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_30_genexpr)) __PYX_ERR(0, 1232, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4ete4_4core_4tree___pyx_scope_struct_30_genexpr_spec, __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_30_genexpr) < 0) __PYX_ERR(0, 1232, __pyx_L1_error)
  #else
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_30_genexpr = &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_30_genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_30_genexpr) < 0) __PYX_ERR(0, 1232, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_30_genexpr->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_30_genexpr->tp_dictoffset && __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_30_genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_30_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_31_from_common = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_31_from_common_spec, NULL); if (unlikely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_31_from_common)) __PYX_ERR(0, 1239, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4ete4_4core_4tree___pyx_scope_struct_31_from_common_spec, __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_31_from_common) < 0) __PYX_ERR(0, 1239, __pyx_L1_error)
  #else
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_31_from_common = &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_31_from_common;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_31_from_common) < 0) __PYX_ERR(0, 1239, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_31_from_common->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_31_from_common->tp_dictoffset && __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_31_from_common->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_31_from_common->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_32_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_32_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_32_genexpr)) __PYX_ERR(0, 1265, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4ete4_4core_4tree___pyx_scope_struct_32_genexpr_spec, __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_32_genexpr) < 0) __PYX_ERR(0, 1265, __pyx_L1_error)
  #else
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_32_genexpr = &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_32_genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_32_genexpr) < 0) __PYX_ERR(0, 1265, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_32_genexpr->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_32_genexpr->tp_dictoffset && __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_32_genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_32_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_33_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_33_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_33_genexpr)) __PYX_ERR(0, 1285, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4ete4_4core_4tree___pyx_scope_struct_33_genexpr_spec, __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_33_genexpr) < 0) __PYX_ERR(0, 1285, __pyx_L1_error)
  #else
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_33_genexpr = &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_33_genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_33_genexpr) < 0) __PYX_ERR(0, 1285, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_33_genexpr->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_33_genexpr->tp_dictoffset && __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_33_genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_33_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_34_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_34_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_34_genexpr)) __PYX_ERR(0, 1306, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4ete4_4core_4tree___pyx_scope_struct_34_genexpr_spec, __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_34_genexpr) < 0) __PYX_ERR(0, 1306, __pyx_L1_error)
  #else
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_34_genexpr = &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_34_genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_34_genexpr) < 0) __PYX_ERR(0, 1306, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_34_genexpr->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_34_genexpr->tp_dictoffset && __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_34_genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_34_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_35_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_35_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_35_genexpr)) __PYX_ERR(0, 1307, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4ete4_4core_4tree___pyx_scope_struct_35_genexpr_spec, __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_35_genexpr) < 0) __PYX_ERR(0, 1307, __pyx_L1_error)
  #else
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_35_genexpr = &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_35_genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_35_genexpr) < 0) __PYX_ERR(0, 1307, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_35_genexpr->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_35_genexpr->tp_dictoffset && __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_35_genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_35_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_36_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_36_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_36_genexpr)) __PYX_ERR(0, 1313, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4ete4_4core_4tree___pyx_scope_struct_36_genexpr_spec, __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_36_genexpr) < 0) __PYX_ERR(0, 1313, __pyx_L1_error)
  #else
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_36_genexpr = &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_36_genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_36_genexpr) < 0) __PYX_ERR(0, 1313, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_36_genexpr->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_36_genexpr->tp_dictoffset && __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_36_genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_36_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_37_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_37_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_37_genexpr)) __PYX_ERR(0, 1314, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4ete4_4core_4tree___pyx_scope_struct_37_genexpr_spec, __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_37_genexpr) < 0) __PYX_ERR(0, 1314, __pyx_L1_error)
  #else
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_37_genexpr = &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_37_genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_37_genexpr) < 0) __PYX_ERR(0, 1314, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_37_genexpr->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_37_genexpr->tp_dictoffset && __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_37_genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_37_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_38_compare = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_38_compare_spec, NULL); if (unlikely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_38_compare)) __PYX_ERR(0, 1321, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4ete4_4core_4tree___pyx_scope_struct_38_compare_spec, __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_38_compare) < 0) __PYX_ERR(0, 1321, __pyx_L1_error)
  #else
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_38_compare = &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_38_compare;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_38_compare) < 0) __PYX_ERR(0, 1321, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_38_compare->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_38_compare->tp_dictoffset && __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_38_compare->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_38_compare->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_39_edges = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_39_edges_spec, NULL); if (unlikely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_39_edges)) __PYX_ERR(0, 1506, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4ete4_4core_4tree___pyx_scope_struct_39_edges_spec, __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_39_edges) < 0) __PYX_ERR(0, 1506, __pyx_L1_error)
  #else
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_39_edges = &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_39_edges;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_39_edges) < 0) __PYX_ERR(0, 1506, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_39_edges->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_39_edges->tp_dictoffset && __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_39_edges->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_39_edges->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_40_get_topology_id = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_40_get_topology_id_spec, NULL); if (unlikely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_40_get_topology_id)) __PYX_ERR(0, 1538, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4ete4_4core_4tree___pyx_scope_struct_40_get_topology_id_spec, __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_40_get_topology_id) < 0) __PYX_ERR(0, 1538, __pyx_L1_error)
  #else
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_40_get_topology_id = &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_40_get_topology_id;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_40_get_topology_id) < 0) __PYX_ERR(0, 1538, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_40_get_topology_id->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_40_get_topology_id->tp_dictoffset && __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_40_get_topology_id->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_40_get_topology_id->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_41_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_41_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_41_genexpr)) __PYX_ERR(0, 1554, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4ete4_4core_4tree___pyx_scope_struct_41_genexpr_spec, __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_41_genexpr) < 0) __PYX_ERR(0, 1554, __pyx_L1_error)
  #else
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_41_genexpr = &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_41_genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_41_genexpr) < 0) __PYX_ERR(0, 1554, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_41_genexpr->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_41_genexpr->tp_dictoffset && __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_41_genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_41_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_42_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_42_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_42_genexpr)) __PYX_ERR(0, 1555, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4ete4_4core_4tree___pyx_scope_struct_42_genexpr_spec, __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_42_genexpr) < 0) __PYX_ERR(0, 1555, __pyx_L1_error)
  #else
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_42_genexpr = &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_42_genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_42_genexpr) < 0) __PYX_ERR(0, 1555, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_42_genexpr->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_42_genexpr->tp_dictoffset && __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_42_genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_42_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_43_is_monophyletic = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_43_is_monophyletic_spec, NULL); if (unlikely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_43_is_monophyletic)) __PYX_ERR(0, 1565, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4ete4_4core_4tree___pyx_scope_struct_43_is_monophyletic_spec, __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_43_is_monophyletic) < 0) __PYX_ERR(0, 1565, __pyx_L1_error)
  #else
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_43_is_monophyletic = &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_43_is_monophyletic;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_43_is_monophyletic) < 0) __PYX_ERR(0, 1565, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_43_is_monophyletic->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_43_is_monophyletic->tp_dictoffset && __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_43_is_monophyletic->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_43_is_monophyletic->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_44_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_44_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_44_genexpr)) __PYX_ERR(0, 1568, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4ete4_4core_4tree___pyx_scope_struct_44_genexpr_spec, __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_44_genexpr) < 0) __PYX_ERR(0, 1568, __pyx_L1_error)
  #else
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_44_genexpr = &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_44_genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_44_genexpr) < 0) __PYX_ERR(0, 1568, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_44_genexpr->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_44_genexpr->tp_dictoffset && __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_44_genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_44_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_45_check_monophyly = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_45_check_monophyly_spec, NULL); if (unlikely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_45_check_monophyly)) __PYX_ERR(0, 1570, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4ete4_4core_4tree___pyx_scope_struct_45_check_monophyly_spec, __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_45_check_monophyly) < 0) __PYX_ERR(0, 1570, __pyx_L1_error)
  #else
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_45_check_monophyly = &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_45_check_monophyly;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_45_check_monophyly) < 0) __PYX_ERR(0, 1570, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_45_check_monophyly->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_45_check_monophyly->tp_dictoffset && __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_45_check_monophyly->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_45_check_monophyly->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_46_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_46_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_46_genexpr)) __PYX_ERR(0, 1580, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4ete4_4core_4tree___pyx_scope_struct_46_genexpr_spec, __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_46_genexpr) < 0) __PYX_ERR(0, 1580, __pyx_L1_error)
  #else
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_46_genexpr = &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_46_genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_46_genexpr) < 0) __PYX_ERR(0, 1580, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_46_genexpr->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_46_genexpr->tp_dictoffset && __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_46_genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_46_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_47_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_47_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_47_genexpr)) __PYX_ERR(0, 1584, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4ete4_4core_4tree___pyx_scope_struct_47_genexpr_spec, __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_47_genexpr) < 0) __PYX_ERR(0, 1584, __pyx_L1_error)
  #else
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_47_genexpr = &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_47_genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_47_genexpr) < 0) __PYX_ERR(0, 1584, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_47_genexpr->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_47_genexpr->tp_dictoffset && __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_47_genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_47_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_48_get_monophyletic = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_48_get_monophyletic_spec, NULL); if (unlikely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_48_get_monophyletic)) __PYX_ERR(0, 1607, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4ete4_4core_4tree___pyx_scope_struct_48_get_monophyletic_spec, __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_48_get_monophyletic) < 0) __PYX_ERR(0, 1607, __pyx_L1_error)
  #else
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_48_get_monophyletic = &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_48_get_monophyletic;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_48_get_monophyletic) < 0) __PYX_ERR(0, 1607, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_48_get_monophyletic->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_48_get_monophyletic->tp_dictoffset && __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_48_get_monophyletic->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_48_get_monophyletic->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_49_expand_polytomies = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_49_expand_polytomies_spec, NULL); if (unlikely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_49_expand_polytomies)) __PYX_ERR(0, 1625, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4ete4_4core_4tree___pyx_scope_struct_49_expand_polytomies_spec, __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_49_expand_polytomies) < 0) __PYX_ERR(0, 1625, __pyx_L1_error)
  #else
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_49_expand_polytomies = &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_49_expand_polytomies;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_49_expand_polytomies) < 0) __PYX_ERR(0, 1625, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_49_expand_polytomies->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_49_expand_polytomies->tp_dictoffset && __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_49_expand_polytomies->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_49_expand_polytomies->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_50_add_leaf = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_50_add_leaf_spec, NULL); if (unlikely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_50_add_leaf)) __PYX_ERR(0, 1648, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4ete4_4core_4tree___pyx_scope_struct_50_add_leaf_spec, __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_50_add_leaf) < 0) __PYX_ERR(0, 1648, __pyx_L1_error)
  #else
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_50_add_leaf = &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_50_add_leaf;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_50_add_leaf) < 0) __PYX_ERR(0, 1648, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_50_add_leaf->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_50_add_leaf->tp_dictoffset && __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_50_add_leaf->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_50_add_leaf->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_51_enum_unordered = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_51_enum_unordered_spec, NULL); if (unlikely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_51_enum_unordered)) __PYX_ERR(0, 1656, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4ete4_4core_4tree___pyx_scope_struct_51_enum_unordered_spec, __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_51_enum_unordered) < 0) __PYX_ERR(0, 1656, __pyx_L1_error)
  #else
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_51_enum_unordered = &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_51_enum_unordered;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_51_enum_unordered) < 0) __PYX_ERR(0, 1656, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_51_enum_unordered->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_51_enum_unordered->tp_dictoffset && __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_51_enum_unordered->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_51_enum_unordered->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_52_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_52_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_52_genexpr)) __PYX_ERR(0, 1779, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4ete4_4core_4tree___pyx_scope_struct_52_genexpr_spec, __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_52_genexpr) < 0) __PYX_ERR(0, 1779, __pyx_L1_error)
  #else
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_52_genexpr = &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_52_genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_52_genexpr) < 0) __PYX_ERR(0, 1779, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_52_genexpr->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_52_genexpr->tp_dictoffset && __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_52_genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_52_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_53_from_parent_child_table = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_53_from_parent_child_table_spec, NULL); if (unlikely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_53_from_parent_child_table)) __PYX_ERR(0, 1797, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4ete4_4core_4tree___pyx_scope_struct_53_from_parent_child_table_spec, __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_53_from_parent_child_table) < 0) __PYX_ERR(0, 1797, __pyx_L1_error)
  #else
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_53_from_parent_child_table = &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_53_from_parent_child_table;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_53_from_parent_child_table) < 0) __PYX_ERR(0, 1797, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_53_from_parent_child_table->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_53_from_parent_child_table->tp_dictoffset && __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_53_from_parent_child_table->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_53_from_parent_child_table->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_54_from_skbio = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_54_from_skbio_spec, NULL); if (unlikely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_54_from_skbio)) __PYX_ERR(0, 1845, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4ete4_4core_4tree___pyx_scope_struct_54_from_skbio_spec, __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_54_from_skbio) < 0) __PYX_ERR(0, 1845, __pyx_L1_error)
  #else
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_54_from_skbio = &__pyx_type_4ete4_4core_4tree___pyx_scope_struct_54_from_skbio;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_54_from_skbio) < 0) __PYX_ERR(0, 1845, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_54_from_skbio->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_54_from_skbio->tp_dictoffset && __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_54_from_skbio->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_4ete4_4core_4tree___pyx_scope_struct_54_from_skbio->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_type_import_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
  /*--- Type import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_variable_import_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
  /*--- Variable import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_function_import_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
  /*--- Function import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}


#if PY_MAJOR_VERSION >= 3
#if CYTHON_PEP489_MULTI_PHASE_INIT
static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
static int __pyx_pymod_exec_tree(PyObject* module); /*proto*/
static PyModuleDef_Slot __pyx_moduledef_slots[] = {
  {Py_mod_create, (void*)__pyx_pymod_create},
  {Py_mod_exec, (void*)__pyx_pymod_exec_tree},
  {0, NULL}
};
#endif

#ifdef __cplusplus
namespace {
  struct PyModuleDef __pyx_moduledef =
  #else
  static struct PyModuleDef __pyx_moduledef =
  #endif
  {
      PyModuleDef_HEAD_INIT,
      "tree",
      __pyx_k_This_module_provides_the_class, /* m_doc */
    #if CYTHON_PEP489_MULTI_PHASE_INIT
      0, /* m_size */
    #elif CYTHON_USE_MODULE_STATE
      sizeof(__pyx_mstate), /* m_size */
    #else
      -1, /* m_size */
    #endif
      __pyx_methods /* m_methods */,
    #if CYTHON_PEP489_MULTI_PHASE_INIT
      __pyx_moduledef_slots, /* m_slots */
    #else
      NULL, /* m_reload */
    #endif
    #if CYTHON_USE_MODULE_STATE
      __pyx_m_traverse, /* m_traverse */
      __pyx_m_clear, /* m_clear */
      NULL /* m_free */
    #else
      NULL, /* m_traverse */
      NULL, /* m_clear */
      NULL /* m_free */
    #endif
  };
  #ifdef __cplusplus
} /* anonymous namespace */
#endif
#endif

#ifndef CYTHON_NO_PYINIT_EXPORT
#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
#elif PY_MAJOR_VERSION < 3
#ifdef __cplusplus
#define __Pyx_PyMODINIT_FUNC extern "C" void
#else
#define __Pyx_PyMODINIT_FUNC void
#endif
#else
#ifdef __cplusplus
#define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
#else
#define __Pyx_PyMODINIT_FUNC PyObject *
#endif
#endif


#if PY_MAJOR_VERSION < 3
__Pyx_PyMODINIT_FUNC inittree(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC inittree(void)
#else
__Pyx_PyMODINIT_FUNC PyInit_tree(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC PyInit_tree(void)
#if CYTHON_PEP489_MULTI_PHASE_INIT
{
  return PyModuleDef_Init(&__pyx_moduledef);
}
static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
    #if PY_VERSION_HEX >= 0x030700A1
    static PY_INT64_T main_interpreter_id = -1;
    PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
    if (main_interpreter_id == -1) {
        main_interpreter_id = current_id;
        return (unlikely(current_id == -1)) ? -1 : 0;
    } else if (unlikely(main_interpreter_id != current_id))
    #else
    static PyInterpreterState *main_interpreter = NULL;
    PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
    if (!main_interpreter) {
        main_interpreter = current_interpreter;
    } else if (unlikely(main_interpreter != current_interpreter))
    #endif
    {
        PyErr_SetString(
            PyExc_ImportError,
            "Interpreter change detected - this module can only be loaded into one interpreter per process.");
        return -1;
    }
    return 0;
}
#if CYTHON_COMPILING_IN_LIMITED_API
static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none)
#else
static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none)
#endif
{
    PyObject *value = PyObject_GetAttrString(spec, from_name);
    int result = 0;
    if (likely(value)) {
        if (allow_none || value != Py_None) {
#if CYTHON_COMPILING_IN_LIMITED_API
            result = PyModule_AddObject(module, to_name, value);
#else
            result = PyDict_SetItemString(moddict, to_name, value);
#endif
        }
        Py_DECREF(value);
    } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
        PyErr_Clear();
    } else {
        result = -1;
    }
    return result;
}
static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) {
    PyObject *module = NULL, *moddict, *modname;
    CYTHON_UNUSED_VAR(def);
    if (__Pyx_check_single_interpreter())
        return NULL;
    if (__pyx_m)
        return __Pyx_NewRef(__pyx_m);
    modname = PyObject_GetAttrString(spec, "name");
    if (unlikely(!modname)) goto bad;
    module = PyModule_NewObject(modname);
    Py_DECREF(modname);
    if (unlikely(!module)) goto bad;
#if CYTHON_COMPILING_IN_LIMITED_API
    moddict = module;
#else
    moddict = PyModule_GetDict(module);
    if (unlikely(!moddict)) goto bad;
#endif
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
    return module;
bad:
    Py_XDECREF(module);
    return NULL;
}


static CYTHON_SMALL_CODE int __pyx_pymod_exec_tree(PyObject *__pyx_pyinit_module)
#endif
#endif
{
  int stringtab_initialized = 0;
  #if CYTHON_USE_MODULE_STATE
  int pystate_addmodule_run = 0;
  #endif
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  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 'tree' has already been imported. Re-initialisation is not supported.");
    return -1;
  }
  #elif PY_MAJOR_VERSION >= 3
  if (__pyx_m) return __Pyx_NewRef(__pyx_m);
  #endif
  /*--- Module creation code ---*/
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  __pyx_m = __pyx_pyinit_module;
  Py_INCREF(__pyx_m);
  #else
  #if PY_MAJOR_VERSION < 3
  __pyx_m = Py_InitModule4("tree", __pyx_methods, __pyx_k_This_module_provides_the_class, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
  if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
  #elif CYTHON_USE_MODULE_STATE
  __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  {
    int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef);
    __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "tree" pseudovariable */
    if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
    pystate_addmodule_run = 1;
  }
  #else
  __pyx_m = PyModule_Create(&__pyx_moduledef);
  if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #endif
  CYTHON_UNUSED_VAR(__pyx_t_1);
  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
  Py_INCREF(__pyx_d);
  __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #if CYTHON_REFNANNY
__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
if (!__Pyx_RefNanny) {
  PyErr_Clear();
  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
  if (!__Pyx_RefNanny)
      Py_FatalError("failed to import 'refnanny' module");
}
#endif
  __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_tree(void)", 0);
  if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #ifdef __Pxy_PyFrame_Initialize_Offsets
  __Pxy_PyFrame_Initialize_Offsets();
  #endif
  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
  #ifdef __Pyx_CyFunction_USED
  if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_FusedFunction_USED
  if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Coroutine_USED
  if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Generator_USED
  if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_AsyncGen_USED
  if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_StopAsyncIteration_USED
  if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  /*--- Library function declarations ---*/
  /*--- Threads initialization code ---*/
  #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  PyEval_InitThreads();
  #endif
  /*--- Initialize various global constants etc. ---*/
  if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  stringtab_initialized = 1;
  if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
  if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  if (__pyx_module_is_main_ete4__core__tree) {
    if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  }
  #if PY_MAJOR_VERSION >= 3
  {
    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
    if (!PyDict_GetItemString(modules, "ete4.core.tree")) {
      if (unlikely((PyDict_SetItemString(modules, "ete4.core.tree", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
    }
  }
  #endif
  /*--- Builtin init code ---*/
  if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Constants init code ---*/
  if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Global type/function init code ---*/
  (void)__Pyx_modinit_global_init_code();
  (void)__Pyx_modinit_variable_export_code();
  (void)__Pyx_modinit_function_export_code();
  if (unlikely((__Pyx_modinit_type_init_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  (void)__Pyx_modinit_type_import_code();
  (void)__Pyx_modinit_variable_import_code();
  (void)__Pyx_modinit_function_import_code();
  /*--- Execution code ---*/
  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
  if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif

  /* "ete4/core/tree.pyx":12
 * """
 * 
 * import copy             # <<<<<<<<<<<<<<
 * import itertools
 * from hashlib import md5
 */
  __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_copy, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_copy, __pyx_t_2) < 0) __PYX_ERR(0, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ete4/core/tree.pyx":13
 * 
 * import copy
 * import itertools             # <<<<<<<<<<<<<<
 * from hashlib import md5
 * from functools import cmp_to_key
 */
  __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_itertools, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_itertools, __pyx_t_2) < 0) __PYX_ERR(0, 13, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ete4/core/tree.pyx":14
 * import copy
 * import itertools
 * from hashlib import md5             # <<<<<<<<<<<<<<
 * from functools import cmp_to_key
 * import pickle
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_md5);
  __Pyx_GIVEREF(__pyx_n_s_md5);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_md5)) __PYX_ERR(0, 14, __pyx_L1_error);
  __pyx_t_3 = __Pyx_Import(__pyx_n_s_hashlib, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 14, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_md5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_md5, __pyx_t_2) < 0) __PYX_ERR(0, 14, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "ete4/core/tree.pyx":15
 * import itertools
 * from hashlib import md5
 * from functools import cmp_to_key             # <<<<<<<<<<<<<<
 * import pickle
 * import math
 */
  __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_n_s_cmp_to_key);
  __Pyx_GIVEREF(__pyx_n_s_cmp_to_key);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_cmp_to_key)) __PYX_ERR(0, 15, __pyx_L1_error);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_functools, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_cmp_to_key); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_cmp_to_key, __pyx_t_3) < 0) __PYX_ERR(0, 15, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ete4/core/tree.pyx":16
 * from hashlib import md5
 * from functools import cmp_to_key
 * import pickle             # <<<<<<<<<<<<<<
 * import math
 * 
 */
  __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_pickle, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pickle, __pyx_t_2) < 0) __PYX_ERR(0, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ete4/core/tree.pyx":17
 * from functools import cmp_to_key
 * import pickle
 * import math             # <<<<<<<<<<<<<<
 * 
 * from . import text_viz
 */
  __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_math, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_math, __pyx_t_2) < 0) __PYX_ERR(0, 17, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ete4/core/tree.pyx":19
 * import math
 * 
 * from . import text_viz             # <<<<<<<<<<<<<<
 * from . import operations as ops
 * from .. import utils
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_text_viz);
  __Pyx_GIVEREF(__pyx_n_s_text_viz);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_text_viz)) __PYX_ERR(0, 19, __pyx_L1_error);
  __pyx_t_3 = __Pyx_Import(__pyx_n_s__3, __pyx_t_2, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_text_viz); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_text_viz, __pyx_t_2) < 0) __PYX_ERR(0, 19, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "ete4/core/tree.pyx":20
 * 
 * from . import text_viz
 * from . import operations as ops             # <<<<<<<<<<<<<<
 * from .. import utils
 * from ..parser import newick, ete_format, indent, nexus
 */
  __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_n_s_operations);
  __Pyx_GIVEREF(__pyx_n_s_operations);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_operations)) __PYX_ERR(0, 20, __pyx_L1_error);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s__3, __pyx_t_3, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_operations); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ops, __pyx_t_3) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ete4/core/tree.pyx":21
 * from . import text_viz
 * from . import operations as ops
 * from .. import utils             # <<<<<<<<<<<<<<
 * from ..parser import newick, ete_format, indent, nexus
 * from ..parser.extract import extract_data_parser
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_utils);
  __Pyx_GIVEREF(__pyx_n_s_utils);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_utils)) __PYX_ERR(0, 21, __pyx_L1_error);
  __pyx_t_3 = __Pyx_Import(__pyx_n_s__3, __pyx_t_2, 2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_utils); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_utils, __pyx_t_2) < 0) __PYX_ERR(0, 21, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "ete4/core/tree.pyx":22
 * from . import operations as ops
 * from .. import utils
 * from ..parser import newick, ete_format, indent, nexus             # <<<<<<<<<<<<<<
 * from ..parser.extract import extract_data_parser
 * 
 */
  __pyx_t_3 = PyList_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_n_s_newick);
  __Pyx_GIVEREF(__pyx_n_s_newick);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_newick)) __PYX_ERR(0, 22, __pyx_L1_error);
  __Pyx_INCREF(__pyx_n_s_ete_format);
  __Pyx_GIVEREF(__pyx_n_s_ete_format);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_ete_format)) __PYX_ERR(0, 22, __pyx_L1_error);
  __Pyx_INCREF(__pyx_n_s_indent);
  __Pyx_GIVEREF(__pyx_n_s_indent);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 2, __pyx_n_s_indent)) __PYX_ERR(0, 22, __pyx_L1_error);
  __Pyx_INCREF(__pyx_n_s_nexus);
  __Pyx_GIVEREF(__pyx_n_s_nexus);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 3, __pyx_n_s_nexus)) __PYX_ERR(0, 22, __pyx_L1_error);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_parser, __pyx_t_3, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_newick); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_newick, __pyx_t_3) < 0) __PYX_ERR(0, 22, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ete_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ete_format, __pyx_t_3) < 0) __PYX_ERR(0, 22, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_indent); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_indent, __pyx_t_3) < 0) __PYX_ERR(0, 22, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_nexus); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_nexus, __pyx_t_3) < 0) __PYX_ERR(0, 22, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ete4/core/tree.pyx":23
 * from .. import utils
 * from ..parser import newick, ete_format, indent, nexus
 * from ..parser.extract import extract_data_parser             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_extract_data_parser);
  __Pyx_GIVEREF(__pyx_n_s_extract_data_parser);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_extract_data_parser)) __PYX_ERR(0, 23, __pyx_L1_error);
  __pyx_t_3 = __Pyx_Import(__pyx_n_s_parser_extract, __pyx_t_2, 2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_extract_data_parser); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_extract_data_parser, __pyx_t_2) < 0) __PYX_ERR(0, 23, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "ete4/core/tree.pyx":26
 * 
 * 
 * class TreeError(Exception):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]));
  __Pyx_GIVEREF((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]));
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])))) __PYX_ERR(0, 26, __pyx_L1_error);
  __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_2, __pyx_n_s_TreeError, __pyx_n_s_TreeError, (PyObject *) NULL, __pyx_n_s_ete4_core_tree, (PyObject *) NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_2 != __pyx_t_3) {
    if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_t_3) < 0))) __PYX_ERR(0, 26, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_n_s_TreeError, __pyx_t_2, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_TreeError, __pyx_t_3) < 0) __PYX_ERR(0, 26, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ete4/core/tree.pyx":181
 *         return n
 * 
 *     def get_prop(self, prop, default=None):             # <<<<<<<<<<<<<<
 *         """Return the node's property prop (an attribute or in self.props)."""
 *         attr = getattr(self, prop, None)
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_3get_prop, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Tree_get_prop, NULL, __pyx_n_s_ete4_core_tree, __pyx_d, ((PyObject *)__pyx_codeobj__50)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 181, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__45);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree, __pyx_n_s_get_prop, __pyx_t_2) < 0) __PYX_ERR(0, 181, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4ete4_4core_4tree_Tree);

  /* "ete4/core/tree.pyx":230
 *         return self.to_str(show_internal=False, compact=True, props=['name'])
 * 
 *     def to_str(self, show_internal=True, compact=False, props=None,             # <<<<<<<<<<<<<<
 *                px=None, py=None, px0=0, cascade=False):
 *         """Return a string containing an ascii drawing of the tree.
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_17to_str, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Tree_to_str, NULL, __pyx_n_s_ete4_core_tree, __pyx_d, ((PyObject *)__pyx_codeobj__52)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__53);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree, __pyx_n_s_to_str, __pyx_t_2) < 0) __PYX_ERR(0, 230, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4ete4_4core_4tree_Tree);

  /* "ete4/core/tree.pyx":260
 *         yield from self.leaves()
 * 
 *     def add_prop(self, name, value):             # <<<<<<<<<<<<<<
 *         """Add or update node's property to the given value."""
 *         self.props[name] = value
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_24add_prop, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Tree_add_prop, NULL, __pyx_n_s_ete4_core_tree, __pyx_d, ((PyObject *)__pyx_codeobj__55)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 260, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree, __pyx_n_s_add_prop, __pyx_t_2) < 0) __PYX_ERR(0, 260, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4ete4_4core_4tree_Tree);

  /* "ete4/core/tree.pyx":264
 *         self.props[name] = value
 * 
 *     def add_props(self, **props):             # <<<<<<<<<<<<<<
 *         """Add or update several properties."""
 *         for name, value in props.items():
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_26add_props, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Tree_add_props, NULL, __pyx_n_s_ete4_core_tree, __pyx_d, ((PyObject *)__pyx_codeobj__57)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 264, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree, __pyx_n_s_add_props, __pyx_t_2) < 0) __PYX_ERR(0, 264, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4ete4_4core_4tree_Tree);

  /* "ete4/core/tree.pyx":269
 *             self.props[name] = value
 * 
 *     def del_prop(self, name):             # <<<<<<<<<<<<<<
 *         """Delete a node's property."""
 *         self.props.pop(name, None)
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_28del_prop, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Tree_del_prop, NULL, __pyx_n_s_ete4_core_tree, __pyx_d, ((PyObject *)__pyx_codeobj__59)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 269, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree, __pyx_n_s_del_prop, __pyx_t_2) < 0) __PYX_ERR(0, 269, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4ete4_4core_4tree_Tree);

  /* "ete4/core/tree.pyx":274
 * 
 *     # Topology management
 *     def add_child(self, child=None, name=None, dist=None, support=None):             # <<<<<<<<<<<<<<
 *         """Add a new child to this node and return it.
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_30add_child, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Tree_add_child, NULL, __pyx_n_s_ete4_core_tree, __pyx_d, ((PyObject *)__pyx_codeobj__61)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 274, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__62);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree, __pyx_n_s_add_child, __pyx_t_2) < 0) __PYX_ERR(0, 274, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4ete4_4core_4tree_Tree);

  /* "ete4/core/tree.pyx":302
 *         return child
 * 
 *     def add_children(self, nodes):             # <<<<<<<<<<<<<<
 *         """Set the given nodes as children of this node."""
 *         for node in nodes:
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_32add_children, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Tree_add_children, NULL, __pyx_n_s_ete4_core_tree, __pyx_d, ((PyObject *)__pyx_codeobj__64)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 302, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree, __pyx_n_s_add_children, __pyx_t_2) < 0) __PYX_ERR(0, 302, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4ete4_4core_4tree_Tree);

  /* "ete4/core/tree.pyx":308
 *         return nodes
 * 
 *     def pop_child(self, child_idx=-1):             # <<<<<<<<<<<<<<
 *         try:
 *             child = self.children.pop(child_idx)  # parent removes child
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_34pop_child, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Tree_pop_child, NULL, __pyx_n_s_ete4_core_tree, __pyx_d, ((PyObject *)__pyx_codeobj__66)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 308, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__67);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree, __pyx_n_s_pop_child, __pyx_t_2) < 0) __PYX_ERR(0, 308, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4ete4_4core_4tree_Tree);

  /* "ete4/core/tree.pyx":319
 *             raise TreeError(f'Cannot pop child: not found ({e})')
 * 
 *     def remove_child(self, child):             # <<<<<<<<<<<<<<
 *         """Remove child from this node and return it.
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_36remove_child, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Tree_remove_child, NULL, __pyx_n_s_ete4_core_tree, __pyx_d, ((PyObject *)__pyx_codeobj__69)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 319, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree, __pyx_n_s_remove_child, __pyx_t_2) < 0) __PYX_ERR(0, 319, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4ete4_4core_4tree_Tree);

  /* "ete4/core/tree.pyx":338
 *             raise TreeError(f'Cannot remove child: not found ({e})')
 * 
 *     def remove_children(self):             # <<<<<<<<<<<<<<
 *         """Remove all children from this node and return a list with them."""
 *         children = list(self.children)  # we need to make a copy of the list!
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_38remove_children, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Tree_remove_children, NULL, __pyx_n_s_ete4_core_tree, __pyx_d, ((PyObject *)__pyx_codeobj__71)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 338, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree, __pyx_n_s_remove_children, __pyx_t_2) < 0) __PYX_ERR(0, 338, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4ete4_4core_4tree_Tree);

  /* "ete4/core/tree.pyx":343
 *         return [self.remove_child(node) for node in children]
 * 
 *     def add_sister(self, sister=None, name=None, dist=None):             # <<<<<<<<<<<<<<
 *         """Add a sister to this node and return it.
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_40add_sister, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Tree_add_sister, NULL, __pyx_n_s_ete4_core_tree, __pyx_d, ((PyObject *)__pyx_codeobj__73)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 343, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__16);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree, __pyx_n_s_add_sister, __pyx_t_2) < 0) __PYX_ERR(0, 343, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4ete4_4core_4tree_Tree);

  /* "ete4/core/tree.pyx":353
 *         return self.up.add_child(child=sister, name=name, dist=dist)
 * 
 *     def remove_sister(self, sister=None):             # <<<<<<<<<<<<<<
 *         """Remove a sister node and return it.
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_42remove_sister, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Tree_remove_sister, NULL, __pyx_n_s_ete4_core_tree, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 353, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__45);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree, __pyx_n_s_remove_sister, __pyx_t_2) < 0) __PYX_ERR(0, 353, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4ete4_4core_4tree_Tree);

  /* "ete4/core/tree.pyx":367
 *         return self.up.remove_child(sister or sisters[0])
 * 
 *     def delete(self, prevent_nondicotomic=True, preserve_branch_length=False):             # <<<<<<<<<<<<<<
 *         """Delete node from the tree structure, keeping its children.
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_44delete, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Tree_delete, NULL, __pyx_n_s_ete4_core_tree, __pyx_d, ((PyObject *)__pyx_codeobj__77)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 367, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__78);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree, __pyx_n_s_delete, __pyx_t_2) < 0) __PYX_ERR(0, 367, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4ete4_4core_4tree_Tree);

  /* "ete4/core/tree.pyx":416
 *                           preserve_branch_length=preserve_branch_length)
 * 
 *     def detach(self):             # <<<<<<<<<<<<<<
 *         """Detach this node (and descendants) from its parent and return itself.
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_46detach, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Tree_detach, NULL, __pyx_n_s_ete4_core_tree, __pyx_d, ((PyObject *)__pyx_codeobj__80)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 416, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree, __pyx_n_s_detach, __pyx_t_2) < 0) __PYX_ERR(0, 416, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4ete4_4core_4tree_Tree);

  /* "ete4/core/tree.pyx":429
 *         return self
 * 
 *     def prune(self, nodes, preserve_branch_length=False):             # <<<<<<<<<<<<<<
 *         """Prune the topology conserving only the given nodes.
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_48prune, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Tree_prune, NULL, __pyx_n_s_ete4_core_tree, __pyx_d, ((PyObject *)__pyx_codeobj__82)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__83);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree, __pyx_n_s_prune, __pyx_t_2) < 0) __PYX_ERR(0, 429, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4ete4_4core_4tree_Tree);

  /* "ete4/core/tree.pyx":542
 *                 n.delete(prevent_nondicotomic=False)
 * 
 *     def reverse_children(self):             # <<<<<<<<<<<<<<
 *         """Reverse current children order."""
 *         self.children.reverse()
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_50reverse_children, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Tree_reverse_children, NULL, __pyx_n_s_ete4_core_tree, __pyx_d, ((PyObject *)__pyx_codeobj__84)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree, __pyx_n_s_reverse_children, __pyx_t_2) < 0) __PYX_ERR(0, 542, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4ete4_4core_4tree_Tree);

  /* "ete4/core/tree.pyx":546
 *         self.children.reverse()
 * 
 *     def swap_children(self):             # <<<<<<<<<<<<<<
 *         """Like reverse, but if there are only two children."""
 *         n = len(self.children)
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_52swap_children, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Tree_swap_children, NULL, __pyx_n_s_ete4_core_tree, __pyx_d, ((PyObject *)__pyx_codeobj__86)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 546, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree, __pyx_n_s_swap_children, __pyx_t_2) < 0) __PYX_ERR(0, 546, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4ete4_4core_4tree_Tree);

  /* "ete4/core/tree.pyx":553
 *         self.children.reverse()
 * 
 *     def get_children(self):             # <<<<<<<<<<<<<<
 *         """Return an independent list of the node's children."""
 *         # The returned list can be changed without affecting self.children.
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_54get_children, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Tree_get_children, NULL, __pyx_n_s_ete4_core_tree, __pyx_d, ((PyObject *)__pyx_codeobj__87)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 553, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree, __pyx_n_s_get_children, __pyx_t_2) < 0) __PYX_ERR(0, 553, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4ete4_4core_4tree_Tree);

  /* "ete4/core/tree.pyx":558
 *         return self.children.copy()
 * 
 *     def get_sisters(self):             # <<<<<<<<<<<<<<
 *         """Return a list of sister nodes (siblings)."""
 *         return ([node for node in self.up.children if node is not self]
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_56get_sisters, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Tree_get_sisters, NULL, __pyx_n_s_ete4_core_tree, __pyx_d, ((PyObject *)__pyx_codeobj__89)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 558, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree, __pyx_n_s_get_sisters, __pyx_t_2) < 0) __PYX_ERR(0, 558, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4ete4_4core_4tree_Tree);

  /* "ete4/core/tree.pyx":563
 *                 if not self.is_root else [])
 * 
 *     def leaves(self, is_leaf_fn=None):             # <<<<<<<<<<<<<<
 *         """Yield the terminal nodes (leaves) under this node."""
 *         is_leaf = is_leaf_fn or (lambda n: n.is_leaf)
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_58leaves, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Tree_leaves, NULL, __pyx_n_s_ete4_core_tree, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 563, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__45);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree, __pyx_n_s_leaves, __pyx_t_2) < 0) __PYX_ERR(0, 563, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4ete4_4core_4tree_Tree);

  /* "ete4/core/tree.pyx":570
 *                 yield node
 * 
 *     def leaf_names(self, is_leaf_fn=None):             # <<<<<<<<<<<<<<
 *         """Yield the leaf names under this node."""
 *         for leaf in self.leaves(is_leaf_fn):
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_61leaf_names, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Tree_leaf_names, NULL, __pyx_n_s_ete4_core_tree, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 570, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__45);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree, __pyx_n_s_leaf_names, __pyx_t_2) < 0) __PYX_ERR(0, 570, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4ete4_4core_4tree_Tree);

  /* "ete4/core/tree.pyx":575
 *             yield leaf.name
 * 
 *     def descendants(self, strategy='levelorder', is_leaf_fn=None):             # <<<<<<<<<<<<<<
 *         """Yield all descendant nodes."""
 *         for node in self.traverse(strategy, is_leaf_fn):
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_64descendants, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Tree_descendants, NULL, __pyx_n_s_ete4_core_tree, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 575, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__93);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree, __pyx_n_s_descendants, __pyx_t_2) < 0) __PYX_ERR(0, 575, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4ete4_4core_4tree_Tree);

  /* "ete4/core/tree.pyx":581
 *                 yield node
 * 
 *     def traverse(self, strategy='levelorder', is_leaf_fn=None):             # <<<<<<<<<<<<<<
 *         """Traverse the tree structure under this node and yield the nodes.
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_67traverse, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Tree_traverse, NULL, __pyx_n_s_ete4_core_tree, __pyx_d, ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 581, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__93);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree, __pyx_n_s_traverse, __pyx_t_2) < 0) __PYX_ERR(0, 581, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4ete4_4core_4tree_Tree);

  /* "ete4/core/tree.pyx":606
 *             raise TreeError(f'Unknown strategy: {strategy}')
 * 
 *     def iter_prepostorder(self, is_leaf_fn=None):             # <<<<<<<<<<<<<<
 *         """Yield all nodes in a tree in both pre and post order.
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_70iter_prepostorder, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Tree_iter_prepostorder, NULL, __pyx_n_s_ete4_core_tree, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 606, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__45);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree, __pyx_n_s_iter_prepostorder, __pyx_t_2) < 0) __PYX_ERR(0, 606, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4ete4_4core_4tree_Tree);

  /* "ete4/core/tree.pyx":621
 *                 path.append(node)
 * 
 *     def ancestors(self, root=None, include_root=True):             # <<<<<<<<<<<<<<
 *         """Yield all ancestor nodes of this node (up to the root if given)."""
 *         # root === n1 === n2 === .. === nN === node  ->  [nN, .., n2, n1, root]
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_73ancestors, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Tree_ancestors, NULL, __pyx_n_s_ete4_core_tree, __pyx_d, ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 621, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__97);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree, __pyx_n_s_ancestors, __pyx_t_2) < 0) __PYX_ERR(0, 621, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4ete4_4core_4tree_Tree);

  /* "ete4/core/tree.pyx":636
 *             yield root
 * 
 *     def lineage(self, root=None, include_root=True):             # <<<<<<<<<<<<<<
 *         """Yield all nodes in the lineage of this node (up to root if given)."""
 *         if not include_root and self is root:
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_76lineage, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Tree_lineage, NULL, __pyx_n_s_ete4_core_tree, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 636, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__97);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree, __pyx_n_s_lineage, __pyx_t_2) < 0) __PYX_ERR(0, 636, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4ete4_4core_4tree_Tree);

  /* "ete4/core/tree.pyx":645
 *         yield from self.ancestors(root, include_root)
 * 
 *     def _translate_nodes(self, nodes):             # <<<<<<<<<<<<<<
 *         """Return a list of nodes that correspond to the given names or nodes."""
 *         # ['A', self['B'], 'C'] -> [self['A'], self['B'], self['C']]
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_79_translate_nodes, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Tree__translate_nodes, NULL, __pyx_n_s_ete4_core_tree, __pyx_d, ((PyObject *)__pyx_codeobj__100)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 645, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree, __pyx_n_s_translate_nodes, __pyx_t_2) < 0) __PYX_ERR(0, 645, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4ete4_4core_4tree_Tree);

  /* "ete4/core/tree.pyx":663
 *         return [name2node[n] if type(n) == str else n for n in nodes]
 * 
 *     def describe(self):             # <<<<<<<<<<<<<<
 *         """Return a string with information on this node and its connections."""
 *         if len(self.root.children) == 2:
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_81describe, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Tree_describe, NULL, __pyx_n_s_ete4_core_tree, __pyx_d, ((PyObject *)__pyx_codeobj__102)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 663, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree, __pyx_n_s_describe, __pyx_t_2) < 0) __PYX_ERR(0, 663, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4ete4_4core_4tree_Tree);

  /* "ete4/core/tree.pyx":682
 *             'Max. distance: %g' % max_dist])
 * 
 *     def write(self, outfile=None, props=(), parser=None,             # <<<<<<<<<<<<<<
 *               format_root_node=False, is_leaf_fn=None):
 *         """Return or write to file the newick representation.
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_83write, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Tree_write, NULL, __pyx_n_s_ete4_core_tree, __pyx_d, ((PyObject *)__pyx_codeobj__104)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 682, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__105);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree, __pyx_n_s_write, __pyx_t_2) < 0) __PYX_ERR(0, 682, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4ete4_4core_4tree_Tree);

  /* "ete4/core/tree.pyx":706
 *                 newick.dump(self, fp, props, parser, format_root_node, is_leaf_fn)
 * 
 *     def common_ancestor(self, *nodes):             # <<<<<<<<<<<<<<
 *         """Return the last node common to the lineages of the given nodes.
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_85common_ancestor, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Tree_common_ancestor, NULL, __pyx_n_s_ete4_core_tree, __pyx_d, ((PyObject *)__pyx_codeobj__107)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 706, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree, __pyx_n_s_common_ancestor, __pyx_t_2) < 0) __PYX_ERR(0, 706, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4ete4_4core_4tree_Tree);

  /* "ete4/core/tree.pyx":728
 *         return root
 * 
 *     def search_nodes(self, **conditions):             # <<<<<<<<<<<<<<
 *         """Yield nodes matching the given conditions.
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_87search_nodes, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Tree_search_nodes, NULL, __pyx_n_s_ete4_core_tree, __pyx_d, ((PyObject *)__pyx_codeobj__17)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 728, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree, __pyx_n_s_search_nodes, __pyx_t_2) < 0) __PYX_ERR(0, 728, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4ete4_4core_4tree_Tree);

  /* "ete4/core/tree.pyx":740
 *                 yield node
 * 
 *     def search_descendants(self, **conditions):             # <<<<<<<<<<<<<<
 *         """Yield descendant nodes matching the given conditions."""
 *         for node in self.search_nodes(**conditions):
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_90search_descendants, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Tree_search_descendants, NULL, __pyx_n_s_ete4_core_tree, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 740, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree, __pyx_n_s_search_descendants, __pyx_t_2) < 0) __PYX_ERR(0, 740, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4ete4_4core_4tree_Tree);

  /* "ete4/core/tree.pyx":746
 *                 yield node
 * 
 *     def search_ancestors(self, **conditions):             # <<<<<<<<<<<<<<
 *         """Yield ancestor nodes matching the given conditions."""
 *         for node in self.ancestors():
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_93search_ancestors, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Tree_search_ancestors, NULL, __pyx_n_s_ete4_core_tree, __pyx_d, ((PyObject *)__pyx_codeobj__19)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 746, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree, __pyx_n_s_search_ancestors, __pyx_t_2) < 0) __PYX_ERR(0, 746, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4ete4_4core_4tree_Tree);

  /* "ete4/core/tree.pyx":752
 *                 yield node
 * 
 *     def search_leaves_by_name(self, name):             # <<<<<<<<<<<<<<
 *         """Yield leaf nodes matching the given name."""
 *         return self.search_nodes(name=name, children=[])
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_96search_leaves_by_name, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Tree_search_leaves_by_name, NULL, __pyx_n_s_ete4_core_tree, __pyx_d, ((PyObject *)__pyx_codeobj__110)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 752, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree, __pyx_n_s_search_leaves_by_name, __pyx_t_2) < 0) __PYX_ERR(0, 752, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4ete4_4core_4tree_Tree);

  /* "ete4/core/tree.pyx":760
 *     # ###########################
 * 
 *     def get_distance(self, node1, node2, topological=False):             # <<<<<<<<<<<<<<
 *         """Return the distance between the given nodes.
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_98get_distance, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Tree_get_distance, NULL, __pyx_n_s_ete4_core_tree, __pyx_d, ((PyObject *)__pyx_codeobj__112)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 760, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__83);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree, __pyx_n_s_get_distance, __pyx_t_2) < 0) __PYX_ERR(0, 760, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4ete4_4core_4tree_Tree);

  /* "ete4/core/tree.pyx":777
 *                 sum(d(n) for n in node2.lineage(root, include_root=False)))
 * 
 *     def get_farthest_node(self, topological=False):             # <<<<<<<<<<<<<<
 *         """Returns the farthest descendant or ancestor node, and its distance.
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_100get_farthest_node, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Tree_get_farthest_node, NULL, __pyx_n_s_ete4_core_tree, __pyx_d, ((PyObject *)__pyx_codeobj__114)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 777, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__83);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree, __pyx_n_s_get_farthest_node, __pyx_t_2) < 0) __PYX_ERR(0, 777, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4ete4_4core_4tree_Tree);

  /* "ete4/core/tree.pyx":814
 *         return farthest_node, farthest_dist
 * 
 *     def _get_farthest_and_closest_leaves(self, topological=False, is_leaf_fn=None):             # <<<<<<<<<<<<<<
 *         # if called from a leaf node, no necessary to compute
 *         if (is_leaf_fn and is_leaf_fn(self)) or self.is_leaf:
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_102_get_farthest_and_closest_leaves, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Tree__get_farthest_and_closest_l, NULL, __pyx_n_s_ete4_core_tree, __pyx_d, ((PyObject *)__pyx_codeobj__116)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 814, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__117);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree, __pyx_n_s_get_farthest_and_closest_leaves_2, __pyx_t_2) < 0) __PYX_ERR(0, 814, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4ete4_4core_4tree_Tree);

  /* "ete4/core/tree.pyx":845
 * 
 * 
 *     def get_farthest_leaf(self, topological=False, is_leaf_fn=None):             # <<<<<<<<<<<<<<
 *         """Return the node's farthest descendant (a leaf), and its distance.
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_104get_farthest_leaf, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Tree_get_farthest_leaf, NULL, __pyx_n_s_ete4_core_tree, __pyx_d, ((PyObject *)__pyx_codeobj__119)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 845, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__117);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree, __pyx_n_s_get_farthest_leaf, __pyx_t_2) < 0) __PYX_ERR(0, 845, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4ete4_4core_4tree_Tree);

  /* "ete4/core/tree.pyx":856
 *         return max_node, max_dist
 * 
 *     def get_closest_leaf(self, topological=False, is_leaf_fn=None):             # <<<<<<<<<<<<<<
 *         """Return the node's closest descendant leaf, and its distance.
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_106get_closest_leaf, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Tree_get_closest_leaf, NULL, __pyx_n_s_ete4_core_tree, __pyx_d, ((PyObject *)__pyx_codeobj__120)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 856, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__117);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree, __pyx_n_s_get_closest_leaf, __pyx_t_2) < 0) __PYX_ERR(0, 856, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4ete4_4core_4tree_Tree);

  /* "ete4/core/tree.pyx":867
 *         return min_node, min_dist
 * 
 *     def get_midpoint_outgroup(self, topological=False):             # <<<<<<<<<<<<<<
 *         """Return the node dividing into two distance-balanced partitions.
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_108get_midpoint_outgroup, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Tree_get_midpoint_outgroup, NULL, __pyx_n_s_ete4_core_tree, __pyx_d, ((PyObject *)__pyx_codeobj__123)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 867, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__83);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree, __pyx_n_s_get_midpoint_outgroup, __pyx_t_2) < 0) __PYX_ERR(0, 867, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4ete4_4core_4tree_Tree);

  /* "ete4/core/tree.pyx":888
 *         return current  # the midpoint was the root (we went back to it)
 * 
 *     def mean_distance(self, weight_fn=None, leaf=None, topological=False):             # <<<<<<<<<<<<<<
 *         """Return the weighted mean distance between leaves, or from leaf.
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_110mean_distance, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Tree_mean_distance, NULL, __pyx_n_s_ete4_core_tree, __pyx_d, ((PyObject *)__pyx_codeobj__125)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 888, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__126);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree, __pyx_n_s_mean_distance, __pyx_t_2) < 0) __PYX_ERR(0, 888, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4ete4_4core_4tree_Tree);

  /* "ete4/core/tree.pyx":911
 *         return ops.mean_distance(self, weight_fn, leaf, topological)
 * 
 *     def populate(self, size, names=None, model='yule',             # <<<<<<<<<<<<<<
 *                  dist_fn=None, support_fn=None):
 *         """Populate current node with a dichotomic random topology.
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_112populate, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Tree_populate, NULL, __pyx_n_s_ete4_core_tree, __pyx_d, ((PyObject *)__pyx_codeobj__128)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 911, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__129);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree, __pyx_n_s_populate, __pyx_t_2) < 0) __PYX_ERR(0, 911, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4ete4_4core_4tree_Tree);

  /* "ete4/core/tree.pyx":940
 *         ops.populate(self, size, names, model, dist_fn, support_fn)
 * 
 *     def set_outgroup(self, node, bprops=None, dist=None):             # <<<<<<<<<<<<<<
 *         """Change tree so the given node is set as outgroup.
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_114set_outgroup, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Tree_set_outgroup, NULL, __pyx_n_s_ete4_core_tree, __pyx_d, ((PyObject *)__pyx_codeobj__131)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 940, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__132);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree, __pyx_n_s_set_outgroup, __pyx_t_2) < 0) __PYX_ERR(0, 940, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4ete4_4core_4tree_Tree);

  /* "ete4/core/tree.pyx":953
 *         ops.set_outgroup(node, bprops, dist)
 * 
 *     def unroot(self, bprops=None):             # <<<<<<<<<<<<<<
 *         """Unroot the tree, that is, make the root not have 2 children.
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_116unroot, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Tree_unroot, NULL, __pyx_n_s_ete4_core_tree, __pyx_d, ((PyObject *)__pyx_codeobj__134)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 953, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__45);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree, __pyx_n_s_unroot, __pyx_t_2) < 0) __PYX_ERR(0, 953, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4ete4_4core_4tree_Tree);

  /* "ete4/core/tree.pyx":963
 *         ops.unroot(self, bprops)
 * 
 *     def show(self, layout=None, tree_style=None, name="ETE"):             # <<<<<<<<<<<<<<
 *         """Start an interactive session to visualize the current node."""
 *         from ..treeview import drawer
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_118show, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Tree_show, NULL, __pyx_n_s_ete4_core_tree, __pyx_d, ((PyObject *)__pyx_codeobj__136)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 963, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__137);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree, __pyx_n_s_show, __pyx_t_2) < 0) __PYX_ERR(0, 963, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4ete4_4core_4tree_Tree);

  /* "ete4/core/tree.pyx":969
 *                          tree_style=tree_style, win_name=name)
 * 
 *     def render(self, file_name, layout=None, w=None, h=None,             # <<<<<<<<<<<<<<
 *                tree_style=None, units='px', dpi=90):
 *         """Render the tree as an image.
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_120render, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Tree_render, NULL, __pyx_n_s_ete4_core_tree, __pyx_d, ((PyObject *)__pyx_codeobj__139)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 969, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__140);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree, __pyx_n_s_render, __pyx_t_2) < 0) __PYX_ERR(0, 969, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4ete4_4core_4tree_Tree);

  /* "ete4/core/tree.pyx":1000
 *             print('Wrote file:', file_name)
 * 
 *     def explore(self, name=None, layouts=None,             # <<<<<<<<<<<<<<
 *                 host='127.0.0.1', port=None, verbose=False,
 *                 compress=False, keep_server=False, open_browser=True,
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_122explore, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Tree_explore, NULL, __pyx_n_s_ete4_core_tree, __pyx_d, ((PyObject *)__pyx_codeobj__142)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1000, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__143);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree, __pyx_n_s_explore, __pyx_t_2) < 0) __PYX_ERR(0, 1000, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4ete4_4core_4tree_Tree);

  /* "ete4/core/tree.pyx":1018
 *                          **kwargs)
 * 
 *     def render_sm(self, file_name, layouts=None, w=None, h=None):             # <<<<<<<<<<<<<<
 *         """Save an image with the contents of the tree."""
 *         import time
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_124render_sm, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Tree_render_sm, NULL, __pyx_n_s_ete4_core_tree, __pyx_d, ((PyObject *)__pyx_codeobj__145)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1018, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__16);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree, __pyx_n_s_render_sm, __pyx_t_2) < 0) __PYX_ERR(0, 1018, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4ete4_4core_4tree_Tree);

  /* "ete4/core/tree.pyx":1065
 *         explorer.remove_tree(name)
 * 
 *     def copy(self, method="cpickle"):             # <<<<<<<<<<<<<<
 *         """Return a copy of the current node.
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_126copy, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Tree_copy, NULL, __pyx_n_s_ete4_core_tree, __pyx_d, ((PyObject *)__pyx_codeobj__147)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1065, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__148);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree, __pyx_n_s_copy, __pyx_t_2) < 0) __PYX_ERR(0, 1065, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4ete4_4core_4tree_Tree);

  /* "ete4/core/tree.pyx":1110
 *         return new_node
 * 
 *     def ladderize(self, topological=False, reverse=False):             # <<<<<<<<<<<<<<
 *         """Sort branches according to the size of each partition."""
 *         ops.ladderize(self, topological, reverse)
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_128ladderize, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Tree_ladderize, NULL, __pyx_n_s_ete4_core_tree, __pyx_d, ((PyObject *)__pyx_codeobj__150)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1110, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__151);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree, __pyx_n_s_ladderize, __pyx_t_2) < 0) __PYX_ERR(0, 1110, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4ete4_4core_4tree_Tree);

  /* "ete4/core/tree.pyx":1114
 *         ops.ladderize(self, topological, reverse)
 * 
 *     def sort_descendants(self, prop='name'):             # <<<<<<<<<<<<<<
 *         """Sort branches by leaf node values (names or any other given prop)."""
 *         leaf_values = self.get_cached_content(prop, container_type=list)
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_130sort_descendants, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Tree_sort_descendants, NULL, __pyx_n_s_ete4_core_tree, __pyx_d, ((PyObject *)__pyx_codeobj__153)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1114, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__154);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree, __pyx_n_s_sort_descendants, __pyx_t_2) < 0) __PYX_ERR(0, 1114, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4ete4_4core_4tree_Tree);

  /* "ete4/core/tree.pyx":1119
 *         ops.sort(self, key=lambda node: tuple(sorted(leaf_values[node])))
 * 
 *     def get_cached_content(self, prop=None, container_type=set,             # <<<<<<<<<<<<<<
 *                            leaves_only=True):
 *         """Return dict that assigns to each node a set of its leaves.
 */
  __Pyx_INCREF((PyObject *)(&PySet_Type));
  __pyx_k__24 = ((PyObject *)(&PySet_Type));
  __Pyx_GIVEREF((&PySet_Type));

  /* "ete4/core/tree.pyx":1120
 * 
 *     def get_cached_content(self, prop=None, container_type=set,
 *                            leaves_only=True):             # <<<<<<<<<<<<<<
 *         """Return dict that assigns to each node a set of its leaves.
 * 
 */
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1119, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, Py_None)) __PYX_ERR(0, 1119, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)(&PySet_Type));
  __Pyx_GIVEREF((PyObject *)(&PySet_Type));
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)(&PySet_Type)))) __PYX_ERR(0, 1119, __pyx_L1_error);
  __Pyx_INCREF(Py_True);
  __Pyx_GIVEREF(Py_True);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, Py_True)) __PYX_ERR(0, 1119, __pyx_L1_error);

  /* "ete4/core/tree.pyx":1119
 *         ops.sort(self, key=lambda node: tuple(sorted(leaf_values[node])))
 * 
 *     def get_cached_content(self, prop=None, container_type=set,             # <<<<<<<<<<<<<<
 *                            leaves_only=True):
 *         """Return dict that assigns to each node a set of its leaves.
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_132get_cached_content, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Tree_get_cached_content, NULL, __pyx_n_s_ete4_core_tree, __pyx_d, ((PyObject *)__pyx_codeobj__156)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1119, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree, __pyx_n_s_get_cached_content, __pyx_t_4) < 0) __PYX_ERR(0, 1119, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  PyType_Modified(__pyx_ptype_4ete4_4core_4tree_Tree);

  /* "ete4/core/tree.pyx":1158
 *         return leaves
 * 
 *     def robinson_foulds(self, t2, prop_t1='name', prop_t2='name',             # <<<<<<<<<<<<<<
 *                         unrooted_trees=False, expand_polytomies=False,
 *                         polytomy_size_limit=5, skip_large_polytomies=False,
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_134robinson_foulds, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Tree_robinson_foulds, NULL, __pyx_n_s_ete4_core_tree, __pyx_d, ((PyObject *)__pyx_codeobj__158)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1158, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__159);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree, __pyx_n_s_robinson_foulds, __pyx_t_4) < 0) __PYX_ERR(0, 1158, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  PyType_Modified(__pyx_ptype_4ete4_4core_4tree_Tree);

  /* "ete4/core/tree.pyx":1321
 *         return min_comparison
 * 
 *     def compare(self, ref_tree, use_collateral=False, min_support_source=0.0, min_support_ref=0.0,             # <<<<<<<<<<<<<<
 *                 has_duplications=False, expand_polytomies=False, unrooted=False,
 *                 max_treeko_splits_to_be_artifact=1000, ref_tree_attr='name', source_tree_attr='name'):
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_136compare, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Tree_compare, NULL, __pyx_n_s_ete4_core_tree, __pyx_d, ((PyObject *)__pyx_codeobj__161)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1321, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__162);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree, __pyx_n_s_compare_2, __pyx_t_4) < 0) __PYX_ERR(0, 1321, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  PyType_Modified(__pyx_ptype_4ete4_4core_4tree_Tree);

  /* "ete4/core/tree.pyx":1482
 *         return result
 * 
 *     def _diff(self, t2, output='topology', prop_t1='name', prop_t2='name', color=True):             # <<<<<<<<<<<<<<
 *         """Return the difference between two tree topologies.
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_138_diff, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Tree__diff, NULL, __pyx_n_s_ete4_core_tree, __pyx_d, ((PyObject *)__pyx_codeobj__164)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1482, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__165);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree, __pyx_n_s_diff, __pyx_t_4) < 0) __PYX_ERR(0, 1482, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  PyType_Modified(__pyx_ptype_4ete4_4core_4tree_Tree);

  /* "ete4/core/tree.pyx":1506
 *             raise TreeError(f'Unknown output for diff: {output}')
 * 
 *     def edges(self, cached_content=None):             # <<<<<<<<<<<<<<
 *         """Yield a pair of sets of leafs for every partition of the tree.
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_140edges, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Tree_edges, NULL, __pyx_n_s_ete4_core_tree, __pyx_d, ((PyObject *)__pyx_codeobj__36)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1506, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__45);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree, __pyx_n_s_edges, __pyx_t_4) < 0) __PYX_ERR(0, 1506, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  PyType_Modified(__pyx_ptype_4ete4_4core_4tree_Tree);

  /* "ete4/core/tree.pyx":1524
 *             yield (leaves_descendant, all_leaves - leaves_descendant)
 * 
 *     def standardize(self, delete_orphan=True, preserve_branch_length=True):             # <<<<<<<<<<<<<<
 *         """Resolve multifurcations and remove single-child nodes.
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_143standardize, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Tree_standardize, NULL, __pyx_n_s_ete4_core_tree, __pyx_d, ((PyObject *)__pyx_codeobj__168)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1524, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__169);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree, __pyx_n_s_standardize, __pyx_t_4) < 0) __PYX_ERR(0, 1524, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  PyType_Modified(__pyx_ptype_4ete4_4core_4tree_Tree);

  /* "ete4/core/tree.pyx":1538
 *                          preserve_branch_length=preserve_branch_length)
 * 
 *     def get_topology_id(self, prop='name'):             # <<<<<<<<<<<<<<
 *         """Return a unique ID representing the topology of the tree.
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_145get_topology_id, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Tree_get_topology_id, NULL, __pyx_n_s_ete4_core_tree, __pyx_d, ((PyObject *)__pyx_codeobj__171)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1538, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__154);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree, __pyx_n_s_get_topology_id, __pyx_t_4) < 0) __PYX_ERR(0, 1538, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  PyType_Modified(__pyx_ptype_4ete4_4core_4tree_Tree);

  /* "ete4/core/tree.pyx":1561
 *         return md5(str(sorted(edge_keys)).encode('utf-8')).hexdigest()
 * 
 *     def to_ultrametric(self, topological=False):             # <<<<<<<<<<<<<<
 *         """Convert tree to ultrametric (all leaves equidistant from root)."""
 *         ops.to_ultrametric(self, topological)
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_147to_ultrametric, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Tree_to_ultrametric, NULL, __pyx_n_s_ete4_core_tree, __pyx_d, ((PyObject *)__pyx_codeobj__173)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1561, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__83);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree, __pyx_n_s_to_ultrametric, __pyx_t_4) < 0) __PYX_ERR(0, 1561, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  PyType_Modified(__pyx_ptype_4ete4_4core_4tree_Tree);

  /* "ete4/core/tree.pyx":1565
 *         ops.to_ultrametric(self, topological)
 * 
 *     def is_monophyletic(self, nodes):             # <<<<<<<<<<<<<<
 *         """Return True if the nodes form a monophyletic group."""
 *         nodes = set(nodes)  # in case it is not a set already
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_149is_monophyletic, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Tree_is_monophyletic, NULL, __pyx_n_s_ete4_core_tree, __pyx_d, ((PyObject *)__pyx_codeobj__175)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1565, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree, __pyx_n_s_is_monophyletic, __pyx_t_4) < 0) __PYX_ERR(0, 1565, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  PyType_Modified(__pyx_ptype_4ete4_4core_4tree_Tree);

  /* "ete4/core/tree.pyx":1570
 *         return all(n in nodes for n in self.common_ancestor(nodes).leaves())
 * 
 *     def check_monophyly(self, values, prop='name', unrooted=False):             # <<<<<<<<<<<<<<
 *         """Return tuple (is_monophyletic, clade_type, leaves_extra).
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_151check_monophyly, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Tree_check_monophyly, NULL, __pyx_n_s_ete4_core_tree, __pyx_d, ((PyObject *)__pyx_codeobj__177)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1570, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__178);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree, __pyx_n_s_check_monophyly, __pyx_t_4) < 0) __PYX_ERR(0, 1570, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  PyType_Modified(__pyx_ptype_4ete4_4core_4tree_Tree);

  /* "ete4/core/tree.pyx":1607
 *             return False, 'polyphyletic', leaves_extra
 * 
 *     def get_monophyletic(self, values, prop='name'):             # <<<<<<<<<<<<<<
 *         """Yield nodes matching the provided monophyly criteria.
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_153get_monophyletic, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Tree_get_monophyletic, NULL, __pyx_n_s_ete4_core_tree, __pyx_d, ((PyObject *)__pyx_codeobj__37)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1607, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__154);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree, __pyx_n_s_get_monophyletic, __pyx_t_4) < 0) __PYX_ERR(0, 1607, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  PyType_Modified(__pyx_ptype_4ete4_4core_4tree_Tree);

  /* "ete4/core/tree.pyx":1625
 *         yield from self.leaves(is_leaf_fn=is_monophyletic)
 * 
 *     def expand_polytomies(self, map_prop="name", polytomy_size_limit=5,             # <<<<<<<<<<<<<<
 *                           skip_large_polytomies=False):
 *         """Return all combinations of solutions of the multifurcated nodes.
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_156expand_polytomies, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Tree_expand_polytomies, NULL, __pyx_n_s_ete4_core_tree, __pyx_d, ((PyObject *)__pyx_codeobj__181)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1625, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__182);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree, __pyx_n_s_expand_polytomies, __pyx_t_4) < 0) __PYX_ERR(0, 1625, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  PyType_Modified(__pyx_ptype_4ete4_4core_4tree_Tree);

  /* "ete4/core/tree.pyx":1683
 *         return ["%s;"%str(nw) for nw in n2subtrees[self]] # tuples are in newick format ^_^
 * 
 *     def resolve_polytomy(self, descendants=True):             # <<<<<<<<<<<<<<
 *         """Convert node to a series of dicotomies if it is a polytomy.
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_158resolve_polytomy, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Tree_resolve_polytomy, NULL, __pyx_n_s_ete4_core_tree, __pyx_d, ((PyObject *)__pyx_codeobj__184)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1683, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__185);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree, __pyx_n_s_resolve_polytomy, __pyx_t_4) < 0) __PYX_ERR(0, 1683, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  PyType_Modified(__pyx_ptype_4ete4_4core_4tree_Tree);

  /* "ete4/core/tree.pyx":1696
 *         ops.resolve_polytomy(self, descendants)
 * 
 *     def cophenetic_matrix(self):             # <<<<<<<<<<<<<<
 *         """Return a cophenetic distance matrix of the tree.
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_160cophenetic_matrix, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Tree_cophenetic_matrix, NULL, __pyx_n_s_ete4_core_tree, __pyx_d, ((PyObject *)__pyx_codeobj__187)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1696, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree, __pyx_n_s_cophenetic_matrix, __pyx_t_4) < 0) __PYX_ERR(0, 1696, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  PyType_Modified(__pyx_ptype_4ete4_4core_4tree_Tree);

  /* "ete4/core/tree.pyx":1797
 *     # TODO: The next two functions should really be parsers (which may
 *     # be also used when calling __init__().
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_parent_child_table(parent_child_table):
 *         """Convert a parent-child table into an ETE Tree instance.
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_162from_parent_child_table, __Pyx_CYFUNCTION_STATICMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Tree_from_parent_child_table, NULL, __pyx_n_s_ete4_core_tree, __pyx_d, ((PyObject *)__pyx_codeobj__189)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1797, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree, __pyx_n_s_from_parent_child_table, __pyx_t_4) < 0) __PYX_ERR(0, 1797, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  PyType_Modified(__pyx_ptype_4ete4_4core_4tree_Tree);
  __Pyx_GetNameInClass(__pyx_t_4, (PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree, __pyx_n_s_from_parent_child_table); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1797, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1797, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree, __pyx_n_s_from_parent_child_table, __pyx_t_2) < 0) __PYX_ERR(0, 1797, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4ete4_4core_4tree_Tree);

  /* "ete4/core/tree.pyx":1845
 *         return root
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_skbio(skbio_tree, map_attributes=None):
 *         """Convert a scikit-bio TreeNode object into ETE Tree object.
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_164from_skbio, __Pyx_CYFUNCTION_STATICMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Tree_from_skbio, NULL, __pyx_n_s_ete4_core_tree, __pyx_d, ((PyObject *)__pyx_codeobj__191)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1845, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__45);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree, __pyx_n_s_from_skbio, __pyx_t_2) < 0) __PYX_ERR(0, 1845, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4ete4_4core_4tree_Tree);
  __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree, __pyx_n_s_from_skbio); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1845, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1845, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree, __pyx_n_s_from_skbio, __pyx_t_4) < 0) __PYX_ERR(0, 1845, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  PyType_Modified(__pyx_ptype_4ete4_4core_4tree_Tree);

  /* "ete4/core/tree.pyx":1884
 *     # Functions used for treeview (qt visualization).
 * 
 *     def add_face(self, face, column, position='branch-right'):             # <<<<<<<<<<<<<<
 *         from ..treeview import Face, FaceContainer
 *         from ..treeview.main import _FaceAreas, FACE_POSITIONS
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_166add_face, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Tree_add_face, NULL, __pyx_n_s_ete4_core_tree, __pyx_d, ((PyObject *)__pyx_codeobj__193)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1884, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__194);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree, __pyx_n_s_add_face, __pyx_t_4) < 0) __PYX_ERR(0, 1884, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  PyType_Modified(__pyx_ptype_4ete4_4core_4tree_Tree);

  /* "ete4/core/tree.pyx":1914
 *         self.props['_img_style'] = value
 * 
 *     def set_style(self, value):             # <<<<<<<<<<<<<<
 *         self.props['_img_style'] = value
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_168set_style, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Tree_set_style, NULL, __pyx_n_s_ete4_core_tree, __pyx_d, ((PyObject *)__pyx_codeobj__196)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1914, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree, __pyx_n_s_set_style, __pyx_t_4) < 0) __PYX_ERR(0, 1914, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  PyType_Modified(__pyx_ptype_4ete4_4core_4tree_Tree);

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_170__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Tree___reduce_cython, NULL, __pyx_n_s_ete4_core_tree, __pyx_d, ((PyObject *)__pyx_codeobj__198)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree, __pyx_n_s_reduce_cython, __pyx_t_4) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  PyType_Modified(__pyx_ptype_4ete4_4core_4tree_Tree);

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_Tree, (type(self), 0x9050475, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_Tree__set_state(self, __pyx_state)
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_4Tree_172__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Tree___setstate_cython, NULL, __pyx_n_s_ete4_core_tree, __pyx_d, ((PyObject *)__pyx_codeobj__200)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4ete4_4core_4tree_Tree, __pyx_n_s_setstate_cython, __pyx_t_4) < 0) __PYX_ERR(1, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  PyType_Modified(__pyx_ptype_4ete4_4core_4tree_Tree);

  /* "(tree fragment)":1
 * def __pyx_unpickle_Tree(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4ete4_4core_4tree_1__pyx_unpickle_Tree, 0, __pyx_n_s_pyx_unpickle_Tree, NULL, __pyx_n_s_ete4_core_tree, __pyx_d, ((PyObject *)__pyx_codeobj__202)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Tree, __pyx_t_4) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ete4/core/tree.pyx":1
 * """             # <<<<<<<<<<<<<<
 * This module provides the class Tree, which is the main one used in ete.
 * 
 */
  __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_4) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /*--- Wrapped vars code ---*/

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  if (__pyx_m) {
    if (__pyx_d && stringtab_initialized) {
      __Pyx_AddTraceback("init ete4.core.tree", __pyx_clineno, __pyx_lineno, __pyx_filename);
    }
    #if !CYTHON_USE_MODULE_STATE
    Py_CLEAR(__pyx_m);
    #else
    Py_DECREF(__pyx_m);
    if (pystate_addmodule_run) {
      PyObject *tp, *value, *tb;
      PyErr_Fetch(&tp, &value, &tb);
      PyState_RemoveModule(&__pyx_moduledef);
      PyErr_Restore(tp, value, tb);
    }
    #endif
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init ete4.core.tree");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  return (__pyx_m != NULL) ? 0 : -1;
  #elif PY_MAJOR_VERSION >= 3
  return __pyx_m;
  #else
  return;
  #endif
}
/* #### Code section: cleanup_globals ### */
/* #### Code section: cleanup_module ### */
/* #### Code section: main_method ### */
/* #### Code section: utility_code_pragmas ### */
#ifdef _MSC_VER
#pragma warning( push )
/* Warning 4127: conditional expression is constant
 * Cython uses constant conditional expressions to allow in inline functions to be optimized at
 * compile-time, so this warning is not useful
 */
#pragma warning( disable : 4127 )
#endif



/* #### Code section: utility_code_def ### */

/* --- Runtime support code --- */
/* Refnanny */
#if CYTHON_REFNANNY
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
    PyObject *m = NULL, *p = NULL;
    void *r = NULL;
    m = PyImport_ImportModule(modname);
    if (!m) goto end;
    p = PyObject_GetAttrString(m, "RefNannyAPI");
    if (!p) goto end;
    r = PyLong_AsVoidPtr(p);
end:
    Py_XDECREF(p);
    Py_XDECREF(m);
    return (__Pyx_RefNannyAPIStruct *)r;
}
#endif

/* PyErrExceptionMatches */
#if CYTHON_FAST_THREAD_STATE
static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
    Py_ssize_t i, n;
    n = PyTuple_GET_SIZE(tuple);
#if PY_MAJOR_VERSION >= 3
    for (i=0; i<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
#endif
    for (i=0; i<n; i++) {
        if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
    }
    return 0;
}
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
    int result;
    PyObject *exc_type;
#if PY_VERSION_HEX >= 0x030C00A6
    PyObject *current_exception = tstate->current_exception;
    if (unlikely(!current_exception)) return 0;
    exc_type = (PyObject*) Py_TYPE(current_exception);
    if (exc_type == err) return 1;
#else
    exc_type = tstate->curexc_type;
    if (exc_type == err) return 1;
    if (unlikely(!exc_type)) return 0;
#endif
    #if CYTHON_AVOID_BORROWED_REFS
    Py_INCREF(exc_type);
    #endif
    if (unlikely(PyTuple_Check(err))) {
        result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
    } else {
        result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
    }
    #if CYTHON_AVOID_BORROWED_REFS
    Py_DECREF(exc_type);
    #endif
    return result;
}
#endif

/* PyErrFetchRestore */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
#if PY_VERSION_HEX >= 0x030C00A6
    PyObject *tmp_value;
    assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value)));
    if (value) {
        #if CYTHON_COMPILING_IN_CPYTHON
        if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb))
        #endif
            PyException_SetTraceback(value, tb);
    }
    tmp_value = tstate->current_exception;
    tstate->current_exception = value;
    Py_XDECREF(tmp_value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
#else
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    tmp_type = tstate->curexc_type;
    tmp_value = tstate->curexc_value;
    tmp_tb = tstate->curexc_traceback;
    tstate->curexc_type = type;
    tstate->curexc_value = value;
    tstate->curexc_traceback = tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#endif
}
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
#if PY_VERSION_HEX >= 0x030C00A6
    PyObject* exc_value;
    exc_value = tstate->current_exception;
    tstate->current_exception = 0;
    *value = exc_value;
    *type = NULL;
    *tb = NULL;
    if (exc_value) {
        *type = (PyObject*) Py_TYPE(exc_value);
        Py_INCREF(*type);
        #if CYTHON_COMPILING_IN_CPYTHON
        *tb = ((PyBaseExceptionObject*) exc_value)->traceback;
        Py_XINCREF(*tb);
        #else
        *tb = PyException_GetTraceback(exc_value);
        #endif
    }
#else
    *type = tstate->curexc_type;
    *value = tstate->curexc_value;
    *tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
#endif
}
#endif

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

/* PyObjectGetAttrStrNoError */
#if __PYX_LIMITED_VERSION_HEX < 0x030d00A1
static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
        __Pyx_PyErr_Clear();
}
#endif
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
    PyObject *result;
#if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1
    (void) PyObject_GetOptionalAttr(obj, attr_name, &result);
    return result;
#else
#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
        return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
    }
#endif
    result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
    if (unlikely(!result)) {
        __Pyx_PyObject_GetAttrStr_ClearAttributeError();
    }
    return result;
#endif
}

/* GetBuiltinName */
static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
    PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name);
    if (unlikely(!result) && !PyErr_Occurred()) {
        PyErr_Format(PyExc_NameError,
#if PY_MAJOR_VERSION >= 3
            "name '%U' is not defined", name);
#else
            "name '%.200s' is not defined", PyString_AS_STRING(name));
#endif
    }
    return result;
}

/* TupleAndListFromArray */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) {
    PyObject *v;
    Py_ssize_t i;
    for (i = 0; i < length; i++) {
        v = dest[i] = src[i];
        Py_INCREF(v);
    }
}
static CYTHON_INLINE PyObject *
__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n)
{
    PyObject *res;
    if (n <= 0) {
        Py_INCREF(__pyx_empty_tuple);
        return __pyx_empty_tuple;
    }
    res = PyTuple_New(n);
    if (unlikely(res == NULL)) return NULL;
    __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n);
    return res;
}
static CYTHON_INLINE PyObject *
__Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n)
{
    PyObject *res;
    if (n <= 0) {
        return PyList_New(0);
    }
    res = PyList_New(n);
    if (unlikely(res == NULL)) return NULL;
    __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n);
    return res;
}
#endif

/* BytesEquals */
static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API
    return PyObject_RichCompareBool(s1, s2, equals);
#else
    if (s1 == s2) {
        return (equals == Py_EQ);
    } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
        const char *ps1, *ps2;
        Py_ssize_t length = PyBytes_GET_SIZE(s1);
        if (length != PyBytes_GET_SIZE(s2))
            return (equals == Py_NE);
        ps1 = PyBytes_AS_STRING(s1);
        ps2 = PyBytes_AS_STRING(s2);
        if (ps1[0] != ps2[0]) {
            return (equals == Py_NE);
        } else if (length == 1) {
            return (equals == Py_EQ);
        } else {
            int result;
#if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000)
            Py_hash_t hash1, hash2;
            hash1 = ((PyBytesObject*)s1)->ob_shash;
            hash2 = ((PyBytesObject*)s2)->ob_shash;
            if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
                return (equals == Py_NE);
            }
#endif
            result = memcmp(ps1, ps2, (size_t)length);
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
        return (equals == Py_NE);
    } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
        return (equals == Py_NE);
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
#endif
}

/* UnicodeEquals */
static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API
    return PyObject_RichCompareBool(s1, s2, equals);
#else
#if PY_MAJOR_VERSION < 3
    PyObject* owned_ref = NULL;
#endif
    int s1_is_unicode, s2_is_unicode;
    if (s1 == s2) {
        goto return_eq;
    }
    s1_is_unicode = PyUnicode_CheckExact(s1);
    s2_is_unicode = PyUnicode_CheckExact(s2);
#if PY_MAJOR_VERSION < 3
    if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
        owned_ref = PyUnicode_FromObject(s2);
        if (unlikely(!owned_ref))
            return -1;
        s2 = owned_ref;
        s2_is_unicode = 1;
    } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
        owned_ref = PyUnicode_FromObject(s1);
        if (unlikely(!owned_ref))
            return -1;
        s1 = owned_ref;
        s1_is_unicode = 1;
    } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
        return __Pyx_PyBytes_Equals(s1, s2, equals);
    }
#endif
    if (s1_is_unicode & s2_is_unicode) {
        Py_ssize_t length;
        int kind;
        void *data1, *data2;
        if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
            return -1;
        length = __Pyx_PyUnicode_GET_LENGTH(s1);
        if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
            goto return_ne;
        }
#if CYTHON_USE_UNICODE_INTERNALS
        {
            Py_hash_t hash1, hash2;
        #if CYTHON_PEP393_ENABLED
            hash1 = ((PyASCIIObject*)s1)->hash;
            hash2 = ((PyASCIIObject*)s2)->hash;
        #else
            hash1 = ((PyUnicodeObject*)s1)->hash;
            hash2 = ((PyUnicodeObject*)s2)->hash;
        #endif
            if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
                goto return_ne;
            }
        }
#endif
        kind = __Pyx_PyUnicode_KIND(s1);
        if (kind != __Pyx_PyUnicode_KIND(s2)) {
            goto return_ne;
        }
        data1 = __Pyx_PyUnicode_DATA(s1);
        data2 = __Pyx_PyUnicode_DATA(s2);
        if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
            goto return_ne;
        } else if (length == 1) {
            goto return_eq;
        } else {
            int result = memcmp(data1, data2, (size_t)(length * kind));
            #if PY_MAJOR_VERSION < 3
            Py_XDECREF(owned_ref);
            #endif
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & s2_is_unicode) {
        goto return_ne;
    } else if ((s2 == Py_None) & s1_is_unicode) {
        goto return_ne;
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        #if PY_MAJOR_VERSION < 3
        Py_XDECREF(owned_ref);
        #endif
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
return_eq:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(owned_ref);
    #endif
    return (equals == Py_EQ);
return_ne:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(owned_ref);
    #endif
    return (equals == Py_NE);
#endif
}

/* fastcall */
#if CYTHON_METH_FASTCALL
static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s)
{
    Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames);
    for (i = 0; i < n; i++)
    {
        if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i];
    }
    for (i = 0; i < n; i++)
    {
        int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ);
        if (unlikely(eq != 0)) {
            if (unlikely(eq < 0)) return NULL;
            return kwvalues[i];
        }
    }
    return NULL;
}
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000
CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) {
    Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames);
    PyObject *dict;
    dict = PyDict_New();
    if (unlikely(!dict))
        return NULL;
    for (i=0; i<nkwargs; i++) {
        PyObject *key = PyTuple_GET_ITEM(kwnames, i);
        if (unlikely(PyDict_SetItem(dict, key, kwvalues[i]) < 0))
            goto bad;
    }
    return dict;
bad:
    Py_DECREF(dict);
    return NULL;
}
#endif
#endif

/* RaiseDoubleKeywords */
static void __Pyx_RaiseDoubleKeywordsError(
    const char* func_name,
    PyObject* kw_name)
{
    PyErr_Format(PyExc_TypeError,
        #if PY_MAJOR_VERSION >= 3
        "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
        #else
        "%s() got multiple values for keyword argument '%s'", func_name,
        PyString_AsString(kw_name));
        #endif
}

/* ParseKeywords */
static int __Pyx_ParseOptionalKeywords(
    PyObject *kwds,
    PyObject *const *kwvalues,
    PyObject **argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    const char* function_name)
{
    PyObject *key = 0, *value = 0;
    Py_ssize_t pos = 0;
    PyObject*** name;
    PyObject*** first_kw_arg = argnames + num_pos_args;
    int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds));
    while (1) {
        Py_XDECREF(key); key = NULL;
        Py_XDECREF(value); value = NULL;
        if (kwds_is_tuple) {
            Py_ssize_t size;
#if CYTHON_ASSUME_SAFE_MACROS
            size = PyTuple_GET_SIZE(kwds);
#else
            size = PyTuple_Size(kwds);
            if (size < 0) goto bad;
#endif
            if (pos >= size) break;
#if CYTHON_AVOID_BORROWED_REFS
            key = __Pyx_PySequence_ITEM(kwds, pos);
            if (!key) goto bad;
#elif CYTHON_ASSUME_SAFE_MACROS
            key = PyTuple_GET_ITEM(kwds, pos);
#else
            key = PyTuple_GetItem(kwds, pos);
            if (!key) goto bad;
#endif
            value = kwvalues[pos];
            pos++;
        }
        else
        {
            if (!PyDict_Next(kwds, &pos, &key, &value)) break;
#if CYTHON_AVOID_BORROWED_REFS
            Py_INCREF(key);
#endif
        }
        name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (*name) {
            values[name-argnames] = value;
#if CYTHON_AVOID_BORROWED_REFS
            Py_INCREF(value);
            Py_DECREF(key);
#endif
            key = NULL;
            value = NULL;
            continue;
        }
#if !CYTHON_AVOID_BORROWED_REFS
        Py_INCREF(key);
#endif
        Py_INCREF(value);
        name = first_kw_arg;
        #if PY_MAJOR_VERSION < 3
        if (likely(PyString_Check(key))) {
            while (*name) {
                if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
                        && _PyString_Eq(**name, key)) {
                    values[name-argnames] = value;
#if CYTHON_AVOID_BORROWED_REFS
                    value = NULL;
#endif
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    if ((**argname == key) || (
                            (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
                             && _PyString_Eq(**argname, key))) {
                        goto arg_passed_twice;
                    }
                    argname++;
                }
            }
        } else
        #endif
        if (likely(PyUnicode_Check(key))) {
            while (*name) {
                int cmp = (
                #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                    (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
                #endif
                    PyUnicode_Compare(**name, key)
                );
                if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                if (cmp == 0) {
                    values[name-argnames] = value;
#if CYTHON_AVOID_BORROWED_REFS
                    value = NULL;
#endif
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    int cmp = (**argname == key) ? 0 :
                    #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                        (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
                    #endif
                        PyUnicode_Compare(**argname, key);
                    if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                    if (cmp == 0) goto arg_passed_twice;
                    argname++;
                }
            }
        } else
            goto invalid_keyword_type;
        if (kwds2) {
            if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
        } else {
            goto invalid_keyword;
        }
    }
    Py_XDECREF(key);
    Py_XDECREF(value);
    return 0;
arg_passed_twice:
    __Pyx_RaiseDoubleKeywordsError(function_name, key);
    goto bad;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%.200s() keywords must be strings", function_name);
    goto bad;
invalid_keyword:
    #if PY_MAJOR_VERSION < 3
    PyErr_Format(PyExc_TypeError,
        "%.200s() got an unexpected keyword argument '%.200s'",
        function_name, PyString_AsString(key));
    #else
    PyErr_Format(PyExc_TypeError,
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
bad:
    Py_XDECREF(key);
    Py_XDECREF(value);
    return -1;
}

/* RaiseArgTupleInvalid */
static void __Pyx_RaiseArgtupleInvalid(
    const char* func_name,
    int exact,
    Py_ssize_t num_min,
    Py_ssize_t num_max,
    Py_ssize_t num_found)
{
    Py_ssize_t num_expected;
    const char *more_or_less;
    if (num_found < num_min) {
        num_expected = num_min;
        more_or_less = "at least";
    } else {
        num_expected = num_max;
        more_or_less = "at most";
    }
    if (exact) {
        more_or_less = "exactly";
    }
    PyErr_Format(PyExc_TypeError,
                 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
                 func_name, more_or_less, num_expected,
                 (num_expected == 1) ? "" : "s", num_found);
}

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

/* RaiseException */
#if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
    __Pyx_PyThreadState_declare
    CYTHON_UNUSED_VAR(cause);
    Py_XINCREF(type);
    if (!value || value == Py_None)
        value = NULL;
    else
        Py_INCREF(value);
    if (!tb || tb == Py_None)
        tb = NULL;
    else {
        Py_INCREF(tb);
        if (!PyTraceBack_Check(tb)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: arg 3 must be a traceback or None");
            goto raise_error;
        }
    }
    if (PyType_Check(type)) {
#if CYTHON_COMPILING_IN_PYPY
        if (!value) {
            Py_INCREF(Py_None);
            value = Py_None;
        }
#endif
        PyErr_NormalizeException(&type, &value, &tb);
    } else {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto raise_error;
        }
        value = type;
        type = (PyObject*) Py_TYPE(type);
        Py_INCREF(type);
        if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: exception class must be a subclass of BaseException");
            goto raise_error;
        }
    }
    __Pyx_PyThreadState_assign
    __Pyx_ErrRestore(type, value, tb);
    return;
raise_error:
    Py_XDECREF(value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
    return;
}
#else
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
    PyObject* owned_instance = NULL;
    if (tb == Py_None) {
        tb = 0;
    } else if (tb && !PyTraceBack_Check(tb)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: arg 3 must be a traceback or None");
        goto bad;
    }
    if (value == Py_None)
        value = 0;
    if (PyExceptionInstance_Check(type)) {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto bad;
        }
        value = type;
        type = (PyObject*) Py_TYPE(value);
    } else if (PyExceptionClass_Check(type)) {
        PyObject *instance_class = NULL;
        if (value && PyExceptionInstance_Check(value)) {
            instance_class = (PyObject*) Py_TYPE(value);
            if (instance_class != type) {
                int is_subclass = PyObject_IsSubclass(instance_class, type);
                if (!is_subclass) {
                    instance_class = NULL;
                } else if (unlikely(is_subclass == -1)) {
                    goto bad;
                } else {
                    type = instance_class;
                }
            }
        }
        if (!instance_class) {
            PyObject *args;
            if (!value)
                args = PyTuple_New(0);
            else if (PyTuple_Check(value)) {
                Py_INCREF(value);
                args = value;
            } else
                args = PyTuple_Pack(1, value);
            if (!args)
                goto bad;
            owned_instance = PyObject_Call(type, args, NULL);
            Py_DECREF(args);
            if (!owned_instance)
                goto bad;
            value = owned_instance;
            if (!PyExceptionInstance_Check(value)) {
                PyErr_Format(PyExc_TypeError,
                             "calling %R should have returned an instance of "
                             "BaseException, not %R",
                             type, Py_TYPE(value));
                goto bad;
            }
        }
    } else {
        PyErr_SetString(PyExc_TypeError,
            "raise: exception class must be a subclass of BaseException");
        goto bad;
    }
    if (cause) {
        PyObject *fixed_cause;
        if (cause == Py_None) {
            fixed_cause = NULL;
        } else if (PyExceptionClass_Check(cause)) {
            fixed_cause = PyObject_CallObject(cause, NULL);
            if (fixed_cause == NULL)
                goto bad;
        } else if (PyExceptionInstance_Check(cause)) {
            fixed_cause = cause;
            Py_INCREF(fixed_cause);
        } else {
            PyErr_SetString(PyExc_TypeError,
                            "exception causes must derive from "
                            "BaseException");
            goto bad;
        }
        PyException_SetCause(value, fixed_cause);
    }
    PyErr_SetObject(type, value);
    if (tb) {
      #if PY_VERSION_HEX >= 0x030C00A6
        PyException_SetTraceback(value, tb);
      #elif CYTHON_FAST_THREAD_STATE
        PyThreadState *tstate = __Pyx_PyThreadState_Current;
        PyObject* tmp_tb = tstate->curexc_traceback;
        if (tb != tmp_tb) {
            Py_INCREF(tb);
            tstate->curexc_traceback = tb;
            Py_XDECREF(tmp_tb);
        }
#else
        PyObject *tmp_type, *tmp_value, *tmp_tb;
        PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
        Py_INCREF(tb);
        PyErr_Restore(tmp_type, tmp_value, tb);
        Py_XDECREF(tmp_tb);
#endif
    }
bad:
    Py_XDECREF(owned_instance);
    return;
}
#endif

/* PyFunctionFastCall */
#if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL
static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
                                               PyObject *globals) {
    PyFrameObject *f;
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    PyObject **fastlocals;
    Py_ssize_t i;
    PyObject *result;
    assert(globals != NULL);
    /* XXX Perhaps we should create a specialized
       PyFrame_New() that doesn't take locals, but does
       take builtins without sanity checking them.
       */
    assert(tstate != NULL);
    f = PyFrame_New(tstate, co, globals, NULL);
    if (f == NULL) {
        return NULL;
    }
    fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
    for (i = 0; i < na; i++) {
        Py_INCREF(*args);
        fastlocals[i] = *args++;
    }
    result = PyEval_EvalFrameEx(f,0);
    ++tstate->recursion_depth;
    Py_DECREF(f);
    --tstate->recursion_depth;
    return result;
}
static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
    PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
    PyObject *globals = PyFunction_GET_GLOBALS(func);
    PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
    PyObject *closure;
#if PY_MAJOR_VERSION >= 3
    PyObject *kwdefs;
#endif
    PyObject *kwtuple, **k;
    PyObject **d;
    Py_ssize_t nd;
    Py_ssize_t nk;
    PyObject *result;
    assert(kwargs == NULL || PyDict_Check(kwargs));
    nk = kwargs ? PyDict_Size(kwargs) : 0;
    #if PY_MAJOR_VERSION < 3
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) {
        return NULL;
    }
    #else
    if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) {
        return NULL;
    }
    #endif
    if (
#if PY_MAJOR_VERSION >= 3
            co->co_kwonlyargcount == 0 &&
#endif
            likely(kwargs == NULL || nk == 0) &&
            co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
        if (argdefs == NULL && co->co_argcount == nargs) {
            result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
            goto done;
        }
        else if (nargs == 0 && argdefs != NULL
                 && co->co_argcount == Py_SIZE(argdefs)) {
            /* function called with no arguments, but all parameters have
               a default value: use default values as arguments .*/
            args = &PyTuple_GET_ITEM(argdefs, 0);
            result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
            goto done;
        }
    }
    if (kwargs != NULL) {
        Py_ssize_t pos, i;
        kwtuple = PyTuple_New(2 * nk);
        if (kwtuple == NULL) {
            result = NULL;
            goto done;
        }
        k = &PyTuple_GET_ITEM(kwtuple, 0);
        pos = i = 0;
        while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
            Py_INCREF(k[i]);
            Py_INCREF(k[i+1]);
            i += 2;
        }
        nk = i / 2;
    }
    else {
        kwtuple = NULL;
        k = NULL;
    }
    closure = PyFunction_GET_CLOSURE(func);
#if PY_MAJOR_VERSION >= 3
    kwdefs = PyFunction_GET_KW_DEFAULTS(func);
#endif
    if (argdefs != NULL) {
        d = &PyTuple_GET_ITEM(argdefs, 0);
        nd = Py_SIZE(argdefs);
    }
    else {
        d = NULL;
        nd = 0;
    }
#if PY_MAJOR_VERSION >= 3
    result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
                               args, (int)nargs,
                               k, (int)nk,
                               d, (int)nd, kwdefs, closure);
#else
    result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
                               args, (int)nargs,
                               k, (int)nk,
                               d, (int)nd, closure);
#endif
    Py_XDECREF(kwtuple);
done:
    Py_LeaveRecursiveCall();
    return result;
}
#endif

/* PyObjectCall */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyObject *result;
    ternaryfunc call = Py_TYPE(func)->tp_call;
    if (unlikely(!call))
        return PyObject_Call(func, arg, kw);
    #if PY_MAJOR_VERSION < 3
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    #else
    if (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
        return NULL;
    #endif
    result = (*call)(func, arg, kw);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

/* PyObjectCallMethO */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
    PyObject *self, *result;
    PyCFunction cfunc;
    cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func);
    self = __Pyx_CyOrPyCFunction_GET_SELF(func);
    #if PY_MAJOR_VERSION < 3
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    #else
    if (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
        return NULL;
    #endif
    result = cfunc(self, arg);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

/* PyObjectFastCall */
#if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API
static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) {
    PyObject *argstuple;
    PyObject *result = 0;
    size_t i;
    argstuple = PyTuple_New((Py_ssize_t)nargs);
    if (unlikely(!argstuple)) return NULL;
    for (i = 0; i < nargs; i++) {
        Py_INCREF(args[i]);
        if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad;
    }
    result = __Pyx_PyObject_Call(func, argstuple, kwargs);
  bad:
    Py_DECREF(argstuple);
    return result;
}
#endif
static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) {
    Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs);
#if CYTHON_COMPILING_IN_CPYTHON
    if (nargs == 0 && kwargs == NULL) {
        if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS))
            return __Pyx_PyObject_CallMethO(func, NULL);
    }
    else if (nargs == 1 && kwargs == NULL) {
        if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O))
            return __Pyx_PyObject_CallMethO(func, args[0]);
    }
#endif
    #if PY_VERSION_HEX < 0x030800B1
    #if CYTHON_FAST_PYCCALL
    if (PyCFunction_Check(func)) {
        if (kwargs) {
            return _PyCFunction_FastCallDict(func, args, nargs, kwargs);
        } else {
            return _PyCFunction_FastCallKeywords(func, args, nargs, NULL);
        }
    }
    #if PY_VERSION_HEX >= 0x030700A1
    if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) {
        return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL);
    }
    #endif
    #endif
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(func)) {
        return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs);
    }
    #endif
    #endif
    if (kwargs == NULL) {
        #if CYTHON_VECTORCALL
        #if PY_VERSION_HEX < 0x03090000
        vectorcallfunc f = _PyVectorcall_Function(func);
        #else
        vectorcallfunc f = PyVectorcall_Function(func);
        #endif
        if (f) {
            return f(func, args, (size_t)nargs, NULL);
        }
        #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL
        if (__Pyx_CyFunction_CheckExact(func)) {
            __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func);
            if (f) return f(func, args, (size_t)nargs, NULL);
        }
        #endif
    }
    if (nargs == 0) {
        return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs);
    }
    #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API
    return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs);
    #else
    return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs);
    #endif
}

/* RaiseUnexpectedTypeError */
static int
__Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj)
{
    __Pyx_TypeName obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
    PyErr_Format(PyExc_TypeError, "Expected %s, got " __Pyx_FMT_TYPENAME,
                 expected, obj_type_name);
    __Pyx_DECREF_TypeName(obj_type_name);
    return 0;
}

/* PyDictVersioning */
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
    PyObject *dict = Py_TYPE(obj)->tp_dict;
    return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
}
static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
    PyObject **dictptr = NULL;
    Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
    if (offset) {
#if CYTHON_COMPILING_IN_CPYTHON
        dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
#else
        dictptr = _PyObject_GetDictPtr(obj);
#endif
    }
    return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
}
static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
    PyObject *dict = Py_TYPE(obj)->tp_dict;
    if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
        return 0;
    return obj_dict_version == __Pyx_get_object_dict_version(obj);
}
#endif

/* GetModuleGlobalName */
#if CYTHON_USE_DICT_VERSIONS
static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
#else
static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
#endif
{
    PyObject *result;
#if !CYTHON_AVOID_BORROWED_REFS
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000
    result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
    __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return __Pyx_NewRef(result);
    } else if (unlikely(PyErr_Occurred())) {
        return NULL;
    }
#elif CYTHON_COMPILING_IN_LIMITED_API
    if (unlikely(!__pyx_m)) {
        return NULL;
    }
    result = PyObject_GetAttr(__pyx_m, name);
    if (likely(result)) {
        return result;
    }
#else
    result = PyDict_GetItem(__pyx_d, name);
    __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return __Pyx_NewRef(result);
    }
#endif
#else
    result = PyObject_GetItem(__pyx_d, name);
    __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return __Pyx_NewRef(result);
    }
    PyErr_Clear();
#endif
    return __Pyx_GetBuiltinName(name);
}

/* RaiseTooManyValuesToUnpack */
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
    PyErr_Format(PyExc_ValueError,
                 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
}

/* RaiseNeedMoreValuesToUnpack */
static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
    PyErr_Format(PyExc_ValueError,
                 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
                 index, (index == 1) ? "" : "s");
}

/* IterFinish */
static CYTHON_INLINE int __Pyx_IterFinish(void) {
    PyObject* exc_type;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    exc_type = __Pyx_PyErr_CurrentExceptionType();
    if (unlikely(exc_type)) {
        if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))
            return -1;
        __Pyx_PyErr_Clear();
        return 0;
    }
    return 0;
}

/* UnpackItemEndCheck */
static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
    if (unlikely(retval)) {
        Py_DECREF(retval);
        __Pyx_RaiseTooManyValuesError(expected);
        return -1;
    }
    return __Pyx_IterFinish();
}

/* GetItemInt */
static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
    PyObject *r;
    if (unlikely(!j)) return NULL;
    r = PyObject_GetItem(o, j);
    Py_DECREF(j);
    return r;
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                                                              CYTHON_NCP_UNUSED int wraparound,
                                                              CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    Py_ssize_t wrapped_i = i;
    if (wraparound & unlikely(i < 0)) {
        wrapped_i += PyList_GET_SIZE(o);
    }
    if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
        PyObject *r = PyList_GET_ITEM(o, wrapped_i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                              CYTHON_NCP_UNUSED int wraparound,
                                                              CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    Py_ssize_t wrapped_i = i;
    if (wraparound & unlikely(i < 0)) {
        wrapped_i += PyTuple_GET_SIZE(o);
    }
    if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
        PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
                                                     CYTHON_NCP_UNUSED int wraparound,
                                                     CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
    if (is_list || PyList_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
        if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
            PyObject *r = PyList_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    }
    else if (PyTuple_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
        if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
            PyObject *r = PyTuple_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    } else {
        PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping;
        PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence;
        if (mm && mm->mp_subscript) {
            PyObject *r, *key = PyInt_FromSsize_t(i);
            if (unlikely(!key)) return NULL;
            r = mm->mp_subscript(o, key);
            Py_DECREF(key);
            return r;
        }
        if (likely(sm && sm->sq_item)) {
            if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) {
                Py_ssize_t l = sm->sq_length(o);
                if (likely(l >= 0)) {
                    i += l;
                } else {
                    if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                        return NULL;
                    PyErr_Clear();
                }
            }
            return sm->sq_item(o, i);
        }
    }
#else
    if (is_list || !PyMapping_Check(o)) {
        return PySequence_GetItem(o, i);
    }
#endif
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}

/* PyObjectCallOneArg */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *args[2] = {NULL, arg};
    return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
}

/* ObjectGetItem */
#if CYTHON_USE_TYPE_SLOTS
static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) {
    PyObject *runerr = NULL;
    Py_ssize_t key_value;
    key_value = __Pyx_PyIndex_AsSsize_t(index);
    if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
        return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
    }
    if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
        __Pyx_TypeName index_type_name = __Pyx_PyType_GetName(Py_TYPE(index));
        PyErr_Clear();
        PyErr_Format(PyExc_IndexError,
            "cannot fit '" __Pyx_FMT_TYPENAME "' into an index-sized integer", index_type_name);
        __Pyx_DECREF_TypeName(index_type_name);
    }
    return NULL;
}
static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) {
    __Pyx_TypeName obj_type_name;
    if (likely(PyType_Check(obj))) {
        PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_n_s_class_getitem);
        if (!meth) {
            PyErr_Clear();
        } else {
            PyObject *result = __Pyx_PyObject_CallOneArg(meth, key);
            Py_DECREF(meth);
            return result;
        }
    }
    obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
    PyErr_Format(PyExc_TypeError,
        "'" __Pyx_FMT_TYPENAME "' object is not subscriptable", obj_type_name);
    __Pyx_DECREF_TypeName(obj_type_name);
    return NULL;
}
static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) {
    PyTypeObject *tp = Py_TYPE(obj);
    PyMappingMethods *mm = tp->tp_as_mapping;
    PySequenceMethods *sm = tp->tp_as_sequence;
    if (likely(mm && mm->mp_subscript)) {
        return mm->mp_subscript(obj, key);
    }
    if (likely(sm && sm->sq_item)) {
        return __Pyx_PyObject_GetIndex(obj, key);
    }
    return __Pyx_PyObject_GetItem_Slow(obj, key);
}
#endif

/* UnpackUnboundCMethod */
static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) {
    PyObject *result;
    PyObject *selfless_args = PyTuple_GetSlice(args, 1, PyTuple_Size(args));
    if (unlikely(!selfless_args)) return NULL;
    result = PyObject_Call(method, selfless_args, kwargs);
    Py_DECREF(selfless_args);
    return result;
}
static PyMethodDef __Pyx_UnboundCMethod_Def = {
     "CythonUnboundCMethod",
     __PYX_REINTERPRET_FUNCION(PyCFunction, __Pyx_SelflessCall),
     METH_VARARGS | METH_KEYWORDS,
     NULL
};
static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) {
    PyObject *method;
    method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name);
    if (unlikely(!method))
        return -1;
    target->method = method;
#if CYTHON_COMPILING_IN_CPYTHON
    #if PY_MAJOR_VERSION >= 3
    if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type)))
    #else
    if (likely(!__Pyx_CyOrPyCFunction_Check(method)))
    #endif
    {
        PyMethodDescrObject *descr = (PyMethodDescrObject*) method;
        target->func = descr->d_method->ml_meth;
        target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS);
    } else
#endif
#if CYTHON_COMPILING_IN_PYPY
#else
    if (PyCFunction_Check(method))
#endif
    {
        PyObject *self;
        int self_found;
#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
        self = PyObject_GetAttrString(method, "__self__");
        if (!self) {
            PyErr_Clear();
        }
#else
        self = PyCFunction_GET_SELF(method);
#endif
        self_found = (self && self != Py_None);
#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
        Py_XDECREF(self);
#endif
        if (self_found) {
            PyObject *unbound_method = PyCFunction_New(&__Pyx_UnboundCMethod_Def, method);
            if (unlikely(!unbound_method)) return -1;
            Py_DECREF(method);
            target->method = unbound_method;
        }
    }
    return 0;
}

/* CallUnboundCMethod1 */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg) {
    if (likely(cfunc->func)) {
        int flag = cfunc->flag;
        if (flag == METH_O) {
            return (*(cfunc->func))(self, arg);
        } else if ((PY_VERSION_HEX >= 0x030600B1) && flag == METH_FASTCALL) {
            #if PY_VERSION_HEX >= 0x030700A0
                return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, &arg, 1);
            #else
                return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL);
            #endif
        } else if ((PY_VERSION_HEX >= 0x030700A0) && flag == (METH_FASTCALL | METH_KEYWORDS)) {
            return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL);
        }
    }
    return __Pyx__CallUnboundCMethod1(cfunc, self, arg);
}
#endif
static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg){
    PyObject *args, *result = NULL;
    if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
#if CYTHON_COMPILING_IN_CPYTHON
    if (cfunc->func && (cfunc->flag & METH_VARARGS)) {
        args = PyTuple_New(1);
        if (unlikely(!args)) goto bad;
        Py_INCREF(arg);
        PyTuple_SET_ITEM(args, 0, arg);
        if (cfunc->flag & METH_KEYWORDS)
            result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL);
        else
            result = (*cfunc->func)(self, args);
    } else {
        args = PyTuple_New(2);
        if (unlikely(!args)) goto bad;
        Py_INCREF(self);
        PyTuple_SET_ITEM(args, 0, self);
        Py_INCREF(arg);
        PyTuple_SET_ITEM(args, 1, arg);
        result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
    }
#else
    args = PyTuple_Pack(2, self, arg);
    if (unlikely(!args)) goto bad;
    result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
#endif
bad:
    Py_XDECREF(args);
    return result;
}

/* CallUnboundCMethod2 */
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030600B1
static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) {
    if (likely(cfunc->func)) {
        PyObject *args[2] = {arg1, arg2};
        if (cfunc->flag == METH_FASTCALL) {
            #if PY_VERSION_HEX >= 0x030700A0
            return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, args, 2);
            #else
            return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, 2, NULL);
            #endif
        }
        #if PY_VERSION_HEX >= 0x030700A0
        if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS))
            return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, 2, NULL);
        #endif
    }
    return __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2);
}
#endif
static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){
    PyObject *args, *result = NULL;
    if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
#if CYTHON_COMPILING_IN_CPYTHON
    if (cfunc->func && (cfunc->flag & METH_VARARGS)) {
        args = PyTuple_New(2);
        if (unlikely(!args)) goto bad;
        Py_INCREF(arg1);
        PyTuple_SET_ITEM(args, 0, arg1);
        Py_INCREF(arg2);
        PyTuple_SET_ITEM(args, 1, arg2);
        if (cfunc->flag & METH_KEYWORDS)
            result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL);
        else
            result = (*cfunc->func)(self, args);
    } else {
        args = PyTuple_New(3);
        if (unlikely(!args)) goto bad;
        Py_INCREF(self);
        PyTuple_SET_ITEM(args, 0, self);
        Py_INCREF(arg1);
        PyTuple_SET_ITEM(args, 1, arg1);
        Py_INCREF(arg2);
        PyTuple_SET_ITEM(args, 2, arg2);
        result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
    }
#else
    args = PyTuple_Pack(3, self, arg1, arg2);
    if (unlikely(!args)) goto bad;
    result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
#endif
bad:
    Py_XDECREF(args);
    return result;
}

/* dict_getitem_default */
static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value) {
    PyObject* value;
#if PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000)
    value = PyDict_GetItemWithError(d, key);
    if (unlikely(!value)) {
        if (unlikely(PyErr_Occurred()))
            return NULL;
        value = default_value;
    }
    Py_INCREF(value);
    if ((1));
#else
    if (PyString_CheckExact(key) || PyUnicode_CheckExact(key) || PyInt_CheckExact(key)) {
        value = PyDict_GetItem(d, key);
        if (unlikely(!value)) {
            value = default_value;
        }
        Py_INCREF(value);
    }
#endif
    else {
        if (default_value == Py_None)
            value = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyDict_Type_get, d, key);
        else
            value = __Pyx_CallUnboundCMethod2(&__pyx_umethod_PyDict_Type_get, d, key, default_value);
    }
    return value;
}

/* py_dict_pop */
static CYTHON_INLINE PyObject *__Pyx_PyDict_Pop(PyObject *d, PyObject *key, PyObject *default_value) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B3 & PY_VERSION_HEX < 0x030d0000
    if ((1)) {
        return _PyDict_Pop(d, key, default_value);
    } else
#endif
    if (default_value) {
        return __Pyx_CallUnboundCMethod2(&__pyx_umethod_PyDict_Type_pop, d, key, default_value);
    } else {
        return __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyDict_Type_pop, d, key);
    }
}

/* pybytes_as_double */
static double __Pyx_SlowPyString_AsDouble(PyObject *obj) {
    PyObject *float_value;
#if PY_MAJOR_VERSION >= 3
    float_value = PyFloat_FromString(obj);
#else
    float_value = PyFloat_FromString(obj, 0);
#endif
    if (likely(float_value)) {
#if CYTHON_ASSUME_SAFE_MACROS
        double value = PyFloat_AS_DOUBLE(float_value);
#else
        double value = PyFloat_AsDouble(float_value);
#endif
        Py_DECREF(float_value);
        return value;
    }
    return (double)-1;
}
static const char* __Pyx__PyBytes_AsDouble_Copy(const char* start, char* buffer, Py_ssize_t length) {
    int last_was_punctuation = 1;
    Py_ssize_t i;
    for (i=0; i < length; i++) {
        char chr = start[i];
        int is_punctuation = (chr == '_') | (chr == '.') | (chr == 'e') | (chr == 'E');
        *buffer = chr;
        buffer += (chr != '_');
        if (unlikely(last_was_punctuation & is_punctuation)) goto parse_failure;
        last_was_punctuation = is_punctuation;
    }
    if (unlikely(last_was_punctuation)) goto parse_failure;
    *buffer = '\0';
    return buffer;
parse_failure:
    return NULL;
}
static double __Pyx__PyBytes_AsDouble_inf_nan(const char* start, Py_ssize_t length) {
    int matches = 1;
    char sign = start[0];
    int is_signed = (sign == '+') | (sign == '-');
    start += is_signed;
    length -= is_signed;
    switch (start[0]) {
        #ifdef Py_NAN
        case 'n':
        case 'N':
            if (unlikely(length != 3)) goto parse_failure;
            matches &= (start[1] == 'a' || start[1] == 'A');
            matches &= (start[2] == 'n' || start[2] == 'N');
            if (unlikely(!matches)) goto parse_failure;
            return (sign == '-') ? -Py_NAN : Py_NAN;
        #endif
        case 'i':
        case 'I':
            if (unlikely(length < 3)) goto parse_failure;
            matches &= (start[1] == 'n' || start[1] == 'N');
            matches &= (start[2] == 'f' || start[2] == 'F');
            if (likely(length == 3 && matches))
                return (sign == '-') ? -Py_HUGE_VAL : Py_HUGE_VAL;
            if (unlikely(length != 8)) goto parse_failure;
            matches &= (start[3] == 'i' || start[3] == 'I');
            matches &= (start[4] == 'n' || start[4] == 'N');
            matches &= (start[5] == 'i' || start[5] == 'I');
            matches &= (start[6] == 't' || start[6] == 'T');
            matches &= (start[7] == 'y' || start[7] == 'Y');
            if (unlikely(!matches)) goto parse_failure;
            return (sign == '-') ? -Py_HUGE_VAL : Py_HUGE_VAL;
        case '.': case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9':
            break;
        default:
            goto parse_failure;
    }
    return 0.0;
parse_failure:
    return -1.0;
}
static CYTHON_INLINE int __Pyx__PyBytes_AsDouble_IsSpace(char ch) {
    return (ch == 0x20) | !((ch < 0x9) | (ch > 0xd));
}
CYTHON_UNUSED static double __Pyx__PyBytes_AsDouble(PyObject *obj, const char* start, Py_ssize_t length) {
    double value;
    Py_ssize_t i, digits;
    const char *last = start + length;
    char *end;
    while (__Pyx__PyBytes_AsDouble_IsSpace(*start))
        start++;
    while (start < last - 1 && __Pyx__PyBytes_AsDouble_IsSpace(last[-1]))
        last--;
    length = last - start;
    if (unlikely(length <= 0)) goto fallback;
    value = __Pyx__PyBytes_AsDouble_inf_nan(start, length);
    if (unlikely(value == -1.0)) goto fallback;
    if (value != 0.0) return value;
    digits = 0;
    for (i=0; i < length; digits += start[i++] != '_');
    if (likely(digits == length)) {
        value = PyOS_string_to_double(start, &end, NULL);
    } else if (digits < 40) {
        char number[40];
        last = __Pyx__PyBytes_AsDouble_Copy(start, number, length);
        if (unlikely(!last)) goto fallback;
        value = PyOS_string_to_double(number, &end, NULL);
    } else {
        char *number = (char*) PyMem_Malloc((digits + 1) * sizeof(char));
        if (unlikely(!number)) goto fallback;
        last = __Pyx__PyBytes_AsDouble_Copy(start, number, length);
        if (unlikely(!last)) {
            PyMem_Free(number);
            goto fallback;
        }
        value = PyOS_string_to_double(number, &end, NULL);
        PyMem_Free(number);
    }
    if (likely(end == last) || (value == (double)-1 && PyErr_Occurred())) {
        return value;
    }
fallback:
    return __Pyx_SlowPyString_AsDouble(obj);
}

/* pynumber_float */
static CYTHON_INLINE PyObject* __Pyx__PyNumber_Float(PyObject* obj) {
    double val;
    if (PyLong_CheckExact(obj)) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (likely(__Pyx_PyLong_IsCompact(obj))) {
            val = (double) __Pyx_PyLong_CompactValue(obj);
            goto no_error;
        }
#endif
        val = PyLong_AsDouble(obj);
    } else if (PyUnicode_CheckExact(obj)) {
        val = __Pyx_PyUnicode_AsDouble(obj);
    } else if (PyBytes_CheckExact(obj)) {
        val = __Pyx_PyBytes_AsDouble(obj);
    } else if (PyByteArray_CheckExact(obj)) {
        val = __Pyx_PyByteArray_AsDouble(obj);
    } else {
        return PyNumber_Float(obj);
    }
    if (unlikely(val == -1 && PyErr_Occurred())) {
        return NULL;
    }
#if CYTHON_USE_PYLONG_INTERNALS
no_error:
#endif
    return PyFloat_FromDouble(val);
}

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

/* PyIntBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_MAYBE_UNUSED_VAR(inplace);
    CYTHON_UNUSED_VAR(zerodivision_check);
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long x;
        long a = PyInt_AS_LONG(op1);
        
            x = (long)((unsigned long)a + (unsigned long)b);
            if (likely((x^a) >= 0 || (x^b) >= 0))
                return PyInt_FromLong(x);
            return PyLong_Type.tp_as_number->nb_add(op1, op2);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a, x;
#ifdef HAVE_LONG_LONG
        const PY_LONG_LONG llb = intval;
        PY_LONG_LONG lla, llx;
#endif
        if (unlikely(__Pyx_PyLong_IsZero(op1))) {
            return __Pyx_NewRef(op2);
        }
        if (likely(__Pyx_PyLong_IsCompact(op1))) {
            a = __Pyx_PyLong_CompactValue(op1);
        } else {
            const digit* digits = __Pyx_PyLong_Digits(op1);
            const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1);
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
            }
        }
                x = a + b;
            return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
        long_long:
                llx = lla + llb;
            return PyLong_FromLongLong(llx);
#endif
        
        
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
#if CYTHON_COMPILING_IN_LIMITED_API
        double a = __pyx_PyFloat_AsDouble(op1);
#else
        double a = PyFloat_AS_DOUBLE(op1);
#endif
            double result;
            
            PyFPE_START_PROTECT("add", return NULL)
            result = ((double)a) + (double)b;
            PyFPE_END_PROTECT(result)
            return PyFloat_FromDouble(result);
    }
    return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
}
#endif

/* GetAttr3 */
#if __PYX_LIMITED_VERSION_HEX < 0x030d00A1
static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
        return NULL;
    __Pyx_PyErr_Clear();
    Py_INCREF(d);
    return d;
}
#endif
static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
    PyObject *r;
#if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1
    int res = PyObject_GetOptionalAttr(o, n, &r);
    return (res != 0) ? r : __Pyx_NewRef(d);
#else
  #if CYTHON_USE_TYPE_SLOTS
    if (likely(PyString_Check(n))) {
        r = __Pyx_PyObject_GetAttrStrNoError(o, n);
        if (unlikely(!r) && likely(!PyErr_Occurred())) {
            r = __Pyx_NewRef(d);
        }
        return r;
    }
  #endif
    r = PyObject_GetAttr(o, n);
    return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
#endif
}

/* RaiseUnboundLocalError */
static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
    PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
}

/* GetException */
#if CYTHON_FAST_THREAD_STATE
static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
#else
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
#endif
{
    PyObject *local_type = NULL, *local_value, *local_tb = NULL;
#if CYTHON_FAST_THREAD_STATE
    PyObject *tmp_type, *tmp_value, *tmp_tb;
  #if PY_VERSION_HEX >= 0x030C00A6
    local_value = tstate->current_exception;
    tstate->current_exception = 0;
    if (likely(local_value)) {
        local_type = (PyObject*) Py_TYPE(local_value);
        Py_INCREF(local_type);
        local_tb = PyException_GetTraceback(local_value);
    }
  #else
    local_type = tstate->curexc_type;
    local_value = tstate->curexc_value;
    local_tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
  #endif
#else
    PyErr_Fetch(&local_type, &local_value, &local_tb);
#endif
    PyErr_NormalizeException(&local_type, &local_value, &local_tb);
#if CYTHON_FAST_THREAD_STATE && PY_VERSION_HEX >= 0x030C00A6
    if (unlikely(tstate->current_exception))
#elif CYTHON_FAST_THREAD_STATE
    if (unlikely(tstate->curexc_type))
#else
    if (unlikely(PyErr_Occurred()))
#endif
        goto bad;
    #if PY_MAJOR_VERSION >= 3
    if (local_tb) {
        if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
            goto bad;
    }
    #endif
    Py_XINCREF(local_tb);
    Py_XINCREF(local_type);
    Py_XINCREF(local_value);
    *type = local_type;
    *value = local_value;
    *tb = local_tb;
#if CYTHON_FAST_THREAD_STATE
    #if CYTHON_USE_EXC_INFO_STACK
    {
        _PyErr_StackItem *exc_info = tstate->exc_info;
      #if PY_VERSION_HEX >= 0x030B00a4
        tmp_value = exc_info->exc_value;
        exc_info->exc_value = local_value;
        tmp_type = NULL;
        tmp_tb = NULL;
        Py_XDECREF(local_type);
        Py_XDECREF(local_tb);
      #else
        tmp_type = exc_info->exc_type;
        tmp_value = exc_info->exc_value;
        tmp_tb = exc_info->exc_traceback;
        exc_info->exc_type = local_type;
        exc_info->exc_value = local_value;
        exc_info->exc_traceback = local_tb;
      #endif
    }
    #else
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = local_type;
    tstate->exc_value = local_value;
    tstate->exc_traceback = local_tb;
    #endif
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#else
    PyErr_SetExcInfo(local_type, local_value, local_tb);
#endif
    return 0;
bad:
    *type = 0;
    *value = 0;
    *tb = 0;
    Py_XDECREF(local_type);
    Py_XDECREF(local_value);
    Py_XDECREF(local_tb);
    return -1;
}

/* pep479 */
static void __Pyx_Generator_Replace_StopIteration(int in_async_gen) {
    PyObject *exc, *val, *tb, *cur_exc;
    __Pyx_PyThreadState_declare
    #ifdef __Pyx_StopAsyncIteration_USED
    int is_async_stopiteration = 0;
    #endif
    CYTHON_MAYBE_UNUSED_VAR(in_async_gen);
    cur_exc = PyErr_Occurred();
    if (likely(!__Pyx_PyErr_GivenExceptionMatches(cur_exc, PyExc_StopIteration))) {
        #ifdef __Pyx_StopAsyncIteration_USED
        if (in_async_gen && unlikely(__Pyx_PyErr_GivenExceptionMatches(cur_exc, __Pyx_PyExc_StopAsyncIteration))) {
            is_async_stopiteration = 1;
        } else
        #endif
            return;
    }
    __Pyx_PyThreadState_assign
    __Pyx_GetException(&exc, &val, &tb);
    Py_XDECREF(exc);
    Py_XDECREF(val);
    Py_XDECREF(tb);
    PyErr_SetString(PyExc_RuntimeError,
        #ifdef __Pyx_StopAsyncIteration_USED
        is_async_stopiteration ? "async generator raised StopAsyncIteration" :
        in_async_gen ? "async generator raised StopIteration" :
        #endif
        "generator raised StopIteration");
}

/* RaiseClosureNameError */
static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) {
    PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname);
}

/* IterNext */
static PyObject *__Pyx_PyIter_Next2Default(PyObject* defval) {
    PyObject* exc_type;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    exc_type = __Pyx_PyErr_CurrentExceptionType();
    if (unlikely(exc_type)) {
        if (!defval || unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))
            return NULL;
        __Pyx_PyErr_Clear();
        Py_INCREF(defval);
        return defval;
    }
    if (defval) {
        Py_INCREF(defval);
        return defval;
    }
    __Pyx_PyErr_SetNone(PyExc_StopIteration);
    return NULL;
}
static void __Pyx_PyIter_Next_ErrorNoIterator(PyObject *iterator) {
    __Pyx_TypeName iterator_type_name = __Pyx_PyType_GetName(Py_TYPE(iterator));
    PyErr_Format(PyExc_TypeError,
        __Pyx_FMT_TYPENAME " object is not an iterator", iterator_type_name);
    __Pyx_DECREF_TypeName(iterator_type_name);
}
static CYTHON_INLINE PyObject *__Pyx_PyIter_Next2(PyObject* iterator, PyObject* defval) {
    PyObject* next;
    iternextfunc iternext = Py_TYPE(iterator)->tp_iternext;
    if (likely(iternext)) {
#if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
        next = iternext(iterator);
        if (likely(next))
            return next;
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000
        if (unlikely(iternext == &_PyObject_NextNotImplemented))
            return NULL;
#endif
#else
        next = PyIter_Next(iterator);
        if (likely(next))
            return next;
#endif
    } else if (CYTHON_USE_TYPE_SLOTS || unlikely(!PyIter_Check(iterator))) {
        __Pyx_PyIter_Next_ErrorNoIterator(iterator);
        return NULL;
    }
#if !CYTHON_USE_TYPE_SLOTS
    else {
        next = PyIter_Next(iterator);
        if (likely(next))
            return next;
    }
#endif
    return __Pyx_PyIter_Next2Default(defval);
}

/* GetTopmostException */
#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
static _PyErr_StackItem *
__Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
{
    _PyErr_StackItem *exc_info = tstate->exc_info;
    while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) &&
           exc_info->previous_item != NULL)
    {
        exc_info = exc_info->previous_item;
    }
    return exc_info;
}
#endif

/* SaveResetException */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
  #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
    _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
    PyObject *exc_value = exc_info->exc_value;
    if (exc_value == NULL || exc_value == Py_None) {
        *value = NULL;
        *type = NULL;
        *tb = NULL;
    } else {
        *value = exc_value;
        Py_INCREF(*value);
        *type = (PyObject*) Py_TYPE(exc_value);
        Py_INCREF(*type);
        *tb = PyException_GetTraceback(exc_value);
    }
  #elif CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
    *type = exc_info->exc_type;
    *value = exc_info->exc_value;
    *tb = exc_info->exc_traceback;
    Py_XINCREF(*type);
    Py_XINCREF(*value);
    Py_XINCREF(*tb);
  #else
    *type = tstate->exc_type;
    *value = tstate->exc_value;
    *tb = tstate->exc_traceback;
    Py_XINCREF(*type);
    Py_XINCREF(*value);
    Py_XINCREF(*tb);
  #endif
}
static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
  #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
    _PyErr_StackItem *exc_info = tstate->exc_info;
    PyObject *tmp_value = exc_info->exc_value;
    exc_info->exc_value = value;
    Py_XDECREF(tmp_value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
  #else
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    #if CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = tstate->exc_info;
    tmp_type = exc_info->exc_type;
    tmp_value = exc_info->exc_value;
    tmp_tb = exc_info->exc_traceback;
    exc_info->exc_type = type;
    exc_info->exc_value = value;
    exc_info->exc_traceback = tb;
    #else
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = type;
    tstate->exc_value = value;
    tstate->exc_traceback = tb;
    #endif
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
  #endif
}
#endif

/* FastTypeChecks */
#if CYTHON_COMPILING_IN_CPYTHON
static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
    while (a) {
        a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*);
        if (a == b)
            return 1;
    }
    return b == &PyBaseObject_Type;
}
static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
    PyObject *mro;
    if (a == b) return 1;
    mro = a->tp_mro;
    if (likely(mro)) {
        Py_ssize_t i, n;
        n = PyTuple_GET_SIZE(mro);
        for (i = 0; i < n; i++) {
            if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
                return 1;
        }
        return 0;
    }
    return __Pyx_InBases(a, b);
}
static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) {
    PyObject *mro;
    if (cls == a || cls == b) return 1;
    mro = cls->tp_mro;
    if (likely(mro)) {
        Py_ssize_t i, n;
        n = PyTuple_GET_SIZE(mro);
        for (i = 0; i < n; i++) {
            PyObject *base = PyTuple_GET_ITEM(mro, i);
            if (base == (PyObject *)a || base == (PyObject *)b)
                return 1;
        }
        return 0;
    }
    return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b);
}
#if PY_MAJOR_VERSION == 2
static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
    PyObject *exception, *value, *tb;
    int res;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&exception, &value, &tb);
    res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
    if (unlikely(res == -1)) {
        PyErr_WriteUnraisable(err);
        res = 0;
    }
    if (!res) {
        res = PyObject_IsSubclass(err, exc_type2);
        if (unlikely(res == -1)) {
            PyErr_WriteUnraisable(err);
            res = 0;
        }
    }
    __Pyx_ErrRestore(exception, value, tb);
    return res;
}
#else
static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
    if (exc_type1) {
        return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2);
    } else {
        return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
    }
}
#endif
static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
    Py_ssize_t i, n;
    assert(PyExceptionClass_Check(exc_type));
    n = PyTuple_GET_SIZE(tuple);
#if PY_MAJOR_VERSION >= 3
    for (i=0; i<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
#endif
    for (i=0; i<n; i++) {
        PyObject *t = PyTuple_GET_ITEM(tuple, i);
        #if PY_MAJOR_VERSION < 3
        if (likely(exc_type == t)) return 1;
        #endif
        if (likely(PyExceptionClass_Check(t))) {
            if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
        } else {
        }
    }
    return 0;
}
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
    if (likely(err == exc_type)) return 1;
    if (likely(PyExceptionClass_Check(err))) {
        if (likely(PyExceptionClass_Check(exc_type))) {
            return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
        } else if (likely(PyTuple_Check(exc_type))) {
            return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
        } else {
        }
    }
    return PyErr_GivenExceptionMatches(err, exc_type);
}
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
    assert(PyExceptionClass_Check(exc_type1));
    assert(PyExceptionClass_Check(exc_type2));
    if (likely(err == exc_type1 || err == exc_type2)) return 1;
    if (likely(PyExceptionClass_Check(err))) {
        return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
    }
    return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
}
#endif

/* SwapException */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
  #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
    _PyErr_StackItem *exc_info = tstate->exc_info;
    tmp_value = exc_info->exc_value;
    exc_info->exc_value = *value;
    if (tmp_value == NULL || tmp_value == Py_None) {
        Py_XDECREF(tmp_value);
        tmp_value = NULL;
        tmp_type = NULL;
        tmp_tb = NULL;
    } else {
        tmp_type = (PyObject*) Py_TYPE(tmp_value);
        Py_INCREF(tmp_type);
        #if CYTHON_COMPILING_IN_CPYTHON
        tmp_tb = ((PyBaseExceptionObject*) tmp_value)->traceback;
        Py_XINCREF(tmp_tb);
        #else
        tmp_tb = PyException_GetTraceback(tmp_value);
        #endif
    }
  #elif CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = tstate->exc_info;
    tmp_type = exc_info->exc_type;
    tmp_value = exc_info->exc_value;
    tmp_tb = exc_info->exc_traceback;
    exc_info->exc_type = *type;
    exc_info->exc_value = *value;
    exc_info->exc_traceback = *tb;
  #else
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = *type;
    tstate->exc_value = *value;
    tstate->exc_traceback = *tb;
  #endif
    *type = tmp_type;
    *value = tmp_value;
    *tb = tmp_tb;
}
#else
static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
    PyErr_SetExcInfo(*type, *value, *tb);
    *type = tmp_type;
    *value = tmp_value;
    *tb = tmp_tb;
}
#endif

/* PyObjectFormatAndDecref */
static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f) {
    if (unlikely(!s)) return NULL;
    if (likely(PyUnicode_CheckExact(s))) return s;
    #if PY_MAJOR_VERSION < 3
    if (likely(PyString_CheckExact(s))) {
        PyObject *result = PyUnicode_FromEncodedObject(s, NULL, "strict");
        Py_DECREF(s);
        return result;
    }
    #endif
    return __Pyx_PyObject_FormatAndDecref(s, f);
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f) {
    PyObject *result;
    if (unlikely(!s)) return NULL;
    result = PyObject_Format(s, f);
    Py_DECREF(s);
    return result;
}

/* JoinPyUnicode */
static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength,
                                      Py_UCS4 max_char) {
#if CYTHON_USE_UNICODE_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    PyObject *result_uval;
    int result_ukind, kind_shift;
    Py_ssize_t i, char_pos;
    void *result_udata;
    CYTHON_MAYBE_UNUSED_VAR(max_char);
#if CYTHON_PEP393_ENABLED
    result_uval = PyUnicode_New(result_ulength, max_char);
    if (unlikely(!result_uval)) return NULL;
    result_ukind = (max_char <= 255) ? PyUnicode_1BYTE_KIND : (max_char <= 65535) ? PyUnicode_2BYTE_KIND : PyUnicode_4BYTE_KIND;
    kind_shift = (result_ukind == PyUnicode_4BYTE_KIND) ? 2 : result_ukind - 1;
    result_udata = PyUnicode_DATA(result_uval);
#else
    result_uval = PyUnicode_FromUnicode(NULL, result_ulength);
    if (unlikely(!result_uval)) return NULL;
    result_ukind = sizeof(Py_UNICODE);
    kind_shift = (result_ukind == 4) ? 2 : result_ukind - 1;
    result_udata = PyUnicode_AS_UNICODE(result_uval);
#endif
    assert(kind_shift == 2 || kind_shift == 1 || kind_shift == 0);
    char_pos = 0;
    for (i=0; i < value_count; i++) {
        int ukind;
        Py_ssize_t ulength;
        void *udata;
        PyObject *uval = PyTuple_GET_ITEM(value_tuple, i);
        if (unlikely(__Pyx_PyUnicode_READY(uval)))
            goto bad;
        ulength = __Pyx_PyUnicode_GET_LENGTH(uval);
        if (unlikely(!ulength))
            continue;
        if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - ulength < char_pos))
            goto overflow;
        ukind = __Pyx_PyUnicode_KIND(uval);
        udata = __Pyx_PyUnicode_DATA(uval);
        if (!CYTHON_PEP393_ENABLED || ukind == result_ukind) {
            memcpy((char *)result_udata + (char_pos << kind_shift), udata, (size_t) (ulength << kind_shift));
        } else {
            #if PY_VERSION_HEX >= 0x030d0000
            if (unlikely(PyUnicode_CopyCharacters(result_uval, char_pos, uval, 0, ulength) < 0)) goto bad;
            #elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030300F0 || defined(_PyUnicode_FastCopyCharacters)
            _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength);
            #else
            Py_ssize_t j;
            for (j=0; j < ulength; j++) {
                Py_UCS4 uchar = __Pyx_PyUnicode_READ(ukind, udata, j);
                __Pyx_PyUnicode_WRITE(result_ukind, result_udata, char_pos+j, uchar);
            }
            #endif
        }
        char_pos += ulength;
    }
    return result_uval;
overflow:
    PyErr_SetString(PyExc_OverflowError, "join() result is too long for a Python string");
bad:
    Py_DECREF(result_uval);
    return NULL;
#else
    CYTHON_UNUSED_VAR(max_char);
    CYTHON_UNUSED_VAR(result_ulength);
    CYTHON_UNUSED_VAR(value_count);
    return PyUnicode_Join(__pyx_empty_unicode, value_tuple);
#endif
}

/* FixUpExtensionType */
#if CYTHON_USE_TYPE_SPECS
static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) {
#if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
    CYTHON_UNUSED_VAR(spec);
    CYTHON_UNUSED_VAR(type);
#else
    const PyType_Slot *slot = spec->slots;
    while (slot && slot->slot && slot->slot != Py_tp_members)
        slot++;
    if (slot && slot->slot == Py_tp_members) {
        int changed = 0;
#if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON)
        const
#endif
            PyMemberDef *memb = (PyMemberDef*) slot->pfunc;
        while (memb && memb->name) {
            if (memb->name[0] == '_' && memb->name[1] == '_') {
#if PY_VERSION_HEX < 0x030900b1
                if (strcmp(memb->name, "__weaklistoffset__") == 0) {
                    assert(memb->type == T_PYSSIZET);
                    assert(memb->flags == READONLY);
                    type->tp_weaklistoffset = memb->offset;
                    changed = 1;
                }
                else if (strcmp(memb->name, "__dictoffset__") == 0) {
                    assert(memb->type == T_PYSSIZET);
                    assert(memb->flags == READONLY);
                    type->tp_dictoffset = memb->offset;
                    changed = 1;
                }
#if CYTHON_METH_FASTCALL
                else if (strcmp(memb->name, "__vectorcalloffset__") == 0) {
                    assert(memb->type == T_PYSSIZET);
                    assert(memb->flags == READONLY);
#if PY_VERSION_HEX >= 0x030800b4
                    type->tp_vectorcall_offset = memb->offset;
#else
                    type->tp_print = (printfunc) memb->offset;
#endif
                    changed = 1;
                }
#endif
#else
                if ((0));
#endif
#if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON
                else if (strcmp(memb->name, "__module__") == 0) {
                    PyObject *descr;
                    assert(memb->type == T_OBJECT);
                    assert(memb->flags == 0 || memb->flags == READONLY);
                    descr = PyDescr_NewMember(type, memb);
                    if (unlikely(!descr))
                        return -1;
                    if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) {
                        Py_DECREF(descr);
                        return -1;
                    }
                    Py_DECREF(descr);
                    changed = 1;
                }
#endif
            }
            memb++;
        }
        if (changed)
            PyType_Modified(type);
    }
#endif
    return 0;
}
#endif

/* FetchSharedCythonModule */
static PyObject *__Pyx_FetchSharedCythonABIModule(void) {
    return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME);
}

/* FetchCommonType */
static int __Pyx_VerifyCachedType(PyObject *cached_type,
                               const char *name,
                               Py_ssize_t basicsize,
                               Py_ssize_t expected_basicsize) {
    if (!PyType_Check(cached_type)) {
        PyErr_Format(PyExc_TypeError,
            "Shared Cython type %.200s is not a type object", name);
        return -1;
    }
    if (basicsize != expected_basicsize) {
        PyErr_Format(PyExc_TypeError,
            "Shared Cython type %.200s has the wrong size, try recompiling",
            name);
        return -1;
    }
    return 0;
}
#if !CYTHON_USE_TYPE_SPECS
static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
    PyObject* abi_module;
    const char* object_name;
    PyTypeObject *cached_type = NULL;
    abi_module = __Pyx_FetchSharedCythonABIModule();
    if (!abi_module) return NULL;
    object_name = strrchr(type->tp_name, '.');
    object_name = object_name ? object_name+1 : type->tp_name;
    cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name);
    if (cached_type) {
        if (__Pyx_VerifyCachedType(
              (PyObject *)cached_type,
              object_name,
              cached_type->tp_basicsize,
              type->tp_basicsize) < 0) {
            goto bad;
        }
        goto done;
    }
    if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
    PyErr_Clear();
    if (PyType_Ready(type) < 0) goto bad;
    if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0)
        goto bad;
    Py_INCREF(type);
    cached_type = type;
done:
    Py_DECREF(abi_module);
    return cached_type;
bad:
    Py_XDECREF(cached_type);
    cached_type = NULL;
    goto done;
}
#else
static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) {
    PyObject *abi_module, *cached_type = NULL;
    const char* object_name = strrchr(spec->name, '.');
    object_name = object_name ? object_name+1 : spec->name;
    abi_module = __Pyx_FetchSharedCythonABIModule();
    if (!abi_module) return NULL;
    cached_type = PyObject_GetAttrString(abi_module, object_name);
    if (cached_type) {
        Py_ssize_t basicsize;
#if CYTHON_COMPILING_IN_LIMITED_API
        PyObject *py_basicsize;
        py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__");
        if (unlikely(!py_basicsize)) goto bad;
        basicsize = PyLong_AsSsize_t(py_basicsize);
        Py_DECREF(py_basicsize);
        py_basicsize = 0;
        if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
#else
        basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1;
#endif
        if (__Pyx_VerifyCachedType(
              cached_type,
              object_name,
              basicsize,
              spec->basicsize) < 0) {
            goto bad;
        }
        goto done;
    }
    if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
    PyErr_Clear();
    CYTHON_UNUSED_VAR(module);
    cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases);
    if (unlikely(!cached_type)) goto bad;
    if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad;
    if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad;
done:
    Py_DECREF(abi_module);
    assert(cached_type == NULL || PyType_Check(cached_type));
    return (PyTypeObject *) cached_type;
bad:
    Py_XDECREF(cached_type);
    cached_type = NULL;
    goto done;
}
#endif

/* PyObjectCall2Args */
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
    PyObject *args[3] = {NULL, arg1, arg2};
    return __Pyx_PyObject_FastCall(function, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
}

/* PyObjectGetMethod */
static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) {
    PyObject *attr;
#if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP
    __Pyx_TypeName type_name;
    PyTypeObject *tp = Py_TYPE(obj);
    PyObject *descr;
    descrgetfunc f = NULL;
    PyObject **dictptr, *dict;
    int meth_found = 0;
    assert (*method == NULL);
    if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) {
        attr = __Pyx_PyObject_GetAttrStr(obj, name);
        goto try_unpack;
    }
    if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) {
        return 0;
    }
    descr = _PyType_Lookup(tp, name);
    if (likely(descr != NULL)) {
        Py_INCREF(descr);
#if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR
        if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR))
#elif PY_MAJOR_VERSION >= 3
        #ifdef __Pyx_CyFunction_USED
        if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr)))
        #else
        if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type)))
        #endif
#else
        #ifdef __Pyx_CyFunction_USED
        if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr)))
        #else
        if (likely(PyFunction_Check(descr)))
        #endif
#endif
        {
            meth_found = 1;
        } else {
            f = Py_TYPE(descr)->tp_descr_get;
            if (f != NULL && PyDescr_IsData(descr)) {
                attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
                Py_DECREF(descr);
                goto try_unpack;
            }
        }
    }
    dictptr = _PyObject_GetDictPtr(obj);
    if (dictptr != NULL && (dict = *dictptr) != NULL) {
        Py_INCREF(dict);
        attr = __Pyx_PyDict_GetItemStr(dict, name);
        if (attr != NULL) {
            Py_INCREF(attr);
            Py_DECREF(dict);
            Py_XDECREF(descr);
            goto try_unpack;
        }
        Py_DECREF(dict);
    }
    if (meth_found) {
        *method = descr;
        return 1;
    }
    if (f != NULL) {
        attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
        Py_DECREF(descr);
        goto try_unpack;
    }
    if (likely(descr != NULL)) {
        *method = descr;
        return 0;
    }
    type_name = __Pyx_PyType_GetName(tp);
    PyErr_Format(PyExc_AttributeError,
#if PY_MAJOR_VERSION >= 3
                 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'",
                 type_name, name);
#else
                 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'",
                 type_name, PyString_AS_STRING(name));
#endif
    __Pyx_DECREF_TypeName(type_name);
    return 0;
#else
    attr = __Pyx_PyObject_GetAttrStr(obj, name);
    goto try_unpack;
#endif
try_unpack:
#if CYTHON_UNPACK_METHODS
    if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) {
        PyObject *function = PyMethod_GET_FUNCTION(attr);
        Py_INCREF(function);
        Py_DECREF(attr);
        *method = function;
        return 1;
    }
#endif
    *method = attr;
    return 0;
}

/* PyObjectCallMethod1 */
#if !(CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C00A2)
static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) {
    PyObject *result = __Pyx_PyObject_CallOneArg(method, arg);
    Py_DECREF(method);
    return result;
}
#endif
static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
#if CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C00A2
    PyObject *args[2] = {obj, arg};
    (void) __Pyx_PyObject_GetMethod;
    (void) __Pyx_PyObject_CallOneArg;
    (void) __Pyx_PyObject_Call2Args;
    return PyObject_VectorcallMethod(method_name, args, 2 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
#else
    PyObject *method = NULL, *result;
    int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
    if (likely(is_method)) {
        result = __Pyx_PyObject_Call2Args(method, obj, arg);
        Py_DECREF(method);
        return result;
    }
    if (unlikely(!method)) return NULL;
    return __Pyx__PyObject_CallMethod1(method, arg);
#endif
}

/* PyObjectCallNoArg */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
    PyObject *arg[2] = {NULL, NULL};
    return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
}

/* CoroutineBase */
#include <frameobject.h>
#if PY_VERSION_HEX >= 0x030b00a6 && !defined(PYPY_VERSION)
  #ifndef Py_BUILD_CORE
    #define Py_BUILD_CORE 1
  #endif
  #include "internal/pycore_frame.h"
#endif
#define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom)
static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *__pyx_tstate, PyObject **pvalue) {
    PyObject *et, *ev, *tb;
    PyObject *value = NULL;
    CYTHON_UNUSED_VAR(__pyx_tstate);
    __Pyx_ErrFetch(&et, &ev, &tb);
    if (!et) {
        Py_XDECREF(tb);
        Py_XDECREF(ev);
        Py_INCREF(Py_None);
        *pvalue = Py_None;
        return 0;
    }
    if (likely(et == PyExc_StopIteration)) {
        if (!ev) {
            Py_INCREF(Py_None);
            value = Py_None;
        }
#if PY_VERSION_HEX >= 0x030300A0
        else if (likely(__Pyx_IS_TYPE(ev, (PyTypeObject*)PyExc_StopIteration))) {
            value = ((PyStopIterationObject *)ev)->value;
            Py_INCREF(value);
            Py_DECREF(ev);
        }
#endif
        else if (unlikely(PyTuple_Check(ev))) {
            if (PyTuple_GET_SIZE(ev) >= 1) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                value = PyTuple_GET_ITEM(ev, 0);
                Py_INCREF(value);
#else
                value = PySequence_ITEM(ev, 0);
#endif
            } else {
                Py_INCREF(Py_None);
                value = Py_None;
            }
            Py_DECREF(ev);
        }
        else if (!__Pyx_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) {
            value = ev;
        }
        if (likely(value)) {
            Py_XDECREF(tb);
            Py_DECREF(et);
            *pvalue = value;
            return 0;
        }
    } else if (!__Pyx_PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) {
        __Pyx_ErrRestore(et, ev, tb);
        return -1;
    }
    PyErr_NormalizeException(&et, &ev, &tb);
    if (unlikely(!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration))) {
        __Pyx_ErrRestore(et, ev, tb);
        return -1;
    }
    Py_XDECREF(tb);
    Py_DECREF(et);
#if PY_VERSION_HEX >= 0x030300A0
    value = ((PyStopIterationObject *)ev)->value;
    Py_INCREF(value);
    Py_DECREF(ev);
#else
    {
        PyObject* args = __Pyx_PyObject_GetAttrStr(ev, __pyx_n_s_args);
        Py_DECREF(ev);
        if (likely(args)) {
            value = PySequence_GetItem(args, 0);
            Py_DECREF(args);
        }
        if (unlikely(!value)) {
            __Pyx_ErrRestore(NULL, NULL, NULL);
            Py_INCREF(Py_None);
            value = Py_None;
        }
    }
#endif
    *pvalue = value;
    return 0;
}
static CYTHON_INLINE
void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *exc_state) {
#if PY_VERSION_HEX >= 0x030B00a4
    Py_CLEAR(exc_state->exc_value);
#else
    PyObject *t, *v, *tb;
    t = exc_state->exc_type;
    v = exc_state->exc_value;
    tb = exc_state->exc_traceback;
    exc_state->exc_type = NULL;
    exc_state->exc_value = NULL;
    exc_state->exc_traceback = NULL;
    Py_XDECREF(t);
    Py_XDECREF(v);
    Py_XDECREF(tb);
#endif
}
#define __Pyx_Coroutine_AlreadyRunningError(gen)  (__Pyx__Coroutine_AlreadyRunningError(gen), (PyObject*)NULL)
static void __Pyx__Coroutine_AlreadyRunningError(__pyx_CoroutineObject *gen) {
    const char *msg;
    CYTHON_MAYBE_UNUSED_VAR(gen);
    if ((0)) {
    #ifdef __Pyx_Coroutine_USED
    } else if (__Pyx_Coroutine_Check((PyObject*)gen)) {
        msg = "coroutine already executing";
    #endif
    #ifdef __Pyx_AsyncGen_USED
    } else if (__Pyx_AsyncGen_CheckExact((PyObject*)gen)) {
        msg = "async generator already executing";
    #endif
    } else {
        msg = "generator already executing";
    }
    PyErr_SetString(PyExc_ValueError, msg);
}
#define __Pyx_Coroutine_NotStartedError(gen)  (__Pyx__Coroutine_NotStartedError(gen), (PyObject*)NULL)
static void __Pyx__Coroutine_NotStartedError(PyObject *gen) {
    const char *msg;
    CYTHON_MAYBE_UNUSED_VAR(gen);
    if ((0)) {
    #ifdef __Pyx_Coroutine_USED
    } else if (__Pyx_Coroutine_Check(gen)) {
        msg = "can't send non-None value to a just-started coroutine";
    #endif
    #ifdef __Pyx_AsyncGen_USED
    } else if (__Pyx_AsyncGen_CheckExact(gen)) {
        msg = "can't send non-None value to a just-started async generator";
    #endif
    } else {
        msg = "can't send non-None value to a just-started generator";
    }
    PyErr_SetString(PyExc_TypeError, msg);
}
#define __Pyx_Coroutine_AlreadyTerminatedError(gen, value, closing)  (__Pyx__Coroutine_AlreadyTerminatedError(gen, value, closing), (PyObject*)NULL)
static void __Pyx__Coroutine_AlreadyTerminatedError(PyObject *gen, PyObject *value, int closing) {
    CYTHON_MAYBE_UNUSED_VAR(gen);
    CYTHON_MAYBE_UNUSED_VAR(closing);
    #ifdef __Pyx_Coroutine_USED
    if (!closing && __Pyx_Coroutine_Check(gen)) {
        PyErr_SetString(PyExc_RuntimeError, "cannot reuse already awaited coroutine");
    } else
    #endif
    if (value) {
        #ifdef __Pyx_AsyncGen_USED
        if (__Pyx_AsyncGen_CheckExact(gen))
            PyErr_SetNone(__Pyx_PyExc_StopAsyncIteration);
        else
        #endif
        PyErr_SetNone(PyExc_StopIteration);
    }
}
static
PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, int closing) {
    __Pyx_PyThreadState_declare
    PyThreadState *tstate;
    __Pyx_ExcInfoStruct *exc_state;
    PyObject *retval;
    assert(!self->is_running);
    if (unlikely(self->resume_label == 0)) {
        if (unlikely(value && value != Py_None)) {
            return __Pyx_Coroutine_NotStartedError((PyObject*)self);
        }
    }
    if (unlikely(self->resume_label == -1)) {
        return __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)self, value, closing);
    }
#if CYTHON_FAST_THREAD_STATE
    __Pyx_PyThreadState_assign
    tstate = __pyx_tstate;
#else
    tstate = __Pyx_PyThreadState_Current;
#endif
    exc_state = &self->gi_exc_state;
    if (exc_state->exc_value) {
        #if CYTHON_COMPILING_IN_PYPY
        #else
        PyObject *exc_tb;
        #if PY_VERSION_HEX >= 0x030B00a4 && !CYTHON_COMPILING_IN_CPYTHON
        exc_tb = PyException_GetTraceback(exc_state->exc_value);
        #elif PY_VERSION_HEX >= 0x030B00a4
        exc_tb = ((PyBaseExceptionObject*) exc_state->exc_value)->traceback;
        #else
        exc_tb = exc_state->exc_traceback;
        #endif
        if (exc_tb) {
            PyTracebackObject *tb = (PyTracebackObject *) exc_tb;
            PyFrameObject *f = tb->tb_frame;
            assert(f->f_back == NULL);
            #if PY_VERSION_HEX >= 0x030B00A1
            f->f_back = PyThreadState_GetFrame(tstate);
            #else
            Py_XINCREF(tstate->frame);
            f->f_back = tstate->frame;
            #endif
            #if PY_VERSION_HEX >= 0x030B00a4 && !CYTHON_COMPILING_IN_CPYTHON
            Py_DECREF(exc_tb);
            #endif
        }
        #endif
    }
#if CYTHON_USE_EXC_INFO_STACK
    exc_state->previous_item = tstate->exc_info;
    tstate->exc_info = exc_state;
#else
    if (exc_state->exc_type) {
        __Pyx_ExceptionSwap(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
    } else {
        __Pyx_Coroutine_ExceptionClear(exc_state);
        __Pyx_ExceptionSave(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
    }
#endif
    self->is_running = 1;
    retval = self->body(self, tstate, value);
    self->is_running = 0;
#if CYTHON_USE_EXC_INFO_STACK
    exc_state = &self->gi_exc_state;
    tstate->exc_info = exc_state->previous_item;
    exc_state->previous_item = NULL;
    __Pyx_Coroutine_ResetFrameBackpointer(exc_state);
#endif
    return retval;
}
static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state) {
#if CYTHON_COMPILING_IN_PYPY
    CYTHON_UNUSED_VAR(exc_state);
#else
    PyObject *exc_tb;
    #if PY_VERSION_HEX >= 0x030B00a4
    if (!exc_state->exc_value) return;
    exc_tb = PyException_GetTraceback(exc_state->exc_value);
    #else
    exc_tb = exc_state->exc_traceback;
    #endif
    if (likely(exc_tb)) {
        PyTracebackObject *tb = (PyTracebackObject *) exc_tb;
        PyFrameObject *f = tb->tb_frame;
        Py_CLEAR(f->f_back);
        #if PY_VERSION_HEX >= 0x030B00a4
        Py_DECREF(exc_tb);
        #endif
    }
#endif
}
static CYTHON_INLINE
PyObject *__Pyx_Coroutine_MethodReturn(PyObject* gen, PyObject *retval) {
    CYTHON_MAYBE_UNUSED_VAR(gen);
    if (unlikely(!retval)) {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        if (!__Pyx_PyErr_Occurred()) {
            PyObject *exc = PyExc_StopIteration;
            #ifdef __Pyx_AsyncGen_USED
            if (__Pyx_AsyncGen_CheckExact(gen))
                exc = __Pyx_PyExc_StopAsyncIteration;
            #endif
            __Pyx_PyErr_SetNone(exc);
        }
    }
    return retval;
}
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
static CYTHON_INLINE
PyObject *__Pyx_PyGen_Send(PyGenObject *gen, PyObject *arg) {
#if PY_VERSION_HEX <= 0x030A00A1
    return _PyGen_Send(gen, arg);
#else
    PyObject *result;
    if (PyIter_Send((PyObject*)gen, arg ? arg : Py_None, &result) == PYGEN_RETURN) {
        if (PyAsyncGen_CheckExact(gen)) {
            assert(result == Py_None);
            PyErr_SetNone(PyExc_StopAsyncIteration);
        }
        else if (result == Py_None) {
            PyErr_SetNone(PyExc_StopIteration);
        }
        else {
#if PY_VERSION_HEX < 0x030d00A1
            _PyGen_SetStopIterationValue(result);
#else
            if (!PyTuple_Check(result) && !PyExceptionInstance_Check(result)) {
                PyErr_SetObject(PyExc_StopIteration, result);
            } else {
                PyObject *exc = __Pyx_PyObject_CallOneArg(PyExc_StopIteration, result);
                if (likely(exc != NULL)) {
                    PyErr_SetObject(PyExc_StopIteration, exc);
                    Py_DECREF(exc);
                }
            }
#endif
        }
        Py_DECREF(result);
        result = NULL;
    }
    return result;
#endif
}
#endif
static CYTHON_INLINE
PyObject *__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen) {
    PyObject *ret;
    PyObject *val = NULL;
    __Pyx_Coroutine_Undelegate(gen);
    __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, &val);
    ret = __Pyx_Coroutine_SendEx(gen, val, 0);
    Py_XDECREF(val);
    return ret;
}
static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) {
    PyObject *retval;
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
    PyObject *yf = gen->yieldfrom;
    if (unlikely(gen->is_running))
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    if (yf) {
        PyObject *ret;
        gen->is_running = 1;
        #ifdef __Pyx_Generator_USED
        if (__Pyx_Generator_CheckExact(yf)) {
            ret = __Pyx_Coroutine_Send(yf, value);
        } else
        #endif
        #ifdef __Pyx_Coroutine_USED
        if (__Pyx_Coroutine_Check(yf)) {
            ret = __Pyx_Coroutine_Send(yf, value);
        } else
        #endif
        #ifdef __Pyx_AsyncGen_USED
        if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
            ret = __Pyx_async_gen_asend_send(yf, value);
        } else
        #endif
        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
        if (PyGen_CheckExact(yf)) {
            ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
        } else
        #endif
        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03050000 && defined(PyCoro_CheckExact) && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
        if (PyCoro_CheckExact(yf)) {
            ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
        } else
        #endif
        {
            if (value == Py_None)
                ret = __Pyx_PyObject_GetIterNextFunc(yf)(yf);
            else
                ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value);
        }
        gen->is_running = 0;
        if (likely(ret)) {
            return ret;
        }
        retval = __Pyx_Coroutine_FinishDelegation(gen);
    } else {
        retval = __Pyx_Coroutine_SendEx(gen, value, 0);
    }
    return __Pyx_Coroutine_MethodReturn(self, retval);
}
static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) {
    PyObject *retval = NULL;
    int err = 0;
    #ifdef __Pyx_Generator_USED
    if (__Pyx_Generator_CheckExact(yf)) {
        retval = __Pyx_Coroutine_Close(yf);
        if (!retval)
            return -1;
    } else
    #endif
    #ifdef __Pyx_Coroutine_USED
    if (__Pyx_Coroutine_Check(yf)) {
        retval = __Pyx_Coroutine_Close(yf);
        if (!retval)
            return -1;
    } else
    if (__Pyx_CoroutineAwait_CheckExact(yf)) {
        retval = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf, NULL);
        if (!retval)
            return -1;
    } else
    #endif
    #ifdef __Pyx_AsyncGen_USED
    if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
        retval = __Pyx_async_gen_asend_close(yf, NULL);
    } else
    if (__pyx_PyAsyncGenAThrow_CheckExact(yf)) {
        retval = __Pyx_async_gen_athrow_close(yf, NULL);
    } else
    #endif
    {
        PyObject *meth;
        gen->is_running = 1;
        meth = __Pyx_PyObject_GetAttrStrNoError(yf, __pyx_n_s_close);
        if (unlikely(!meth)) {
            if (unlikely(PyErr_Occurred())) {
                PyErr_WriteUnraisable(yf);
            }
        } else {
            retval = __Pyx_PyObject_CallNoArg(meth);
            Py_DECREF(meth);
            if (unlikely(!retval))
                err = -1;
        }
        gen->is_running = 0;
    }
    Py_XDECREF(retval);
    return err;
}
static PyObject *__Pyx_Generator_Next(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
    PyObject *yf = gen->yieldfrom;
    if (unlikely(gen->is_running))
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    if (yf) {
        PyObject *ret;
        gen->is_running = 1;
        #ifdef __Pyx_Generator_USED
        if (__Pyx_Generator_CheckExact(yf)) {
            ret = __Pyx_Generator_Next(yf);
        } else
        #endif
        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
        if (PyGen_CheckExact(yf)) {
            ret = __Pyx_PyGen_Send((PyGenObject*)yf, NULL);
        } else
        #endif
        #ifdef __Pyx_Coroutine_USED
        if (__Pyx_Coroutine_Check(yf)) {
            ret = __Pyx_Coroutine_Send(yf, Py_None);
        } else
        #endif
            ret = __Pyx_PyObject_GetIterNextFunc(yf)(yf);
        gen->is_running = 0;
        if (likely(ret)) {
            return ret;
        }
        return __Pyx_Coroutine_FinishDelegation(gen);
    }
    return __Pyx_Coroutine_SendEx(gen, Py_None, 0);
}
static PyObject *__Pyx_Coroutine_Close_Method(PyObject *self, PyObject *arg) {
    CYTHON_UNUSED_VAR(arg);
    return __Pyx_Coroutine_Close(self);
}
static PyObject *__Pyx_Coroutine_Close(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    PyObject *retval, *raised_exception;
    PyObject *yf = gen->yieldfrom;
    int err = 0;
    if (unlikely(gen->is_running))
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    if (yf) {
        Py_INCREF(yf);
        err = __Pyx_Coroutine_CloseIter(gen, yf);
        __Pyx_Coroutine_Undelegate(gen);
        Py_DECREF(yf);
    }
    if (err == 0)
        PyErr_SetNone(PyExc_GeneratorExit);
    retval = __Pyx_Coroutine_SendEx(gen, NULL, 1);
    if (unlikely(retval)) {
        const char *msg;
        Py_DECREF(retval);
        if ((0)) {
        #ifdef __Pyx_Coroutine_USED
        } else if (__Pyx_Coroutine_Check(self)) {
            msg = "coroutine ignored GeneratorExit";
        #endif
        #ifdef __Pyx_AsyncGen_USED
        } else if (__Pyx_AsyncGen_CheckExact(self)) {
#if PY_VERSION_HEX < 0x03060000
            msg = "async generator ignored GeneratorExit - might require Python 3.6+ finalisation (PEP 525)";
#else
            msg = "async generator ignored GeneratorExit";
#endif
        #endif
        } else {
            msg = "generator ignored GeneratorExit";
        }
        PyErr_SetString(PyExc_RuntimeError, msg);
        return NULL;
    }
    raised_exception = PyErr_Occurred();
    if (likely(!raised_exception || __Pyx_PyErr_GivenExceptionMatches2(raised_exception, PyExc_GeneratorExit, PyExc_StopIteration))) {
        if (raised_exception) PyErr_Clear();
        Py_INCREF(Py_None);
        return Py_None;
    }
    return NULL;
}
static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject *val, PyObject *tb,
                                        PyObject *args, int close_on_genexit) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    PyObject *yf = gen->yieldfrom;
    if (unlikely(gen->is_running))
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    if (yf) {
        PyObject *ret;
        Py_INCREF(yf);
        if (__Pyx_PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit) && close_on_genexit) {
            int err = __Pyx_Coroutine_CloseIter(gen, yf);
            Py_DECREF(yf);
            __Pyx_Coroutine_Undelegate(gen);
            if (err < 0)
                return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
            goto throw_here;
        }
        gen->is_running = 1;
        if (0
        #ifdef __Pyx_Generator_USED
            || __Pyx_Generator_CheckExact(yf)
        #endif
        #ifdef __Pyx_Coroutine_USED
            || __Pyx_Coroutine_Check(yf)
        #endif
            ) {
            ret = __Pyx__Coroutine_Throw(yf, typ, val, tb, args, close_on_genexit);
        #ifdef __Pyx_Coroutine_USED
        } else if (__Pyx_CoroutineAwait_CheckExact(yf)) {
            ret = __Pyx__Coroutine_Throw(((__pyx_CoroutineAwaitObject*)yf)->coroutine, typ, val, tb, args, close_on_genexit);
        #endif
        } else {
            PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(yf, __pyx_n_s_throw);
            if (unlikely(!meth)) {
                Py_DECREF(yf);
                if (unlikely(PyErr_Occurred())) {
                    gen->is_running = 0;
                    return NULL;
                }
                __Pyx_Coroutine_Undelegate(gen);
                gen->is_running = 0;
                goto throw_here;
            }
            if (likely(args)) {
                ret = __Pyx_PyObject_Call(meth, args, NULL);
            } else {
                PyObject *cargs[4] = {NULL, typ, val, tb};
                ret = __Pyx_PyObject_FastCall(meth, cargs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
            }
            Py_DECREF(meth);
        }
        gen->is_running = 0;
        Py_DECREF(yf);
        if (!ret) {
            ret = __Pyx_Coroutine_FinishDelegation(gen);
        }
        return __Pyx_Coroutine_MethodReturn(self, ret);
    }
throw_here:
    __Pyx_Raise(typ, val, tb, NULL);
    return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
}
static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) {
    PyObject *typ;
    PyObject *val = NULL;
    PyObject *tb = NULL;
    if (unlikely(!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb)))
        return NULL;
    return __Pyx__Coroutine_Throw(self, typ, val, tb, args, 1);
}
static CYTHON_INLINE int __Pyx_Coroutine_traverse_excstate(__Pyx_ExcInfoStruct *exc_state, visitproc visit, void *arg) {
#if PY_VERSION_HEX >= 0x030B00a4
    Py_VISIT(exc_state->exc_value);
#else
    Py_VISIT(exc_state->exc_type);
    Py_VISIT(exc_state->exc_value);
    Py_VISIT(exc_state->exc_traceback);
#endif
    return 0;
}
static int __Pyx_Coroutine_traverse(__pyx_CoroutineObject *gen, visitproc visit, void *arg) {
    Py_VISIT(gen->closure);
    Py_VISIT(gen->classobj);
    Py_VISIT(gen->yieldfrom);
    return __Pyx_Coroutine_traverse_excstate(&gen->gi_exc_state, visit, arg);
}
static int __Pyx_Coroutine_clear(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    Py_CLEAR(gen->closure);
    Py_CLEAR(gen->classobj);
    Py_CLEAR(gen->yieldfrom);
    __Pyx_Coroutine_ExceptionClear(&gen->gi_exc_state);
#ifdef __Pyx_AsyncGen_USED
    if (__Pyx_AsyncGen_CheckExact(self)) {
        Py_CLEAR(((__pyx_PyAsyncGenObject*)gen)->ag_finalizer);
    }
#endif
    Py_CLEAR(gen->gi_code);
    Py_CLEAR(gen->gi_frame);
    Py_CLEAR(gen->gi_name);
    Py_CLEAR(gen->gi_qualname);
    Py_CLEAR(gen->gi_modulename);
    return 0;
}
static void __Pyx_Coroutine_dealloc(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    PyObject_GC_UnTrack(gen);
    if (gen->gi_weakreflist != NULL)
        PyObject_ClearWeakRefs(self);
    if (gen->resume_label >= 0) {
        PyObject_GC_Track(self);
#if PY_VERSION_HEX >= 0x030400a1 && CYTHON_USE_TP_FINALIZE
        if (unlikely(PyObject_CallFinalizerFromDealloc(self)))
#else
        Py_TYPE(gen)->tp_del(self);
        if (unlikely(Py_REFCNT(self) > 0))
#endif
        {
            return;
        }
        PyObject_GC_UnTrack(self);
    }
#ifdef __Pyx_AsyncGen_USED
    if (__Pyx_AsyncGen_CheckExact(self)) {
        /* We have to handle this case for asynchronous generators
           right here, because this code has to be between UNTRACK
           and GC_Del. */
        Py_CLEAR(((__pyx_PyAsyncGenObject*)self)->ag_finalizer);
    }
#endif
    __Pyx_Coroutine_clear(self);
    __Pyx_PyHeapTypeObject_GC_Del(gen);
}
static void __Pyx_Coroutine_del(PyObject *self) {
    PyObject *error_type, *error_value, *error_traceback;
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    __Pyx_PyThreadState_declare
    if (gen->resume_label < 0) {
        return;
    }
#if !CYTHON_USE_TP_FINALIZE
    assert(self->ob_refcnt == 0);
    __Pyx_SET_REFCNT(self, 1);
#endif
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&error_type, &error_value, &error_traceback);
#ifdef __Pyx_AsyncGen_USED
    if (__Pyx_AsyncGen_CheckExact(self)) {
        __pyx_PyAsyncGenObject *agen = (__pyx_PyAsyncGenObject*)self;
        PyObject *finalizer = agen->ag_finalizer;
        if (finalizer && !agen->ag_closed) {
            PyObject *res = __Pyx_PyObject_CallOneArg(finalizer, self);
            if (unlikely(!res)) {
                PyErr_WriteUnraisable(self);
            } else {
                Py_DECREF(res);
            }
            __Pyx_ErrRestore(error_type, error_value, error_traceback);
            return;
        }
    }
#endif
    if (unlikely(gen->resume_label == 0 && !error_value)) {
#ifdef __Pyx_Coroutine_USED
#ifdef __Pyx_Generator_USED
    if (!__Pyx_Generator_CheckExact(self))
#endif
        {
        PyObject_GC_UnTrack(self);
#if PY_MAJOR_VERSION >= 3  || defined(PyErr_WarnFormat)
        if (unlikely(PyErr_WarnFormat(PyExc_RuntimeWarning, 1, "coroutine '%.50S' was never awaited", gen->gi_qualname) < 0))
            PyErr_WriteUnraisable(self);
#else
        {PyObject *msg;
        char *cmsg;
        #if CYTHON_COMPILING_IN_PYPY
        msg = NULL;
        cmsg = (char*) "coroutine was never awaited";
        #else
        char *cname;
        PyObject *qualname;
        qualname = gen->gi_qualname;
        cname = PyString_AS_STRING(qualname);
        msg = PyString_FromFormat("coroutine '%.50s' was never awaited", cname);
        if (unlikely(!msg)) {
            PyErr_Clear();
            cmsg = (char*) "coroutine was never awaited";
        } else {
            cmsg = PyString_AS_STRING(msg);
        }
        #endif
        if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, cmsg, 1) < 0))
            PyErr_WriteUnraisable(self);
        Py_XDECREF(msg);}
#endif
        PyObject_GC_Track(self);
        }
#endif
    } else {
        PyObject *res = __Pyx_Coroutine_Close(self);
        if (unlikely(!res)) {
            if (PyErr_Occurred())
                PyErr_WriteUnraisable(self);
        } else {
            Py_DECREF(res);
        }
    }
    __Pyx_ErrRestore(error_type, error_value, error_traceback);
#if !CYTHON_USE_TP_FINALIZE
    assert(Py_REFCNT(self) > 0);
    if (likely(--self->ob_refcnt == 0)) {
        return;
    }
    {
        Py_ssize_t refcnt = Py_REFCNT(self);
        _Py_NewReference(self);
        __Pyx_SET_REFCNT(self, refcnt);
    }
#if CYTHON_COMPILING_IN_CPYTHON
    assert(PyType_IS_GC(Py_TYPE(self)) &&
           _Py_AS_GC(self)->gc.gc_refs != _PyGC_REFS_UNTRACKED);
    _Py_DEC_REFTOTAL;
#endif
#ifdef COUNT_ALLOCS
    --Py_TYPE(self)->tp_frees;
    --Py_TYPE(self)->tp_allocs;
#endif
#endif
}
static PyObject *
__Pyx_Coroutine_get_name(__pyx_CoroutineObject *self, void *context)
{
    PyObject *name = self->gi_name;
    CYTHON_UNUSED_VAR(context);
    if (unlikely(!name)) name = Py_None;
    Py_INCREF(name);
    return name;
}
static int
__Pyx_Coroutine_set_name(__pyx_CoroutineObject *self, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value)))
#else
    if (unlikely(value == NULL || !PyString_Check(value)))
#endif
    {
        PyErr_SetString(PyExc_TypeError,
                        "__name__ must be set to a string object");
        return -1;
    }
    Py_INCREF(value);
    __Pyx_Py_XDECREF_SET(self->gi_name, value);
    return 0;
}
static PyObject *
__Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *self, void *context)
{
    PyObject *name = self->gi_qualname;
    CYTHON_UNUSED_VAR(context);
    if (unlikely(!name)) name = Py_None;
    Py_INCREF(name);
    return name;
}
static int
__Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value)))
#else
    if (unlikely(value == NULL || !PyString_Check(value)))
#endif
    {
        PyErr_SetString(PyExc_TypeError,
                        "__qualname__ must be set to a string object");
        return -1;
    }
    Py_INCREF(value);
    __Pyx_Py_XDECREF_SET(self->gi_qualname, value);
    return 0;
}
static PyObject *
__Pyx_Coroutine_get_frame(__pyx_CoroutineObject *self, void *context)
{
    PyObject *frame = self->gi_frame;
    CYTHON_UNUSED_VAR(context);
    if (!frame) {
        if (unlikely(!self->gi_code)) {
            Py_RETURN_NONE;
        }
        frame = (PyObject *) PyFrame_New(
            PyThreadState_Get(),            /*PyThreadState *tstate,*/
            (PyCodeObject*) self->gi_code,  /*PyCodeObject *code,*/
            __pyx_d,                 /*PyObject *globals,*/
            0                               /*PyObject *locals*/
        );
        if (unlikely(!frame))
            return NULL;
        self->gi_frame = frame;
    }
    Py_INCREF(frame);
    return frame;
}
static __pyx_CoroutineObject *__Pyx__Coroutine_New(
            PyTypeObject* type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
            PyObject *name, PyObject *qualname, PyObject *module_name) {
    __pyx_CoroutineObject *gen = PyObject_GC_New(__pyx_CoroutineObject, type);
    if (unlikely(!gen))
        return NULL;
    return __Pyx__Coroutine_NewInit(gen, body, code, closure, name, qualname, module_name);
}
static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
            __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
            PyObject *name, PyObject *qualname, PyObject *module_name) {
    gen->body = body;
    gen->closure = closure;
    Py_XINCREF(closure);
    gen->is_running = 0;
    gen->resume_label = 0;
    gen->classobj = NULL;
    gen->yieldfrom = NULL;
    #if PY_VERSION_HEX >= 0x030B00a4
    gen->gi_exc_state.exc_value = NULL;
    #else
    gen->gi_exc_state.exc_type = NULL;
    gen->gi_exc_state.exc_value = NULL;
    gen->gi_exc_state.exc_traceback = NULL;
    #endif
#if CYTHON_USE_EXC_INFO_STACK
    gen->gi_exc_state.previous_item = NULL;
#endif
    gen->gi_weakreflist = NULL;
    Py_XINCREF(qualname);
    gen->gi_qualname = qualname;
    Py_XINCREF(name);
    gen->gi_name = name;
    Py_XINCREF(module_name);
    gen->gi_modulename = module_name;
    Py_XINCREF(code);
    gen->gi_code = code;
    gen->gi_frame = NULL;
    PyObject_GC_Track(gen);
    return gen;
}

/* PyObject_GenericGetAttrNoDict */
#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
    __Pyx_TypeName type_name = __Pyx_PyType_GetName(tp);
    PyErr_Format(PyExc_AttributeError,
#if PY_MAJOR_VERSION >= 3
                 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'",
                 type_name, attr_name);
#else
                 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'",
                 type_name, PyString_AS_STRING(attr_name));
#endif
    __Pyx_DECREF_TypeName(type_name);
    return NULL;
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
    PyObject *descr;
    PyTypeObject *tp = Py_TYPE(obj);
    if (unlikely(!PyString_Check(attr_name))) {
        return PyObject_GenericGetAttr(obj, attr_name);
    }
    assert(!tp->tp_dictoffset);
    descr = _PyType_Lookup(tp, attr_name);
    if (unlikely(!descr)) {
        return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
    }
    Py_INCREF(descr);
    #if PY_MAJOR_VERSION < 3
    if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
    #endif
    {
        descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
        if (unlikely(f)) {
            PyObject *res = f(descr, obj, (PyObject *)tp);
            Py_DECREF(descr);
            return res;
        }
    }
    return descr;
}
#endif

/* PatchModuleWithCoroutine */
static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code) {
#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
    int result;
    PyObject *globals, *result_obj;
    globals = PyDict_New();  if (unlikely(!globals)) goto ignore;
    result = PyDict_SetItemString(globals, "_cython_coroutine_type",
    #ifdef __Pyx_Coroutine_USED
        (PyObject*)__pyx_CoroutineType);
    #else
        Py_None);
    #endif
    if (unlikely(result < 0)) goto ignore;
    result = PyDict_SetItemString(globals, "_cython_generator_type",
    #ifdef __Pyx_Generator_USED
        (PyObject*)__pyx_GeneratorType);
    #else
        Py_None);
    #endif
    if (unlikely(result < 0)) goto ignore;
    if (unlikely(PyDict_SetItemString(globals, "_module", module) < 0)) goto ignore;
    if (unlikely(PyDict_SetItemString(globals, "__builtins__", __pyx_b) < 0)) goto ignore;
    result_obj = PyRun_String(py_code, Py_file_input, globals, globals);
    if (unlikely(!result_obj)) goto ignore;
    Py_DECREF(result_obj);
    Py_DECREF(globals);
    return module;
ignore:
    Py_XDECREF(globals);
    PyErr_WriteUnraisable(module);
    if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, "Cython module failed to patch module with custom type", 1) < 0)) {
        Py_DECREF(module);
        module = NULL;
    }
#else
    py_code++;
#endif
    return module;
}

/* PatchGeneratorABC */
#ifndef CYTHON_REGISTER_ABCS
#define CYTHON_REGISTER_ABCS 1
#endif
#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
static PyObject* __Pyx_patch_abc_module(PyObject *module);
static PyObject* __Pyx_patch_abc_module(PyObject *module) {
    module = __Pyx_Coroutine_patch_module(
        module, ""
"if _cython_generator_type is not None:\n"
"    try: Generator = _module.Generator\n"
"    except AttributeError: pass\n"
"    else: Generator.register(_cython_generator_type)\n"
"if _cython_coroutine_type is not None:\n"
"    try: Coroutine = _module.Coroutine\n"
"    except AttributeError: pass\n"
"    else: Coroutine.register(_cython_coroutine_type)\n"
    );
    return module;
}
#endif
static int __Pyx_patch_abc(void) {
#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
    static int abc_patched = 0;
    if (CYTHON_REGISTER_ABCS && !abc_patched) {
        PyObject *module;
        module = PyImport_ImportModule((PY_MAJOR_VERSION >= 3) ? "collections.abc" : "collections");
        if (unlikely(!module)) {
            PyErr_WriteUnraisable(NULL);
            if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning,
                    ((PY_MAJOR_VERSION >= 3) ?
                        "Cython module failed to register with collections.abc module" :
                        "Cython module failed to register with collections module"), 1) < 0)) {
                return -1;
            }
        } else {
            module = __Pyx_patch_abc_module(module);
            abc_patched = 1;
            if (unlikely(!module))
                return -1;
            Py_DECREF(module);
        }
        module = PyImport_ImportModule("backports_abc");
        if (module) {
            module = __Pyx_patch_abc_module(module);
            Py_XDECREF(module);
        }
        if (!module) {
            PyErr_Clear();
        }
    }
#else
    if ((0)) __Pyx_Coroutine_patch_module(NULL, NULL);
#endif
    return 0;
}

/* Generator */
static PyMethodDef __pyx_Generator_methods[] = {
    {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O,
     (char*) PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")},
    {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS,
     (char*) PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")},
    {"close", (PyCFunction) __Pyx_Coroutine_Close_Method, METH_NOARGS,
     (char*) PyDoc_STR("close() -> raise GeneratorExit inside generator.")},
    {0, 0, 0, 0}
};
static PyMemberDef __pyx_Generator_memberlist[] = {
    {(char *) "gi_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL},
    {(char*) "gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY,
     (char*) PyDoc_STR("object being iterated by 'yield from', or None")},
    {(char*) "gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL},
    {(char *) "__module__", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_modulename), 0, 0},
#if CYTHON_USE_TYPE_SPECS
    {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CoroutineObject, gi_weakreflist), READONLY, 0},
#endif
    {0, 0, 0, 0, 0}
};
static PyGetSetDef __pyx_Generator_getsets[] = {
    {(char *) "__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name,
     (char*) PyDoc_STR("name of the generator"), 0},
    {(char *) "__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname,
     (char*) PyDoc_STR("qualified name of the generator"), 0},
    {(char *) "gi_frame", (getter)__Pyx_Coroutine_get_frame, NULL,
     (char*) PyDoc_STR("Frame of the generator"), 0},
    {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_GeneratorType_slots[] = {
    {Py_tp_dealloc, (void *)__Pyx_Coroutine_dealloc},
    {Py_tp_traverse, (void *)__Pyx_Coroutine_traverse},
    {Py_tp_iter, (void *)PyObject_SelfIter},
    {Py_tp_iternext, (void *)__Pyx_Generator_Next},
    {Py_tp_methods, (void *)__pyx_Generator_methods},
    {Py_tp_members, (void *)__pyx_Generator_memberlist},
    {Py_tp_getset, (void *)__pyx_Generator_getsets},
    {Py_tp_getattro, (void *) __Pyx_PyObject_GenericGetAttrNoDict},
#if CYTHON_USE_TP_FINALIZE
    {Py_tp_finalize, (void *)__Pyx_Coroutine_del},
#endif
    {0, 0},
};
static PyType_Spec __pyx_GeneratorType_spec = {
    __PYX_TYPE_MODULE_PREFIX "generator",
    sizeof(__pyx_CoroutineObject),
    0,
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE,
    __pyx_GeneratorType_slots
};
#else
static PyTypeObject __pyx_GeneratorType_type = {
    PyVarObject_HEAD_INIT(0, 0)
    __PYX_TYPE_MODULE_PREFIX "generator",
    sizeof(__pyx_CoroutineObject),
    0,
    (destructor) __Pyx_Coroutine_dealloc,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE,
    0,
    (traverseproc) __Pyx_Coroutine_traverse,
    0,
    0,
    offsetof(__pyx_CoroutineObject, gi_weakreflist),
    0,
    (iternextfunc) __Pyx_Generator_Next,
    __pyx_Generator_methods,
    __pyx_Generator_memberlist,
    __pyx_Generator_getsets,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
#if CYTHON_USE_TP_FINALIZE
    0,
#else
    __Pyx_Coroutine_del,
#endif
    0,
#if CYTHON_USE_TP_FINALIZE
    __Pyx_Coroutine_del,
#elif PY_VERSION_HEX >= 0x030400a1
    0,
#endif
#if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
    0,
#endif
#if __PYX_NEED_TP_PRINT_SLOT
    0,
#endif
#if PY_VERSION_HEX >= 0x030C0000
    0,
#endif
#if PY_VERSION_HEX >= 0x030d00A4
    0,
#endif
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
    0,
#endif
};
#endif
static int __pyx_Generator_init(PyObject *module) {
#if CYTHON_USE_TYPE_SPECS
    __pyx_GeneratorType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_GeneratorType_spec, NULL);
#else
    CYTHON_UNUSED_VAR(module);
    __pyx_GeneratorType_type.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
    __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter;
    __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type);
#endif
    if (unlikely(!__pyx_GeneratorType)) {
        return -1;
    }
    return 0;
}

/* GeneratorYieldFrom */
#if CYTHON_USE_TYPE_SLOTS
static void __Pyx_PyIter_CheckErrorAndDecref(PyObject *source) {
    __Pyx_TypeName source_type_name = __Pyx_PyType_GetName(Py_TYPE(source));
    PyErr_Format(PyExc_TypeError,
        "iter() returned non-iterator of type '" __Pyx_FMT_TYPENAME "'", source_type_name);
    __Pyx_DECREF_TypeName(source_type_name);
    Py_DECREF(source);
}
#endif
static CYTHON_INLINE PyObject* __Pyx_Generator_Yield_From(__pyx_CoroutineObject *gen, PyObject *source) {
    PyObject *source_gen, *retval;
#ifdef __Pyx_Coroutine_USED
    if (__Pyx_Coroutine_Check(source)) {
        Py_INCREF(source);
        source_gen = source;
        retval = __Pyx_Generator_Next(source);
    } else
#endif
    {
#if CYTHON_USE_TYPE_SLOTS
        if (likely(Py_TYPE(source)->tp_iter)) {
            source_gen = Py_TYPE(source)->tp_iter(source);
            if (unlikely(!source_gen))
                return NULL;
            if (unlikely(!PyIter_Check(source_gen))) {
                __Pyx_PyIter_CheckErrorAndDecref(source_gen);
                return NULL;
            }
        } else
#endif
        {
            source_gen = PyObject_GetIter(source);
            if (unlikely(!source_gen))
                return NULL;
        }
        retval = __Pyx_PyObject_GetIterNextFunc(source_gen)(source_gen);
    }
    if (likely(retval)) {
        gen->yieldfrom = source_gen;
        return retval;
    }
    Py_DECREF(source_gen);
    return NULL;
}

/* KeywordStringCheck */
static int __Pyx_CheckKeywordStrings(
    PyObject *kw,
    const char* function_name,
    int kw_allowed)
{
    PyObject* key = 0;
    Py_ssize_t pos = 0;
#if CYTHON_COMPILING_IN_PYPY
    if (!kw_allowed && PyDict_Next(kw, &pos, &key, 0))
        goto invalid_keyword;
    return 1;
#else
    if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kw))) {
        Py_ssize_t kwsize;
#if CYTHON_ASSUME_SAFE_MACROS
        kwsize = PyTuple_GET_SIZE(kw);
#else
        kwsize = PyTuple_Size(kw);
        if (kwsize < 0) return 0;
#endif
        if (unlikely(kwsize == 0))
            return 1;
        if (!kw_allowed) {
#if CYTHON_ASSUME_SAFE_MACROS
            key = PyTuple_GET_ITEM(kw, 0);
#else
            key = PyTuple_GetItem(kw, pos);
            if (!key) return 0;
#endif
            goto invalid_keyword;
        }
#if PY_VERSION_HEX < 0x03090000
        for (pos = 0; pos < kwsize; pos++) {
#if CYTHON_ASSUME_SAFE_MACROS
            key = PyTuple_GET_ITEM(kw, pos);
#else
            key = PyTuple_GetItem(kw, pos);
            if (!key) return 0;
#endif
            if (unlikely(!PyUnicode_Check(key)))
                goto invalid_keyword_type;
        }
#endif
        return 1;
    }
    while (PyDict_Next(kw, &pos, &key, 0)) {
        #if PY_MAJOR_VERSION < 3
        if (unlikely(!PyString_Check(key)))
        #endif
            if (unlikely(!PyUnicode_Check(key)))
                goto invalid_keyword_type;
    }
    if (!kw_allowed && unlikely(key))
        goto invalid_keyword;
    return 1;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%.200s() keywords must be strings", function_name);
    return 0;
#endif
invalid_keyword:
    #if PY_MAJOR_VERSION < 3
    PyErr_Format(PyExc_TypeError,
        "%.200s() got an unexpected keyword argument '%.200s'",
        function_name, PyString_AsString(key));
    #else
    PyErr_Format(PyExc_TypeError,
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
    return 0;
}

/* PyObjectCallMethod0 */
static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
    PyObject *method = NULL, *result = NULL;
    int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
    if (likely(is_method)) {
        result = __Pyx_PyObject_CallOneArg(method, obj);
        Py_DECREF(method);
        return result;
    }
    if (unlikely(!method)) goto bad;
    result = __Pyx_PyObject_CallNoArg(method);
    Py_DECREF(method);
bad:
    return result;
}

/* RaiseNoneIterError */
static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
}

/* UnpackTupleError */
static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) {
    if (t == Py_None) {
      __Pyx_RaiseNoneNotIterableError();
    } else if (PyTuple_GET_SIZE(t) < index) {
      __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t));
    } else {
      __Pyx_RaiseTooManyValuesError(index);
    }
}

/* UnpackTuple2 */
static CYTHON_INLINE int __Pyx_unpack_tuple2_exact(
        PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int decref_tuple) {
    PyObject *value1 = NULL, *value2 = NULL;
#if CYTHON_COMPILING_IN_PYPY
    value1 = PySequence_ITEM(tuple, 0);  if (unlikely(!value1)) goto bad;
    value2 = PySequence_ITEM(tuple, 1);  if (unlikely(!value2)) goto bad;
#else
    value1 = PyTuple_GET_ITEM(tuple, 0);  Py_INCREF(value1);
    value2 = PyTuple_GET_ITEM(tuple, 1);  Py_INCREF(value2);
#endif
    if (decref_tuple) {
        Py_DECREF(tuple);
    }
    *pvalue1 = value1;
    *pvalue2 = value2;
    return 0;
#if CYTHON_COMPILING_IN_PYPY
bad:
    Py_XDECREF(value1);
    Py_XDECREF(value2);
    if (decref_tuple) { Py_XDECREF(tuple); }
    return -1;
#endif
}
static int __Pyx_unpack_tuple2_generic(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2,
                                       int has_known_size, int decref_tuple) {
    Py_ssize_t index;
    PyObject *value1 = NULL, *value2 = NULL, *iter = NULL;
    iternextfunc iternext;
    iter = PyObject_GetIter(tuple);
    if (unlikely(!iter)) goto bad;
    if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; }
    iternext = __Pyx_PyObject_GetIterNextFunc(iter);
    value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; }
    value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; }
    if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad;
    Py_DECREF(iter);
    *pvalue1 = value1;
    *pvalue2 = value2;
    return 0;
unpacking_failed:
    if (!has_known_size && __Pyx_IterFinish() == 0)
        __Pyx_RaiseNeedMoreValuesError(index);
bad:
    Py_XDECREF(iter);
    Py_XDECREF(value1);
    Py_XDECREF(value2);
    if (decref_tuple) { Py_XDECREF(tuple); }
    return -1;
}

/* dict_iter */
#if CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
#include <string.h>
#endif
static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name,
                                                   Py_ssize_t* p_orig_length, int* p_source_is_dict) {
    is_dict = is_dict || likely(PyDict_CheckExact(iterable));
    *p_source_is_dict = is_dict;
    if (is_dict) {
#if !CYTHON_COMPILING_IN_PYPY
        *p_orig_length = PyDict_Size(iterable);
        Py_INCREF(iterable);
        return iterable;
#elif PY_MAJOR_VERSION >= 3
        static PyObject *py_items = NULL, *py_keys = NULL, *py_values = NULL;
        PyObject **pp = NULL;
        if (method_name) {
            const char *name = PyUnicode_AsUTF8(method_name);
            if (strcmp(name, "iteritems") == 0) pp = &py_items;
            else if (strcmp(name, "iterkeys") == 0) pp = &py_keys;
            else if (strcmp(name, "itervalues") == 0) pp = &py_values;
            if (pp) {
                if (!*pp) {
                    *pp = PyUnicode_FromString(name + 4);
                    if (!*pp)
                        return NULL;
                }
                method_name = *pp;
            }
        }
#endif
    }
    *p_orig_length = 0;
    if (method_name) {
        PyObject* iter;
        iterable = __Pyx_PyObject_CallMethod0(iterable, method_name);
        if (!iterable)
            return NULL;
#if !CYTHON_COMPILING_IN_PYPY
        if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable))
            return iterable;
#endif
        iter = PyObject_GetIter(iterable);
        Py_DECREF(iterable);
        return iter;
    }
    return PyObject_GetIter(iterable);
}
static CYTHON_INLINE int __Pyx_dict_iter_next(
        PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos,
        PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) {
    PyObject* next_item;
#if !CYTHON_COMPILING_IN_PYPY
    if (source_is_dict) {
        PyObject *key, *value;
        if (unlikely(orig_length != PyDict_Size(iter_obj))) {
            PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration");
            return -1;
        }
        if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) {
            return 0;
        }
        if (pitem) {
            PyObject* tuple = PyTuple_New(2);
            if (unlikely(!tuple)) {
                return -1;
            }
            Py_INCREF(key);
            Py_INCREF(value);
            PyTuple_SET_ITEM(tuple, 0, key);
            PyTuple_SET_ITEM(tuple, 1, value);
            *pitem = tuple;
        } else {
            if (pkey) {
                Py_INCREF(key);
                *pkey = key;
            }
            if (pvalue) {
                Py_INCREF(value);
                *pvalue = value;
            }
        }
        return 1;
    } else if (PyTuple_CheckExact(iter_obj)) {
        Py_ssize_t pos = *ppos;
        if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0;
        *ppos = pos + 1;
        next_item = PyTuple_GET_ITEM(iter_obj, pos);
        Py_INCREF(next_item);
    } else if (PyList_CheckExact(iter_obj)) {
        Py_ssize_t pos = *ppos;
        if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0;
        *ppos = pos + 1;
        next_item = PyList_GET_ITEM(iter_obj, pos);
        Py_INCREF(next_item);
    } else
#endif
    {
        next_item = PyIter_Next(iter_obj);
        if (unlikely(!next_item)) {
            return __Pyx_IterFinish();
        }
    }
    if (pitem) {
        *pitem = next_item;
    } else if (pkey && pvalue) {
        if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1))
            return -1;
    } else if (pkey) {
        *pkey = next_item;
    } else {
        *pvalue = next_item;
    }
    return 1;
}

/* append */
static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
    if (likely(PyList_CheckExact(L))) {
        if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1;
    } else {
        PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_append, x);
        if (unlikely(!retval))
            return -1;
        Py_DECREF(retval);
    }
    return 0;
}

/* PyVectorcallFastCallDict */
#if CYTHON_METH_FASTCALL
static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
{
    PyObject *res = NULL;
    PyObject *kwnames;
    PyObject **newargs;
    PyObject **kwvalues;
    Py_ssize_t i, pos;
    size_t j;
    PyObject *key, *value;
    unsigned long keys_are_strings;
    Py_ssize_t nkw = PyDict_GET_SIZE(kw);
    newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0]));
    if (unlikely(newargs == NULL)) {
        PyErr_NoMemory();
        return NULL;
    }
    for (j = 0; j < nargs; j++) newargs[j] = args[j];
    kwnames = PyTuple_New(nkw);
    if (unlikely(kwnames == NULL)) {
        PyMem_Free(newargs);
        return NULL;
    }
    kwvalues = newargs + nargs;
    pos = i = 0;
    keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS;
    while (PyDict_Next(kw, &pos, &key, &value)) {
        keys_are_strings &= Py_TYPE(key)->tp_flags;
        Py_INCREF(key);
        Py_INCREF(value);
        PyTuple_SET_ITEM(kwnames, i, key);
        kwvalues[i] = value;
        i++;
    }
    if (unlikely(!keys_are_strings)) {
        PyErr_SetString(PyExc_TypeError, "keywords must be strings");
        goto cleanup;
    }
    res = vc(func, newargs, nargs, kwnames);
cleanup:
    Py_DECREF(kwnames);
    for (i = 0; i < nkw; i++)
        Py_DECREF(kwvalues[i]);
    PyMem_Free(newargs);
    return res;
}
static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
{
    if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) {
        return vc(func, args, nargs, NULL);
    }
    return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw);
}
#endif

/* CythonFunctionShared */
#if CYTHON_COMPILING_IN_LIMITED_API
static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) {
    if (__Pyx_CyFunction_Check(func)) {
        return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc;
    } else if (PyCFunction_Check(func)) {
        return PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
    }
    return 0;
}
#else
static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) {
    return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
}
#endif
static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) {
#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
    __Pyx_Py_XDECREF_SET(
        __Pyx_CyFunction_GetClassObj(f),
            ((classobj) ? __Pyx_NewRef(classobj) : NULL));
#else
    __Pyx_Py_XDECREF_SET(
        ((PyCMethodObject *) (f))->mm_class,
        (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL));
#endif
}
static PyObject *
__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure)
{
    CYTHON_UNUSED_VAR(closure);
    if (unlikely(op->func_doc == NULL)) {
#if CYTHON_COMPILING_IN_LIMITED_API
        op->func_doc = PyObject_GetAttrString(op->func, "__doc__");
        if (unlikely(!op->func_doc)) return NULL;
#else
        if (((PyCFunctionObject*)op)->m_ml->ml_doc) {
#if PY_MAJOR_VERSION >= 3
            op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc);
#else
            op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc);
#endif
            if (unlikely(op->func_doc == NULL))
                return NULL;
        } else {
            Py_INCREF(Py_None);
            return Py_None;
        }
#endif
    }
    Py_INCREF(op->func_doc);
    return op->func_doc;
}
static int
__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (value == NULL) {
        value = Py_None;
    }
    Py_INCREF(value);
    __Pyx_Py_XDECREF_SET(op->func_doc, value);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (unlikely(op->func_name == NULL)) {
#if CYTHON_COMPILING_IN_LIMITED_API
        op->func_name = PyObject_GetAttrString(op->func, "__name__");
#elif PY_MAJOR_VERSION >= 3
        op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name);
#else
        op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name);
#endif
        if (unlikely(op->func_name == NULL))
            return NULL;
    }
    Py_INCREF(op->func_name);
    return op->func_name;
}
static int
__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value)))
#else
    if (unlikely(value == NULL || !PyString_Check(value)))
#endif
    {
        PyErr_SetString(PyExc_TypeError,
                        "__name__ must be set to a string object");
        return -1;
    }
    Py_INCREF(value);
    __Pyx_Py_XDECREF_SET(op->func_name, value);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context)
{
    CYTHON_UNUSED_VAR(context);
    Py_INCREF(op->func_qualname);
    return op->func_qualname;
}
static int
__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value)))
#else
    if (unlikely(value == NULL || !PyString_Check(value)))
#endif
    {
        PyErr_SetString(PyExc_TypeError,
                        "__qualname__ must be set to a string object");
        return -1;
    }
    Py_INCREF(value);
    __Pyx_Py_XDECREF_SET(op->func_qualname, value);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (unlikely(op->func_dict == NULL)) {
        op->func_dict = PyDict_New();
        if (unlikely(op->func_dict == NULL))
            return NULL;
    }
    Py_INCREF(op->func_dict);
    return op->func_dict;
}
static int
__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (unlikely(value == NULL)) {
        PyErr_SetString(PyExc_TypeError,
               "function's dictionary may not be deleted");
        return -1;
    }
    if (unlikely(!PyDict_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
               "setting function's dictionary to a non-dict");
        return -1;
    }
    Py_INCREF(value);
    __Pyx_Py_XDECREF_SET(op->func_dict, value);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context)
{
    CYTHON_UNUSED_VAR(context);
    Py_INCREF(op->func_globals);
    return op->func_globals;
}
static PyObject *
__Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context)
{
    CYTHON_UNUSED_VAR(op);
    CYTHON_UNUSED_VAR(context);
    Py_INCREF(Py_None);
    return Py_None;
}
static PyObject *
__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context)
{
    PyObject* result = (op->func_code) ? op->func_code : Py_None;
    CYTHON_UNUSED_VAR(context);
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
    int result = 0;
    PyObject *res = op->defaults_getter((PyObject *) op);
    if (unlikely(!res))
        return -1;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
    Py_INCREF(op->defaults_tuple);
    op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
    Py_INCREF(op->defaults_kwdict);
    #else
    op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0);
    if (unlikely(!op->defaults_tuple)) result = -1;
    else {
        op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1);
        if (unlikely(!op->defaults_kwdict)) result = -1;
    }
    #endif
    Py_DECREF(res);
    return result;
}
static int
__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
    CYTHON_UNUSED_VAR(context);
    if (!value) {
        value = Py_None;
    } else if (unlikely(value != Py_None && !PyTuple_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__defaults__ must be set to a tuple object");
        return -1;
    }
    PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not "
                 "currently affect the values used in function calls", 1);
    Py_INCREF(value);
    __Pyx_Py_XDECREF_SET(op->defaults_tuple, value);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) {
    PyObject* result = op->defaults_tuple;
    CYTHON_UNUSED_VAR(context);
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL;
            result = op->defaults_tuple;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
    CYTHON_UNUSED_VAR(context);
    if (!value) {
        value = Py_None;
    } else if (unlikely(value != Py_None && !PyDict_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__kwdefaults__ must be set to a dict object");
        return -1;
    }
    PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not "
                 "currently affect the values used in function calls", 1);
    Py_INCREF(value);
    __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) {
    PyObject* result = op->defaults_kwdict;
    CYTHON_UNUSED_VAR(context);
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL;
            result = op->defaults_kwdict;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
    CYTHON_UNUSED_VAR(context);
    if (!value || value == Py_None) {
        value = NULL;
    } else if (unlikely(!PyDict_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__annotations__ must be set to a dict object");
        return -1;
    }
    Py_XINCREF(value);
    __Pyx_Py_XDECREF_SET(op->func_annotations, value);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) {
    PyObject* result = op->func_annotations;
    CYTHON_UNUSED_VAR(context);
    if (unlikely(!result)) {
        result = PyDict_New();
        if (unlikely(!result)) return NULL;
        op->func_annotations = result;
    }
    Py_INCREF(result);
    return result;
}
static PyObject *
__Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) {
    int is_coroutine;
    CYTHON_UNUSED_VAR(context);
    if (op->func_is_coroutine) {
        return __Pyx_NewRef(op->func_is_coroutine);
    }
    is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE;
#if PY_VERSION_HEX >= 0x03050000
    if (is_coroutine) {
        PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine;
        fromlist = PyList_New(1);
        if (unlikely(!fromlist)) return NULL;
        Py_INCREF(marker);
#if CYTHON_ASSUME_SAFE_MACROS
        PyList_SET_ITEM(fromlist, 0, marker);
#else
        if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) {
            Py_DECREF(marker);
            Py_DECREF(fromlist);
            return NULL;
        }
#endif
        module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0);
        Py_DECREF(fromlist);
        if (unlikely(!module)) goto ignore;
        op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker);
        Py_DECREF(module);
        if (likely(op->func_is_coroutine)) {
            return __Pyx_NewRef(op->func_is_coroutine);
        }
ignore:
        PyErr_Clear();
    }
#endif
    op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine);
    return __Pyx_NewRef(op->func_is_coroutine);
}
#if CYTHON_COMPILING_IN_LIMITED_API
static PyObject *
__Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) {
    CYTHON_UNUSED_VAR(context);
    return PyObject_GetAttrString(op->func, "__module__");
}
static int
__Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
    CYTHON_UNUSED_VAR(context);
    return PyObject_SetAttrString(op->func, "__module__", value);
}
#endif
static PyGetSetDef __pyx_CyFunction_getsets[] = {
    {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {(char *) "__doc__",  (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
    {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
    {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
    {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
    {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
    {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0},
#if CYTHON_COMPILING_IN_LIMITED_API
    {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0},
#endif
    {0, 0, 0, 0, 0}
};
static PyMemberDef __pyx_CyFunction_members[] = {
#if !CYTHON_COMPILING_IN_LIMITED_API
    {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0},
#endif
#if CYTHON_USE_TYPE_SPECS
    {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0},
#if CYTHON_METH_FASTCALL
#if CYTHON_BACKPORT_VECTORCALL
    {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0},
#else
#if !CYTHON_COMPILING_IN_LIMITED_API
    {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0},
#endif
#endif
#endif
#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API
    {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0},
#else
    {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0},
#endif
#endif
    {0, 0, 0,  0, 0}
};
static PyObject *
__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args)
{
    CYTHON_UNUSED_VAR(args);
#if PY_MAJOR_VERSION >= 3
    Py_INCREF(m->func_qualname);
    return m->func_qualname;
#else
    return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name);
#endif
}
static PyMethodDef __pyx_CyFunction_methods[] = {
    {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
    {0, 0, 0, 0}
};
#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API
#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
#else
#define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist)
#endif
static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname,
                                       PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
#if !CYTHON_COMPILING_IN_LIMITED_API
    PyCFunctionObject *cf = (PyCFunctionObject*) op;
#endif
    if (unlikely(op == NULL))
        return NULL;
#if CYTHON_COMPILING_IN_LIMITED_API
    op->func = PyCFunction_NewEx(ml, (PyObject*)op, module);
    if (unlikely(!op->func)) return NULL;
#endif
    op->flags = flags;
    __Pyx_CyFunction_weakreflist(op) = NULL;
#if !CYTHON_COMPILING_IN_LIMITED_API
    cf->m_ml = ml;
    cf->m_self = (PyObject *) op;
#endif
    Py_XINCREF(closure);
    op->func_closure = closure;
#if !CYTHON_COMPILING_IN_LIMITED_API
    Py_XINCREF(module);
    cf->m_module = module;
#endif
    op->func_dict = NULL;
    op->func_name = NULL;
    Py_INCREF(qualname);
    op->func_qualname = qualname;
    op->func_doc = NULL;
#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
    op->func_classobj = NULL;
#else
    ((PyCMethodObject*)op)->mm_class = NULL;
#endif
    op->func_globals = globals;
    Py_INCREF(op->func_globals);
    Py_XINCREF(code);
    op->func_code = code;
    op->defaults_pyobjects = 0;
    op->defaults_size = 0;
    op->defaults = NULL;
    op->defaults_tuple = NULL;
    op->defaults_kwdict = NULL;
    op->defaults_getter = NULL;
    op->func_annotations = NULL;
    op->func_is_coroutine = NULL;
#if CYTHON_METH_FASTCALL
    switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) {
    case METH_NOARGS:
        __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS;
        break;
    case METH_O:
        __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O;
        break;
    case METH_METHOD | METH_FASTCALL | METH_KEYWORDS:
        __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD;
        break;
    case METH_FASTCALL | METH_KEYWORDS:
        __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS;
        break;
    case METH_VARARGS | METH_KEYWORDS:
        __Pyx_CyFunction_func_vectorcall(op) = NULL;
        break;
    default:
        PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
        Py_DECREF(op);
        return NULL;
    }
#endif
    return (PyObject *) op;
}
static int
__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
{
    Py_CLEAR(m->func_closure);
#if CYTHON_COMPILING_IN_LIMITED_API
    Py_CLEAR(m->func);
#else
    Py_CLEAR(((PyCFunctionObject*)m)->m_module);
#endif
    Py_CLEAR(m->func_dict);
    Py_CLEAR(m->func_name);
    Py_CLEAR(m->func_qualname);
    Py_CLEAR(m->func_doc);
    Py_CLEAR(m->func_globals);
    Py_CLEAR(m->func_code);
#if !CYTHON_COMPILING_IN_LIMITED_API
#if PY_VERSION_HEX < 0x030900B1
    Py_CLEAR(__Pyx_CyFunction_GetClassObj(m));
#else
    {
        PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class;
        ((PyCMethodObject *) (m))->mm_class = NULL;
        Py_XDECREF(cls);
    }
#endif
#endif
    Py_CLEAR(m->defaults_tuple);
    Py_CLEAR(m->defaults_kwdict);
    Py_CLEAR(m->func_annotations);
    Py_CLEAR(m->func_is_coroutine);
    if (m->defaults) {
        PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
        int i;
        for (i = 0; i < m->defaults_pyobjects; i++)
            Py_XDECREF(pydefaults[i]);
        PyObject_Free(m->defaults);
        m->defaults = NULL;
    }
    return 0;
}
static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
{
    if (__Pyx_CyFunction_weakreflist(m) != NULL)
        PyObject_ClearWeakRefs((PyObject *) m);
    __Pyx_CyFunction_clear(m);
    __Pyx_PyHeapTypeObject_GC_Del(m);
}
static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
{
    PyObject_GC_UnTrack(m);
    __Pyx__CyFunction_dealloc(m);
}
static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
{
    Py_VISIT(m->func_closure);
#if CYTHON_COMPILING_IN_LIMITED_API
    Py_VISIT(m->func);
#else
    Py_VISIT(((PyCFunctionObject*)m)->m_module);
#endif
    Py_VISIT(m->func_dict);
    Py_VISIT(m->func_name);
    Py_VISIT(m->func_qualname);
    Py_VISIT(m->func_doc);
    Py_VISIT(m->func_globals);
    Py_VISIT(m->func_code);
#if !CYTHON_COMPILING_IN_LIMITED_API
    Py_VISIT(__Pyx_CyFunction_GetClassObj(m));
#endif
    Py_VISIT(m->defaults_tuple);
    Py_VISIT(m->defaults_kwdict);
    Py_VISIT(m->func_is_coroutine);
    if (m->defaults) {
        PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
        int i;
        for (i = 0; i < m->defaults_pyobjects; i++)
            Py_VISIT(pydefaults[i]);
    }
    return 0;
}
static PyObject*
__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
{
#if PY_MAJOR_VERSION >= 3
    return PyUnicode_FromFormat("<cyfunction %U at %p>",
                                op->func_qualname, (void *)op);
#else
    return PyString_FromFormat("<cyfunction %s at %p>",
                               PyString_AsString(op->func_qualname), (void *)op);
#endif
}
static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *f = ((__pyx_CyFunctionObject*)func)->func;
    PyObject *py_name = NULL;
    PyCFunction meth;
    int flags;
    meth = PyCFunction_GetFunction(f);
    if (unlikely(!meth)) return NULL;
    flags = PyCFunction_GetFlags(f);
    if (unlikely(flags < 0)) return NULL;
#else
    PyCFunctionObject* f = (PyCFunctionObject*)func;
    PyCFunction meth = f->m_ml->ml_meth;
    int flags = f->m_ml->ml_flags;
#endif
    Py_ssize_t size;
    switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
    case METH_VARARGS:
        if (likely(kw == NULL || PyDict_Size(kw) == 0))
            return (*meth)(self, arg);
        break;
    case METH_VARARGS | METH_KEYWORDS:
        return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw);
    case METH_NOARGS:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
#if CYTHON_ASSUME_SAFE_MACROS
            size = PyTuple_GET_SIZE(arg);
#else
            size = PyTuple_Size(arg);
            if (unlikely(size < 0)) return NULL;
#endif
            if (likely(size == 0))
                return (*meth)(self, NULL);
#if CYTHON_COMPILING_IN_LIMITED_API
            py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL);
            if (!py_name) return NULL;
            PyErr_Format(PyExc_TypeError,
                "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
                py_name, size);
            Py_DECREF(py_name);
#else
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
                f->m_ml->ml_name, size);
#endif
            return NULL;
        }
        break;
    case METH_O:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
#if CYTHON_ASSUME_SAFE_MACROS
            size = PyTuple_GET_SIZE(arg);
#else
            size = PyTuple_Size(arg);
            if (unlikely(size < 0)) return NULL;
#endif
            if (likely(size == 1)) {
                PyObject *result, *arg0;
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                arg0 = PyTuple_GET_ITEM(arg, 0);
                #else
                arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
                #endif
                result = (*meth)(self, arg0);
                #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
                Py_DECREF(arg0);
                #endif
                return result;
            }
#if CYTHON_COMPILING_IN_LIMITED_API
            py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL);
            if (!py_name) return NULL;
            PyErr_Format(PyExc_TypeError,
                "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
                py_name, size);
            Py_DECREF(py_name);
#else
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
                f->m_ml->ml_name, size);
#endif
            return NULL;
        }
        break;
    default:
        PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
        return NULL;
    }
#if CYTHON_COMPILING_IN_LIMITED_API
    py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL);
    if (!py_name) return NULL;
    PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments",
                 py_name);
    Py_DECREF(py_name);
#else
    PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
                 f->m_ml->ml_name);
#endif
    return NULL;
}
static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyObject *self, *result;
#if CYTHON_COMPILING_IN_LIMITED_API
    self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func);
    if (unlikely(!self) && PyErr_Occurred()) return NULL;
#else
    self = ((PyCFunctionObject*)func)->m_self;
#endif
    result = __Pyx_CyFunction_CallMethod(func, self, arg, kw);
    return result;
}
static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
    PyObject *result;
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
#if CYTHON_METH_FASTCALL
     __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc);
    if (vc) {
#if CYTHON_ASSUME_SAFE_MACROS
        return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw);
#else
        (void) &__Pyx_PyVectorcall_FastCallDict;
        return PyVectorcall_Call(func, args, kw);
#endif
    }
#endif
    if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
        Py_ssize_t argc;
        PyObject *new_args;
        PyObject *self;
#if CYTHON_ASSUME_SAFE_MACROS
        argc = PyTuple_GET_SIZE(args);
#else
        argc = PyTuple_Size(args);
        if (unlikely(!argc) < 0) return NULL;
#endif
        new_args = PyTuple_GetSlice(args, 1, argc);
        if (unlikely(!new_args))
            return NULL;
        self = PyTuple_GetItem(args, 0);
        if (unlikely(!self)) {
            Py_DECREF(new_args);
#if PY_MAJOR_VERSION > 2
            PyErr_Format(PyExc_TypeError,
                         "unbound method %.200S() needs an argument",
                         cyfunc->func_qualname);
#else
            PyErr_SetString(PyExc_TypeError,
                            "unbound method needs an argument");
#endif
            return NULL;
        }
        result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
        Py_DECREF(new_args);
    } else {
        result = __Pyx_CyFunction_Call(func, args, kw);
    }
    return result;
}
#if CYTHON_METH_FASTCALL
static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames)
{
    int ret = 0;
    if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
        if (unlikely(nargs < 1)) {
            PyErr_Format(PyExc_TypeError, "%.200s() needs an argument",
                         ((PyCFunctionObject*)cyfunc)->m_ml->ml_name);
            return -1;
        }
        ret = 1;
    }
    if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) {
        PyErr_Format(PyExc_TypeError,
                     "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name);
        return -1;
    }
    return ret;
}
static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
{
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
    PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
#if CYTHON_BACKPORT_VECTORCALL
    Py_ssize_t nargs = (Py_ssize_t)nargsf;
#else
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
#endif
    PyObject *self;
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
        self = ((PyCFunctionObject*)cyfunc)->m_self;
        break;
    default:
        return NULL;
    }
    if (unlikely(nargs != 0)) {
        PyErr_Format(PyExc_TypeError,
            "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
            def->ml_name, nargs);
        return NULL;
    }
    return def->ml_meth(self, NULL);
}
static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
{
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
    PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
#if CYTHON_BACKPORT_VECTORCALL
    Py_ssize_t nargs = (Py_ssize_t)nargsf;
#else
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
#endif
    PyObject *self;
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
        self = ((PyCFunctionObject*)cyfunc)->m_self;
        break;
    default:
        return NULL;
    }
    if (unlikely(nargs != 1)) {
        PyErr_Format(PyExc_TypeError,
            "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
            def->ml_name, nargs);
        return NULL;
    }
    return def->ml_meth(self, args[0]);
}
static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
{
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
    PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
#if CYTHON_BACKPORT_VECTORCALL
    Py_ssize_t nargs = (Py_ssize_t)nargsf;
#else
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
#endif
    PyObject *self;
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
        self = ((PyCFunctionObject*)cyfunc)->m_self;
        break;
    default:
        return NULL;
    }
    return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames);
}
static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
{
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
    PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
    PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc);
#if CYTHON_BACKPORT_VECTORCALL
    Py_ssize_t nargs = (Py_ssize_t)nargsf;
#else
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
#endif
    PyObject *self;
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
        self = ((PyCFunctionObject*)cyfunc)->m_self;
        break;
    default:
        return NULL;
    }
    return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames);
}
#endif
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_CyFunctionType_slots[] = {
    {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc},
    {Py_tp_repr, (void *)__Pyx_CyFunction_repr},
    {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod},
    {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse},
    {Py_tp_clear, (void *)__Pyx_CyFunction_clear},
    {Py_tp_methods, (void *)__pyx_CyFunction_methods},
    {Py_tp_members, (void *)__pyx_CyFunction_members},
    {Py_tp_getset, (void *)__pyx_CyFunction_getsets},
    {Py_tp_descr_get, (void *)__Pyx_PyMethod_New},
    {0, 0},
};
static PyType_Spec __pyx_CyFunctionType_spec = {
    __PYX_TYPE_MODULE_PREFIX "cython_function_or_method",
    sizeof(__pyx_CyFunctionObject),
    0,
#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR
    Py_TPFLAGS_METHOD_DESCRIPTOR |
#endif
#if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL)
    _Py_TPFLAGS_HAVE_VECTORCALL |
#endif
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
    __pyx_CyFunctionType_slots
};
#else
static PyTypeObject __pyx_CyFunctionType_type = {
    PyVarObject_HEAD_INIT(0, 0)
    __PYX_TYPE_MODULE_PREFIX "cython_function_or_method",
    sizeof(__pyx_CyFunctionObject),
    0,
    (destructor) __Pyx_CyFunction_dealloc,
#if !CYTHON_METH_FASTCALL
    0,
#elif CYTHON_BACKPORT_VECTORCALL
    (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall),
#else
    offsetof(PyCFunctionObject, vectorcall),
#endif
    0,
    0,
#if PY_MAJOR_VERSION < 3
    0,
#else
    0,
#endif
    (reprfunc) __Pyx_CyFunction_repr,
    0,
    0,
    0,
    0,
    __Pyx_CyFunction_CallAsMethod,
    0,
    0,
    0,
    0,
#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR
    Py_TPFLAGS_METHOD_DESCRIPTOR |
#endif
#if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL
    _Py_TPFLAGS_HAVE_VECTORCALL |
#endif
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
    0,
    (traverseproc) __Pyx_CyFunction_traverse,
    (inquiry) __Pyx_CyFunction_clear,
    0,
#if PY_VERSION_HEX < 0x030500A0
    offsetof(__pyx_CyFunctionObject, func_weakreflist),
#else
    offsetof(PyCFunctionObject, m_weakreflist),
#endif
    0,
    0,
    __pyx_CyFunction_methods,
    __pyx_CyFunction_members,
    __pyx_CyFunction_getsets,
    0,
    0,
    __Pyx_PyMethod_New,
    0,
    offsetof(__pyx_CyFunctionObject, func_dict),
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
#if PY_VERSION_HEX >= 0x030400a1
    0,
#endif
#if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
    0,
#endif
#if __PYX_NEED_TP_PRINT_SLOT
    0,
#endif
#if PY_VERSION_HEX >= 0x030C0000
    0,
#endif
#if PY_VERSION_HEX >= 0x030d00A4
    0,
#endif
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
    0,
#endif
};
#endif
static int __pyx_CyFunction_init(PyObject *module) {
#if CYTHON_USE_TYPE_SPECS
    __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL);
#else
    CYTHON_UNUSED_VAR(module);
    __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
#endif
    if (unlikely(__pyx_CyFunctionType == NULL)) {
        return -1;
    }
    return 0;
}
static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults = PyObject_Malloc(size);
    if (unlikely(!m->defaults))
        return PyErr_NoMemory();
    memset(m->defaults, 0, size);
    m->defaults_pyobjects = pyobjects;
    m->defaults_size = size;
    return m->defaults;
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults_tuple = tuple;
    Py_INCREF(tuple);
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults_kwdict = dict;
    Py_INCREF(dict);
}
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->func_annotations = dict;
    Py_INCREF(dict);
}

/* CythonFunction */
static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname,
                                      PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
    PyObject *op = __Pyx_CyFunction_Init(
        PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType),
        ml, flags, qualname, closure, module, globals, code
    );
    if (likely(op)) {
        PyObject_GC_Track(op);
    }
    return op;
}

/* 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 && PY_VERSION_HEX < 0x030d0000
    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
    CYTHON_UNUSED_VAR(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 || PY_VERSION_HEX >= 0x030d0000 || unlikely(!source_is_set)) {
        *value = PyIter_Next(iter_obj);
        if (unlikely(!*value)) {
            return __Pyx_IterFinish();
        }
        CYTHON_UNUSED_VAR(orig_length);
        CYTHON_UNUSED_VAR(ppos);
        return 1;
    }
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000
    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;
}

/* dict_setdefault */
static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value,
                                                       int is_safe_type) {
    PyObject* value;
    CYTHON_MAYBE_UNUSED_VAR(is_safe_type);
#if PY_VERSION_HEX >= 0x030400A0
    if ((1)) {
        value = PyDict_SetDefault(d, key, default_value);
        if (unlikely(!value)) return NULL;
        Py_INCREF(value);
#else
    if (is_safe_type == 1 || (is_safe_type == -1 &&
#if PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000)
            (PyUnicode_CheckExact(key) || PyString_CheckExact(key) || PyLong_CheckExact(key)))) {
        value = PyDict_GetItemWithError(d, key);
        if (unlikely(!value)) {
            if (unlikely(PyErr_Occurred()))
                return NULL;
            if (unlikely(PyDict_SetItem(d, key, default_value) == -1))
                return NULL;
            value = default_value;
        }
        Py_INCREF(value);
#else
            (PyString_CheckExact(key) || PyUnicode_CheckExact(key) || PyInt_CheckExact(key) || PyLong_CheckExact(key)))) {
        value = PyDict_GetItem(d, key);
        if (unlikely(!value)) {
            if (unlikely(PyDict_SetItem(d, key, default_value) == -1))
                return NULL;
            value = default_value;
        }
        Py_INCREF(value);
#endif
#endif
    } else {
        value = __Pyx_CallUnboundCMethod2(&__pyx_umethod_PyDict_Type_setdefault, d, key, default_value);
    }
    return value;
}

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

/* CIntToDigits */
    static const char DIGIT_PAIRS_10[2*10*10+1] = {
    "00010203040506070809"
    "10111213141516171819"
    "20212223242526272829"
    "30313233343536373839"
    "40414243444546474849"
    "50515253545556575859"
    "60616263646566676869"
    "70717273747576777879"
    "80818283848586878889"
    "90919293949596979899"
};
static const char DIGIT_PAIRS_8[2*8*8+1] = {
    "0001020304050607"
    "1011121314151617"
    "2021222324252627"
    "3031323334353637"
    "4041424344454647"
    "5051525354555657"
    "6061626364656667"
    "7071727374757677"
};
static const char DIGITS_HEX[2*16+1] = {
    "0123456789abcdef"
    "0123456789ABCDEF"
};

/* BuildPyUnicode */
    static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, char* chars, int clength,
                                                int prepend_sign, char padding_char) {
    PyObject *uval;
    Py_ssize_t uoffset = ulength - clength;
#if CYTHON_USE_UNICODE_INTERNALS
    Py_ssize_t i;
#if CYTHON_PEP393_ENABLED
    void *udata;
    uval = PyUnicode_New(ulength, 127);
    if (unlikely(!uval)) return NULL;
    udata = PyUnicode_DATA(uval);
#else
    Py_UNICODE *udata;
    uval = PyUnicode_FromUnicode(NULL, ulength);
    if (unlikely(!uval)) return NULL;
    udata = PyUnicode_AS_UNICODE(uval);
#endif
    if (uoffset > 0) {
        i = 0;
        if (prepend_sign) {
            __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, 0, '-');
            i++;
        }
        for (; i < uoffset; i++) {
            __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, i, padding_char);
        }
    }
    for (i=0; i < clength; i++) {
        __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, uoffset+i, chars[i]);
    }
#else
    {
        PyObject *sign = NULL, *padding = NULL;
        uval = NULL;
        if (uoffset > 0) {
            prepend_sign = !!prepend_sign;
            if (uoffset > prepend_sign) {
                padding = PyUnicode_FromOrdinal(padding_char);
                if (likely(padding) && uoffset > prepend_sign + 1) {
                    PyObject *tmp;
                    PyObject *repeat = PyInt_FromSsize_t(uoffset - prepend_sign);
                    if (unlikely(!repeat)) goto done_or_error;
                    tmp = PyNumber_Multiply(padding, repeat);
                    Py_DECREF(repeat);
                    Py_DECREF(padding);
                    padding = tmp;
                }
                if (unlikely(!padding)) goto done_or_error;
            }
            if (prepend_sign) {
                sign = PyUnicode_FromOrdinal('-');
                if (unlikely(!sign)) goto done_or_error;
            }
        }
        uval = PyUnicode_DecodeASCII(chars, clength, NULL);
        if (likely(uval) && padding) {
            PyObject *tmp = PyNumber_Add(padding, uval);
            Py_DECREF(uval);
            uval = tmp;
        }
        if (likely(uval) && sign) {
            PyObject *tmp = PyNumber_Add(sign, uval);
            Py_DECREF(uval);
            uval = tmp;
        }
done_or_error:
        Py_XDECREF(padding);
        Py_XDECREF(sign);
    }
#endif
    return uval;
}

/* CIntToPyUnicode */
    static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char, char format_char) {
    char digits[sizeof(Py_ssize_t)*3+2];
    char *dpos, *end = digits + sizeof(Py_ssize_t)*3+2;
    const char *hex_digits = DIGITS_HEX;
    Py_ssize_t length, ulength;
    int prepend_sign, last_one_off;
    Py_ssize_t remaining;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const Py_ssize_t neg_one = (Py_ssize_t) -1, const_zero = (Py_ssize_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (format_char == 'X') {
        hex_digits += 16;
        format_char = 'x';
    }
    remaining = value;
    last_one_off = 0;
    dpos = end;
    do {
        int digit_pos;
        switch (format_char) {
        case 'o':
            digit_pos = abs((int)(remaining % (8*8)));
            remaining = (Py_ssize_t) (remaining / (8*8));
            dpos -= 2;
            memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2);
            last_one_off = (digit_pos < 8);
            break;
        case 'd':
            digit_pos = abs((int)(remaining % (10*10)));
            remaining = (Py_ssize_t) (remaining / (10*10));
            dpos -= 2;
            memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2);
            last_one_off = (digit_pos < 10);
            break;
        case 'x':
            *(--dpos) = hex_digits[abs((int)(remaining % 16))];
            remaining = (Py_ssize_t) (remaining / 16);
            break;
        default:
            assert(0);
            break;
        }
    } while (unlikely(remaining != 0));
    assert(!last_one_off || *dpos == '0');
    dpos += last_one_off;
    length = end - dpos;
    ulength = length;
    prepend_sign = 0;
    if (!is_unsigned && value <= neg_one) {
        if (padding_char == ' ' || width <= length + 1) {
            *(--dpos) = '-';
            ++length;
        } else {
            prepend_sign = 1;
        }
        ++ulength;
    }
    if (width > ulength) {
        ulength = width;
    }
    if (ulength == 1) {
        return PyUnicode_FromOrdinal(*dpos);
    }
    return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char);
}

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

/* pop */
    static CYTHON_INLINE PyObject* __Pyx__PyObject_Pop(PyObject* L) {
    if (__Pyx_IS_TYPE(L, &PySet_Type)) {
        return PySet_Pop(L);
    }
    return __Pyx_PyObject_CallMethod0(L, __pyx_n_s_pop);
}
#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
static CYTHON_INLINE PyObject* __Pyx_PyList_Pop(PyObject* L) {
    if (likely(PyList_GET_SIZE(L) > (((PyListObject*)L)->allocated >> 1))) {
        __Pyx_SET_SIZE(L, Py_SIZE(L) - 1);
        return PyList_GET_ITEM(L, PyList_GET_SIZE(L));
    }
    return __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyList_Type_pop, L);
}
#endif

/* PyObjectLookupSpecial */
    #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error) {
    PyObject *res;
    PyTypeObject *tp = Py_TYPE(obj);
#if PY_MAJOR_VERSION < 3
    if (unlikely(PyInstance_Check(obj)))
        return with_error ? __Pyx_PyObject_GetAttrStr(obj, attr_name) : __Pyx_PyObject_GetAttrStrNoError(obj, attr_name);
#endif
    res = _PyType_Lookup(tp, attr_name);
    if (likely(res)) {
        descrgetfunc f = Py_TYPE(res)->tp_descr_get;
        if (!f) {
            Py_INCREF(res);
        } else {
            res = f(res, obj, (PyObject *)tp);
        }
    } else if (with_error) {
        PyErr_SetObject(PyExc_AttributeError, attr_name);
    }
    return res;
}
#endif

/* PyFloatBinop */
    #if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyFloat_AddObjC(PyObject *op1, PyObject *op2, double floatval, int inplace, int zerodivision_check) {
    const double b = floatval;
    double a, result;
    CYTHON_UNUSED_VAR(inplace);
    CYTHON_UNUSED_VAR(zerodivision_check);
    if (likely(PyFloat_CheckExact(op1))) {
#if CYTHON_COMPILING_IN_LIMITED_API
        a = __pyx_PyFloat_AsDouble(op1);
#else
        a = PyFloat_AS_DOUBLE(op1);
#endif
        
    } else
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        a = (double) PyInt_AS_LONG(op1);
        
    } else
    #endif
    if (likely(PyLong_CheckExact(op1))) {
        #if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsZero(op1)) {
            a = 0.0;
            
        } else if (__Pyx_PyLong_IsCompact(op1)) {
            a = (double) __Pyx_PyLong_CompactValue(op1);
        } else {
            const digit* digits = __Pyx_PyLong_Digits(op1);
            const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1);
            switch (size) {
                case -2:
                case 2:
                    if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (1 * PyLong_SHIFT < 53))) {
                        a = (double) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        if ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
                            if (size == -2)
                                a = -a;
                            break;
                        }
                    }
                    CYTHON_FALLTHROUGH;
                case -3:
                case 3:
                    if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53))) {
                        a = (double) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        if ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
                            if (size == -3)
                                a = -a;
                            break;
                        }
                    }
                    CYTHON_FALLTHROUGH;
                case -4:
                case 4:
                    if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53))) {
                        a = (double) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        if ((8 * sizeof(unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
                            if (size == -4)
                                a = -a;
                            break;
                        }
                    }
                    CYTHON_FALLTHROUGH;
                default:
        #endif
                    a = PyLong_AsDouble(op1);
                    if (unlikely(a == -1.0 && PyErr_Occurred())) return NULL;
        #if CYTHON_USE_PYLONG_INTERNALS
            }
        }
        #endif
    } else {
        return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
    }
        PyFPE_START_PROTECT("add", return NULL)
        result = a + b;
        PyFPE_END_PROTECT(result)
        return PyFloat_FromDouble(result);
}
#endif

/* PyIntBinop */
    #if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_TrueDivideObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_MAYBE_UNUSED_VAR(inplace);
    CYTHON_UNUSED_VAR(zerodivision_check);
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long a = PyInt_AS_LONG(op1);
        
            if (8 * sizeof(long) <= 53 || likely(labs(a) <= ((PY_LONG_LONG)1 << 53))) {
                return PyFloat_FromDouble((double)a / (double)b);
            }
            return PyInt_Type.tp_as_number->nb_true_divide(op1, op2);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a, x;
        if (unlikely(__Pyx_PyLong_IsZero(op1))) {
        }
        if (likely(__Pyx_PyLong_IsCompact(op1))) {
            a = __Pyx_PyLong_CompactValue(op1);
        } else {
            const digit* digits = __Pyx_PyLong_Digits(op1);
            const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1);
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT && 1 * PyLong_SHIFT < 53) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                    CYTHON_FALLTHROUGH;
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT && 1 * PyLong_SHIFT < 53) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                    CYTHON_FALLTHROUGH;
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT && 2 * PyLong_SHIFT < 53) {
                        a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                    CYTHON_FALLTHROUGH;
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT && 2 * PyLong_SHIFT < 53) {
                        a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                    CYTHON_FALLTHROUGH;
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT && 3 * PyLong_SHIFT < 53) {
                        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;
                    }
                    CYTHON_FALLTHROUGH;
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT && 3 * PyLong_SHIFT < 53) {
                        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;
                    }
                    CYTHON_FALLTHROUGH;
                default: return PyLong_Type.tp_as_number->nb_true_divide(op1, op2);
            }
        }
                if ((8 * sizeof(long) <= 53 || likely(labs(a) <= ((PY_LONG_LONG)1 << 53)))
                        || __Pyx_PyLong_DigitCount(op1) <= 52 / PyLong_SHIFT) {
                    return PyFloat_FromDouble((double)a / (double)b);
                }
                return PyLong_Type.tp_as_number->nb_true_divide(op1, op2);
            return PyLong_FromLong(x);
        
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
#if CYTHON_COMPILING_IN_LIMITED_API
        double a = __pyx_PyFloat_AsDouble(op1);
#else
        double a = PyFloat_AS_DOUBLE(op1);
#endif
            double result;
            
            PyFPE_START_PROTECT("divide", return NULL)
            result = ((double)a) / (double)b;
            PyFPE_END_PROTECT(result)
            return PyFloat_FromDouble(result);
    }
    return (inplace ? PyNumber_InPlaceTrueDivide : PyNumber_TrueDivide)(op1, op2);
}
#endif

/* Import */
    static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
    PyObject *module = 0;
    PyObject *empty_dict = 0;
    PyObject *empty_list = 0;
    #if PY_MAJOR_VERSION < 3
    PyObject *py_import;
    py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
    if (unlikely(!py_import))
        goto bad;
    if (!from_list) {
        empty_list = PyList_New(0);
        if (unlikely(!empty_list))
            goto bad;
        from_list = empty_list;
    }
    #endif
    empty_dict = PyDict_New();
    if (unlikely(!empty_dict))
        goto bad;
    {
        #if PY_MAJOR_VERSION >= 3
        if (level == -1) {
            if (strchr(__Pyx_MODULE_NAME, '.') != NULL) {
                module = PyImport_ImportModuleLevelObject(
                    name, __pyx_d, empty_dict, from_list, 1);
                if (unlikely(!module)) {
                    if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError)))
                        goto bad;
                    PyErr_Clear();
                }
            }
            level = 0;
        }
        #endif
        if (!module) {
            #if PY_MAJOR_VERSION < 3
            PyObject *py_level = PyInt_FromLong(level);
            if (unlikely(!py_level))
                goto bad;
            module = PyObject_CallFunctionObjArgs(py_import,
                name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL);
            Py_DECREF(py_level);
            #else
            module = PyImport_ImportModuleLevelObject(
                name, __pyx_d, empty_dict, from_list, level);
            #endif
        }
    }
bad:
    Py_XDECREF(empty_dict);
    Py_XDECREF(empty_list);
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(py_import);
    #endif
    return module;
}

/* ImportFrom */
    static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
    PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
    if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
        const char* module_name_str = 0;
        PyObject* module_name = 0;
        PyObject* module_dot = 0;
        PyObject* full_name = 0;
        PyErr_Clear();
        module_name_str = PyModule_GetName(module);
        if (unlikely(!module_name_str)) { goto modbad; }
        module_name = PyUnicode_FromString(module_name_str);
        if (unlikely(!module_name)) { goto modbad; }
        module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__20);
        if (unlikely(!module_dot)) { goto modbad; }
        full_name = PyUnicode_Concat(module_dot, name);
        if (unlikely(!full_name)) { goto modbad; }
        #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM  < 0x07030400)
        {
            PyObject *modules = PyImport_GetModuleDict();
            if (unlikely(!modules))
                goto modbad;
            value = PyObject_GetItem(modules, full_name);
        }
        #else
        value = PyImport_GetModule(full_name);
        #endif
      modbad:
        Py_XDECREF(full_name);
        Py_XDECREF(module_dot);
        Py_XDECREF(module_name);
    }
    if (unlikely(!value)) {
        PyErr_Format(PyExc_ImportError,
        #if PY_MAJOR_VERSION < 3
            "cannot import name %.230s", PyString_AS_STRING(name));
        #else
            "cannot import name %S", name);
        #endif
    }
    return value;
}

/* ImportDottedModule */
    #if PY_MAJOR_VERSION >= 3
static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) {
    PyObject *partial_name = NULL, *slice = NULL, *sep = NULL;
    if (unlikely(PyErr_Occurred())) {
        PyErr_Clear();
    }
    if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) {
        partial_name = name;
    } else {
        slice = PySequence_GetSlice(parts_tuple, 0, count);
        if (unlikely(!slice))
            goto bad;
        sep = PyUnicode_FromStringAndSize(".", 1);
        if (unlikely(!sep))
            goto bad;
        partial_name = PyUnicode_Join(sep, slice);
    }
    PyErr_Format(
#if PY_MAJOR_VERSION < 3
        PyExc_ImportError,
        "No module named '%s'", PyString_AS_STRING(partial_name));
#else
#if PY_VERSION_HEX >= 0x030600B1
        PyExc_ModuleNotFoundError,
#else
        PyExc_ImportError,
#endif
        "No module named '%U'", partial_name);
#endif
bad:
    Py_XDECREF(sep);
    Py_XDECREF(slice);
    Py_XDECREF(partial_name);
    return NULL;
}
#endif
#if PY_MAJOR_VERSION >= 3
static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) {
    PyObject *imported_module;
#if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM  < 0x07030400)
    PyObject *modules = PyImport_GetModuleDict();
    if (unlikely(!modules))
        return NULL;
    imported_module = __Pyx_PyDict_GetItemStr(modules, name);
    Py_XINCREF(imported_module);
#else
    imported_module = PyImport_GetModule(name);
#endif
    return imported_module;
}
#endif
#if PY_MAJOR_VERSION >= 3
static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) {
    Py_ssize_t i, nparts;
    nparts = PyTuple_GET_SIZE(parts_tuple);
    for (i=1; i < nparts && module; i++) {
        PyObject *part, *submodule;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        part = PyTuple_GET_ITEM(parts_tuple, i);
#else
        part = PySequence_ITEM(parts_tuple, i);
#endif
        submodule = __Pyx_PyObject_GetAttrStrNoError(module, part);
#if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
        Py_DECREF(part);
#endif
        Py_DECREF(module);
        module = submodule;
    }
    if (unlikely(!module)) {
        return __Pyx__ImportDottedModule_Error(name, parts_tuple, i);
    }
    return module;
}
#endif
static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) {
#if PY_MAJOR_VERSION < 3
    PyObject *module, *from_list, *star = __pyx_n_s__21;
    CYTHON_UNUSED_VAR(parts_tuple);
    from_list = PyList_New(1);
    if (unlikely(!from_list))
        return NULL;
    Py_INCREF(star);
    PyList_SET_ITEM(from_list, 0, star);
    module = __Pyx_Import(name, from_list, 0);
    Py_DECREF(from_list);
    return module;
#else
    PyObject *imported_module;
    PyObject *module = __Pyx_Import(name, NULL, 0);
    if (!parts_tuple || unlikely(!module))
        return module;
    imported_module = __Pyx__ImportDottedModule_Lookup(name);
    if (likely(imported_module)) {
        Py_DECREF(module);
        return imported_module;
    }
    PyErr_Clear();
    return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple);
#endif
}
static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1
    PyObject *module = __Pyx__ImportDottedModule_Lookup(name);
    if (likely(module)) {
        PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec);
        if (likely(spec)) {
            PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing);
            if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) {
                Py_DECREF(spec);
                spec = NULL;
            }
            Py_XDECREF(unsafe);
        }
        if (likely(!spec)) {
            PyErr_Clear();
            return module;
        }
        Py_DECREF(spec);
        Py_DECREF(module);
    } else if (PyErr_Occurred()) {
        PyErr_Clear();
    }
#endif
    return __Pyx__ImportDottedModule(name, parts_tuple);
}

/* GetAttr */
    static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
#if CYTHON_USE_TYPE_SLOTS
#if PY_MAJOR_VERSION >= 3
    if (likely(PyUnicode_Check(n)))
#else
    if (likely(PyString_Check(n)))
#endif
        return __Pyx_PyObject_GetAttrStr(o, n);
#endif
    return PyObject_GetAttr(o, n);
}

/* HasAttr */
    static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
    PyObject *r;
    if (unlikely(!__Pyx_PyBaseString_Check(n))) {
        PyErr_SetString(PyExc_TypeError,
                        "hasattr(): attribute name must be string");
        return -1;
    }
    r = __Pyx_GetAttr(o, n);
    if (!r) {
        PyErr_Clear();
        return 0;
    } else {
        Py_DECREF(r);
        return 1;
    }
}

/* 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, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_MAYBE_UNUSED_VAR(inplace);
    CYTHON_UNUSED_VAR(zerodivision_check);
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long x;
        long a = PyInt_AS_LONG(op1);
        
            x = (long)((unsigned long)a - (unsigned long)b);
            if (likely((x^a) >= 0 || (x^~b) >= 0))
                return PyInt_FromLong(x);
            return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a, x;
#ifdef HAVE_LONG_LONG
        const PY_LONG_LONG llb = intval;
        PY_LONG_LONG lla, llx;
#endif
        if (unlikely(__Pyx_PyLong_IsZero(op1))) {
            return PyLong_FromLong(-intval);
        }
        if (likely(__Pyx_PyLong_IsCompact(op1))) {
            a = __Pyx_PyLong_CompactValue(op1);
        } else {
            const digit* digits = __Pyx_PyLong_Digits(op1);
            const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1);
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                default: return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
            }
        }
                x = a - b;
            return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
        long_long:
                llx = lla - llb;
            return PyLong_FromLongLong(llx);
#endif
        
        
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
#if CYTHON_COMPILING_IN_LIMITED_API
        double a = __pyx_PyFloat_AsDouble(op1);
#else
        double a = PyFloat_AS_DOUBLE(op1);
#endif
            double result;
            
            PyFPE_START_PROTECT("subtract", return NULL)
            result = ((double)a) - (double)b;
            PyFPE_END_PROTECT(result)
            return PyFloat_FromDouble(result);
    }
    return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2);
}
#endif

/* PyIntCompare */
    static CYTHON_INLINE int __Pyx_PyInt_BoolNeObjC(PyObject *op1, PyObject *op2, long intval, long inplace) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_UNUSED_VAR(inplace);
    if (op1 == op2) {
        return 0;
    }
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long a = PyInt_AS_LONG(op1);
        return (a != b);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        int unequal;
        unsigned long uintval;
        Py_ssize_t size = __Pyx_PyLong_DigitCount(op1);
        const digit* digits = __Pyx_PyLong_Digits(op1);
        if (intval == 0) {
            return (__Pyx_PyLong_IsZero(op1) != 1);
        } else if (intval < 0) {
            if (__Pyx_PyLong_IsNonNeg(op1))
                return 1;
            intval = -intval;
        } else {
            if (__Pyx_PyLong_IsNeg(op1))
                return 1;
        }
        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));
        return (unequal != 0);
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
#if CYTHON_COMPILING_IN_LIMITED_API
        double a = __pyx_PyFloat_AsDouble(op1);
#else
        double a = PyFloat_AS_DOUBLE(op1);
#endif
        return ((double)a != (double)b);
    }
    return __Pyx_PyObject_IsTrueAndDecref(
        PyObject_RichCompare(op1, op2, Py_NE));
}

/* pyobject_as_double */
    static double __Pyx__PyObject_AsDouble(PyObject* obj) {
    if (PyUnicode_CheckExact(obj)) {
        return __Pyx_PyUnicode_AsDouble(obj);
    } else if (PyBytes_CheckExact(obj)) {
        return __Pyx_PyBytes_AsDouble(obj);
    } else if (PyByteArray_CheckExact(obj)) {
        return __Pyx_PyByteArray_AsDouble(obj);
    } else {
        PyObject* float_value;
#if !CYTHON_USE_TYPE_SLOTS
        float_value = PyNumber_Float(obj);  if ((0)) goto bad;
        (void)__Pyx_PyObject_CallOneArg;
#else
        PyNumberMethods *nb = Py_TYPE(obj)->tp_as_number;
        if (likely(nb) && likely(nb->nb_float)) {
            float_value = nb->nb_float(obj);
            if (likely(float_value) && unlikely(!PyFloat_Check(float_value))) {
                __Pyx_TypeName float_value_type_name = __Pyx_PyType_GetName(Py_TYPE(float_value));
                PyErr_Format(PyExc_TypeError,
                    "__float__ returned non-float (type " __Pyx_FMT_TYPENAME ")",
                    float_value_type_name);
                __Pyx_DECREF_TypeName(float_value_type_name);
                Py_DECREF(float_value);
                goto bad;
            }
        } else {
            float_value = __Pyx_PyObject_CallOneArg((PyObject*)&PyFloat_Type, obj);
        }
#endif
        if (likely(float_value)) {
            double value = PyFloat_AS_DOUBLE(float_value);
            Py_DECREF(float_value);
            return value;
        }
    }
bad:
    return (double)-1;
}

/* SliceObject */
    static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj,
        Py_ssize_t cstart, Py_ssize_t cstop,
        PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
        int has_cstart, int has_cstop, int wraparound) {
    __Pyx_TypeName obj_type_name;
#if CYTHON_USE_TYPE_SLOTS
    PyMappingMethods* mp;
#if PY_MAJOR_VERSION < 3
    PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
    if (likely(ms && ms->sq_slice)) {
        if (!has_cstart) {
            if (_py_start && (*_py_start != Py_None)) {
                cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
                if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
            } else
                cstart = 0;
        }
        if (!has_cstop) {
            if (_py_stop && (*_py_stop != Py_None)) {
                cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
                if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
            } else
                cstop = PY_SSIZE_T_MAX;
        }
        if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
            Py_ssize_t l = ms->sq_length(obj);
            if (likely(l >= 0)) {
                if (cstop < 0) {
                    cstop += l;
                    if (cstop < 0) cstop = 0;
                }
                if (cstart < 0) {
                    cstart += l;
                    if (cstart < 0) cstart = 0;
                }
            } else {
                if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                    goto bad;
                PyErr_Clear();
            }
        }
        return ms->sq_slice(obj, cstart, cstop);
    }
#else
    CYTHON_UNUSED_VAR(wraparound);
#endif
    mp = Py_TYPE(obj)->tp_as_mapping;
    if (likely(mp && mp->mp_subscript))
#else
    CYTHON_UNUSED_VAR(wraparound);
#endif
    {
        PyObject* result;
        PyObject *py_slice, *py_start, *py_stop;
        if (_py_slice) {
            py_slice = *_py_slice;
        } else {
            PyObject* owned_start = NULL;
            PyObject* owned_stop = NULL;
            if (_py_start) {
                py_start = *_py_start;
            } else {
                if (has_cstart) {
                    owned_start = py_start = PyInt_FromSsize_t(cstart);
                    if (unlikely(!py_start)) goto bad;
                } else
                    py_start = Py_None;
            }
            if (_py_stop) {
                py_stop = *_py_stop;
            } else {
                if (has_cstop) {
                    owned_stop = py_stop = PyInt_FromSsize_t(cstop);
                    if (unlikely(!py_stop)) {
                        Py_XDECREF(owned_start);
                        goto bad;
                    }
                } else
                    py_stop = Py_None;
            }
            py_slice = PySlice_New(py_start, py_stop, Py_None);
            Py_XDECREF(owned_start);
            Py_XDECREF(owned_stop);
            if (unlikely(!py_slice)) goto bad;
        }
#if CYTHON_USE_TYPE_SLOTS
        result = mp->mp_subscript(obj, py_slice);
#else
        result = PyObject_GetItem(obj, py_slice);
#endif
        if (!_py_slice) {
            Py_DECREF(py_slice);
        }
        return result;
    }
    obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
    PyErr_Format(PyExc_TypeError,
        "'" __Pyx_FMT_TYPENAME "' object is unsliceable", obj_type_name);
    __Pyx_DECREF_TypeName(obj_type_name);
bad:
    return NULL;
}

/* Py3UpdateBases */
    static PyObject*
__Pyx_PEP560_update_bases(PyObject *bases)
{
    Py_ssize_t i, j, size_bases;
    PyObject *base, *meth, *new_base, *result, *new_bases = NULL;
    size_bases = PyTuple_GET_SIZE(bases);
    for (i = 0; i < size_bases; i++) {
        base  = PyTuple_GET_ITEM(bases, i);
        if (PyType_Check(base)) {
            if (new_bases) {
                if (PyList_Append(new_bases, base) < 0) {
                    goto error;
                }
            }
            continue;
        }
        meth = __Pyx_PyObject_GetAttrStrNoError(base, __pyx_n_s_mro_entries);
        if (!meth && PyErr_Occurred()) {
            goto error;
        }
        if (!meth) {
            if (new_bases) {
                if (PyList_Append(new_bases, base) < 0) {
                    goto error;
                }
            }
            continue;
        }
        new_base = __Pyx_PyObject_CallOneArg(meth, bases);
        Py_DECREF(meth);
        if (!new_base) {
            goto error;
        }
        if (!PyTuple_Check(new_base)) {
            PyErr_SetString(PyExc_TypeError,
                            "__mro_entries__ must return a tuple");
            Py_DECREF(new_base);
            goto error;
        }
        if (!new_bases) {
            if (!(new_bases = PyList_New(i))) {
                goto error;
            }
            for (j = 0; j < i; j++) {
                base = PyTuple_GET_ITEM(bases, j);
                PyList_SET_ITEM(new_bases, j, base);
                Py_INCREF(base);
            }
        }
        j = PyList_GET_SIZE(new_bases);
        if (PyList_SetSlice(new_bases, j, j, new_base) < 0) {
            goto error;
        }
        Py_DECREF(new_base);
    }
    if (!new_bases) {
        Py_INCREF(bases);
        return bases;
    }
    result = PyList_AsTuple(new_bases);
    Py_DECREF(new_bases);
    return result;
error:
    Py_XDECREF(new_bases);
    return NULL;
}

/* CalculateMetaclass */
    static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
    Py_ssize_t i, nbases;
#if CYTHON_ASSUME_SAFE_MACROS
    nbases = PyTuple_GET_SIZE(bases);
#else
    nbases = PyTuple_Size(bases);
    if (nbases < 0) return NULL;
#endif
    for (i=0; i < nbases; i++) {
        PyTypeObject *tmptype;
#if CYTHON_ASSUME_SAFE_MACROS
        PyObject *tmp = PyTuple_GET_ITEM(bases, i);
#else
        PyObject *tmp = PyTuple_GetItem(bases, i);
        if (!tmp) return NULL;
#endif
        tmptype = Py_TYPE(tmp);
#if PY_MAJOR_VERSION < 3
        if (tmptype == &PyClass_Type)
            continue;
#endif
        if (!metaclass) {
            metaclass = tmptype;
            continue;
        }
        if (PyType_IsSubtype(metaclass, tmptype))
            continue;
        if (PyType_IsSubtype(tmptype, metaclass)) {
            metaclass = tmptype;
            continue;
        }
        PyErr_SetString(PyExc_TypeError,
                        "metaclass conflict: "
                        "the metaclass of a derived class "
                        "must be a (non-strict) subclass "
                        "of the metaclasses of all its bases");
        return NULL;
    }
    if (!metaclass) {
#if PY_MAJOR_VERSION < 3
        metaclass = &PyClass_Type;
#else
        metaclass = &PyType_Type;
#endif
    }
    Py_INCREF((PyObject*) metaclass);
    return (PyObject*) metaclass;
}

/* Py3ClassCreate */
    static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
                                           PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
    PyObject *ns;
    if (metaclass) {
        PyObject *prep = __Pyx_PyObject_GetAttrStrNoError(metaclass, __pyx_n_s_prepare);
        if (prep) {
            PyObject *pargs[3] = {NULL, name, bases};
            ns = __Pyx_PyObject_FastCallDict(prep, pargs+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, mkw);
            Py_DECREF(prep);
        } else {
            if (unlikely(PyErr_Occurred()))
                return NULL;
            ns = PyDict_New();
        }
    } else {
        ns = PyDict_New();
    }
    if (unlikely(!ns))
        return NULL;
    if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad;
#if PY_VERSION_HEX >= 0x03030000
    if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad;
#else
    CYTHON_MAYBE_UNUSED_VAR(qualname);
#endif
    if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad;
    return ns;
bad:
    Py_DECREF(ns);
    return NULL;
}
#if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS
static int __Pyx_SetNamesPEP487(PyObject *type_obj) {
    PyTypeObject *type = (PyTypeObject*) type_obj;
    PyObject *names_to_set, *key, *value, *set_name, *tmp;
    Py_ssize_t i = 0;
#if CYTHON_USE_TYPE_SLOTS
    names_to_set = PyDict_Copy(type->tp_dict);
#else
    {
        PyObject *d = PyObject_GetAttr(type_obj, __pyx_n_s_dict);
        names_to_set = NULL;
        if (likely(d)) {
            PyObject *names_to_set = PyDict_New();
            int ret = likely(names_to_set) ? PyDict_Update(names_to_set, d) : -1;
            Py_DECREF(d);
            if (unlikely(ret < 0))
                Py_CLEAR(names_to_set);
        }
    }
#endif
    if (unlikely(names_to_set == NULL))
        goto bad;
    while (PyDict_Next(names_to_set, &i, &key, &value)) {
        set_name = __Pyx_PyObject_LookupSpecialNoError(value, __pyx_n_s_set_name);
        if (unlikely(set_name != NULL)) {
            tmp = __Pyx_PyObject_Call2Args(set_name, type_obj, key);
            Py_DECREF(set_name);
            if (unlikely(tmp == NULL)) {
                __Pyx_TypeName value_type_name =
                    __Pyx_PyType_GetName(Py_TYPE(value));
                __Pyx_TypeName type_name = __Pyx_PyType_GetName(type);
                PyErr_Format(PyExc_RuntimeError,
#if PY_MAJOR_VERSION >= 3
                    "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %R " "in '" __Pyx_FMT_TYPENAME "'",
                    value_type_name, key, type_name);
#else
                    "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %.100s in '" __Pyx_FMT_TYPENAME "'",
                    value_type_name,
                    PyString_Check(key) ? PyString_AS_STRING(key) : "?",
                    type_name);
#endif
                goto bad;
            } else {
                Py_DECREF(tmp);
            }
        }
        else if (unlikely(PyErr_Occurred())) {
            goto bad;
        }
    }
    Py_DECREF(names_to_set);
    return 0;
bad:
    Py_XDECREF(names_to_set);
    return -1;
}
static PyObject *__Pyx_InitSubclassPEP487(PyObject *type_obj, PyObject *mkw) {
#if CYTHON_USE_TYPE_SLOTS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    PyTypeObject *type = (PyTypeObject*) type_obj;
    PyObject *mro = type->tp_mro;
    Py_ssize_t i, nbases;
    if (unlikely(!mro)) goto done;
    (void) &__Pyx_GetBuiltinName;
    Py_INCREF(mro);
    nbases = PyTuple_GET_SIZE(mro);
    assert(PyTuple_GET_ITEM(mro, 0) == type_obj);
    for (i = 1; i < nbases-1; i++) {
        PyObject *base, *dict, *meth;
        base = PyTuple_GET_ITEM(mro, i);
        dict = ((PyTypeObject *)base)->tp_dict;
        meth = __Pyx_PyDict_GetItemStrWithError(dict, __pyx_n_s_init_subclass);
        if (unlikely(meth)) {
            descrgetfunc f = Py_TYPE(meth)->tp_descr_get;
            PyObject *res;
            Py_INCREF(meth);
            if (likely(f)) {
                res = f(meth, NULL, type_obj);
                Py_DECREF(meth);
                if (unlikely(!res)) goto bad;
                meth = res;
            }
            res = __Pyx_PyObject_FastCallDict(meth, NULL, 0, mkw);
            Py_DECREF(meth);
            if (unlikely(!res)) goto bad;
            Py_DECREF(res);
            goto done;
        } else if (unlikely(PyErr_Occurred())) {
            goto bad;
        }
    }
done:
    Py_XDECREF(mro);
    return type_obj;
bad:
    Py_XDECREF(mro);
    Py_DECREF(type_obj);
    return NULL;
#else
    PyObject *super_type, *super, *func, *res;
#if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type)
    super_type = __Pyx_GetBuiltinName(__pyx_n_s_super);
#else
    super_type = (PyObject*) &PySuper_Type;
    (void) &__Pyx_GetBuiltinName;
#endif
    super = likely(super_type) ? __Pyx_PyObject_Call2Args(super_type, type_obj, type_obj) : NULL;
#if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type)
    Py_XDECREF(super_type);
#endif
    if (unlikely(!super)) {
        Py_CLEAR(type_obj);
        goto done;
    }
    func = __Pyx_PyObject_GetAttrStrNoError(super, __pyx_n_s_init_subclass);
    Py_DECREF(super);
    if (likely(!func)) {
        if (unlikely(PyErr_Occurred()))
            Py_CLEAR(type_obj);
        goto done;
    }
    res = __Pyx_PyObject_FastCallDict(func, NULL, 0, mkw);
    Py_DECREF(func);
    if (unlikely(!res))
        Py_CLEAR(type_obj);
    Py_XDECREF(res);
done:
    return type_obj;
#endif
}
#endif
static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
                                      PyObject *dict, PyObject *mkw,
                                      int calculate_metaclass, int allow_py2_metaclass) {
    PyObject *result;
    PyObject *owned_metaclass = NULL;
    PyObject *margs[4] = {NULL, name, bases, dict};
    if (allow_py2_metaclass) {
        owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass);
        if (owned_metaclass) {
            metaclass = owned_metaclass;
        } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
            PyErr_Clear();
        } else {
            return NULL;
        }
    }
    if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
        metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
        Py_XDECREF(owned_metaclass);
        if (unlikely(!metaclass))
            return NULL;
        owned_metaclass = metaclass;
    }
    result = __Pyx_PyObject_FastCallDict(metaclass, margs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET,
#if PY_VERSION_HEX < 0x030600A4
        (metaclass == (PyObject*)&PyType_Type) ? NULL : mkw
#else
        mkw
#endif
    );
    Py_XDECREF(owned_metaclass);
#if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS
    if (likely(result) && likely(PyType_Check(result))) {
        if (unlikely(__Pyx_SetNamesPEP487(result) < 0)) {
            Py_CLEAR(result);
        } else {
            result = __Pyx_InitSubclassPEP487(result, mkw);
        }
    }
#else
    (void) &__Pyx_GetBuiltinName;
#endif
    return result;
}

/* py_dict_keys */
    static CYTHON_INLINE PyObject* __Pyx_PyDict_Keys(PyObject* d) {
    if (PY_MAJOR_VERSION >= 3)
        return __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyDict_Type_keys, d);
    else
        return PyDict_Keys(d);
}

/* ExtTypeTest */
    static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
    __Pyx_TypeName obj_type_name;
    __Pyx_TypeName type_name;
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (likely(__Pyx_TypeCheck(obj, type)))
        return 1;
    obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
    type_name = __Pyx_PyType_GetName(type);
    PyErr_Format(PyExc_TypeError,
                 "Cannot convert " __Pyx_FMT_TYPENAME " to " __Pyx_FMT_TYPENAME,
                 obj_type_name, type_name);
    __Pyx_DECREF_TypeName(obj_type_name);
    __Pyx_DECREF_TypeName(type_name);
    return 0;
}

/* ValidateBasesTuple */
    #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS
static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) {
    Py_ssize_t i, n;
#if CYTHON_ASSUME_SAFE_MACROS
    n = PyTuple_GET_SIZE(bases);
#else
    n = PyTuple_Size(bases);
    if (n < 0) return -1;
#endif
    for (i = 1; i < n; i++)
    {
#if CYTHON_AVOID_BORROWED_REFS
        PyObject *b0 = PySequence_GetItem(bases, i);
        if (!b0) return -1;
#elif CYTHON_ASSUME_SAFE_MACROS
        PyObject *b0 = PyTuple_GET_ITEM(bases, i);
#else
        PyObject *b0 = PyTuple_GetItem(bases, i);
        if (!b0) return -1;
#endif
        PyTypeObject *b;
#if PY_MAJOR_VERSION < 3
        if (PyClass_Check(b0))
        {
            PyErr_Format(PyExc_TypeError, "base class '%.200s' is an old-style class",
                         PyString_AS_STRING(((PyClassObject*)b0)->cl_name));
#if CYTHON_AVOID_BORROWED_REFS
            Py_DECREF(b0);
#endif
            return -1;
        }
#endif
        b = (PyTypeObject*) b0;
        if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE))
        {
            __Pyx_TypeName b_name = __Pyx_PyType_GetName(b);
            PyErr_Format(PyExc_TypeError,
                "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name);
            __Pyx_DECREF_TypeName(b_name);
#if CYTHON_AVOID_BORROWED_REFS
            Py_DECREF(b0);
#endif
            return -1;
        }
        if (dictoffset == 0)
        {
            Py_ssize_t b_dictoffset = 0;
#if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
            b_dictoffset = b->tp_dictoffset;
#else
            PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__");
            if (!py_b_dictoffset) goto dictoffset_return;
            b_dictoffset = PyLong_AsSsize_t(py_b_dictoffset);
            Py_DECREF(py_b_dictoffset);
            if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return;
#endif
            if (b_dictoffset) {
                {
                    __Pyx_TypeName b_name = __Pyx_PyType_GetName(b);
                    PyErr_Format(PyExc_TypeError,
                        "extension type '%.200s' has no __dict__ slot, "
                        "but base type '" __Pyx_FMT_TYPENAME "' has: "
                        "either add 'cdef dict __dict__' to the extension type "
                        "or add '__slots__ = [...]' to the base type",
                        type_name, b_name);
                    __Pyx_DECREF_TypeName(b_name);
                }
#if !(CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY)
              dictoffset_return:
#endif
#if CYTHON_AVOID_BORROWED_REFS
                Py_DECREF(b0);
#endif
                return -1;
            }
        }
#if CYTHON_AVOID_BORROWED_REFS
        Py_DECREF(b0);
#endif
    }
    return 0;
}
#endif

/* PyType_Ready */
    static int __Pyx_PyType_Ready(PyTypeObject *t) {
#if CYTHON_USE_TYPE_SPECS || !(CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API) || defined(PYSTON_MAJOR_VERSION)
    (void)__Pyx_PyObject_CallMethod0;
#if CYTHON_USE_TYPE_SPECS
    (void)__Pyx_validate_bases_tuple;
#endif
    return PyType_Ready(t);
#else
    int r;
    PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*);
    if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1))
        return -1;
#if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION)
    {
        int gc_was_enabled;
    #if PY_VERSION_HEX >= 0x030A00b1
        gc_was_enabled = PyGC_Disable();
        (void)__Pyx_PyObject_CallMethod0;
    #else
        PyObject *ret, *py_status;
        PyObject *gc = NULL;
        #if PY_VERSION_HEX >= 0x030700a1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400)
        gc = PyImport_GetModule(__pyx_kp_u_gc);
        #endif
        if (unlikely(!gc)) gc = PyImport_Import(__pyx_kp_u_gc);
        if (unlikely(!gc)) return -1;
        py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_isenabled);
        if (unlikely(!py_status)) {
            Py_DECREF(gc);
            return -1;
        }
        gc_was_enabled = __Pyx_PyObject_IsTrue(py_status);
        Py_DECREF(py_status);
        if (gc_was_enabled > 0) {
            ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_disable);
            if (unlikely(!ret)) {
                Py_DECREF(gc);
                return -1;
            }
            Py_DECREF(ret);
        } else if (unlikely(gc_was_enabled == -1)) {
            Py_DECREF(gc);
            return -1;
        }
    #endif
        t->tp_flags |= Py_TPFLAGS_HEAPTYPE;
#if PY_VERSION_HEX >= 0x030A0000
        t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE;
#endif
#else
        (void)__Pyx_PyObject_CallMethod0;
#endif
    r = PyType_Ready(t);
#if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION)
        t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE;
    #if PY_VERSION_HEX >= 0x030A00b1
        if (gc_was_enabled)
            PyGC_Enable();
    #else
        if (gc_was_enabled) {
            PyObject *tp, *v, *tb;
            PyErr_Fetch(&tp, &v, &tb);
            ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_enable);
            if (likely(ret || r == -1)) {
                Py_XDECREF(ret);
                PyErr_Restore(tp, v, tb);
            } else {
                Py_XDECREF(tp);
                Py_XDECREF(v);
                Py_XDECREF(tb);
                r = -1;
            }
        }
        Py_DECREF(gc);
    #endif
    }
#endif
    return r;
#endif
}

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

/* SetupReduce */
    #if !CYTHON_COMPILING_IN_LIMITED_API
static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
  int ret;
  PyObject *name_attr;
  name_attr = __Pyx_PyObject_GetAttrStrNoError(meth, __pyx_n_s_name_2);
  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_GetAttrStrNoError(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()) {
        __Pyx_TypeName type_obj_name =
            __Pyx_PyType_GetName((PyTypeObject*)type_obj);
        PyErr_Format(PyExc_RuntimeError,
            "Unable to initialize pickling for " __Pyx_FMT_TYPENAME, type_obj_name);
        __Pyx_DECREF_TypeName(type_obj_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;
}
#endif

/* GetNameInClass */
    static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name) {
    PyObject *result;
    PyObject *dict;
    assert(PyType_Check(nmspace));
#if CYTHON_USE_TYPE_SLOTS
    dict = ((PyTypeObject*)nmspace)->tp_dict;
    Py_XINCREF(dict);
#else
    dict = PyObject_GetAttr(nmspace, __pyx_n_s_dict);
#endif
    if (likely(dict)) {
        result = PyObject_GetItem(dict, name);
        Py_DECREF(dict);
        if (result) {
            return result;
        }
    }
    PyErr_Clear();
    __Pyx_GetModuleGlobalNameUncached(result, name);
    return result;
}

/* CLineInTraceback */
    #ifndef CYTHON_CLINE_IN_TRACEBACK
static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) {
    PyObject *use_cline;
    PyObject *ptype, *pvalue, *ptraceback;
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject **cython_runtime_dict;
#endif
    CYTHON_MAYBE_UNUSED_VAR(tstate);
    if (unlikely(!__pyx_cython_runtime)) {
        return c_line;
    }
    __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
#if CYTHON_COMPILING_IN_CPYTHON
    cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
    if (likely(cython_runtime_dict)) {
        __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
            use_cline, *cython_runtime_dict,
            __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
    } else
#endif
    {
      PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
      if (use_cline_obj) {
        use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
        Py_DECREF(use_cline_obj);
      } else {
        PyErr_Clear();
        use_cline = NULL;
      }
    }
    if (!use_cline) {
        c_line = 0;
        (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
    }
    else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
        c_line = 0;
    }
    __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
    return c_line;
}
#endif

/* CodeObjectCache */
    #if !CYTHON_COMPILING_IN_LIMITED_API
static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
    int start = 0, mid = 0, end = count - 1;
    if (end >= 0 && code_line > entries[end].code_line) {
        return count;
    }
    while (start < end) {
        mid = start + (end - start) / 2;
        if (code_line < entries[mid].code_line) {
            end = mid;
        } else if (code_line > entries[mid].code_line) {
             start = mid + 1;
        } else {
            return mid;
        }
    }
    if (code_line <= entries[mid].code_line) {
        return mid;
    } else {
        return mid + 1;
    }
}
static PyCodeObject *__pyx_find_code_object(int code_line) {
    PyCodeObject* code_object;
    int pos;
    if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
        return NULL;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
        return NULL;
    }
    code_object = __pyx_code_cache.entries[pos].code_object;
    Py_INCREF(code_object);
    return code_object;
}
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
    int pos, i;
    __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
    if (unlikely(!code_line)) {
        return;
    }
    if (unlikely(!entries)) {
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
        if (likely(entries)) {
            __pyx_code_cache.entries = entries;
            __pyx_code_cache.max_count = 64;
            __pyx_code_cache.count = 1;
            entries[0].code_line = code_line;
            entries[0].code_object = code_object;
            Py_INCREF(code_object);
        }
        return;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
        PyCodeObject* tmp = entries[pos].code_object;
        entries[pos].code_object = code_object;
        Py_DECREF(tmp);
        return;
    }
    if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
        int new_max = __pyx_code_cache.max_count + 64;
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
            __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
        if (unlikely(!entries)) {
            return;
        }
        __pyx_code_cache.entries = entries;
        __pyx_code_cache.max_count = new_max;
    }
    for (i=__pyx_code_cache.count; i>pos; i--) {
        entries[i] = entries[i-1];
    }
    entries[pos].code_line = code_line;
    entries[pos].code_object = code_object;
    __pyx_code_cache.count++;
    Py_INCREF(code_object);
}
#endif

/* AddTraceback */
    #include "compile.h"
#include "frameobject.h"
#include "traceback.h"
#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION)
  #ifndef Py_BUILD_CORE
    #define Py_BUILD_CORE 1
  #endif
  #include "internal/pycore_frame.h"
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict,
                                                       PyObject *firstlineno, PyObject *name) {
    PyObject *replace = NULL;
    if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL;
    if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL;
    replace = PyObject_GetAttrString(code, "replace");
    if (likely(replace)) {
        PyObject *result;
        result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict);
        Py_DECREF(replace);
        return result;
    }
    PyErr_Clear();
    #if __PYX_LIMITED_VERSION_HEX < 0x030780000
    {
        PyObject *compiled = NULL, *result = NULL;
        if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL;
        if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL;
        compiled = Py_CompileString(
            "out = type(code)(\n"
            "  code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n"
            "  code.co_flags, code.co_code, code.co_consts, code.co_names,\n"
            "  code.co_varnames, code.co_filename, co_name, co_firstlineno,\n"
            "  code.co_lnotab)\n", "<dummy>", Py_file_input);
        if (!compiled) return NULL;
        result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict);
        Py_DECREF(compiled);
        if (!result) PyErr_Print();
        Py_DECREF(result);
        result = PyDict_GetItemString(scratch_dict, "out");
        if (result) Py_INCREF(result);
        return result;
    }
    #else
    return NULL;
    #endif
}
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename) {
    PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL;
    PyObject *replace = NULL, *getframe = NULL, *frame = NULL;
    PyObject *exc_type, *exc_value, *exc_traceback;
    int success = 0;
    if (c_line) {
        (void) __pyx_cfilenm;
        (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line);
    }
    PyErr_Fetch(&exc_type, &exc_value, &exc_traceback);
    code_object = Py_CompileString("_getframe()", filename, Py_eval_input);
    if (unlikely(!code_object)) goto bad;
    py_py_line = PyLong_FromLong(py_line);
    if (unlikely(!py_py_line)) goto bad;
    py_funcname = PyUnicode_FromString(funcname);
    if (unlikely(!py_funcname)) goto bad;
    dict = PyDict_New();
    if (unlikely(!dict)) goto bad;
    {
        PyObject *old_code_object = code_object;
        code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname);
        Py_DECREF(old_code_object);
    }
    if (unlikely(!code_object)) goto bad;
    getframe = PySys_GetObject("_getframe");
    if (unlikely(!getframe)) goto bad;
    if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad;
    frame = PyEval_EvalCode(code_object, dict, dict);
    if (unlikely(!frame) || frame == Py_None) goto bad;
    success = 1;
  bad:
    PyErr_Restore(exc_type, exc_value, exc_traceback);
    Py_XDECREF(code_object);
    Py_XDECREF(py_py_line);
    Py_XDECREF(py_funcname);
    Py_XDECREF(dict);
    Py_XDECREF(replace);
    if (success) {
        PyTraceBack_Here(
            (struct _frame*)frame);
    }
    Py_XDECREF(frame);
}
#else
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
            const char *funcname, int c_line,
            int py_line, const char *filename) {
    PyCodeObject *py_code = NULL;
    PyObject *py_funcname = NULL;
    #if PY_MAJOR_VERSION < 3
    PyObject *py_srcfile = NULL;
    py_srcfile = PyString_FromString(filename);
    if (!py_srcfile) goto bad;
    #endif
    if (c_line) {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        if (!py_funcname) goto bad;
        #else
        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        if (!py_funcname) goto bad;
        funcname = PyUnicode_AsUTF8(py_funcname);
        if (!funcname) goto bad;
        #endif
    }
    else {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromString(funcname);
        if (!py_funcname) goto bad;
        #endif
    }
    #if PY_MAJOR_VERSION < 3
    py_code = __Pyx_PyCode_New(
        0,
        0,
        0,
        0,
        0,
        0,
        __pyx_empty_bytes, /*PyObject *code,*/
        __pyx_empty_tuple, /*PyObject *consts,*/
        __pyx_empty_tuple, /*PyObject *names,*/
        __pyx_empty_tuple, /*PyObject *varnames,*/
        __pyx_empty_tuple, /*PyObject *freevars,*/
        __pyx_empty_tuple, /*PyObject *cellvars,*/
        py_srcfile,   /*PyObject *filename,*/
        py_funcname,  /*PyObject *name,*/
        py_line,
        __pyx_empty_bytes  /*PyObject *lnotab*/
    );
    Py_DECREF(py_srcfile);
    #else
    py_code = PyCode_NewEmpty(filename, funcname, py_line);
    #endif
    Py_XDECREF(py_funcname);
    return py_code;
bad:
    Py_XDECREF(py_funcname);
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(py_srcfile);
    #endif
    return NULL;
}
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyFrameObject *py_frame = 0;
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    PyObject *ptype, *pvalue, *ptraceback;
    if (c_line) {
        c_line = __Pyx_CLineForTraceback(tstate, c_line);
    }
    py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
    if (!py_code) {
        __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
        py_code = __Pyx_CreateCodeObjectForTraceback(
            funcname, c_line, py_line, filename);
        if (!py_code) {
            /* If the code object creation fails, then we should clear the
               fetched exception references and propagate the new exception */
            Py_XDECREF(ptype);
            Py_XDECREF(pvalue);
            Py_XDECREF(ptraceback);
            goto bad;
        }
        __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
        __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
    }
    py_frame = PyFrame_New(
        tstate,            /*PyThreadState *tstate,*/
        py_code,           /*PyCodeObject *code,*/
        __pyx_d,    /*PyObject *globals,*/
        0                  /*PyObject *locals*/
    );
    if (!py_frame) goto bad;
    __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
    PyTraceBack_Here(py_frame);
bad:
    Py_XDECREF(py_code);
    Py_XDECREF(py_frame);
}
#endif

/* ToPyCTupleUtility */
    static PyObject* __pyx_convert__to_py___pyx_ctuple_double__and_double(__pyx_ctuple_double__and_double value) {
    PyObject* item = NULL;
    PyObject* result = PyTuple_New(2);
    if (!result) goto bad;
        item = PyFloat_FromDouble(value.f0);
        if (!item) goto bad;
        PyTuple_SET_ITEM(result, 0, item);
        item = PyFloat_FromDouble(value.f1);
        if (!item) goto bad;
        PyTuple_SET_ITEM(result, 1, item);
    return result;
bad:
    Py_XDECREF(item);
    Py_XDECREF(result);
    return NULL;
}

/* FromPyCTupleUtility */
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
static void __Pyx_tuple___pyx_convert__from_py___pyx_ctuple_double__and_double(PyObject * o, __pyx_ctuple_double__and_double *result) {
        result->f0 = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(o, 0));
        if ((result->f0 == (double)-1) && PyErr_Occurred()) goto bad;
        result->f1 = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(o, 1));
        if ((result->f1 == (double)-1) && PyErr_Occurred()) goto bad;
    return;
bad:
    return;
}
static void __Pyx_list___pyx_convert__from_py___pyx_ctuple_double__and_double(PyObject * o, __pyx_ctuple_double__and_double *result) {
        result->f0 = __pyx_PyFloat_AsDouble(PyList_GET_ITEM(o, 0));
        if ((result->f0 == (double)-1) && PyErr_Occurred()) goto bad;
        result->f1 = __pyx_PyFloat_AsDouble(PyList_GET_ITEM(o, 1));
        if ((result->f1 == (double)-1) && PyErr_Occurred()) goto bad;
    return;
bad:
    return;
}
#endif
static void __Pyx_seq___pyx_convert__from_py___pyx_ctuple_double__and_double(PyObject * o, __pyx_ctuple_double__and_double *result) {
    if (unlikely(!PySequence_Check(o))) {
        __Pyx_TypeName o_type_name = __Pyx_PyType_GetName(Py_TYPE(o));
        PyErr_Format(PyExc_TypeError,
                     "Expected a sequence of size %zd, got " __Pyx_FMT_TYPENAME, (Py_ssize_t) 2, o_type_name);
        __Pyx_DECREF_TypeName(o_type_name);
        goto bad;
    } else if (unlikely(PySequence_Length(o) != 2)) {
        PyErr_Format(PyExc_TypeError,
                     "Expected a sequence of size %zd, got size %zd", (Py_ssize_t) 2, PySequence_Length(o));
        goto bad;
    }
    {
        PyObject *item;
        item = PySequence_ITEM(o, 0);  if (unlikely(!item)) goto bad;
        result->f0 = __pyx_PyFloat_AsDouble(item);
        Py_DECREF(item);
        if ((result->f0 == (double)-1) && PyErr_Occurred()) goto bad;
        item = PySequence_ITEM(o, 1);  if (unlikely(!item)) goto bad;
        result->f1 = __pyx_PyFloat_AsDouble(item);
        Py_DECREF(item);
        if ((result->f1 == (double)-1) && PyErr_Occurred()) goto bad;
    }
    return;
bad:
    return;
}
static CYTHON_INLINE __pyx_ctuple_double__and_double __pyx_convert__from_py___pyx_ctuple_double__and_double(PyObject * o) {
    __pyx_ctuple_double__and_double result;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_Check(o) && PyTuple_GET_SIZE(o) == 2)) {
        __Pyx_tuple___pyx_convert__from_py___pyx_ctuple_double__and_double(o, &result);
    } else if (likely(PyList_Check(o) && PyList_GET_SIZE(o) == 2)) {
        __Pyx_list___pyx_convert__from_py___pyx_ctuple_double__and_double(o, &result);
    } else
    #endif
    {
        __Pyx_seq___pyx_convert__from_py___pyx_ctuple_double__and_double(o, &result);
    }
    return result;
}

/* CIntFromPyVerify */
    #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
    {\
        func_type value = func_value;\
        if (sizeof(target_type) < sizeof(func_type)) {\
            if (unlikely(value != (func_type) (target_type) value)) {\
                func_type zero = 0;\
                if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
                    return (target_type) -1;\
                if (is_unsigned && unlikely(value < zero))\
                    goto raise_neg_overflow;\
                else\
                    goto raise_overflow;\
            }\
        }\
        return (target_type) value;\
    }

/* CIntFromPy */
    static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const long neg_one = (long) -1, const_zero = (long) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if ((sizeof(long) < sizeof(long))) {
            __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (long) val;
        }
    }
#endif
    if (unlikely(!PyLong_Check(x))) {
        long val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (long) -1;
        val = __Pyx_PyInt_As_long(tmp);
        Py_DECREF(tmp);
        return val;
    }
    if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (unlikely(__Pyx_PyLong_IsNeg(x))) {
            goto raise_neg_overflow;
        } else if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_DigitCount(x)) {
                case 2:
                    if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) {
                            return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) {
                            return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) {
                            return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
            }
        }
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
        if (unlikely(Py_SIZE(x) < 0)) {
            goto raise_neg_overflow;
        }
#else
        {
            int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
            if (unlikely(result < 0))
                return (long) -1;
            if (unlikely(result == 1))
                goto raise_neg_overflow;
        }
#endif
        if ((sizeof(long) <= sizeof(unsigned long))) {
            __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
        }
    } else {
#if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_SignedDigitCount(x)) {
                case -2:
                    if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
                            return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
                            return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
                            return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
                            return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) {
                            return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) {
                            return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
            }
        }
#endif
        if ((sizeof(long) <= sizeof(long))) {
            __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
        }
    }
    {
        long val;
        int ret = -1;
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
            x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
        if (unlikely(bytes_copied == -1)) {
        } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
            goto raise_overflow;
        } else {
            ret = 0;
        }
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
        int one = 1; int is_little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        ret = _PyLong_AsByteArray((PyLongObject *)x,
                                    bytes, sizeof(val),
                                    is_little, !is_unsigned);
#else
        PyObject *v;
        PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
        int bits, remaining_bits, is_negative = 0;
        int chunk_size = (sizeof(long) < 8) ? 30 : 62;
        if (likely(PyLong_CheckExact(x))) {
            v = __Pyx_NewRef(x);
        } else {
            v = PyNumber_Long(x);
            if (unlikely(!v)) return (long) -1;
            assert(PyLong_CheckExact(v));
        }
        {
            int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
            if (unlikely(result < 0)) {
                Py_DECREF(v);
                return (long) -1;
            }
            is_negative = result == 1;
        }
        if (is_unsigned && unlikely(is_negative)) {
            Py_DECREF(v);
            goto raise_neg_overflow;
        } else if (is_negative) {
            stepval = PyNumber_Invert(v);
            Py_DECREF(v);
            if (unlikely(!stepval))
                return (long) -1;
        } else {
            stepval = v;
        }
        v = NULL;
        val = (long) 0;
        mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
        shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
        for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) {
            PyObject *tmp, *digit;
            long idigit;
            digit = PyNumber_And(stepval, mask);
            if (unlikely(!digit)) goto done;
            idigit = PyLong_AsLong(digit);
            Py_DECREF(digit);
            if (unlikely(idigit < 0)) goto done;
            val |= ((long) idigit) << bits;
            tmp = PyNumber_Rshift(stepval, shift);
            if (unlikely(!tmp)) goto done;
            Py_DECREF(stepval); stepval = tmp;
        }
        Py_DECREF(shift); shift = NULL;
        Py_DECREF(mask); mask = NULL;
        {
            long idigit = PyLong_AsLong(stepval);
            if (unlikely(idigit < 0)) goto done;
            remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1);
            if (unlikely(idigit >= (1L << remaining_bits)))
                goto raise_overflow;
            val |= ((long) idigit) << bits;
        }
        if (!is_unsigned) {
            if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1))))
                goto raise_overflow;
            if (is_negative)
                val = ~val;
        }
        ret = 0;
    done:
        Py_XDECREF(shift);
        Py_XDECREF(mask);
        Py_XDECREF(stepval);
#endif
        if (unlikely(ret))
            return (long) -1;
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to long");
    return (long) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to long");
    return (long) -1;
}

/* CIntToPy */
    static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const long neg_one = (long) -1, const_zero = (long) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(long) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(long) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        unsigned char *bytes = (unsigned char *)&value;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
        if (is_unsigned) {
            return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
        } else {
            return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
        }
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        int one = 1; int little = (int)*(unsigned char *)&one;
        return _PyLong_FromByteArray(bytes, sizeof(long),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL;
        PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
        from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
        if (!from_bytes) return NULL;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
        if (!arg_tuple) goto limited_bad;
        if (!is_unsigned) {
            kwds = PyDict_New();
            if (!kwds) goto limited_bad;
            if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
        }
        result = PyObject_Call(from_bytes, arg_tuple, kwds);
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(arg_tuple);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* CIntFromPy */
    static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const int neg_one = (int) -1, const_zero = (int) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if ((sizeof(int) < sizeof(long))) {
            __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (int) val;
        }
    }
#endif
    if (unlikely(!PyLong_Check(x))) {
        int val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (int) -1;
        val = __Pyx_PyInt_As_int(tmp);
        Py_DECREF(tmp);
        return val;
    }
    if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (unlikely(__Pyx_PyLong_IsNeg(x))) {
            goto raise_neg_overflow;
        } else if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_DigitCount(x)) {
                case 2:
                    if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) {
                            return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) {
                            return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) {
                            return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
            }
        }
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
        if (unlikely(Py_SIZE(x) < 0)) {
            goto raise_neg_overflow;
        }
#else
        {
            int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
            if (unlikely(result < 0))
                return (int) -1;
            if (unlikely(result == 1))
                goto raise_neg_overflow;
        }
#endif
        if ((sizeof(int) <= sizeof(unsigned long))) {
            __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
        }
    } else {
#if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_SignedDigitCount(x)) {
                case -2:
                    if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
                            return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
                            return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
                            return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
                            return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) {
                            return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) {
                            return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
            }
        }
#endif
        if ((sizeof(int) <= sizeof(long))) {
            __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
        }
    }
    {
        int val;
        int ret = -1;
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
            x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
        if (unlikely(bytes_copied == -1)) {
        } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
            goto raise_overflow;
        } else {
            ret = 0;
        }
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
        int one = 1; int is_little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        ret = _PyLong_AsByteArray((PyLongObject *)x,
                                    bytes, sizeof(val),
                                    is_little, !is_unsigned);
#else
        PyObject *v;
        PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
        int bits, remaining_bits, is_negative = 0;
        int chunk_size = (sizeof(long) < 8) ? 30 : 62;
        if (likely(PyLong_CheckExact(x))) {
            v = __Pyx_NewRef(x);
        } else {
            v = PyNumber_Long(x);
            if (unlikely(!v)) return (int) -1;
            assert(PyLong_CheckExact(v));
        }
        {
            int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
            if (unlikely(result < 0)) {
                Py_DECREF(v);
                return (int) -1;
            }
            is_negative = result == 1;
        }
        if (is_unsigned && unlikely(is_negative)) {
            Py_DECREF(v);
            goto raise_neg_overflow;
        } else if (is_negative) {
            stepval = PyNumber_Invert(v);
            Py_DECREF(v);
            if (unlikely(!stepval))
                return (int) -1;
        } else {
            stepval = v;
        }
        v = NULL;
        val = (int) 0;
        mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
        shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
        for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) {
            PyObject *tmp, *digit;
            long idigit;
            digit = PyNumber_And(stepval, mask);
            if (unlikely(!digit)) goto done;
            idigit = PyLong_AsLong(digit);
            Py_DECREF(digit);
            if (unlikely(idigit < 0)) goto done;
            val |= ((int) idigit) << bits;
            tmp = PyNumber_Rshift(stepval, shift);
            if (unlikely(!tmp)) goto done;
            Py_DECREF(stepval); stepval = tmp;
        }
        Py_DECREF(shift); shift = NULL;
        Py_DECREF(mask); mask = NULL;
        {
            long idigit = PyLong_AsLong(stepval);
            if (unlikely(idigit < 0)) goto done;
            remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1);
            if (unlikely(idigit >= (1L << remaining_bits)))
                goto raise_overflow;
            val |= ((int) idigit) << bits;
        }
        if (!is_unsigned) {
            if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1))))
                goto raise_overflow;
            if (is_negative)
                val = ~val;
        }
        ret = 0;
    done:
        Py_XDECREF(shift);
        Py_XDECREF(mask);
        Py_XDECREF(stepval);
#endif
        if (unlikely(ret))
            return (int) -1;
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to int");
    return (int) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to int");
    return (int) -1;
}

/* FormatTypeName */
    #if CYTHON_COMPILING_IN_LIMITED_API
static __Pyx_TypeName
__Pyx_PyType_GetName(PyTypeObject* tp)
{
    PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
                                               __pyx_n_s_name_2);
    if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) {
        PyErr_Clear();
        Py_XDECREF(name);
        name = __Pyx_NewRef(__pyx_n_s__203);
    }
    return name;
}
#endif

/* CheckBinaryVersion */
    static unsigned long __Pyx_get_runtime_version(void) {
#if __PYX_LIMITED_VERSION_HEX >= 0x030B00A4
    return Py_Version & ~0xFFUL;
#else
    const char* rt_version = Py_GetVersion();
    unsigned long version = 0;
    unsigned long factor = 0x01000000UL;
    unsigned int digit = 0;
    int i = 0;
    while (factor) {
        while ('0' <= rt_version[i] && rt_version[i] <= '9') {
            digit = digit * 10 + (unsigned int) (rt_version[i] - '0');
            ++i;
        }
        version += factor * digit;
        if (rt_version[i] != '.')
            break;
        digit = 0;
        factor >>= 8;
        ++i;
    }
    return version;
#endif
}
static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) {
    const unsigned long MAJOR_MINOR = 0xFFFF0000UL;
    if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR))
        return 0;
    if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR)))
        return 1;
    {
        char message[200];
        PyOS_snprintf(message, sizeof(message),
                      "compile time Python version %d.%d "
                      "of module '%.100s' "
                      "%s "
                      "runtime version %d.%d",
                       (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF),
                       __Pyx_MODULE_NAME,
                       (allow_newer) ? "was newer than" : "does not match",
                       (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF)
       );
        return PyErr_WarnEx(NULL, message, 1);
    }
}

/* InitStrings */
    #if PY_MAJOR_VERSION >= 3
static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) {
    if (t.is_unicode | t.is_str) {
        if (t.intern) {
            *str = PyUnicode_InternFromString(t.s);
        } else if (t.encoding) {
            *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL);
        } else {
            *str = PyUnicode_FromStringAndSize(t.s, t.n - 1);
        }
    } else {
        *str = PyBytes_FromStringAndSize(t.s, t.n - 1);
    }
    if (!*str)
        return -1;
    if (PyObject_Hash(*str) == -1)
        return -1;
    return 0;
}
#endif
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
    while (t->p) {
        #if PY_MAJOR_VERSION >= 3
        __Pyx_InitString(*t, t->p);
        #else
        if (t->is_unicode) {
            *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
        } else if (t->intern) {
            *t->p = PyString_InternFromString(t->s);
        } else {
            *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
        }
        if (!*t->p)
            return -1;
        if (PyObject_Hash(*t->p) == -1)
            return -1;
        #endif
        ++t;
    }
    return 0;
}

#include <string.h>
static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) {
    size_t len = strlen(s);
    if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) {
        PyErr_SetString(PyExc_OverflowError, "byte string is too long");
        return -1;
    }
    return (Py_ssize_t) len;
}
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
    Py_ssize_t len = __Pyx_ssize_strlen(c_str);
    if (unlikely(len < 0)) return NULL;
    return __Pyx_PyUnicode_FromStringAndSize(c_str, len);
}
static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) {
    Py_ssize_t len = __Pyx_ssize_strlen(c_str);
    if (unlikely(len < 0)) return NULL;
    return PyByteArray_FromStringAndSize(c_str, len);
}
static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
    Py_ssize_t ignore;
    return __Pyx_PyObject_AsStringAndSize(o, &ignore);
}
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
#if !CYTHON_PEP393_ENABLED
static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
    char* defenc_c;
    PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
    if (!defenc) return NULL;
    defenc_c = PyBytes_AS_STRING(defenc);
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
    {
        char* end = defenc_c + PyBytes_GET_SIZE(defenc);
        char* c;
        for (c = defenc_c; c < end; c++) {
            if ((unsigned char) (*c) >= 128) {
                PyUnicode_AsASCIIString(o);
                return NULL;
            }
        }
    }
#endif
    *length = PyBytes_GET_SIZE(defenc);
    return defenc_c;
}
#else
static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
    if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
    if (likely(PyUnicode_IS_ASCII(o))) {
        *length = PyUnicode_GET_LENGTH(o);
        return PyUnicode_AsUTF8(o);
    } else {
        PyUnicode_AsASCIIString(o);
        return NULL;
    }
#else
    return PyUnicode_AsUTF8AndSize(o, length);
#endif
}
#endif
#endif
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
    if (
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
            __Pyx_sys_getdefaultencoding_not_ascii &&
#endif
            PyUnicode_Check(o)) {
        return __Pyx_PyUnicode_AsStringAndSize(o, length);
    } else
#endif
#if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
    if (PyByteArray_Check(o)) {
        *length = PyByteArray_GET_SIZE(o);
        return PyByteArray_AS_STRING(o);
    } else
#endif
    {
        char* result;
        int r = PyBytes_AsStringAndSize(o, &result, length);
        if (unlikely(r < 0)) {
            return NULL;
        } else {
            return result;
        }
    }
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
   int is_true = x == Py_True;
   if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
   else return PyObject_IsTrue(x);
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
    int retval;
    if (unlikely(!x)) return -1;
    retval = __Pyx_PyObject_IsTrue(x);
    Py_DECREF(x);
    return retval;
}
static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
    __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result));
#if PY_MAJOR_VERSION >= 3
    if (PyLong_Check(result)) {
        if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
                "__int__ returned non-int (type " __Pyx_FMT_TYPENAME ").  "
                "The ability to return an instance of a strict subclass of int is deprecated, "
                "and may be removed in a future version of Python.",
                result_type_name)) {
            __Pyx_DECREF_TypeName(result_type_name);
            Py_DECREF(result);
            return NULL;
        }
        __Pyx_DECREF_TypeName(result_type_name);
        return result;
    }
#endif
    PyErr_Format(PyExc_TypeError,
                 "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")",
                 type_name, type_name, result_type_name);
    __Pyx_DECREF_TypeName(result_type_name);
    Py_DECREF(result);
    return NULL;
}
static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
#if CYTHON_USE_TYPE_SLOTS
  PyNumberMethods *m;
#endif
  const char *name = NULL;
  PyObject *res = NULL;
#if PY_MAJOR_VERSION < 3
  if (likely(PyInt_Check(x) || PyLong_Check(x)))
#else
  if (likely(PyLong_Check(x)))
#endif
    return __Pyx_NewRef(x);
#if CYTHON_USE_TYPE_SLOTS
  m = Py_TYPE(x)->tp_as_number;
  #if PY_MAJOR_VERSION < 3
  if (m && m->nb_int) {
    name = "int";
    res = m->nb_int(x);
  }
  else if (m && m->nb_long) {
    name = "long";
    res = m->nb_long(x);
  }
  #else
  if (likely(m && m->nb_int)) {
    name = "int";
    res = m->nb_int(x);
  }
  #endif
#else
  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
    res = PyNumber_Int(x);
  }
#endif
  if (likely(res)) {
#if PY_MAJOR_VERSION < 3
    if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
#else
    if (unlikely(!PyLong_CheckExact(res))) {
#endif
        return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
    }
  }
  else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_TypeError,
                    "an integer is required");
  }
  return res;
}
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  Py_ssize_t ival;
  PyObject *x;
#if PY_MAJOR_VERSION < 3
  if (likely(PyInt_CheckExact(b))) {
    if (sizeof(Py_ssize_t) >= sizeof(long))
        return PyInt_AS_LONG(b);
    else
        return PyInt_AsSsize_t(b);
  }
#endif
  if (likely(PyLong_CheckExact(b))) {
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(__Pyx_PyLong_IsCompact(b))) {
        return __Pyx_PyLong_CompactValue(b);
    } else {
      const digit* digits = __Pyx_PyLong_Digits(b);
      const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b);
      switch (size) {
         case 2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
      }
    }
    #endif
    return PyLong_AsSsize_t(b);
  }
  x = PyNumber_Index(b);
  if (!x) return -1;
  ival = PyInt_AsSsize_t(x);
  Py_DECREF(x);
  return ival;
}
static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
  if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) {
    return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
#if PY_MAJOR_VERSION < 3
  } else if (likely(PyInt_CheckExact(o))) {
    return PyInt_AS_LONG(o);
#endif
  } else {
    Py_ssize_t ival;
    PyObject *x;
    x = PyNumber_Index(o);
    if (!x) return -1;
    ival = PyInt_AsLong(x);
    Py_DECREF(x);
    return ival;
  }
}
static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
  return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
}
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
    return PyInt_FromSize_t(ival);
}


/* #### Code section: utility_code_pragmas_end ### */
#ifdef _MSC_VER
#pragma warning( pop )
#endif



/* #### Code section: end ### */
#endif /* Py_PYTHON_H */
